Month
+ The leap day will be added to this month.
`,o=V(),l=T("div"),s=T("select");for(let N=0;Nt[15].call(s)),w(l,"class","setting-item-control"),w(r,"class","setting-item"),w(e,"class","fantasy-calendar-nested-settings"),w(v,"class","buttons svelte-n1tx0h")},m(N,x){q(N,e,x),J(n,e,null),C(e,a),C(e,r),C(r,i),C(r,o),C(r,l),C(l,s);for(let P=0;P{let W=new Cs(d,u.interval.length>0,B);W.onClose=()=>{!W.saved||!W.condition.interval||(B?u.interval.splice(u.interval.indexOf(B),1,W.condition):u.interval.push(W.condition),n(0,u))},W.open()},y=B=>{let W=[`${B.interval}`];return B.exclusive&&W.push("(Exclusive)"),B.ignore&&W.push(" - Ignoring Offset"),W.join(" ")},m=B=>{new wr.ExtraButtonComponent(B).setIcon("pencil")},v=B=>{new wr.ExtraButtonComponent(B).setIcon("trash")},p=B=>{new wr.ButtonComponent(B).setButtonText("Cancel").setCta()},k=B=>n(0,u.name=B.detail,u);function E(){u.timespan=hn(this),n(0,u)}let A=B=>n(0,u.intercalary=!u.intercalary,u),S=()=>n(0,u.numbered=!u.numbered,u);function _(){u.after=hn(this),n(0,u)}let F=B=>n(0,u.offset=B.detail,u),D=()=>h(),N=B=>h(B),x=B=>n(0,u.interval=u.interval.filter(W=>W!=B),u),P=()=>s("cancel");return t.$$set=B=>{"app"in B&&n(11,d=B.app),"leapDay"in B&&n(0,u=B.leapDay),"calendar"in B&&n(12,c=B.calendar)},t.$$.update=()=>{if(t.$$.dirty[0]&1){e:n(4,a=u.intercalary)}if(t.$$.dirty[0]&4096){e:n(1,r=c.static.months)}if(t.$$.dirty[0]&3){e:n(13,i=r[u.timespan])}if(t.$$.dirty[0]&8192){e:n(3,o=i.length?[...Array(i.length).keys()].map(B=>B+1):[])}if(t.$$.dirty[0]&1){e:n(2,l=u.interval.sort((B,W)=>B.interval-W.interval))}},[u,r,l,o,a,s,h,y,m,v,p,d,c,i,k,E,A,S,_,F,D,N,x,P]}var Df=class extends de{constructor(e){super();fe(this,e,k1,A1,se,{app:11,leapDay:0,calendar:12},C1,[-1,-1])}},_f=Df;function x1(t){let e,n,a,r,i,o;return e=new kn({props:{type:"number",name:"Interval",desc:"How often the condition applies.",value:t[0].interval,warn:!t[0].interval}}),e.$on("blur",t[2]),a=new Mt({props:{disabled:!t[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:t[0].exclusive}}),a.$on("click",t[3]),i=new Mt({props:{name:"Ignore Offset",desc:"The condition will ignore the leap day's offset when checking to apply.",value:t[0].ignore}}),i.$on("click",t[4]),{c(){$(e.$$.fragment),n=V(),$(a.$$.fragment),r=V(),$(i.$$.fragment)},m(l,s){J(e,l,s),q(l,n,s),J(a,l,s),q(l,r,s),J(i,l,s),o=!0},p(l,[s]){let d={};s&1&&(d.value=l[0].interval),s&1&&(d.warn=!l[0].interval),e.$set(d);let u={};s&2&&(u.disabled=!l[1]),s&1&&(u.value=l[0].exclusive),a.$set(u);let c={};s&1&&(c.value=l[0].ignore),i.$set(c)},i(l){o||(R(e.$$.fragment,l),R(a.$$.fragment,l),R(i.$$.fragment,l),o=!0)},o(l){H(e.$$.fragment,l),H(a.$$.fragment,l),H(i.$$.fragment,l),o=!1},d(l){Q(e,l),l&&O(n),Q(a,l),l&&O(r),Q(i,l)}}}function F1(t,e,n){let{canBeExclusive:a}=e,{condition:r}=e,i=s=>n(0,r.interval=s.detail,r),o=()=>a?n(0,r.exclusive=!r.exclusive,r):null,l=()=>n(0,r.ignore=!r.ignore,r);return t.$$set=s=>{"canBeExclusive"in s&&n(1,a=s.canBeExclusive),"condition"in s&&n(0,r=s.condition)},[r,a,i,o,l]}var Cf=class extends de{constructor(e){super();fe(this,e,F1,x1,se,{canBeExclusive:1,condition:0})}},Ef=Cf;var Es=class extends it{constructor(e,n,a){super(e);this.calendar=n;this.saved=!0;this.leapday={id:Ze(6),name:"Leap Day",interval:[],intercalary:!1,timespan:0,offset:0,type:"leapday"};a&&(this.leapday=(0,Af.default)(a),this.editing=!0),this.containerEl.addClasses(["fantasy-calendar-create-leapday"])}async display(){this.titleEl.setText(this.editing?"Edit Leap Day":"New Leap Day"),new _f({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()}},Cs=class extends it{constructor(e,n,a){super(e);this.app=e;this.canBeExclusive=n;this.saved=!0;this.editing=!1;this.condition={interval:null,exclusive:!1,ignore:!1};a&&(this.condition={...a},this.editing=!0)}onOpen(){this.containerEl.addClasses(["fantasy-calendar-nested-settings"]),this.contentEl.empty(),this.titleEl.setText("Leap Day Condition"),new Ef({target:this.contentEl,props:{canBeExclusive:this.canBeExclusive,condition:this.condition}}),this.buttonsEl=this.contentEl.createDiv("fantasy-context-buttons setting-item"),new qa.ButtonComponent(this.buttonsEl).setCta().setButtonText("Cancel").onClick(()=>{this.saved=!1,this.close()})}old(){new qa.Setting(this.contentEl).setName("Interval").setDesc("How often the condition applies.").addText(e=>{e.inputEl.setAttr("type","number"),e.setValue(`${this.condition.interval}`).onChange(n=>{isNaN(Number(n))||(this.condition.interval=Number(n))})}),new qa.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(e=>e.setDisabled(!this.canBeExclusive).setValue(this.condition.exclusive).onChange(n=>this.condition.exclusive=n)),new qa.Setting(this.contentEl).setName("Ignore Offset").setDesc("The condition will ignore the leap day's offset when checking to apply.").addToggle(e=>e.setValue(this.condition.ignore).onChange(n=>this.condition.ignore=n))}};function kf(t,e,n){let a=t.slice();return a[10]=e[n],a}function T1(t){let e,n,a=t[1],r=[];for(let o=0;oH(r[o],1,1,()=>{r[o]=null});return{c(){e=T("div");for(let o=0;o{s[y]=null}),Ae(),r=s[a],r?r.p(u,c):(r=s[a]=l[a](u),r.c()),R(r,1),r.m(i.parentNode,i))},i(u){o||(R(e.$$.fragment,u),R(r),o=!0)},o(u){H(e.$$.fragment,u),H(r),o=!1},d(u){Q(e,u),u&&O(n),s[a].d(u),u&&O(i)}}}function N1(t){let e,n;return e=new st({props:{name:"Leap Days",$$slots:{default:[B1]},$$scope:{ctx:t}}}),{c(){$(e.$$.fragment)},m(a,r){J(e,a,r),n=!0},p(a,[r]){let i={};r&8195&&(i.$$scope={dirty:r,ctx:a}),e.$set(i)},i(a){n||(R(e.$$.fragment,a),n=!0)},o(a){H(e.$$.fragment,a),n=!1},d(a){Q(e,a)}}}function M1(t,e,n){let a,{calendar:r}=e,{plugin:i}=e;Ke("store").subscribe(y=>n(4,r=y));let l=r.static.months?.filter(y=>y.name?.length).length==0,s=y=>{n(1,a=a.filter(m=>m.id!==y.id))},d=y=>{let m=new Es(i.app,r,y);m.onClose=()=>{if(!!m.saved&&!!m.leapday.interval.length&&!!m.leapday.name){if(m.editing){let v=r.static.leapDays.findIndex(p=>p.id===m.leapday.id);r.static.leapDays.splice(v,1,{...m.leapday})}else r.static.leapDays.push({...m.leapday});n(1,a=r.static.leapDays)}},m.open()},u=()=>d(),c=y=>d(y),h=y=>s(y);return t.$$set=y=>{"calendar"in y&&n(4,r=y.calendar),"plugin"in y&&n(5,i=y.plugin)},t.$$.update=()=>{if(t.$$.dirty&16){e:n(1,a=r.static.leapDays)}if(t.$$.dirty&16){e:n(0,l=r.static.months?.filter(y=>y.name?.length).length==0)}},[l,a,s,d,r,i,u,c,h]}var Ff=class extends de{constructor(e){super();fe(this,e,M1,N1,se,{calendar:4,plugin:5})}},Tf=Ff;var Bf=Fe(require("obsidian"));var I1=Fe(Nn());var Sf=Fe(require("obsidian"));function O1(t){we(t,"svelte-190iu8i","body:not(.is-mobile) .fantasy-calendar-creator.svelte-190iu8i.svelte-190iu8i{position:absolute;top:var(--top, 0);height:100%}body:not(.is-mobile) .fantasy-calendar-creator-inner.svelte-190iu8i.svelte-190iu8i{position:absolute;top:0;left:-2px;bottom:0;overflow:auto;display:grid;grid-template-rows:auto 1fr}.fantasy-calendar-creator.svelte-190iu8i.svelte-190iu8i,.fantasy-calendar-creator.svelte-190iu8i .fantasy-calendar-creator-inner.svelte-190iu8i,.fantasy-calendar-creator.svelte-190iu8i .fantasy-creator-app.svelte-190iu8i{background-color:var(--creator-background-color)}body.is-mobile .fantasy-calendar-creator.svelte-190iu8i.svelte-190iu8i,body.is-mobile .fantasy-calendar-creator.svelte-190iu8i .fantasy-creator-app.svelte-190iu8i{padding:0px 10px;width:100%}.fantasy-creator-app.svelte-190iu8i.svelte-190iu8i{overflow:auto;height:100%}.fantasy-calendar-creator-header.svelte-190iu8i.svelte-190iu8i{margin:0}.top-nav.svelte-190iu8i.svelte-190iu8i{position:sticky;top:0;padding:10px 0px;background-color:inherit;z-index:3}.icons.svelte-190iu8i.svelte-190iu8i{display:flex;justify-content:space-between}.icons.svelte-190iu8i .left.svelte-190iu8i{display:flex;align-items:center}.check.svelte-190iu8i.svelte-190iu8i{display:flex;gap:0.25rem;align-items:center}.additional.svelte-190iu8i.svelte-190iu8i{color:var(--text-faint)}.save.svelte-190iu8i.svelte-190iu8i{color:var(--text-error)}.save.can-save.svelte-190iu8i.svelte-190iu8i{color:var(--interactive-success)}.additional.can-save.svelte-190iu8i.svelte-190iu8i{color:var(--text-normal)}.back.svelte-190iu8i.svelte-190iu8i{width:min-content}.back.svelte-190iu8i .clickable-icon{margin-left:0}")}function Mf(t){let e,n,a,r,i,o,l,s,d,u,c,h,y,m,v,p,k,E,A,S,_,F,D,N,x,P,B,W,Z,le,oe,me,X,z,he,De,ie,Ce,xe,et,je;function yt(Be,Ve){return Be[7]?R1:q1}let Tt=yt(t,-1),$e=Tt(t);return S=new Sc({props:{calendar:t[0],plugin:t[2]}}),F=new wd({props:{calendar:t[0]}}),N=new xd({}),P=new Rd({props:{calendar:t[0],app:t[2].app}}),W=new qo({}),le=new Xd({props:{plugin:t[2],calendar:t[0]}}),me=new af({props:{calendar:t[0]}}),z=new df({props:{plugin:t[2],calendar:t[0]}}),De=new Tf({props:{calendar:t[0],plugin:t[2]}}),{c(){e=T("div"),n=T("div"),a=T("div"),r=T("div"),i=T("div"),s=V(),d=T("div"),$e.c(),u=V(),c=T("div"),y=V(),m=T("h3"),m.textContent="Calendar Creator",v=V(),p=T("div"),k=T("div"),A=V(),$(S.$$.fragment),_=V(),$(F.$$.fragment),D=V(),$(N.$$.fragment),x=V(),$(P.$$.fragment),B=V(),$(W.$$.fragment),Z=V(),$(le.$$.fragment),oe=V(),$(me.$$.fragment),X=V(),$(z.$$.fragment),he=V(),$(De.$$.fragment),w(i,"class","back svelte-190iu8i"),w(i,"aria-label",o=t[7]?"Save and exit":"Exit without saving"),w(d,"class","check svelte-190iu8i"),w(r,"class","left svelte-190iu8i"),w(c,"class","cancel"),w(a,"class","icons svelte-190iu8i"),w(m,"class","fantasy-calendar-creator-header svelte-190iu8i"),w(n,"class","top-nav svelte-190iu8i"),w(p,"class","fantasy-creator-app svelte-190iu8i"),w(e,"class","inherit fantasy-calendar-creator-inner svelte-190iu8i"),w(e,"style",ie=t[9]?"":`width: ${t[1]+4}px;`)},m(Be,Ve){q(Be,e,Ve),C(e,n),C(n,a),C(a,r),C(r,i),C(r,s),C(r,d),$e.m(d,null),C(a,u),C(a,c),C(n,y),C(n,m),C(e,v),C(e,p),C(p,k),C(p,A),J(S,p,null),C(p,_),J(F,p,null),C(p,D),J(N,p,null),C(p,x),J(P,p,null),C(p,B),J(W,p,null),C(p,Z),J(le,p,null),C(p,oe),J(me,p,null),C(p,X),J(z,p,null),C(p,he),J(De,p,null),xe=!0,et||(je=[ue(l=t[11].call(null,i)),ae(i,"click",t[17]),ue(h=t[12].call(null,c)),ae(c,"click",t[18]),ue(E=t[13].call(null,k)),ae(e,"introend",t[19]),ae(e,"outroend",t[20])],et=!0)},p(Be,Ve){t=Be,(!xe||Ve&128&&o!==(o=t[7]?"Save and exit":"Exit without saving"))&&w(i,"aria-label",o),Tt===(Tt=yt(t,Ve))&&$e?$e.p(t,Ve):($e.d(1),$e=Tt(t),$e&&($e.c(),$e.m(d,null)));let jt={};Ve&1&&(jt.calendar=t[0]),Ve&4&&(jt.plugin=t[2]),S.$set(jt);let Ut={};Ve&1&&(Ut.calendar=t[0]),F.$set(Ut);let St={};Ve&1&&(St.calendar=t[0]),Ve&4&&(St.app=t[2].app),P.$set(St);let Ot={};Ve&4&&(Ot.plugin=t[2]),Ve&1&&(Ot.calendar=t[0]),le.$set(Ot);let vn={};Ve&1&&(vn.calendar=t[0]),me.$set(vn);let zt={};Ve&4&&(zt.plugin=t[2]),Ve&1&&(zt.calendar=t[0]),z.$set(zt);let nn={};Ve&1&&(nn.calendar=t[0]),Ve&4&&(nn.plugin=t[2]),De.$set(nn),(!xe||Ve&2&&ie!==(ie=t[9]?"":`width: ${t[1]+4}px;`))&&w(e,"style",ie)},i(Be){xe||(R(S.$$.fragment,Be),R(F.$$.fragment,Be),R(N.$$.fragment,Be),R(P.$$.fragment,Be),R(W.$$.fragment,Be),R(le.$$.fragment,Be),R(me.$$.fragment,Be),R(z.$$.fragment,Be),R(De.$$.fragment,Be),Nt(()=>{Ce||(Ce=Bo(e,t[16],{x:t[1]*1.5,opacity:1},!0)),Ce.run(1)}),xe=!0)},o(Be){H(S.$$.fragment,Be),H(F.$$.fragment,Be),H(N.$$.fragment,Be),H(P.$$.fragment,Be),H(W.$$.fragment,Be),H(le.$$.fragment,Be),H(me.$$.fragment,Be),H(z.$$.fragment,Be),H(De.$$.fragment,Be),Ce||(Ce=Bo(e,t[16],{x:t[1]*1.5,opacity:1},!1)),Ce.run(0),xe=!1},d(Be){Be&&O(e),$e.d(),Q(S),Q(F),Q(N),Q(P),Q(W),Q(le),Q(me),Q(z),Q(De),Be&&Ce&&Ce.end(),et=!1,_e(je)}}}function q1(t){let e,n,a,r,i,o;return{c(){e=T("div"),a=V(),r=T("span"),r.textContent=`Additional information is required before
+ saving`,w(e,"class","save svelte-190iu8i"),w(e,"aria-label",t[8]),w(r,"class","additional svelte-190iu8i")},m(l,s){q(l,e,s),q(l,a,s),q(l,r,s),i||(o=ue(n=t[15].call(null,e)),i=!0)},p(l,s){s&256&&w(e,"aria-label",l[8])},d(l){l&&O(e),l&&O(a),l&&O(r),i=!1,o()}}}function R1(t){let e,n,a,r,i,o;return{c(){e=T("div"),a=V(),r=T("span"),r.textContent="All good! Exit to save calendar",w(e,"class","save can-save svelte-190iu8i"),w(e,"aria-label",t[8]),w(r,"class","additional can-save svelte-190iu8i")},m(l,s){q(l,e,s),q(l,a,s),q(l,r,s),i||(o=ue(n=t[15].call(null,e)),i=!0)},p(l,s){s&256&&w(e,"aria-label",l[8])},d(l){l&&O(e),l&&O(a),l&&O(r),i=!1,o()}}}function L1(t){let e,n,a=t[5]&&Mf(t);return{c(){e=T("div"),a&&a.c(),w(e,"class","fantasy-calendar-creator svelte-190iu8i"),tt(e,"--creator-background-color",t[3]),tt(e,"--top",t[4]+"px")},m(r,i){q(r,e,i),a&&a.m(e,null),n=!0},p(r,[i]){r[5]?a?(a.p(r,i),i&32&&R(a,1)):(a=Mf(r),a.c(),R(a,1),a.m(e,null)):a&&(Ee(),H(a,1,1,()=>{a=null}),Ae()),(!n||i&8)&&tt(e,"--creator-background-color",r[3]),(!n||i&16)&&tt(e,"--top",r[4]+"px")},i(r){n||(R(a),n=!0)},o(r){H(a),n=!1},d(r){r&&O(e),a&&a.d()}}}function P1(t,e,n){let a,r,i=Fn.Platform.isMobile,o=i;zn(()=>{n(5,o=!0)});let l=Se(),{width:s}=e,{calendar:d}=e,{plugin:u}=e,{color:c=null}=e,{top:h}=e,y=Da(d);y.subscribe(x=>{n(0,d=x)}),Yn("store",y);let m=x=>{new Fn.ExtraButtonComponent(x).setIcon("left-arrow-with-tail")},v=x=>{new Fn.ExtraButtonComponent(x).setIcon("cross").setTooltip("Exit without saving")},p=x=>{let P=x.createDiv("fantasy-calendar-apply-preset");new Fn.Setting(P).setName("Apply Preset").setDesc("Apply a common fantasy calendar as a preset.").addButton(B=>{B.setCta().setButtonText("Choose Preset").onClick(()=>{let W=new No(u.app);W.onClose=()=>{if(!!W.saved){if(n(0,d=(0,Nf.default)(W.preset)),d?.name=="Gregorian Calendar"){let Z=new Date;n(0,d.current={year:Z.getFullYear(),month:Z.getMonth(),day:Z.getDate()},d)}y.set(d)}},W.open()})})},k=!1,E=()=>{if(!r&&!u.data.exit.saving){let x=new ps(u);x.onClose=()=>{x.confirmed&&n(5,o=!1),i&&l("exit",{saved:k,calendar:d})},x.open()}else n(6,k=!0),n(5,o=!1)},A=x=>{r?(0,Fn.setIcon)(x,"checkmark"):mn(x)},S=(x,P)=>i?null:ku(x,P),_=()=>{E()},F=()=>n(5,o=!1),D=()=>l("flown"),N=()=>l("exit",{saved:k,calendar:d});return t.$$set=x=>{"width"in x&&n(1,s=x.width),"calendar"in x&&n(0,d=x.calendar),"plugin"in x&&n(2,u=x.plugin),"color"in x&&n(3,c=x.color),"top"in x&&n(4,h=x.top)},t.$$.update=()=>{if(t.$$.dirty&1){e:n(8,a=Fu(d))}if(t.$$.dirty&1){e:n(7,r=Tu(d))}},[d,s,u,c,h,o,k,r,a,i,l,m,v,p,E,A,S,_,F,D,N]}var If=class extends de{constructor(e){super();fe(this,e,P1,L1,se,{width:1,calendar:0,plugin:2,color:3,top:4},O1)}},As=If;var Of;(function(a){a.none="None",a.monthly="Monthly",a.yearly="Yearly"})(Of||(Of={}));(0,Ue.addIcon)("fantasy-calendar-grip",' ');(0,Ue.addIcon)("fantasy-calendar-warning",' ');var Ei=class extends Ue.PluginSettingTab{constructor(e){super(e.app,e);this.plugin=e}get data(){return this.plugin.data}async display(){this.containerEl.empty(),this.containerEl.createEl("h2",{text:"Fantasy Calendars"}),this.containerEl.addClass("fantasy-calendar-settings"),this.contentEl=this.containerEl.createDiv("fantasy-calendar-settings-content"),this.buildInfo(this.contentEl.createDiv("fantasy-calendar-nested-settings")),this.calendarsEl=this.contentEl.createEl("details",{cls:"fantasy-calendar-nested-settings",attr:{...this.data.settingsToggleState.calendars?{open:"open"}:{}}}),this.buildCalendars(),this.buildEvents(this.contentEl.createEl("details",{cls:"fantasy-calendar-nested-settings",attr:{...this.data.settingsToggleState.events?{open:"open"}:{}}})),this.buildAdvanced(this.contentEl.createEl("details",{cls:"fantasy-calendar-nested-settings",attr:{...this.data.settingsToggleState.advanced?{open:"open"}:{}}}))}buildInfo(e){e.empty(),new Ue.Setting(e).setName(`Reset "Don't Ask Again" Prompts`).setDesc(`All confirmations set to "Don't Ask Again" will be reset.`).addButton(n=>{n.setIcon("reset").onClick(async()=>{this.plugin.data.exit={saving:!1,event:!1,calendar:!1},await this.plugin.saveSettings()})}),new Ue.Setting(e).setName(createFragment(n=>{let a=n.createSpan("fantasy-calendar-warning");(0,Ue.setIcon)(a.createSpan("fantasy-calendar-warning"),"fantasy-calendar-warning"),a.createSpan({text:"Default Config Directory"})})).setDesc(createFragment(n=>{n.createSpan({text:"Please back up your data before changing this setting. Hidden directories must be manually entered."}),n.createEl("br"),n.createSpan({text:"Current directory: "});let a=this.data.configDirectory??this.app.vault.configDir;n.createEl("code",{text:a})})).addText(async n=>{let a=this.app.vault.getAllLoadedFiles().filter(i=>i instanceof Ue.TFolder);n.setPlaceholder(this.data.configDirectory??this.app.vault.configDir);let r=new sr(this.app,n,[...a]);r.onClose=async()=>{n.inputEl.value?await this.app.vault.adapter.exists(n.inputEl.value)||(this.data.configDirectory=n.inputEl.value,await this.plugin.saveSettings()):this.data.configDirectory=null},n.inputEl.onblur=async()=>{if(!n.inputEl.value)return;let i=await this.app.vault.adapter.exists(n.inputEl.value);this.data.configDirectory=n.inputEl.value,await this.plugin.saveSettings(),this.display()}}).addExtraButton(n=>{n.setTooltip("Reset to Default").setIcon("reset").onClick(async()=>{this.data.configDirectory=null,await this.plugin.saveSettings(),this.display()})})}buildCalendars(){this.calendarsEl.empty(),this.calendarsEl.ontoggle=()=>{this.data.settingsToggleState.calendars=this.calendarsEl.open};let e=this.calendarsEl.createEl("summary");new Ue.Setting(e).setHeading().setName("Calendar Management"),e.createDiv("collapser").createDiv("handle"),new Ue.Setting(this.calendarsEl).setName("Show Intercalary Months Separately").setDesc("Intercalary months will appear a distinct months in the calendar.").addToggle(n=>{n.setValue(this.data.showIntercalary).onChange(async a=>{this.data.showIntercalary=a,await this.plugin.saveCalendar()})}),new Ue.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.plugin.data.defaultCalendar),n.onChange(async a=>{if(a==="none"){this.plugin.data.defaultCalendar=null,await this.plugin.saveSettings();return}this.plugin.data.defaultCalendar=a,await this.plugin.saveSettings(),this.plugin.watcher.start()})}),new Ue.Setting(this.calendarsEl).setName("Import Calendar").setDesc(createFragment(n=>{n.createSpan({text:"Import calendar from "}),n.createEl("a",{href:"https://app.fantasy-calendar.com",text:"Fantasy Calendar",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:r}=a;if(!!r.length){try{let i=[];for(let l of Array.from(r))i.push(JSON.parse(await l.text()));let o=Pr.import(i);for(let l of o)await this.plugin.addNewCalendar(l);this.display()}catch(i){new Ue.Notice(`There was an error while importing the calendar${r.length==1?"":"s"}.`),console.error(i)}a.value=null}},n.setButtonText("Choose Files"),n.buttonEl.addClass("calendar-file-upload"),n.buttonEl.appendChild(a),n.onClick(()=>a.click())}),new Ue.Setting(this.calendarsEl).setName("Create New Calendar").addButton(n=>n.setTooltip("Launch Calendar Creator").setIcon("plus-with-circle").onClick(async()=>{let a=await this.launchCalendarCreator();a&&(await this.plugin.addNewCalendar(a),this.display())})),this.existingEl=this.calendarsEl.createDiv("existing-calendars"),this.showCalendars()}showCalendars(){if(this.existingEl.empty(),!this.data.calendars.length){this.existingEl.createSpan({text:"No calendars created! Create a calendar to see it here."});return}for(let e of this.data.calendars)new Ue.Setting(this.existingEl).setName(e.name).setDesc(e.description??"").addExtraButton(n=>{n.setIcon("pencil").onClick(async()=>{let a=await this.launchCalendarCreator(e);a&&(this.plugin.addNewCalendar(a,e),await this.plugin.saveCalendar(),this.display())})}).addExtraButton(n=>{n.setIcon("trash").onClick(async()=>{!this.plugin.data.exit.calendar&&!await Td(this.plugin)||(this.plugin.data.calendars=this.plugin.data.calendars.filter(a=>a.id!=e.id),e.id==this.data.defaultCalendar&&(this.plugin.data.defaultCalendar=this.plugin.data.calendars[0]?.id,this.plugin.watcher.start()),await this.plugin.saveCalendar(),this.display())})})}buildEvents(e){e.empty(),e.ontoggle=()=>{this.data.settingsToggleState.events=e.open};let n=e.createEl("summary");new Ue.Setting(n).setHeading().setName("Events"),n.createDiv("collapser").createDiv("handle"),new Ue.Setting(e).setName("Add Events to Default Calendar").setDesc(createFragment(a=>{a.createSpan({text:"Add events found in notes to the default calendar if the "}),a.createEl("code",{text:"fc-calendar"}),a.createSpan({text:" frontmatter tag is not present."})})).addToggle(a=>{a.setValue(this.data.addToDefaultIfMissing).onChange(async r=>{this.data.addToDefaultIfMissing=r,await this.plugin.saveSettings(),this.plugin.watcher.start()})}),new Ue.Setting(e).setName("Display Event Previews").setDesc("Use the core Note Preview plugin to display event notes when hovered.").addToggle(a=>{a.setValue(this.data.eventPreview).onChange(async r=>{this.data.eventPreview=r,await this.plugin.saveSettings()})}),new Ue.Setting(e).setName("Write Event Data to Frontmatter").setDesc("Events linked to notes will write their data to the note frontmatter.").addToggle(a=>{a.setValue(this.data.eventFrontmatter).onChange(async r=>{this.data.eventFrontmatter=r,await this.plugin.saveSettings()})}),new Ue.Setting(e).setName("Parse Note Titles for Event Dates").setDesc("The plugin will parse note titles for event dates.").addToggle(a=>{a.setValue(this.data.parseDates).onChange(async r=>{this.data.parseDates=r,await this.plugin.saveSettings(),this.plugin.watcher.start()})}),new Ue.Setting(e).setName("Date Format").setClass(this.data.dailyNotes?"daily-notes":"no-daily-notes").setDesc(createFragment(a=>{if(a.createSpan({text:"Event dates will be parsed using this format."}),a.createSpan({text:"Only the "}),a.createEl("code",{text:"Y"}),a.createSpan({text:", "}),a.createEl("code",{text:"M"}),a.createSpan({text:", and "}),a.createEl("code",{text:"D"}),a.createEl("a",{text:"tokens",href:"https://momentjs.com/docs/#/displaying/format/",cls:"external-link"}),a.createSpan({text:" are supported."}),["Y","M","D"].some(r=>!this.data.dateFormat.includes(r))){a.createEl("br");let r=a.createSpan({cls:"fantasy-calendar-warning date-format"});(0,Ue.setIcon)(r.createSpan("fantasy-calendar-warning"),"fantasy-calendar-warning");let i=["Y","M","D"].filter(o=>!this.data.dateFormat.includes(o));r.createSpan({text:` Date format is missing: ${i.join(", ").replace(/, ([^,]*)$/," and $1")}`})}})).addText(a=>{a.setDisabled(this.data.dailyNotes).setValue(this.plugin.format).onChange(async r=>{this.data.dateFormat=r,await this.plugin.saveSettings()}),a.inputEl.onblur=()=>this.buildEvents(e)}).addExtraButton(a=>{if(!this.plugin.canUseDailyNotes){a.extraSettingsEl.detach();return}this.data.dailyNotes?a.setIcon("checkmark").setTooltip("Unlink from Daily Notes").onClick(()=>{this.data.dailyNotes=!1,this.buildEvents(e)}):a.setIcon("sync").setTooltip("Link with Daily Notes").onClick(()=>{this.data.dailyNotes=!0,this.buildEvents(e)})})}buildAdvanced(e){e.empty(),e.ontoggle=()=>{this.data.settingsToggleState.advanced=e.open};let n=e.createEl("summary");new Ue.Setting(n).setHeading().setName("Advanced"),n.createDiv("collapser").createDiv("handle"),new Ue.Setting(e).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 r=>{this.data.debug=r,await this.plugin.saveSettings()})})}launchCalendarCreator(e=lr){let n=(0,Ra.default)(e);if(Ue.Platform.isMobile){let a=new qf(this.plugin,n);return new Promise((r,i)=>{try{a.onClose=()=>{a.saved&&(e=(0,Ra.default)(a.calendar),r(e)),r()},a.open()}catch{i()}})}else return this.containerEl.addClass("fantasy-calendar-creator-open"),new Promise(a=>{let r=getComputedStyle(this.containerEl.closest(".modal")).backgroundColor,i=new As({target:this.containerEl,props:{calendar:n,plugin:this.plugin,width:this.contentEl.clientWidth,color:r,top:this.containerEl.scrollTop}}),o=new ResizeObserver(()=>{i.$set({width:this.contentEl.clientWidth})});o.observe(this.contentEl),i.$on("exit",l=>{this.containerEl.removeClass("fantasy-calendar-creator-open"),i.$destroy(),l.detail.saved&&(e=(0,Ra.default)(l.detail.calendar),o.disconnect(),a(e)),a()})})}},qf=class extends it{constructor(e,n){super(e.app);this.plugin=e;this.saved=!1;this.calendar=(0,Ra.default)(n)}onOpen(){this.contentEl.setAttr("style","background-color: inherit; padding-top: 0px;");let e=new As({target:this.contentEl,props:{calendar:this.calendar,plugin:this.plugin,width:this.contentEl.clientWidth,top:0}});e.$on("exit",n=>{n.detail.saved&&(this.calendar=(0,Ra.default)(n.detail.calendar),this.saved=!0),this.close(),e.$destroy()})}};var qe=Fe(require("obsidian"));var Dr=Fe(require("obsidian"));var Rf=class{constructor(e,n,a){this.month=e;this.number=n;this.leapday=a;this.shouldUpdate=!1}get calendar(){return this.month.calendar}get date(){return{day:this.number,month:this.month.number,year:this.year}}get events(){return(!this._events||!this._events.length||this.shouldUpdate)&&(this._events=this.month.getEventsOnDay(this.date)),this._events}get longDate(){return{day:this.number,month:this.month.name,year:this.year}}get daysBefore(){return this.month.daysBefore+this.number-1-this.month.leapDays.filter(e=>e.numbered&&e.after!i.intercalary||i.intercalary&&i.numbered).length).keys()].map(i=>new Rf(this,i+1,this.leapDays.find(o=>o.after==i)))}get id(){return this.data.id}get index(){return this.calendar.data.months.indexOf(this.data)}get name(){return this.data.name}get length(){return this.days.length}get firstWeekday(){return this.calendar.data.overflow?this.days[0].weekday:0}get lastWeekday(){return this.days[this.days.length-1].weekday}get type(){return this.data.type}getEventsOnDay(e){return(!this.events||!this.events.length||this.shouldUpdate)&&(this.days.forEach(n=>n.shouldUpdate=!0),this.events=this.calendar.getEventsForMonth(this),this.shouldUpdate=!1),this.events.filter(n=>{if((!n.date.year||n.date.year==e.year)&&(!n.date.month||n.date.month==e.month)&&n.date.day==e.day)return!0;if(!n.end&&!n.formulas?.length)return!1;let a={...n.date},r={...n.end??{}};a.year||(a.year=r.year=this.year),a.month||(a.month=r.month=this.number);let i=Number(this.calendar.hash(e));if(Number(this.calendar.hash(a))<=i&&i<=Number(this.calendar.hash(r)??1/0))if(n.formulas?.length){let o=this.calendar.totalDaysBeforeYear(a.year)+this.calendar.daysBeforeMonth(a.month,a.year,!0)+a.day;return(this.calendar.totalDaysBeforeYear(e.year)+this.calendar.daysBeforeMonth(e.month,e.year,!0)+e.day-o)%n.formulas[0].number==0}else return!0;return!1})}getMoonsForDay(e){return(!this.moons||!this.moons.length||this.shouldUpdateMoons)&&(this.moons=this.calendar.getMoonsForMonth(this)),this.moons[e.day-1]}},La=class extends Dr.Events{constructor(e,n){super();this.calendar=e;this.plugin=n;this._cache=new Map;this.displayed={year:null,month:null,day:null};this.viewing={year:null,month:null,day:null};this.displayed={...this.current},this.update(this.calendar),this.plugin.registerEvent(this.plugin.app.workspace.on("fantasy-calendars-event-update",a=>{if(!a.has(this.calendar.id))return;let r=a.get(this.calendar.id);for(let i of r)!this._cache.has(i)||this.refreshYear(i)}))}addEvent(e){let n=e.date.year,a=e.date.month;this.refreshMonth(a,n)}refreshMonth(e,n){!this._cache.has(n)||!this._cache.get(n).months.has(e)||(this._cache.get(n).shouldUpdate=!0,this._cache.get(n).months.forEach(a=>a.shouldUpdate=!0),(n==this.displayed.year&&e==this.displayed.month||n==this.viewing.year&&e==this.viewing.month)&&this.trigger("month-update"))}refreshYear(e){!this._cache.has(e)||(this._cache.get(e).shouldUpdate=!0,this._cache.get(e).months.forEach(n=>n.shouldUpdate=!0),(e==this.displayed.year||e==this.viewing.year)&&this.trigger("month-update"))}getDayForDate(e){return this.getMonth(e.month,e.year).days[e.day-1]}getEventsForMonth(e){let{year:n,number:a}=e;if(this._cache.has(n)||this._cache.set(n,{events:[],shouldUpdate:!0,months:new Map}),this._cache.get(n).shouldUpdate){let i=this.calendar.events.filter(o=>{let l={...o.date},s={...o.end};return l.year==n||l.year==null?!0:l.year>n||!s&&!o.formulas?.length&&l.year=n||o.formulas?.length))});this._cache.set(n,{months:this._cache.get(n).months,events:i,shouldUpdate:!1})}return this._cache.get(n).events.filter(i=>{let o={...i.date},l={...i.end};return o.month==null||(o.year==n||o.year==null)&&o.month==a?!0:o.year>n||o.year==n&&o.month>a||!l&&!i.formulas?.length&&(o.month!=a||o.year=n&&l.month>=a)))})}getNameForYear(e){if(!this.data.useCustomYears)return`${e}`;if(this.data.useCustomYears&&e-1>=0&&e<=this.data.years?.length)return this.data.years[e-1].name}get displayWeeks(){return this.calendar.displayWeeks}getMonthsForYear(e){return this._cache.has(e)||this._cache.set(e,{events:[],shouldUpdate:!0,months:new Map(this.data.months.map((n,a)=>[a,new Ai(n,a,e,this)]))}),this._cache.get(e).months.size!=this.data.months.length&&this._cache.set(e,{...this._cache.get(e),months:new Map(this.data.months.map((n,a)=>[a,new Ai(n,a,e,this)]))}),Array.from(this._cache.get(e).months.values())}hash(e){if(e.year==null||e.month==null||e.day==null)return null;let n=`${this.data.months.length}`.length,a=`${e.month}`.padStart(n,"0"),r=`${this.maxDays}`.length,i=`${e.day}`.padStart(r,"0");return`${e.year}${a}${i}`}update(e){this.calendar=e??this.calendar,this.maxDays=Math.max(...this.data.months.map(n=>n.length)),this.standardMonths=this.data.months.filter(n=>n.type!="intercalary"),this.calendar?.current||(this.calendar.current={day:null,month:null,year:null}),Dn(this.calendar?.current.year,this.calendar)||(this.calendar.current.year=1),wn(this.calendar?.current.month,this.calendar)||(this.calendar.current.month=0),bn(this.calendar?.current.day,this.calendar)||(this.calendar.current.day=1),this.trigger("month-update"),this.trigger("day-update")}get categories(){return this.calendar.categories}get data(){return this.calendar.static}get current(){return this.calendar.current}get leapdays(){return this.data.leapDays??[]}get currentDate(){return rn(this.current,this.data.months)}get displayedDate(){return rn(this.displayed,this.data.months)}get viewedDate(){return rn(this.viewing,this.data.months)}reset(){this.displayed={...this.current},this.viewing={...this.current},this.trigger("month-update"),this.trigger("day-update")}setCurrentMonth(e){this.displayed.month=e,this.trigger("month-update")}goToNextDay(){let e=this.getDayForDate(this.viewing);this.viewing.day+=1,this.viewing.day>e.month.days.length&&(this.goToNext(),this.viewing.month=this.displayed.month,this.viewing.year=this.displayed.year,this.viewing.day=1),this.trigger("day-update")}goToNextCurrentDay(){this.current.day+=1;let e=this.getMonth(this.current.month,this.current.year);this.current.day>=e.days.length&&(this.current.day=1,this.current.month+=1,this.current.month>=this.data.months.length&&(this.current.month=0,this.current.year+=1)),this.trigger("day-update")}get nextMonthIndex(){return Mn(this.displayed.month+1,this.data.months.length)}get nextMonth(){return this.getMonth(this.displayed.month+1,this.displayed.year)}canGoToNextYear(e=this.displayed.year){return!this.data.useCustomYears||ethis.displayed.month){if(this.displayed.year==1){new Dr.Notice("This is the earliest year.");return}this.goToPreviousYear()}this.setCurrentMonth(e)}goToPreviousDay(){this.viewing.day-=1,this.viewing.day<1&&(this.goToPrevious(),this.viewing.month=this.displayed.month,this.viewing.year=this.displayed.year,this.viewing.day=this.currentMonth.days.length),this.trigger("day-update")}goToPreviousYear(){this.displayed.year-=1,this.trigger("year-update")}get weekdays(){return this.data.weekdays}get currentMonth(){return this.getMonth(this.displayed.month,this.displayed.year)}testLeapDay(e,n){return e.interval.sort((a,r)=>a.interval-r.interval).some(({interval:a,exclusive:r},i,o)=>{if(r&&i==0)return(n-e.offset)%a!=0;if(!r)return o[i+1]&&o[i+1].exclusive?(n-e.offset)%a==0&&(n-e.offset)%o[i+1].interval!=0:(n-e.offset)%a==0})}leapDaysForYear(e){return this.leapdays.filter(n=>this.testLeapDay(n,e))}leapDaysForMonth(e,n=this.displayed.year){return this.leapdays.filter(a=>a.timespan!=e?!1:this.testLeapDay(a,n))}getMonth(e,n,a=0){let r=this.data.months,i=Mn(e,r.length);if(e<0&&(n-=1),n==0)return null;if(e>=r.length&&(n+=1),this._cache.has(n)){if(this._cache.get(n).months.has(i))return this._cache.get(n).months.get(i)}else this._cache.set(n,{events:[],shouldUpdate:!0,months:new Map});if(r[i].type=="intercalary"&&a!=0)return this.getMonth(e+a,n,a);let o=new Ai(r[i],i,n,this);return this._cache.get(n).months.set(i,o),this._cache.set(n,this._cache.get(n)),o}getPaddedDaysForMonth(e){let n=e.days,a=[],r=this.getMonth(e.index-1,this.displayed.year,-1);e.firstWeekday>0&&e.type=="month"&&(a=r!=null?r.days.slice(-e.firstWeekday):Array(e.firstWeekday).fill(null));let i=[],o=this.getMonth(e.index+1,this.displayed.year,1);return e.lastWeekdaye.type==="month").reduce((e,n)=>e+n.length,0)}daysBeforeMonth(e,n,a=!1){return!e||e==0?0:this.data.months.slice(0,e).filter(r=>a?!0:r.type=="month").map((r,i)=>{let o=this.leapDaysForMonth(i,n);return r.length+o.filter(l=>!l.intercalary).length}).reduce((r,i)=>r+i,0)}dayNumberForDate(e){return this.daysBeforeMonth(e.month,e.year,!0)+e.day}get firstWeekday(){return this.data.firstWeekDay}get leapDaysBefore(){return this.displayed.year==1?0:this.leapDaysBeforeYear(this.displayed.year-1)}leapDaysBeforeYear(e){if(e==1)return 0;let n=e-1,a=0;for(let{interval:r,offset:i}of this.leapdays.filter(o=>!o.intercalary)){let o=0;for(let l=0;l!c.exclusive).map(c=>Math.floor((n+(c.ignore?0:i))/c.interval)).reduce((c,h)=>c+h,0),u=Math.floor((n+(s.ignore?0:i))/s.interval);s.exclusive?(o-=u,o+=d):(o+=u,o-=d)}a+=o}return a}get totalDaysBefore(){return this.totalDaysBeforeYear(this.displayed.year)}totalDaysBeforeYear(e,n=!1){return e<1?0:Math.abs(e-1)*this.data.months.filter(a=>n||a.type=="month").reduce((a,r)=>a+r.length,0)+this.leapDaysBeforeYear(e)}firstDayOfYear(e=this.displayed.year){return this.data.overflow?e==1?this.firstWeekday:Mn(this.totalDaysBeforeYear(e)%this.data.weekdays.length+this.firstWeekday+(this.data.offset??0),this.data.weekdays.length):0}get moons(){return this.data.moons}getMoonsForMonth(e){let n=[];for(let a of e.days){let r=this.totalDaysBeforeYear(e.year,!0)+this.daysBeforeMonth(e.number,e.year,!0)+a.number-1,i=[];for(let o of this.moons){let{offset:l,cycle:s}=o,d=24,u=(r-l)/s,h=(u-Math.floor(u))*d%d,y=of[d];i.push([o,y[Mn(Math.round(h),y.length)]])}n.push(i)}return n}};var Pa=Fe(require("obsidian"));var ki=Fe(require("obsidian"));function j1(t){we(t,"svelte-1e1nyi2",".flag.svelte-1e1nyi2.svelte-1e1nyi2{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-1e1nyi2.svelte-1e1nyi2{display:flex;gap:0.25rem;align-items:flex-start;justify-content:space-between}.day-view.svelte-1e1nyi2 .flag-content.svelte-1e1nyi2{justify-content:space-between}.clamp.svelte-1e1nyi2.svelte-1e1nyi2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;word-break:keep-all;overflow:hidden;text-overflow:ellipsis}.note.svelte-1e1nyi2.svelte-1e1nyi2{display:flex;align-self:center}.multi.svelte-1e1nyi2.svelte-1e1nyi2{flex-shrink:0;overflow:visible;width:unset}.multi.svelte-1e1nyi2 .clamp.svelte-1e1nyi2{-webkit-line-clamp:1;overflow:visible}.multi.start.svelte-1e1nyi2.svelte-1e1nyi2{margin-left:0}.multi.end.svelte-1e1nyi2.svelte-1e1nyi2{margin-right:0}.multi.first.svelte-1e1nyi2.svelte-1e1nyi2{overflow:visible;white-space:nowrap}.multi.svelte-1e1nyi2.svelte-1e1nyi2:not(.first){color:transparent;overflow:hidden}.multi.svelte-1e1nyi2.svelte-1e1nyi2:not(.start){border:0;margin-left:-6px}.multi.svelte-1e1nyi2.svelte-1e1nyi2:not(.end){margin-right:-6px}.start.svelte-1e1nyi2>.flag-content.svelte-1e1nyi2{justify-content:flex-start;gap:1em}")}function Lf(t){let e,n,a,r;return{c(){e=T("div"),w(e,"class","note svelte-1e1nyi2")},m(i,o){q(i,e,o),a||(r=ue(n=t[9].call(null,e)),a=!0)},d(i){i&&O(e),a=!1,r()}}}function V1(t){let e,n,a,r=t[0].name+"",i,o,l,s,d,u=t[0].note&&Lf(t);return{c(){e=T("div"),n=T("div"),a=T("span"),i=pe(r),o=V(),u&&u.c(),w(a,"class","svelte-1e1nyi2"),ge(a,"clamp",!t[1]),ge(a,"day-view",t[1]),w(n,"class","flag-content svelte-1e1nyi2"),w(e,"class","flag svelte-1e1nyi2"),w(e,"aria-label",l=t[1]?null:t[0].name),tt(e,"--hex-alpha",t[6]+"40"),tt(e,"--color",t[6]),ge(e,"multi",t[4]),ge(e,"start",t[2]),ge(e,"end",t[3]),ge(e,"first",t[5]),ge(e,"day-view",t[1])},m(c,h){q(c,e,h),C(e,n),C(n,a),C(a,i),C(n,o),u&&u.m(n,null),s||(d=[ae(e,"click",t[12]),ae(e,"mouseover",t[13]),ae(e,"focus",H1),ae(e,"contextmenu",t[14])],s=!0)},p(c,[h]){h&1&&r!==(r=c[0].name+"")&&be(i,r),h&2&&ge(a,"clamp",!c[1]),h&2&&ge(a,"day-view",c[1]),c[0].note?u||(u=Lf(c),u.c(),u.m(n,null)):u&&(u.d(1),u=null),h&3&&l!==(l=c[1]?null:c[0].name)&&w(e,"aria-label",l),h&64&&tt(e,"--hex-alpha",c[6]+"40"),h&64&&tt(e,"--color",c[6]),h&16&&ge(e,"multi",c[4]),h&4&&ge(e,"start",c[2]),h&8&&ge(e,"end",c[3]),h&32&&ge(e,"first",c[5]),h&2&&ge(e,"day-view",c[1])},i:K,o:K,d(c){c&&O(e),u&&u.d(),s=!1,_e(d)}}}var H1=()=>{};function W1(t,e,n){let a=Se(),{event:r}=e,{date:i}=e,{dayView:o=!1}=e,l=!1,s=!1,d=!1,u=!1,{categories:c}=e,h=c.find(E=>E.id==r.category)?.color??bs,y=ki.Platform.isMacOS?"Meta":"Control",m=E=>{(0,ki.setIcon)(E,"note-glyph")},v=E=>{E.stopPropagation(),a("event-click",{event:r,modifier:E.getModifierState(y)})},p=E=>a("event-mouseover",{target:E.target,event:r}),k=E=>{E.stopPropagation(),a("event-context",{evt:E,event:r})};return t.$$set=E=>{"event"in E&&n(0,r=E.event),"date"in E&&n(10,i=E.date),"dayView"in E&&n(1,o=E.dayView),"categories"in E&&n(11,c=E.categories)},t.$$.update=()=>{if(t.$$.dirty&1039){e:r.end!=null&&!o&&(n(4,l=!0),n(2,s=i.day===r.date.day&&(r.date.month==null||i.month==r.date.month)&&(r.date.year==null||i.year===r.date.year)),n(5,u=s||i.day==1),n(3,d=i.day===r.end.day&&(r.end.month==null||i.month==r.end.month)&&(r.end.year==null||i.year===r.end.year)),s&&d&&(n(4,l=!1),n(2,s=!1),n(3,d=!1)))}if(t.$$.dirty&2049){e:n(6,h=c.find(E=>E.id==r.category)?.color??bs)}},[r,o,s,d,l,u,h,a,y,m,i,c,v,p,k]}var Pf=class extends de{constructor(e){super();fe(this,e,W1,V1,se,{event:0,date:10,dayView:1,categories:11},j1)}},jf=Pf;function G1(t){we(t,"svelte-qnut28",".flags-container.svelte-qnut28{height:100%}.flag-container.svelte-qnut28{display:flex;flex-flow:column nowrap;gap:0.25rem}.overflow.svelte-qnut28{color:var(--text-muted);display:flex;justify-content:flex-end;width:100%}")}function Vf(t){let e,n,a,r;return{c(){e=T("div"),w(e,"class","flag-container svelte-qnut28")},m(i,o){q(i,e,o),a||(r=ue(n=t[2].call(null,e)),a=!0)},d(i){i&&O(e),a=!1,r()}}}function Hf(t){let e,n,a;return{c(){e=T("span"),n=pe("+"),a=pe(t[1])},m(r,i){q(r,e,i),C(e,n),C(e,a)},p(r,i){i&2&&be(a,r[1])},d(r){r&&O(e)}}}function U1(t){let e,n=t[0],a,r,i=Vf(t),o=t[1]>0&&Hf(t);return{c(){e=T("div"),i.c(),a=V(),r=T("div"),o&&o.c(),w(r,"class","overflow svelte-qnut28"),w(e,"class","flags-container svelte-qnut28")},m(l,s){q(l,e,s),i.m(e,null),C(e,a),C(e,r),o&&o.m(r,null)},p(l,[s]){s&1&&se(n,n=l[0])&&(i.d(1),i=Vf(l),i.c(),i.m(e,a)),l[1]>0?o?o.p(l,s):(o=Hf(l),o.c(),o.m(r,null)):o&&(o.d(1),o=null)},i:K,o:K,d(l){l&&O(e),i.d(l),o&&o.d()}}}function z1(t,e,n){let{events:a=[]}=e,{categories:r}=e,{dayView:i=!1}=e,{date:o}=e,{calendar:l}=e,s=0,d=Se(),u,c=0,h=y=>{if(a.length){let m=y?.parentElement?.getBoundingClientRect()?.height;if(!i&&(m==null||Math.floor(m)==Math.floor(c)))return;c=m,u=y,y.empty(),n(1,s=0);let v=m;for(let p of a){let k=new jf({target:y,props:{event:p,categories:r,dayView:i,date:o}});if(k.$on("event-click",E=>d("event-click",E.detail)),k.$on("event-mouseover",E=>d("event-mouseover",E.detail)),k.$on("event-context",E=>d("event-context",E.detail)),!i){if(v=m-y.getBoundingClientRect().height,v<0){y.lastElementChild.detach(),n(1,s=a.length-a.indexOf(p));break}else if(v==0){n(1,s=a.length-a.indexOf(p)-1);break}}}}};return l.on("view-resized",()=>{i||h(u)}),t.$$set=y=>{"events"in y&&n(0,a=y.events),"categories"in y&&n(3,r=y.categories),"dayView"in y&&n(4,i=y.dayView),"date"in y&&n(5,o=y.date),"calendar"in y&&n(6,l=y.calendar)},t.$$.update=()=>{if(t.$$.dirty&1){e:n(0,a=[...a])}},[a,s,h,r,i,o,l]}var Wf=class extends de{constructor(e){super();fe(this,e,z1,U1,se,{events:0,categories:3,dayView:4,date:5,calendar:6},G1)}},xi=Wf;function Y1(t){we(t,"svelte-1uhffao",".day-view.svelte-1uhffao{padding:5px 15px;display:flex;flex-flow:column nowrap;gap:0.5rem}.nav.svelte-1uhffao,.date.svelte-1uhffao{display:flex;justify-content:space-between;align-items:center}.left-nav.svelte-1uhffao{display:flex}.left-nav.svelte-1uhffao .clickable-icon{margin-right:0}.calendar-clickable.svelte-1uhffao{align-items:center;cursor:pointer;display:flex;justify-content:center}h3.svelte-1uhffao{margin:0}.day-view.svelte-1uhffao .flag-container > .flag{padding-left:0.5rem}.title-container.svelte-1uhffao{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center}.day-number.svelte-1uhffao{font-size:small}")}function Gf(t,e,n){let a=t.slice();return a[24]=e[n][0],a[25]=e[n][1],a}function Uf(t){let e,n,a,r;return{c(){e=T("div"),n=T("em"),a=pe("Day "),r=pe(t[8]),w(e,"class","day-number svelte-1uhffao")},m(i,o){q(i,e,o),C(e,n),C(n,a),C(n,r)},p(i,o){o&256&&be(r,i[8])},d(i){i&&O(e)}}}function zf(t){let e,n,a=t[5],r=[];for(let o=0;oH(r[o],1,1,()=>{r[o]=null});return{c(){e=T("div");for(let o=0;o{me=null}),Ae());let he={};z&8&&(he.events=X[3].events),z&128&&(he.categories=X[7]),z&4&&(he.date=X[2]),z&2&&(he.calendar=X[1]),B.$set(he)},i(X){W||(R(me),R(B.$$.fragment,X),W=!0)},o(X){H(me),H(B.$$.fragment,X),W=!1},d(X){X&&O(e),oe&&oe.d(),me&&me.d(),Q(B),Z=!1,_e(le)}}}function K1(t,e,n){let a,r,i,o,l,s,{displayDayNumber:d}=e,u=Ke("calendar"),c;u.subscribe(B=>{n(1,c=B)});let h;Ke("displayMoons").subscribe(B=>n(4,h=B)),c.on("day-update",()=>{n(2,r=c.viewing),n(6,a=c.viewedDate),n(3,i=c.getDayForDate(r)),n(5,l=i.moons)});let m=Se(),v=B=>{new Pa.ExtraButtonComponent(B).setIcon("cross").setTooltip("Close")},p=B=>{new Pa.ExtraButtonComponent(B).setIcon("fantasy-calendar-reveal").setTooltip("Show on Calendar").onClick(()=>{n(1,c.displayed.year=c.viewing.year,c),c.setCurrentMonth(c.viewing.month)})},k=B=>{new Pa.ExtraButtonComponent(B).setIcon("plus-with-circle").setTooltip("New Event").onClick(()=>m("event",r))},E=B=>{new Pa.ExtraButtonComponent(B).setIcon("left-arrow")},A=B=>{new Pa.ExtraButtonComponent(B).setIcon("right-arrow")},S=()=>m("reveal"),_=()=>m("close"),F=()=>c.goToPreviousDay(),D=()=>c.goToNextDay();function N(B){ce.call(this,t,B)}function x(B){ce.call(this,t,B)}function P(B){ce.call(this,t,B)}return t.$$set=B=>{"displayDayNumber"in B&&n(0,d=B.displayDayNumber)},t.$$.update=()=>{if(t.$$.dirty&2){e:n(6,a=c.viewedDate)}if(t.$$.dirty&2){e:n(2,r=c.viewing)}if(t.$$.dirty&6){e:n(3,i=c.getDayForDate(r))}if(t.$$.dirty&6){e:n(8,o=c.dayNumberForDate(r))}if(t.$$.dirty&8){e:n(5,l=i.moons)}if(t.$$.dirty&2){e:n(7,s=c.categories)}},[d,c,r,i,h,l,a,s,o,m,v,p,k,E,A,S,_,F,D,N,x,P]}var Zf=class extends de{constructor(e){super();fe(this,e,K1,Z1,se,{displayDayNumber:0},Y1)}},Kf=Zf;function Q1(t){we(t,"svelte-1gou5hh",".dot.svelte-1gou5hh{display:inline-block;min-height:6px;min-width:6px;height:6px;width:6px;margin:0 2px}.active.svelte-1gou5hh{color:var(--text-on-accent)}")}function X1(t){let e,n,a,r;return{c(){e=on("svg"),n=on("circle"),w(n,"stroke",a=t[2]??"currentColor"),w(n,"fill",r=t[2]??"currentColor"),w(n,"cx","3"),w(n,"cy","3"),w(n,"r","2"),w(e,"class","dot svelte-1gou5hh"),w(e,"viewBox","0 0 6 6"),w(e,"xmlns","http://www.w3.org/2000/svg"),ge(e,"filled",t[0]),ge(e,"active",t[1])},m(i,o){q(i,e,o),C(e,n)},p(i,[o]){o&4&&a!==(a=i[2]??"currentColor")&&w(n,"stroke",a),o&4&&r!==(r=i[2]??"currentColor")&&w(n,"fill",r),o&1&&ge(e,"filled",i[0]),o&2&&ge(e,"active",i[1])},i:K,o:K,d(i){i&&O(e)}}}function J1(t,e,n){let{isFilled:a=!0}=e,{isActive:r=!1}=e,{color:i}=e;return t.$$set=o=>{"isFilled"in o&&n(0,a=o.isFilled),"isActive"in o&&n(1,r=o.isActive),"color"in o&&n(2,i=o.color)},[a,r,i]}var Qf=class extends de{constructor(e){super();fe(this,e,J1,X1,se,{isFilled:0,isActive:1,color:2},Q1)}},Xf=Qf;function $1(t){we(t,"svelte-1w3ytba",".dots-container.svelte-1w3ytba{width:100%}.dot-container.svelte-1w3ytba{display:flex;flex-flow:row nowrap;width:fit-content;margin:auto;line-height:6px;min-height:6px}.centered.svelte-1w3ytba{justify-content:center;align-items:center}.overflow.svelte-1w3ytba{color:var(--text-muted);font-size:xx-small;display:flex;justify-content:flex-end;width:100%;line-height:1.25}")}function Jf(t){let e,n,a,r;return{c(){e=T("div"),w(e,"class","dot-container centered svelte-1w3ytba")},m(i,o){q(i,e,o),a||(r=ue(n=t[2].call(null,e)),a=!0)},d(i){i&&O(e),a=!1,r()}}}function $f(t){let e,n,a;return{c(){e=T("span"),n=pe("+"),a=pe(t[1])},m(r,i){q(r,e,i),C(e,n),C(e,a)},p(r,i){i&2&&be(a,r[1])},d(r){r&&O(e)}}}function eb(t){let e,n=t[0],a,r,i=Jf(t),o=t[1]>0&&$f(t);return{c(){e=T("div"),i.c(),a=V(),r=T("div"),o&&o.c(),w(r,"class","overflow svelte-1w3ytba"),w(e,"class","dots-container svelte-1w3ytba")},m(l,s){q(l,e,s),i.m(e,null),C(e,a),C(e,r),o&&o.m(r,null)},p(l,[s]){s&1&&se(n,n=l[0])&&(i.d(1),i=Jf(l),i.c(),i.m(e,a)),l[1]>0?o?o.p(l,s):(o=$f(l),o.c(),o.m(r,null)):o&&(o.d(1),o=null)},i:K,o:K,d(l){l&&O(e),i.d(l),o&&o.d()}}}function tb(t,e,n){let{events:a=[]}=e,{categories:r}=e,{calendar:i}=e,o=0,l,s=0,d=c=>{if(l=c,a.length){let h=c.parentElement?.getBoundingClientRect()?.width;if(!h||Math.floor(h)==Math.floor(s))return;s=h;let y=h;c.empty(),n(1,o=0);for(let m of a)if(new Xf({target:c,props:{color:u(m)}}),y=h-c.getBoundingClientRect().width,y<0){c.lastElementChild.detach(),n(1,o=a.length-a.indexOf(m));break}else if(y==0){n(1,o=a.length-a.indexOf(m)-1);break}}};i.on("view-resized",()=>{!l||d(l)});let u=c=>r.find(h=>h.id==c.category)?.color;return t.$$set=c=>{"events"in c&&n(0,a=c.events),"categories"in c&&n(3,r=c.categories),"calendar"in c&&n(4,i=c.calendar)},[a,o,d,r,i]}var eh=class extends de{constructor(e){super();fe(this,e,tb,eb,se,{events:0,categories:3,calendar:4},$1)}},th=eh;function nb(t){we(t,"svelte-3pptg2",".day.svelte-3pptg2{background-color:transparent;border:2px solid transparent;border-radius:4px;color:var(--color-text-day);cursor:pointer;font-size:0.8em;height:100%;padding:2px;position:relative;text-align:center;vertical-align:baseline;overflow:visible;display:flex;flex-flow:column nowrap}.active.svelte-3pptg2{background-color:var(--background-secondary)}.viewing.svelte-3pptg2{border:2px solid var(--background-modifier-border)}.adjacent-month.svelte-3pptg2{opacity:0.25}")}function nh(t,e,n){let a=t.slice();return a[20]=e[n][0],a[21]=e[n][1],a}function ab(t){let e,n;return e=new th({props:{events:t[4],categories:t[9],calendar:t[0].calendar}}),{c(){$(e.$$.fragment)},m(a,r){J(e,a,r),n=!0},p(a,r){let i={};r&16&&(i.events=a[4]),r&512&&(i.categories=a[9]),r&1&&(i.calendar=a[0].calendar),e.$set(i)},i(a){n||(R(e.$$.fragment,a),n=!0)},o(a){H(e.$$.fragment,a),n=!1},d(a){Q(e,a)}}}function rb(t){let e,n,a,r=t[5]&&t[10]&&t[10].length&&ah(t);return n=new xi({props:{events:t[4],categories:t[9],date:t[8],calendar:t[0].calendar}}),n.$on("event-click",t[12]),n.$on("event-mouseover",t[13]),n.$on("event-context",t[14]),{c(){r&&r.c(),e=V(),$(n.$$.fragment)},m(i,o){r&&r.m(i,o),q(i,e,o),J(n,i,o),a=!0},p(i,o){i[5]&&i[10]&&i[10].length?r?(r.p(i,o),o&1056&&R(r,1)):(r=ah(i),r.c(),R(r,1),r.m(e.parentNode,e)):r&&(Ee(),H(r,1,1,()=>{r=null}),Ae());let l={};o&16&&(l.events=i[4]),o&512&&(l.categories=i[9]),o&256&&(l.date=i[8]),o&1&&(l.calendar=i[0].calendar),n.$set(l)},i(i){a||(R(r),R(n.$$.fragment,i),a=!0)},o(i){H(r),H(n.$$.fragment,i),a=!1},d(i){r&&r.d(i),i&&O(e),Q(n,i)}}}function ah(t){let e,n,a=t[10],r=[];for(let o=0;oH(r[o],1,1,()=>{r[o]=null});return{c(){e=T("div");for(let o=0;o{m[E]=null}),Ae(),l=m[o],l?l.p(p,k):(l=m[o]=y[o](p),l.c()),R(l,1),l.m(e,null)),(!u||k&2&&s!==(s=""+(Co(p[1]?"adjacent-month fantasy-adjacent-month":"")+" svelte-3pptg2")))&&w(e,"class",s),(!u||k&20&&d!==(d=!p[2]&&p[4].length?`${p[4].length} event${p[4].length==1?"":"s"}`:void 0))&&w(e,"aria-label",d),k&2&&ge(e,"day",!0),k&2&&ge(e,"fantasy-day",!0),k&130&&ge(e,"active",p[7]&&!p[1]),k&74&&ge(e,"viewing",p[3]&&p[6]&&!p[1])},i(p){u||(R(l),u=!0)},o(p){H(l),u=!1},d(p){p&&O(e),m[o].d(),c=!1,_e(h)}}}function ob(t,e,n){let a,r,i,o,l,s=Se(),{day:d}=e,{adjacent:u}=e,{fullView:c}=e,h=[],y;Ke("dayView").subscribe(D=>n(3,y=D));let v;Ke("displayMoons").subscribe(D=>n(5,v=D)),d.calendar.on("month-update",()=>{n(7,o=d.isCurrentDay),n(6,l=d.isDisplaying),n(4,h=d.events)}),d.calendar.on("day-update",()=>{n(7,o=d.isCurrentDay),n(6,l=d.isDisplaying)});function k(D){ce.call(this,t,D)}function E(D){ce.call(this,t,D)}function A(D){ce.call(this,t,D)}let S=()=>s("day-click",d),_=()=>s("day-doubleclick",d),F=D=>s("day-context-menu",{day:d,evt:D});return t.$$set=D=>{"day"in D&&n(0,d=D.day),"adjacent"in D&&n(1,u=D.adjacent),"fullView"in D&&n(2,c=D.fullView)},t.$$.update=()=>{if(t.$$.dirty&3){e:u||n(4,h=d.events)}if(t.$$.dirty&1){e:n(10,a=d.moons)}if(t.$$.dirty&1){e:n(9,r=d.calendar.categories)}if(t.$$.dirty&1){e:n(8,i=d.date)}if(t.$$.dirty&1){e:n(7,o=d.isCurrentDay)}if(t.$$.dirty&1){e:n(6,l=d.isDisplaying)}if(t.$$.dirty&8){e:n(3,y)}},[d,u,c,y,h,v,l,o,i,r,a,s,k,E,A,S,_,F]}var ih=class extends de{constructor(e){super();fe(this,e,ob,ib,se,{day:0,adjacent:1,fullView:2},nb)}},_r=ih;function sb(t){we(t,"svelte-1cfzxxk",`.fantasy-month.svelte-1cfzxxk.svelte-1cfzxxk{display:grid;grid-template-columns:repeat(
+ var(--calendar-columns),
+ var(--column-widths)
+ );grid-auto-rows:var(--calendar-rows)}.intercalary.svelte-1cfzxxk.svelte-1cfzxxk{display:grid;grid-template-columns:1fr;grid-template-rows:auto auto;border-top:1px solid var(--background-modifier-border);border-bottom:1px solid var(--background-modifier-border);border-radius:0;align-items:center}.intercalary.svelte-1cfzxxk span.month.svelte-1cfzxxk{text-align:center}.intercalary.svelte-1cfzxxk .fantasy-month.svelte-1cfzxxk{grid-template-columns:unset;grid-auto-columns:var(--column-widths);align-items:center;justify-content:center}.leapday-container.svelte-1cfzxxk.svelte-1cfzxxk{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)}.full-view.svelte-1cfzxxk.svelte-1cfzxxk{height:100%;margin-bottom:0.5rem}.month.svelte-1cfzxxk.svelte-1cfzxxk{padding:0.25rem}.month-name.svelte-1cfzxxk.svelte-1cfzxxk{margin:0}.month.svelte-1cfzxxk .fantasy-day.day{padding:0px}`)}function oh(t,e,n){let a=t.slice();return a[24]=e[n],a}function sh(t,e,n){let a=t.slice();return a[24]=e[n],a}function lh(t,e,n){let a=t.slice();return a[29]=e[n],a}function uh(t,e,n){let a=t.slice();return a[29]=e[n],a}function ch(t,e,n){let a=t.slice();return a[24]=e[n],a}function dh(t){let e,n=t[1].name+"",a;return{c(){e=T("h3"),a=pe(n),w(e,"class","month-name svelte-1cfzxxk")},m(r,i){q(r,e,i),C(e,a)},p(r,i){i[0]&2&&n!==(n=r[1].name+"")&&be(a,n)},d(r){r&&O(e)}}}function fh(t){let e,n=t[1].name+"",a;return{c(){e=T("span"),a=pe(n),w(e,"class","month svelte-1cfzxxk")},m(r,i){q(r,e,i),C(e,a)},p(r,i){i[0]&2&&n!==(n=r[1].name+"")&&be(a,n)},d(r){r&&O(e)}}}function lb(t){let e;return{c(){e=T("div")},m(n,a){q(n,e,a)},p:K,i:K,o:K,d(n){n&&O(e)}}}function ub(t){let e,n;return e=new _r({props:{day:t[24],adjacent:!0,fullView:t[3]}}),{c(){$(e.$$.fragment)},m(a,r){J(e,a,r),n=!0},p(a,r){let i={};r[0]&512&&(i.day=a[24]),r[0]&8&&(i.fullView=a[3]),e.$set(i)},i(a){n||(R(e.$$.fragment,a),n=!0)},o(a){H(e.$$.fragment,a),n=!1},d(a){Q(e,a)}}}function hh(t){let e,n,a,r,i=[ub,lb],o=[];function l(s,d){return s[6]&&s[24]!=null?0:1}return e=l(t,[-1,-1]),n=o[e]=i[e](t),{c(){n.c(),a=Ge()},m(s,d){o[e].m(s,d),q(s,a,d),r=!0},p(s,d){let u=e;e=l(s,d),e===u?o[e].p(s,d):(Ee(),H(o[u],1,1,()=>{o[u]=null}),Ae(),n=o[e],n?n.p(s,d):(n=o[e]=i[e](s),n.c()),R(n,1),n.m(a.parentNode,a))},i(s){r||(R(n),r=!0)},o(s){H(n),r=!1},d(s){o[e].d(s),s&&O(a)}}}function mh(t){let e,n,a,r,i,o,l,s=t[10](t[24]).next,d=[];for(let v=0;v{c[k]=null}),Ae(),r=c[a],r?r.p(v,p):(r=c[a]=u[a](v),r.c()),R(r,1),r.m(n,null)),p[0]&256){let E=y.length;y=v[10](v[24]).prev;let A;for(A=E;A{r=null}),Ae()),o[24].leapday?.numbered?i&&(Ee(),H(i,1,1,()=>{i=null}),Ae()):i?(i.p(o,l),l[0]&256&&R(i,1)):(i=yh(o),i.c(),R(i,1),i.m(n.parentNode,n))},i(o){a||(R(r),R(i),a=!0)},o(o){H(r),H(i),a=!1},d(o){r&&r.d(o),o&&O(e),i&&i.d(o),o&&O(n)}}}function fb(t){let e;return{c(){e=T("div")},m(n,a){q(n,e,a)},p:K,i:K,o:K,d(n){n&&O(e)}}}function hb(t){let e,n;return e=new _r({props:{day:t[24],adjacent:!0,fullView:t[3]}}),{c(){$(e.$$.fragment)},m(a,r){J(e,a,r),n=!0},p(a,r){let i={};r[0]&128&&(i.day=a[24]),r[0]&8&&(i.fullView=a[3]),e.$set(i)},i(a){n||(R(e.$$.fragment,a),n=!0)},o(a){H(e.$$.fragment,a),n=!1},d(a){Q(e,a)}}}function bh(t){let e,n,a,r,i=[hb,fb],o=[];function l(s,d){return s[6]?0:1}return e=l(t,[-1,-1]),n=o[e]=i[e](t),{c(){n.c(),a=Ge()},m(s,d){o[e].m(s,d),q(s,a,d),r=!0},p(s,d){let u=e;e=l(s,d),e===u?o[e].p(s,d):(Ee(),H(o[u],1,1,()=>{o[u]=null}),Ae(),n=o[e],n?n.p(s,d):(n=o[e]=i[e](s),n.c()),R(n,1),n.m(a.parentNode,a))},i(s){r||(R(n),r=!0)},o(s){H(n),r=!1},d(s){o[e].d(s),s&&O(a)}}}function wh(t){let e,n,a,r,i=t[9],o=[];for(let m=0;mH(o[m],1,1,()=>{o[m]=null}),s=t[8],d=[];for(let m=0;mH(d[m],1,1,()=>{d[m]=null}),c=t[7],h=[];for(let m=0;mH(h[m],1,1,()=>{h[m]=null});return{c(){e=T("div");for(let m=0;m{let W=B.weekday,Z=B.calendar.weekdays.length-W,le=[];Z!=0&&(le=[...Array(Z).keys()]);let oe=[];return W!=0&&(oe=[...Array(W).keys()]),{next:le,prev:oe}};function v(B){ce.call(this,t,B)}function p(B){ce.call(this,t,B)}function k(B){ce.call(this,t,B)}function E(B){ce.call(this,t,B)}function A(B){ce.call(this,t,B)}function S(B){ce.call(this,t,B)}function _(B){ce.call(this,t,B)}function F(B){ce.call(this,t,B)}function D(B){ce.call(this,t,B)}function N(B){ce.call(this,t,B)}function x(B){ce.call(this,t,B)}function P(B){ce.call(this,t,B)}return t.$$set=B=>{"yearView"in B&&n(0,l=B.yearView),"month"in B&&n(1,s=B.month),"columns"in B&&n(2,d=B.columns),"fullView"in B&&n(3,u=B.fullView),"weeks"in B&&n(4,c=B.weeks),"intercalary"in B&&n(5,h=B.intercalary),"showPad"in B&&n(6,y=B.showPad)},t.$$.update=()=>{if(t.$$.dirty[0]&2){e:n(11,a=s.calendar.getPaddedDaysForMonth(s))}if(t.$$.dirty[0]&2048){e:n(9,r=a.previous)}if(t.$$.dirty[0]&2){e:n(8,i=s.days)}if(t.$$.dirty[0]&2048){e:n(7,o=a.next)}},[l,s,d,u,c,h,y,o,i,r,m,a,v,p,k,E,A,S,_,F,D,N,x,P]}var Dh=class extends de{constructor(e){super();fe(this,e,pb,mb,se,{yearView:0,month:1,columns:2,fullView:3,weeks:4,intercalary:5,showPad:6},sb,[-1,-1])}},Vn=Dh;var Fi=Fe(require("obsidian"));function gb(t){we(t,"svelte-131055d",".fantasy-nav.nav.nav.svelte-131055d{padding:10px 0px;margin:0;display:flex;flex-flow:row nowrap;justify-content:space-between;align-items:stretch}.container.svelte-131055d{display:flex;align-items:center}.fantasy-title.svelte-131055d{margin:0;line-height:1.25}.fantasy-right-nav.svelte-131055d{display:flex;justify-content:center;align-items:flex-start}.calendar-clickable.svelte-131055d{align-items:center;cursor:pointer;display:flex;justify-content:center}.title-container.svelte-131055d{display:flex;flex-flow:column nowrap;align-items:flex-start}")}function yb(t){let e,n,a,r,i,o,l,s,d,u,c,h,y,m,v,p,k,E,A,S,_,F,D,N,x,P,B;return{c(){e=T("div"),n=T("div"),a=T("h3"),r=T("span"),i=pe(t[0]),o=V(),l=T("span"),s=pe(t[1]),d=V(),u=T("div"),c=T("div"),h=T("div"),v=V(),p=T("div"),k=T("span"),k.textContent="Today",A=V(),S=T("div"),D=V(),N=T("div"),w(r,"class","fantasy-month month"),w(l,"class","fantasy-year year"),w(a,"class","fantasy-title title svelte-131055d"),w(n,"class","title-container svelte-131055d"),w(h,"class","arrow calendar-clickable svelte-131055d"),w(h,"aria-label",y=t[3].name),w(p,"class","reset-button calendar-clickable svelte-131055d"),w(p,"aria-label",E="Today is "+t[2]),w(S,"class","arrow right calendar-clickable svelte-131055d"),w(S,"aria-label",_=t[4].name),w(N,"class","calendar-clickable svelte-131055d"),w(N,"aria-label","Calendar Settings"),w(c,"class","container svelte-131055d"),w(u,"class","right-nav fantasy-right-nav svelte-131055d"),w(e,"class","fantasy-nav nav svelte-131055d")},m(W,Z){q(W,e,Z),C(e,n),C(n,a),C(a,r),C(r,i),C(a,o),C(a,l),C(l,s),C(e,d),C(e,u),C(u,c),C(c,h),C(c,v),C(c,p),C(p,k),C(c,A),C(c,S),C(c,D),C(c,N),P||(B=[ue(m=t[6].call(null,h)),ae(h,"click",t[9]),ae(p,"click",t[10]),ue(F=t[7].call(null,S)),ae(S,"click",t[11]),ue(x=t[8].call(null,N)),ae(N,"click",t[12])],P=!0)},p(W,[Z]){Z&1&&be(i,W[0]),Z&2&&be(s,W[1]),Z&8&&y!==(y=W[3].name)&&w(h,"aria-label",y),Z&4&&E!==(E="Today is "+W[2])&&w(p,"aria-label",E),Z&16&&_!==(_=W[4].name)&&w(S,"aria-label",_)},i:K,o:K,d(W){W&&O(e),P=!1,_e(B)}}}function vb(t,e,n){let a=Se(),{month:r}=e,{year:i}=e,{current:o}=e,l=Ke("calendar"),s;l.subscribe(E=>{s=E});let d=s.getPreviousMonth(),u=s.getNextMonth();s.on("month-update",()=>{n(3,d=s.getPreviousMonth()),n(4,u=s.getNextMonth())});let c=E=>{new Fi.ExtraButtonComponent(E).setIcon("left-arrow")},h=E=>{new Fi.ExtraButtonComponent(E).setIcon("right-arrow")},y=E=>{new Fi.ExtraButtonComponent(E).setIcon("gear")},m=()=>a("previous"),v=()=>a("reset"),p=E=>a("next"),k=E=>a("settings",E);return t.$$set=E=>{"month"in E&&n(0,r=E.month),"year"in E&&n(1,i=E.year),"current"in E&&n(2,o=E.current)},[r,i,o,d,u,a,c,h,y,m,v,p,k]}var _h=class extends de{constructor(e){super();fe(this,e,vb,yb,se,{month:0,year:1,current:2},gb)}},Ch=_h;var Ti=Fe(require("obsidian"));function bb(t){we(t,"svelte-i3pajt","#calendar-container .fantasy-nav.nav.nav.svelte-i3pajt{padding:0;margin:0;display:flex;flex-flow:row nowrap;justify-content:space-between;align-items:center;position:sticky;top:0;z-index:2}.fantasy-year-nav.svelte-i3pajt{display:flex;align-items:center;margin-right:auto}.container.svelte-i3pajt{display:flex;align-items:center}.fantasy-title.svelte-i3pajt{margin:0}.fantasy-right-nav.svelte-i3pajt{display:flex;justify-content:center;align-items:flex-start}.calendar-clickable.svelte-i3pajt{align-items:center;cursor:pointer;display:flex;justify-content:center}")}function Eh(t){let e,n,a,r;return{c(){e=T("div"),w(e,"class","arrow calendar-clickable svelte-i3pajt"),w(e,"aria-label","Previous Year")},m(i,o){q(i,e,o),a||(r=[ue(n=t[4].call(null,e)),ae(e,"click",t[7])],a=!0)},p:K,d(i){i&&O(e),a=!1,_e(r)}}}function Ah(t){let e,n,a,r;return{c(){e=T("div"),w(e,"class","arrow right calendar-clickable svelte-i3pajt"),w(e,"aria-label","Next Year")},m(i,o){q(i,e,o),a||(r=[ue(n=t[5].call(null,e)),ae(e,"click",t[9])],a=!0)},p:K,d(i){i&&O(e),a=!1,_e(r)}}}function wb(t){let e,n,a,r,i,o,l,s,d,u,c,h,y,m,v,p,k,E,A=t[1]&&Eh(t),S=t[1]&&Ah(t);return{c(){e=T("div"),n=T("div"),a=T("h2"),r=T("span"),i=pe(t[0]),o=V(),l=T("div"),s=T("div"),A&&A.c(),d=V(),u=T("div"),c=T("span"),c.textContent="Today",y=V(),S&&S.c(),m=V(),v=T("div"),w(r,"class","fantasy-year"),w(a,"class","fantasy-title svelte-i3pajt"),w(n,"class","fantasy-year-nav svelte-i3pajt"),w(u,"class","reset-button calendar-clickable svelte-i3pajt"),w(u,"aria-label",h="Today is "+t[2]),w(v,"class","calendar-clickable svelte-i3pajt"),w(v,"aria-label","Calendar Settings"),w(s,"class","container svelte-i3pajt"),w(l,"class","right-nav fantasy-right-nav svelte-i3pajt"),w(e,"class","fantasy-nav nav svelte-i3pajt")},m(_,F){q(_,e,F),C(e,n),C(n,a),C(a,r),C(r,i),C(e,o),C(e,l),C(l,s),A&&A.m(s,null),C(s,d),C(s,u),C(u,c),C(s,y),S&&S.m(s,null),C(s,m),C(s,v),k||(E=[ae(u,"click",t[8]),ue(p=t[6].call(null,v)),ae(v,"click",t[10])],k=!0)},p(_,[F]){F&1&&be(i,_[0]),_[1]?A?A.p(_,F):(A=Eh(_),A.c(),A.m(s,d)):A&&(A.d(1),A=null),F&4&&h!==(h="Today is "+_[2])&&w(u,"aria-label",h),_[1]?S?S.p(_,F):(S=Ah(_),S.c(),S.m(s,m)):S&&(S.d(1),S=null)},i:K,o:K,d(_){_&&O(e),A&&A.d(),S&&S.d(),k=!1,_e(E)}}}function Db(t,e,n){let a=Se(),{year:r}=e,{arrows:i=!1}=e,{current:o}=e,l=m=>{new Ti.ExtraButtonComponent(m).setIcon("left-arrow")},s=m=>{new Ti.ExtraButtonComponent(m).setIcon("right-arrow")},d=m=>{new Ti.ExtraButtonComponent(m).setIcon("gear")},u=()=>a("previous"),c=()=>a("reset"),h=m=>a("next"),y=m=>a("settings",m);return t.$$set=m=>{"year"in m&&n(0,r=m.year),"arrows"in m&&n(1,i=m.arrows),"current"in m&&n(2,o=m.current)},[r,i,o,a,l,s,d,u,c,h,y]}var kh=class extends de{constructor(e){super();fe(this,e,Db,wb,se,{year:0,arrows:1,current:2},bb)}},Si=kh;function _b(t){we(t,"svelte-15hvixf",".year-view.svelte-15hvixf{height:100%;position:relative;display:flex;flex-direction:column}.year.svelte-15hvixf{display:grid;grid-template-columns:1fr 1fr 1fr;gap:1rem;overflow:auto;flex:1}.year.svelte-15hvixf:not(.full-view){grid-template-columns:1fr}")}function Cb(t){let e,n,a,r,i,o,l;return n=new Si({props:{year:t[3],current:t[0]}}),n.$on("next",t[9]),n.$on("previous",t[10]),n.$on("reset",t[11]),n.$on("settings",t[12]),{c(){e=T("div"),$(n.$$.fragment),a=V(),r=T("div"),w(r,"class","year svelte-15hvixf"),ge(r,"full-view",t[1]),w(e,"class","year-view svelte-15hvixf")},m(s,d){q(s,e,d),J(n,e,null),C(e,a),C(e,r),t[13](r),i=!0,o||(l=ae(r,"scroll",t[5],{once:!0}),o=!0)},p(s,[d]){let u={};d&8&&(u.year=s[3]),d&1&&(u.current=s[0]),n.$set(u),d&2&&ge(r,"full-view",s[1])},i(s){i||(R(n.$$.fragment,s),i=!0)},o(s){H(n.$$.fragment,s),i=!1},d(s){s&&O(e),Q(n),t[13](null),o=!1,l()}}}function Eb(t,e,n){let a,r=Se(),{current:i}=e,{year:o}=e,{columns:l}=e,{fullView:s}=e,d,u,c,h=Ke("calendar"),y;h.subscribe(z=>{n(8,y=z)});let m=[],v=Ke("dayView"),p=Ke("displayMoons"),k=new IntersectionObserver((z,he)=>{he===k&&(!z.length||!z[0].isIntersecting||(k.disconnect(),!(!y.canGoToNextYear(c.year)&&c.number===y.data.months.length-1)&&(S(),P(m.shift()),E())))},{root:d,rootMargin:"0px",threshold:.25}),E=()=>{let z=d.children[d.children.length-2];!z||k.observe(z)},A=new IntersectionObserver((z,he)=>{if(he!==A||!z&&!z.length||z[0].isIntersecting)return;let De=d.getBoundingClientRect();z[0].boundingClientRect.top{if(!(!y.canGoToNextYear(c.year)&&c.number===y.data.months.length-1)){if(c=y.getMonth(c.number+1,c.year),c.number===0&&!(d.lastElementChild instanceof HTMLHeadingElement)){let he=d.createEl("h2",{text:y.getNameForYear(c.year),cls:"fantasy-title"});m.push(he),A.disconnect(),A.observe(he)}m.push(x(c,!1)),z&&(u=y.getMonth((u?.number??0)+1,u?.year??1)),F()}},_=new IntersectionObserver((z,he)=>{he===_&&(!z.length||!z[0].isIntersecting||(_.disconnect(),!!u&&(N(),P(m.pop()),F())))},{root:d,rootMargin:"0px",threshold:.25}),F=()=>{let z=d.children[1];!z||_.observe(z)},D=new IntersectionObserver((z,he)=>{he===D&&(!z&&!z.length||z[0].isIntersecting&&(n(6,o-=1),A.observe(z[0].target),D.disconnect()))},{root:d,rootMargin:"0px",threshold:0}),N=(z=!0)=>{if(u=y.getMonth(u.number-1,u.year),!!u){if(m.unshift(x(u,!0)),u.number===0&&!(d.firstElementChild instanceof HTMLHeadingElement)){let he=createEl("h2",{text:y.getNameForYear(u.year),cls:"fantasy-title"});d.prepend(he),m.unshift(he),D.disconnect(),D.observe(he)}z&&(c=y.getMonth(c.number-1,c.year)),E()}},x=(z,he)=>{let De=new Vn({target:d,anchor:he?d.children[0]:null,props:{month:z,fullView:!1,yearView:!0,columns:l,weeks:y.weekdays.length,showPad:!1},context:new Map([["dayView",v],["displayMoons",p]])});return De.$on("day-click",ie=>r("day-click",ie.detail)),De.$on("day-doubleclick",ie=>r("day-doubleclick",ie.detail)),De.$on("day-context-menu",ie=>r("day-context-menu",ie.detail)),De.$on("event-mouseover",ie=>r("event-mouseover",ie.detail)),De.$on("event-mouseover",ie=>r("event-mouseover",ie.detail)),De},P=z=>{z instanceof HTMLHeadingElement?z.detach():z.$destroy()},B=async(z=!1)=>{for(let De of m)P(De);m.splice(0,m.length),d.empty(),await Zn(),n(6,o=y.current.year),u=y.getMonth(y.displayed.month-1,y.displayed.year),c=u;for(let De=0;De{_.disconnect(),k.disconnect(),D.disconnect(),A.disconnect()}),zn(B);let W=async()=>{await Zn(),_.observe(d.children[1]),k.observe(d.children[d.children.length-2])};function Z(z){ce.call(this,t,z)}function le(z){ce.call(this,t,z)}let oe=()=>B(!0);function me(z){ce.call(this,t,z)}function X(z){ba[z?"unshift":"push"](()=>{d=z,n(2,d)})}return t.$$set=z=>{"current"in z&&n(0,i=z.current),"year"in z&&n(6,o=z.year),"columns"in z&&n(7,l=z.columns),"fullView"in z&&n(1,s=z.fullView)},t.$$.update=()=>{if(t.$$.dirty&320){e:n(3,a=y.getNameForYear(o))}},[i,s,d,a,B,W,o,l,y,Z,le,oe,me,X]}var xh=class extends de{constructor(e){super();fe(this,e,Eb,Cb,se,{current:0,year:6,columns:7,fullView:1},_b)}},Fh=xh;var ks=Fe(require("obsidian"));function Ab(t){we(t,"svelte-ztrrn8",".year.svelte-ztrrn8{display:grid;grid-template-columns:1fr 1fr 1fr;gap:1rem;overflow:auto;flex:1}.year.svelte-ztrrn8:not(.full-view){grid-template-columns:1fr}")}function Th(t,e,n){let a=t.slice();return a[8]=e[n],a}function Sh(t){let e,n;return e=new Vn({props:{month:t[8],fullView:!1,yearView:!0,columns:t[2],weeks:t[8].calendar.weekdays.length,showPad:!1}}),e.$on("day-click",t[3]),e.$on("day-doubleclick",t[4]),e.$on("day-context-menu",t[5]),e.$on("event-click",t[6]),e.$on("event-mouseover",t[7]),{c(){$(e.$$.fragment)},m(a,r){J(e,a,r),n=!0},p(a,r){let i={};r&2&&(i.month=a[8]),r&4&&(i.columns=a[2]),r&2&&(i.weeks=a[8].calendar.weekdays.length),e.$set(i)},i(a){n||(R(e.$$.fragment,a),n=!0)},o(a){H(e.$$.fragment,a),n=!1},d(a){Q(e,a)}}}function kb(t){let e,n,a=t[1],r=[];for(let o=0;oH(r[o],1,1,()=>{r[o]=null});return{c(){e=T("div");for(let o=0;o{"fullView"in c&&n(0,a=c.fullView),"months"in c&&n(1,r=c.months),"columns"in c&&n(2,i=c.columns)},[a,r,i,o,l,s,d,u]}var Bh=class extends de{constructor(e){super();fe(this,e,xb,kb,se,{fullView:0,months:1,columns:2},Ab)}},Nh=Bh;function Fb(t){we(t,"svelte-1xpvbi",".year-view.svelte-1xpvbi{height:100%;position:relative;display:flex;flex-direction:column}.year-container.svelte-1xpvbi{flex:1;overflow:auto}")}function Tb(t){let e,n,a,r,i;return n=new Si({props:{year:t[2],current:t[0],arrows:!0}}),n.$on("next",t[9]),n.$on("previous",t[10]),n.$on("reset",t[11]),n.$on("settings",t[12]),{c(){e=T("div"),$(n.$$.fragment),a=V(),r=T("div"),w(r,"class","year-container svelte-1xpvbi"),w(e,"class","year-view svelte-1xpvbi")},m(o,l){q(o,e,l),J(n,e,null),C(e,a),C(e,r),t[13](r),i=!0},p(o,[l]){let s={};l&4&&(s.year=o[2]),l&1&&(s.current=o[0]),n.$set(s)},i(o){i||(R(n.$$.fragment,o),i=!0)},o(o){H(n.$$.fragment,o),i=!1},d(o){o&&O(e),Q(n),t[13](null)}}}function Sb(t,e,n){let a,r=Se(),i=Ke("calendar"),o=Ke("dayView"),l=Ke("displayMoons"),s;i.subscribe(x=>{n(8,s=x)});let{year:d}=e,{current:u}=e,{columns:c}=e,h,y=(x,P=!1)=>{let B=s.getMonthsForYear(x),W=new Nh({target:h,anchor:P?h.children[0]:null,props:{months:B,fullView:!0,columns:c},context:new Map([["dayView",o],["displayMoons",l]])});return W.$on("day-click",Z=>r("day-click",Z.detail)),W.$on("day-doubleclick",Z=>r("day-doubleclick",Z.detail)),W.$on("day-context-menu",Z=>r("day-context-menu",Z.detail)),W.$on("event-mouseover",Z=>r("event-mouseover",Z.detail)),W.$on("event-mouseover",Z=>r("event-mouseover",Z.detail)),W},m=x=>{x instanceof HTMLHeadingElement?x.detach():x.$destroy()},v=[],p=()=>{if(!s.canGoToNextYear(d)){new ks.Notice("This is the last year. Additional years can be created in settings.");return}n(6,d=d+1),A(d)},k=()=>{if(d===1){new ks.Notice("This is the earliest year.");return}n(6,d=d-1),A(d)},E=()=>{n(6,d=s.current.year),A(d)},A=async x=>{v.forEach(P=>m(P)),h.empty(),await Zn(),x=x,v.push(y(x))};zn(()=>v.push(y(d)));let S=()=>p(),_=()=>k(),F=()=>E();function D(x){ce.call(this,t,x)}function N(x){ba[x?"unshift":"push"](()=>{h=x,n(1,h)})}return t.$$set=x=>{"year"in x&&n(6,d=x.year),"current"in x&&n(0,u=x.current),"columns"in x&&n(7,c=x.columns)},t.$$.update=()=>{if(t.$$.dirty&320){e:n(2,a=s.getNameForYear(d))}},[u,h,a,p,k,E,d,c,s,S,_,F,D,N]}var Mh=class extends de{constructor(e){super();fe(this,e,Sb,Tb,se,{year:6,current:0,columns:7},Fb)}},Ih=Mh;function Bb(t){we(t,"svelte-li8ss6","#calendar-container.year-view.svelte-li8ss6.svelte-li8ss6{height:100%}#calendar-container.fantasy-calendar.full-view.svelte-li8ss6.svelte-li8ss6{width:100%;padding:0 0.5rem 0.5rem;height:100%;display:flex;flex-flow:column}.fantasy-calendar.full-view.svelte-li8ss6 .month-container.svelte-li8ss6{height:100%}.month-container.svelte-li8ss6.svelte-li8ss6{display:flex}.month-view.svelte-li8ss6.svelte-li8ss6{flex-grow:2}.weeks.svelte-li8ss6.svelte-li8ss6{display:grid;grid-template-rows:auto 1fr}.week-num-container.svelte-li8ss6.svelte-li8ss6{display:grid;grid-template-rows:repeat(var(--calendar-rows), auto);padding:0.25rem 0}.week-num.svelte-li8ss6.svelte-li8ss6{background-color:transparent;border:2px solid transparent;border-radius:4px;color:var(--color-text-day);cursor:pointer;font-size:0.8em;height:100%;padding:2px;position:relative;text-align:center;vertical-align:baseline;overflow:visible}.weekdays.svelte-li8ss6.svelte-li8ss6{display:grid;grid-template-columns:repeat(var(--calendar-columns), 1fr);grid-template-rows:auto;padding:0 0.25rem;gap:2px}.weekday.svelte-li8ss6.svelte-li8ss6{background-color:var(--color-background-heading);color:var(--color-text-heading);font-size:0.6em;letter-spacing:1px;padding:4px;text-transform:uppercase;text-align:center;border:2px solid transparent}hr.svelte-li8ss6.svelte-li8ss6{margin:1rem 0}.moon-container{display:flex;flex-flow:row wrap;align-items:center;justify-content:center}")}function Oh(t,e,n){let a=t.slice();return a[64]=e[n],a}function qh(t,e,n){let a=t.slice();return a[67]=e[n],a}function Nb(t){let e,n,a,r,i,o,l,s,d,u,c;e=new Ch({props:{month:t[6].name,year:t[11],current:t[3].currentDate}}),e.$on("next",t[34]),e.$on("previous",t[35]),e.$on("reset",t[36]),e.$on("settings",t[37]);let h=t[5]&&Rh(t),y=t[9]&&t[9].type=="intercalary"&&!t[14]&&Ph(t),m=t[6].type=="month"&&jh(t);d=new Vn({props:{columns:t[13].length,weeks:t[7],month:t[6],fullView:t[1]}}),d.$on("day-click",t[44]),d.$on("day-doubleclick",t[45]),d.$on("day-context-menu",t[46]),d.$on("event-click",t[47]),d.$on("event-mouseover",t[48]),d.$on("event-context",t[49]);let v=t[10]&&t[10].type=="intercalary"&&!t[14]&&Hh(t);return{c(){$(e.$$.fragment),n=V(),a=T("div"),r=T("div"),h&&h.c(),i=V(),o=T("div"),y&&y.c(),l=V(),m&&m.c(),s=V(),$(d.$$.fragment),u=V(),v&&v.c(),w(r,"class","weeks svelte-li8ss6"),w(o,"class","month-view svelte-li8ss6"),w(a,"class","month-container svelte-li8ss6")},m(p,k){J(e,p,k),q(p,n,k),q(p,a,k),C(a,r),h&&h.m(r,null),C(a,i),C(a,o),y&&y.m(o,null),C(o,l),m&&m.m(o,null),C(o,s),J(d,o,null),C(o,u),v&&v.m(o,null),c=!0},p(p,k){let E={};k[0]&64&&(E.month=p[6].name),k[0]&2048&&(E.year=p[11]),k[0]&8&&(E.current=p[3].currentDate),e.$set(E),p[5]?h?h.p(p,k):(h=Rh(p),h.c(),h.m(r,null)):h&&(h.d(1),h=null),p[9]&&p[9].type=="intercalary"&&!p[14]?y?(y.p(p,k),k[0]&16896&&R(y,1)):(y=Ph(p),y.c(),R(y,1),y.m(o,l)):y&&(Ee(),H(y,1,1,()=>{y=null}),Ae()),p[6].type=="month"?m?m.p(p,k):(m=jh(p),m.c(),m.m(o,s)):m&&(m.d(1),m=null);let A={};k[0]&8192&&(A.columns=p[13].length),k[0]&128&&(A.weeks=p[7]),k[0]&64&&(A.month=p[6]),k[0]&2&&(A.fullView=p[1]),d.$set(A),p[10]&&p[10].type=="intercalary"&&!p[14]?v?(v.p(p,k),k[0]&17408&&R(v,1)):(v=Hh(p),v.c(),R(v,1),v.m(o,null)):v&&(Ee(),H(v,1,1,()=>{v=null}),Ae())},i(p){c||(R(e.$$.fragment,p),R(y),R(d.$$.fragment,p),R(v),c=!0)},o(p){H(e.$$.fragment,p),H(y),H(d.$$.fragment,p),H(v),c=!1},d(p){Q(e,p),p&&O(n),p&&O(a),h&&h.d(),y&&y.d(),m&&m.d(),Q(d),v&&v.d()}}}function Mb(t){let e,n;return e=new Ih({props:{year:t[12],columns:t[13].length,current:t[3].displayedDate}}),e.$on("next",t[25]),e.$on("previous",t[26]),e.$on("reset",t[27]),e.$on("settings",t[28]),e.$on("day-click",t[29]),e.$on("day-doubleclick",t[30]),e.$on("day-context-menu",t[31]),e.$on("event-click",t[32]),e.$on("event-mouseover",t[33]),{c(){$(e.$$.fragment)},m(a,r){J(e,a,r),n=!0},p(a,r){let i={};r[0]&4096&&(i.year=a[12]),r[0]&8192&&(i.columns=a[13].length),r[0]&8&&(i.current=a[3].displayedDate),e.$set(i)},i(a){n||(R(e.$$.fragment,a),n=!0)},o(a){H(e.$$.fragment,a),n=!1},d(a){Q(e,a)}}}function Ib(t){let e,n;return e=new Fh({props:{year:t[12],fullView:t[1],columns:t[13].length,current:t[3].displayedDate}}),e.$on("next",t[16]),e.$on("previous",t[17]),e.$on("reset",t[18]),e.$on("settings",t[19]),e.$on("day-click",t[20]),e.$on("day-doubleclick",t[21]),e.$on("day-context-menu",t[22]),e.$on("event-click",t[23]),e.$on("event-mouseover",t[24]),{c(){$(e.$$.fragment)},m(a,r){J(e,a,r),n=!0},p(a,r){let i={};r[0]&4096&&(i.year=a[12]),r[0]&2&&(i.fullView=a[1]),r[0]&8192&&(i.columns=a[13].length),r[0]&8&&(i.current=a[3].displayedDate),e.$set(i)},i(a){n||(R(e.$$.fragment,a),n=!0)},o(a){H(e.$$.fragment,a),n=!1},d(a){Q(e,a)}}}function Rh(t){let e,n,a,r=[...Array(t[7]).keys()],i=[];for(let o=0;o{s[y]=null}),Ae(),a=s[n],a?a.p(c,h):(a=s[n]=l[n](c),a.c()),R(a,1),a.m(e,null)),(!o||h[0]&8)&&tt(e,"--calendar-columns",c[3].weekdays.length),(!o||h[0]&8)&&tt(e,"--column-widths",1/c[3].weekdays.length*100+"%"),(!o||h[0]&8)&&tt(e,"--calendar-rows",c[3].weeksPerCurrentMonth),h[0]&2&&ge(e,"full-view",c[1]),h[0]&4&&ge(e,"year-view",c[2]),c[0]&&!c[1]?u?(u.p(c,h),h[0]&3&&R(u,1)):(u=Wh(c),u.c(),R(u,1),u.m(i.parentNode,i)):u&&(Ee(),H(u,1,1,()=>{u=null}),Ae())},i(c){o||(R(a),R(u),o=!0)},o(c){H(a),H(u),o=!1},d(c){c&&O(e),s[n].d(),c&&O(r),u&&u.d(c),c&&O(i)}}}function qb(t,e,n){let a,r,i,o,l,s,d,u,c,{fullView:h=!1}=e,{dayView:y=!1}=e,{yearView:m=!1}=e,{calendar:v}=e,{moons:p}=e,{displayDayNumber:k}=e,{displayWeeks:E}=e,A=Da(y),S=Da(p),_=Da(v);Yn("dayView",A),Yn("displayMoons",S),Yn("calendar",_),v.on("month-update",()=>{n(12,i=v.displayed.year),n(11,o=v.getNameForYear(v.displayed.year)),n(6,l=v.currentMonth),n(10,s=v.nextMonth),n(9,d=v.previousMonth),n(7,c=v.weeksOfMonth(l)),n(8,u=v.weekNumbersOfMonth(l))});let F=()=>v.goToNextYear(),D=()=>v.goToPreviousYear();function N(te){ce.call(this,t,te)}function x(te){ce.call(this,t,te)}function P(te){ce.call(this,t,te)}function B(te){ce.call(this,t,te)}function W(te){ce.call(this,t,te)}function Z(te){ce.call(this,t,te)}function le(te){ce.call(this,t,te)}let oe=()=>v.goToNextYear(),me=()=>v.goToPreviousYear();function X(te){ce.call(this,t,te)}function z(te){ce.call(this,t,te)}function he(te){ce.call(this,t,te)}function De(te){ce.call(this,t,te)}function ie(te){ce.call(this,t,te)}function Ce(te){ce.call(this,t,te)}function xe(te){ce.call(this,t,te)}let et=()=>v.goToNext(),je=()=>v.goToPrevious();function yt(te){ce.call(this,t,te)}function Tt(te){ce.call(this,t,te)}function $e(te){ce.call(this,t,te)}function Be(te){ce.call(this,t,te)}function Ve(te){ce.call(this,t,te)}function jt(te){ce.call(this,t,te)}function Ut(te){ce.call(this,t,te)}function St(te){ce.call(this,t,te)}function Ot(te){ce.call(this,t,te)}function vn(te){ce.call(this,t,te)}function zt(te){ce.call(this,t,te)}function nn(te){ce.call(this,t,te)}function ca(te){ce.call(this,t,te)}function da(te){ce.call(this,t,te)}function Bi(te){ce.call(this,t,te)}function Ni(te){ce.call(this,t,te)}function Mi(te){ce.call(this,t,te)}function Ii(te){ce.call(this,t,te)}function Oi(te){ce.call(this,t,te)}function qi(te){ce.call(this,t,te)}let Ri=()=>n(0,y=!1);function Li(te){ce.call(this,t,te)}function Pi(te){ce.call(this,t,te)}function ji(te){ce.call(this,t,te)}function Vi(te){ce.call(this,t,te)}return t.$$set=te=>{"fullView"in te&&n(1,h=te.fullView),"dayView"in te&&n(0,y=te.dayView),"yearView"in te&&n(2,m=te.yearView),"calendar"in te&&n(3,v=te.calendar),"moons"in te&&n(15,p=te.moons),"displayDayNumber"in te&&n(4,k=te.displayDayNumber),"displayWeeks"in te&&n(5,E=te.displayWeeks)},t.$$.update=()=>{if(t.$$.dirty[0]&4){e:m&&n(0,y=!1)}if(t.$$.dirty[0]&1){e:A.set(y)}if(t.$$.dirty[0]&32768){e:S.set(p)}if(t.$$.dirty[0]&8){e:_.set(v)}if(t.$$.dirty[0]&8){e:n(14,a=v.plugin.data.showIntercalary)}if(t.$$.dirty[0]&8){e:n(13,r=v.weekdays)}if(t.$$.dirty[0]&8){e:n(12,i=v.displayed.year)}if(t.$$.dirty[0]&8){e:n(11,o=v.getNameForYear(v.displayed.year))}if(t.$$.dirty[0]&8){e:n(6,l=v.currentMonth)}if(t.$$.dirty[0]&8){e:n(10,s=v.nextMonth)}if(t.$$.dirty[0]&8){e:n(9,d=v.previousMonth)}if(t.$$.dirty[0]&72){e:n(8,u=v.weekNumbersOfMonth(l))}if(t.$$.dirty[0]&72){e:n(7,c=v.weeksOfMonth(l))}},[y,h,m,v,k,E,l,c,u,d,s,o,i,r,a,p,F,D,N,x,P,B,W,Z,le,oe,me,X,z,he,De,ie,Ce,xe,et,je,yt,Tt,$e,Be,Ve,jt,Ut,St,Ot,vn,zt,nn,ca,da,Bi,Ni,Mi,Ii,Oi,qi,Ri,Li,Pi,ji,Vi]}var Gh=class extends de{constructor(e){super();fe(this,e,qb,Ob,se,{fullView:1,dayView:0,yearView:2,calendar:3,moons:15,displayDayNumber:4,displayWeeks:5},Bb,[-1,-1,-1])}},Uh=Gh;var Kt="FANTASY_CALENDAR",ua="FANTASY_CALENDAR_FULL_VIEW";(0,qe.addIcon)(Kt,' ');(0,qe.addIcon)("fantasy-calendar-reveal",' ');var Hn=class extends qe.ItemView{constructor(e,n,a={}){super(n);this.plugin=e;this.leaf=n;this.options=a;this.updateMe=!0;this.yearView=!1;this.moons=!0;this.containerEl.addClass("fantasy-calendar-view"),this.contentEl.addClass("fantasy-calendar-view-content"),this.registerEvent(this.plugin.app.workspace.on("fantasy-calendars-updated",()=>{this.plugin.onSettingsLoad(()=>this.updateCalendars())})),this.registerEvent(this.plugin.app.workspace.on("layout-change",()=>{!this._app||this._app.$set({fullView:this.full,...this.full?{dayView:!1}:{}})}))}get root(){return this.leaf.getRoot()}get full(){return!("collapse"in this.root)}updateCalendars(){if(!this.updateMe){this.updateMe=!0;return}if(!this.plugin.data.calendars.length){this._app?.$destroy(),this.contentEl.empty(),this.noCalendarEl=this.contentEl.createDiv("fantasy-no-calendar"),this.noCalendarEl.createSpan({text:"No calendars created! Create a calendar to see it here."});return}let e=this.plugin.data.calendars.find(n=>n.id==this.calendar?.id)??this.plugin.defaultCalendar??this.plugin.data.calendars[0];this.helper&&this.helper.calendar.id==e.id?this.update(e):this.setCurrentCalendar(e)}update(e){this.calendar=e,this.helper.update(this.calendar),this.registerCalendarInterval(),this._app?this._app.$set({calendar:this.helper}):this.build()}async registerCalendarInterval(){if(this.interval&&(clearInterval(this.interval),this.interval=null),this.calendar.static.incrementDay){let e=new Date;this.calendar.date||(this.calendar.date=e.valueOf());let n=Do(new Date(this.calendar.date),e);if(n>=1){for(let a=0;a{Do(new Date,e)>=1&&(this.helper.goToNextCurrentDay(),this.helper.current,e=new Date,this.calendar.date=e.valueOf(),await this.saveCalendars())},60*1e3),this.registerInterval(this.interval)}}async saveCalendars(){this.updateMe=!1,await this.plugin.saveCalendar()}setCurrentCalendar(e){this.noCalendarEl?.detach(),this.calendar=e,this.moons=this.calendar.static.displayMoons,this.dayNumber=this.calendar.static.displayDayNumber,this.helper=new La(this.calendar,this.plugin),this.registerCalendarInterval(),this.build()}createEventForDay(e){let n=new Ia(this.plugin,this.calendar,null,e);n.onClose=async()=>{!n.saved||(this.calendar.events.push(n.event),this.helper.addEvent(n.event),await this.saveCalendars(),this._app.$set({calendar:this.helper}),this.triggerHelperEvent("day-update"))},n.open()}async onOpen(){this.plugin.onSettingsLoad(()=>this.updateCalendars())}build(){this.contentEl.empty(),this._app=new Uh({target:this.contentEl,props:{calendar:this.helper,fullView:this.full,yearView:this.yearView,moons:this.moons,displayWeeks:this.helper.displayWeeks,displayDayNumber:this.dayNumber}}),this._app.$on("day-click",e=>{let n=e.detail;n.events.length||this.createEventForDay(n.date)}),this._app.$on("day-doubleclick",e=>{let n=e.detail;!n.events.length||(this.helper.viewing.day=n.number,this.helper.viewing.month=n.month.number,this.helper.viewing.year=n.month.year,this.yearView=!1,this._app.$set({yearView:!1}),this._app.$set({dayView:!0}),this.triggerHelperEvent("day-update",!1))}),this._app.$on("day-context-menu",e=>{let{day:n,evt:a}=e.detail,r=new qe.Menu(this.app);r.setNoIcon(),this.full||r.addItem(i=>{i.setTitle("Open Day").onClick(()=>{this.openDay({day:n.number,month:this.helper.displayed.month,year:this.helper.displayed.year})})}),r.addItem(i=>{i.setTitle("Set as Today").onClick(async()=>{this.calendar.current=n.date,this.helper.current.day=n.number,this.triggerHelperEvent("day-update"),await this.saveCalendars()})}),r.addItem(i=>i.setTitle("New Event").onClick(()=>{this.createEventForDay(n.date)})),r.showAtMouseEvent(a)}),this._app.$on("settings",e=>{let n=e.detail,a=new qe.Menu(this.app);a.setNoIcon(),a.addItem(r=>{r.setTitle(`${this.calendar.displayWeeks?"Hide":"Show"} Weeks`).onClick(async()=>{this.calendar.displayWeeks=!this.calendar.displayWeeks,this.helper.update(this.calendar),this._app.$set({displayWeeks:this.calendar.displayWeeks}),await this.saveCalendars()})}),a.addItem(r=>{r.setTitle(`Open ${this.yearView?"Month":"Year"}`).onClick(()=>{this.yearView=!this.yearView,this._app.$set({yearView:this.yearView})})}),a.addItem(r=>{r.setTitle(this.moons?"Hide Moons":"Display Moons").onClick(()=>{this.toggleMoons()})}),a.addItem(r=>{r.setTitle(this.dayNumber?"Hide Day Number":"Display Day Number").onClick(async()=>{this.dayNumber=!this.dayNumber,this.calendar.static.displayDayNumber=this.dayNumber,this._app.$set({displayDayNumber:this.dayNumber}),await this.saveCalendars()})}),a.addItem(r=>{r.setTitle("View Day"),r.onClick(()=>{this.openDate()})}),a.addItem(r=>{r.setTitle("Switch Calendars"),r.setDisabled(this.plugin.data.calendars.length<=1),r.onClick(()=>{let i=new zh(this.plugin,this.calendar);i.onClose=()=>{!i.confirmed||this.setCurrentCalendar(i.calendar)},i.open()})}),a.showAtMouseEvent(n)}),this._app.$on("event-click",e=>{let{event:n,modifier:a}=e.detail;if(n.note){let r=[];this.app.workspace.iterateAllLeaves(i=>{i.view instanceof qe.MarkdownView&&i.view.file.basename===n.note&&r.push(i)}),r.length?this.app.workspace.setActiveLeaf(r[0]):this.app.workspace.openLinkText(n.note,"",this.full||a)}else new Zh(n,this.plugin).open()}),this._app.$on("event-mouseover",e=>{if(!this.plugin.data.eventPreview)return;let{target:n,event:a}=e.detail;a.note&&this.app.workspace.trigger("link-hover",this,n,a.note,"")}),this._app.$on("event-context",e=>{let{evt:n,event:a}=e.detail,r=new qe.Menu(this.app);r.setNoIcon(),a.note||r.addItem(i=>{i.setTitle("Create Note").onClick(async()=>{let o=this.app.workspace.getActiveFile()?.path,l=o?this.app.fileManager.getNewFileParent(o)?.parent??"/":"/",s=`${a.date.year}-${a.date.month+1}-${a.date.day}`,d;a.end&&(d=`${a.end.year}-${a.end.month+1}-${a.end.day}`);let u={"fc-calendar":this.calendar.name,"fc-date":s,...a.end?{"fc-end":d}:{},...a.category?{"fc-category":this.calendar.categories.find(h=>h.id==a.category)?.name}:{},"fc-display-name":a.name};a.note=(0,qe.normalizePath)(`${l}/${a.name}.md`);let c=this.app.vault.getAbstractFileByPath(a.note);if(c||(c=await this.app.vault.create(a.note,`---
+${(0,qe.stringifyYaml)(u)}
+---`)),await this.saveCalendars(),c instanceof qe.TFile){let y=this.app.workspace.getLeavesOfType("markdown").find(m=>{m.view instanceof qe.FileView&&m.view.file.path==a.note});y?this.app.workspace.setActiveLeaf(y):await this.app.workspace.getUnpinnedLeaf().openFile(c,{active:!0})}})}),r.addItem(i=>{i.setTitle("Edit Event").onClick(()=>{let o=new Ia(this.plugin,this.calendar,a);o.onClose=async()=>{if(!o.saved)return;let l=this.calendar.events.find(s=>s.id==a.id);this.calendar.events.splice(this.calendar.events.indexOf(l),1,o.event),this.helper.refreshMonth(o.event.date.month,o.event.date.year),(o.event.date.month!=l.date.month||o.event.date.year!=l.date.year)&&this.helper.refreshMonth(l.date.month,l.date.year),await this.saveCalendars(),this._app.$set({calendar:this.helper}),this.triggerHelperEvent("day-update")},o.open()})}),r.addItem(i=>{i.setTitle("Delete Event").onClick(async()=>{if(!this.plugin.data.exit.event&&!await Bd(this.plugin))return;let o=this.calendar.events.find(l=>l.id==a.id);this.calendar.events.splice(this.calendar.events.indexOf(o),1),this.helper.refreshMonth(o.date.month,o.date.year),await this.saveCalendars(),this._app.$set({calendar:this.helper}),this.triggerHelperEvent("day-update")})}),r.showAtMouseEvent(n)}),this._app.$on("event",e=>{let n=e.detail;this.createEventForDay(n)}),this._app.$on("reset",()=>{this.helper.reset(),this.yearView=!1,this._app.$set({yearView:!1}),this._app.$set({dayView:!0}),this.triggerHelperEvent("day-update",!1)})}openDay(e){this.helper.viewing.day=e.day,this.helper.viewing.month=e.month,this.helper.viewing.year=e.year,this.yearView=!1,this._app.$set({yearView:!1}),this._app.$set({dayView:!0}),this.triggerHelperEvent("day-update",!1)}openDate(){if(!this.helper||!this.calendar)return;let e=new Yh(this.plugin,this.calendar);e.onClose=async()=>{!e.confirmed||(e.setCurrent?(this.calendar.current={...e.date},this.setCurrentCalendar(this.calendar)):(this.helper.displayed={...e.date},this.helper.update(),this._app.$set({calendar:this.helper})),await this.saveCalendars())},e.open()}toggleMoons(){this.moons=!this.moons,this._app.$set({moons:this.moons})}async onClose(){}onResize(){this.triggerHelperEvent("view-resized",!1)}getViewType(){return Kt}getDisplayText(){return"Fantasy Calendar"}getIcon(){return Kt}triggerHelperEvent(e,n=!0){!this.helper||(this.helper.trigger(e),n&&(this.updateMe=!1,this.plugin.app.workspace.trigger("fantasy-calendars-updated")))}async onunload(){}},zh=class extends it{constructor(e,n){super(e.app);this.plugin=e;this.calendar=n;this.confirmed=!1}async display(){this.contentEl.empty(),this.contentEl.createEl("h4",{text:"Switch Calendars"});let e=this.contentEl.createDiv("fantasy-calendar-dropdown");e.createEl("label",{text:"Choose a Calendar"}),new qe.DropdownComponent(e).onChange(r=>{this.calendar=this.plugin.data.calendars.find(i=>i.id==r)}).addOptions(Object.fromEntries(this.plugin.data.calendars.map(r=>[r.id,r.name]))).setValue(this.calendar?this.calendar.id:null);let a=this.contentEl.createDiv("fantasy-calendar-confirm-buttons");new qe.ButtonComponent(a).setButtonText("Switch").setCta().onClick(()=>{this.confirmed=!0,this.close()}),new qe.ButtonComponent(a).setButtonText("Cancel").onClick(()=>{this.close()})}onOpen(){this.display()}},Yh=class extends it{constructor(e,n){super(e.app);this.plugin=e;this.calendar=n;this.confirmed=!1;this.setCurrent=!1;this.date={...this.calendar.current},this.tempCurrentDays=this.date.day}async display(){this.contentEl.empty(),this.contentEl.createEl("h4",{text:"View Day"}),this.dateFieldEl=this.contentEl.createDiv("fantasy-calendar-date-fields"),this.buildDateFields(),new qe.Setting(this.contentEl).setName("Set as Current Date").setDesc("Also set this date to today's date.").addToggle(n=>n.setValue(this.setCurrent).onChange(a=>{this.setCurrent=a}));let e=this.contentEl.createDiv("fantasy-calendar-confirm-buttons");new qe.ButtonComponent(e).setButtonText("Switch").setCta().onClick(()=>{this.confirmed=!0,this.date.day=this.tempCurrentDays,this.close()}),new qe.ButtonComponent(e).setButtonText("Cancel").onClick(()=>{this.close()})}buildDateFields(){this.dateFieldEl.empty(),this.tempCurrentDays!=null&&this.date.month!=null&&this.tempCurrentDays>this.calendar.static.months[this.date.month]?.length&&(this.tempCurrentDays=this.calendar.static.months[this.date.month]?.length);let e=this.dateFieldEl.createDiv("fantasy-calendar-date-field");e.createEl("label",{text:"Day"}),new qe.TextComponent(e).setPlaceholder("Day").setValue(`${this.tempCurrentDays}`).setDisabled(this.date.month==null).onChange(i=>{if(Number(i)<1||Number(i)>this.calendar.static.months[this.date.month]?.length){new qe.Notice(`The current day must be between 1 and ${this.calendar.static.months[this.date.month].length}`),this.tempCurrentDays=this.date.day,this.buildDateFields();return}this.tempCurrentDays=Number(i)}).inputEl.setAttr("type","number");let a=this.dateFieldEl.createDiv("fantasy-calendar-date-field");a.createEl("label",{text:"Month"}),new qe.DropdownComponent(a).addOptions(Object.fromEntries([["select","Select Month"],...this.calendar.static.months.map(i=>[i.name,i.name])])).setValue(this.date.month!=null?this.calendar.static.months[this.date.month].name:"select").onChange(i=>{i==="select"&&(this.date.month=null);let o=this.calendar.static.months.find(l=>l.name==i);this.date.month=this.calendar.static.months.indexOf(o),this.buildDateFields()});let r=this.dateFieldEl.createDiv("fantasy-calendar-date-field");if(r.createEl("label",{text:"Year"}),this.calendar.static.useCustomYears){let i=new qe.DropdownComponent(r);(this.calendar.static.years??[]).forEach(o=>{i.addOption(o.id,o.name)}),this.date.year>this.calendar.static.years?.length&&(this.date.year=this.calendar.static.years?this.calendar.static.years.length:null),i.setValue(this.calendar.static.years?.[this.date.year-1]?.id).onChange(o=>{this.date.year=this.calendar.static.years.findIndex(l=>l.id==o)+1})}else new qe.TextComponent(r).setPlaceholder("Year").setValue(`${this.date.year}`).onChange(o=>{this.date.year=Number(o)}).inputEl.setAttr("type","number")}onOpen(){this.display()}},Zh=class extends it{constructor(e,n){super(n.app);this.event=e;this.plugin=n;this.containerEl.addClass("fantasy-calendar-view-event")}async display(){this.contentEl.empty(),this.contentEl.createEl("h4",{text:this.event.name}),await qe.MarkdownRenderer.renderMarkdown(this.event.description,this.contentEl,this.event.note,null)}async onOpen(){await this.display()}};var p9=Fe(require("fs")),Qt=Fe(require("obsidian"));function xs(t){let e=new Blob([t],{type:"text/javascript"}),n=URL.createObjectURL(e),a=new Worker(n,{name:"Fantasy Calendar File Watcher"});return URL.revokeObjectURL(n),a}function Fs(){return xs(`var te=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Re=te(Ae=>{Ae.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 Pe=te(me=>{var pe=/[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]/,Oe=new RegExp("[\\\\-\\\\.0-9"+pe.source.slice(1,-1)+"\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]"),Se=new RegExp("^"+pe.source+Oe.source+"*(?::"+pe.source+Oe.source+"*)?$"),j=0,S=1,F=2,G=3,U=4,L=5,Q=6,ne=7;function P(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,P)}P.prototype=new Error;P.prototype.name=P.name;function Me(){}Me.prototype={parse:function(e,t,n){var r=this.domBuilder;r.startDocument(),Ue(t,t={}),vt(e,t,n,r,this.errorHandler),r.endDocument()}};function vt(e,t,n,r,i){function s(E){if(E>65535){E-=65536;var x=55296+(E>>10),dt=56320+(E&1023);return String.fromCharCode(x,dt)}else return String.fromCharCode(E)}function a(E){var x=E.slice(1,-1);return x in n?n[x]:x.charAt(0)==="#"?s(parseInt(x.substr(1).replace("x","0x"))):(i.error("entity not found:"+E),E)}function o(E){if(E>g){var x=e.substring(g,E).replace(/?\\w+;/g,a);p&&c(g),r.characters(x,0,E-g),g=E}}function c(E,x){for(;E>=u&&(x=m.exec(e));)l=x.index,u=l+x[0].length,p.lineNumber++;p.columnNumber=E-l+1}for(var l=0,u=0,m=/.*(?:\\r\\n?|\\n)|.*$/g,p=r.locator,v=[{currentNSMap:t}],_={},g=0;;){try{var d=e.indexOf("<",g);if(d<0){if(!e.substr(g).match(/^\\s*$/)){var O=r.doc,z=O.createTextNode(e.substr(g));O.appendChild(z),r.currentElement=z}return}switch(d>g&&o(d),e.charAt(d+1)){case"/":var h=e.indexOf(">",d+3),f=e.substring(d+2,h),b=v.pop();h<0?(f=e.substring(d+2).replace(/[\\s<].*/,""),i.error("end tag name: "+f+" is not complete:"+b.tagName),h=d+1+f.length):f.match(/\\s)&&(f=f.replace(/[\\s<].*/,""),i.error("end tag name: "+f+" maybe not complete"),h=d+1+f.length);var _e=b.localNSMap,Ce=b.tagName==f,pt=Ce||b.tagName&&b.tagName.toLowerCase()==f.toLowerCase();if(pt){if(r.endElement(b.uri,b.localName,f),_e)for(var mt in _e)r.endPrefixMapping(mt);Ce||i.fatalError("end tag name: "+f+" is not match the current start tagName:"+b.tagName)}else v.push(b);h++;break;case"?":p&&c(d),h=Dt(e,d,r);break;case"!":p&&c(d),h=yt(e,d,r,i);break;default:p&&c(d);var C=new Le,ue=v[v.length-1].currentNSMap,h=gt(e,d,C,ue,a,i),xe=C.length;if(!C.closed&&Nt(e,h,C.tagName,_)&&(C.closed=!0,n.nbsp||i.warning("unclosed xml attribute")),p&&xe){for(var ht=$e(p,{}),le=0;leg?g=h:o(Math.max(d,g)+1)}}function $e(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function gt(e,t,n,r,i,s){function a(v,_,g){v in n.attributeNames&&s.fatalError("Attribute "+v+" redefined"),n.addValue(v,_,g)}for(var o,c,l=++t,u=j;;){var m=e.charAt(l);switch(m){case"=":if(u===S)o=e.slice(t,l),u=G;else if(u===F)u=G;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(u===G||u===S)if(u===S&&(s.warning('attribute value must after "="'),o=e.slice(t,l)),t=l+1,l=e.indexOf(m,t),l>0)c=e.slice(t,l).replace(/?\\w+;/g,i),a(o,c,t-1),u=L;else throw new Error("attribute value no end '"+m+"' match");else if(u==U)c=e.slice(t,l).replace(/?\\w+;/g,i),a(o,c,t),s.warning('attribute "'+o+'" missed start quot('+m+")!!"),t=l+1,u=L;else throw new Error('attribute value must after "="');break;case"/":switch(u){case j:n.setTagName(e.slice(t,l));case L:case Q:case ne:u=ne,n.closed=!0;case U:case S:case F:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),u==j&&n.setTagName(e.slice(t,l)),l;case">":switch(u){case j:n.setTagName(e.slice(t,l));case L:case Q:case ne:break;case U:case S:c=e.slice(t,l),c.slice(-1)==="/"&&(n.closed=!0,c=c.slice(0,-1));case F:u===F&&(c=o),u==U?(s.warning('attribute "'+c+'" missed quot(")!'),a(o,c.replace(/?\\w+;/g,i),t)):((r[""]!=="http://www.w3.org/1999/xhtml"||!c.match(/^(?:disabled|checked|selected)$/i))&&s.warning('attribute "'+c+'" missed value!! "'+c+'" instead!!'),a(c,c,t));break;case G:throw new Error("attribute value missed!!")}return l;case"\\x80":m=" ";default:if(m<=" ")switch(u){case j:n.setTagName(e.slice(t,l)),u=Q;break;case S:o=e.slice(t,l),u=F;break;case U:var c=e.slice(t,l).replace(/?\\w+;/g,i);s.warning('attribute "'+c+'" missed quot(")!!'),a(o,c,t);case L:u=Q;break}else switch(u){case F:var p=n.tagName;(r[""]!=="http://www.w3.org/1999/xhtml"||!o.match(/^(?:disabled|checked|selected)$/i))&&s.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,t),t=l,u=S;break;case L:s.warning('attribute space is required"'+o+'"!!');case Q:u=S,t=l;break;case G:u=U,t=l;break;case ne:throw new Error("elements closed character '/' and '>' must be connected to")}}l++}}function Fe(e,t,n){for(var r=e.tagName,i=null,s=e.length;s--;){var a=e[s],o=a.qName,c=a.value,p=o.indexOf(":");if(p>0)var l=a.prefix=o.slice(0,p),u=o.slice(p+1),m=l==="xmlns"&&u;else u=o,l=null,m=o==="xmlns"&&"";a.localName=u,m!==!1&&(i==null&&(i={},Ue(n,n={})),n[m]=i[m]=c,a.uri="http://www.w3.org/2000/xmlns/",t.startPrefixMapping(m,c))}for(var s=e.length;s--;){a=e[s];var l=a.prefix;l&&(l==="xml"&&(a.uri="http://www.w3.org/XML/1998/namespace"),l!=="xmlns"&&(a.uri=n[l||""]))}var p=r.indexOf(":");p>0?(l=e.prefix=r.slice(0,p),u=e.localName=r.slice(p+1)):(l=null,u=e.localName=r);var v=e.uri=n[l||""];if(t.startElement(v,u,r,e),e.closed){if(t.endElement(v,u,r),i)for(l in i)t.endPrefixMapping(l)}else return e.currentNSMap=n,e.localNSMap=i,!0}function Et(e,t,n,r,i){if(/^(?:script|textarea)$/i.test(n)){var s=e.indexOf(""+n+">",t),a=e.substring(t+1,s);if(/[&<]/.test(a))return/^script$/i.test(n)?(i.characters(a,0,a.length),s):(a=a.replace(/?\\w+;/g,r),i.characters(a,0,a.length),s)}return t+1}function Nt(e,t,n,r){var i=r[n];return i==null&&(i=e.lastIndexOf(""+n+">"),i",t+4);return s>t?(n.comment(e,t+4,s-t-4),s+3):(r.error("Unclosed comment"),-1)}else return-1;default:if(e.substr(t+3,6)=="CDATA["){var s=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,s-t-9),n.endCDATA(),s+3}var a=bt(e,t),o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var c=a[1][0],l=!1,u=!1;o>3&&(/^public$/i.test(a[2][0])?(l=a[3][0],u=o>4&&a[4][0]):/^system$/i.test(a[2][0])&&(u=a[3][0]));var m=a[o-1];return n.startDTD(c,l,u),n.endDTD(),m.index+m[0].length}}return-1}function Dt(e,t,n){var r=e.indexOf("?>",t);if(r){var i=e.substring(t,r).match(/^<\\?(\\S*)\\s*([\\s\\S]*?)\\s*$/);if(i){var s=i[0].length;return n.processingInstruction(i[1],i[2]),r+2}else return-1}return-1}function Le(){this.attributeNames={}}Le.prototype={setTagName:function(e){if(!Se.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,n){if(!Se.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};function bt(e,t){var n,r=[],i=/'[^']+'|"[^"]+"|[^\\s<>\\/=]+=?|(\\/?\\s*>|<)/g;for(i.lastIndex=t,i.exec(e);n=i.exec(e);)if(r.push(n),n[1])return r}me.XMLReader=Me;me.ParseError=P});var we=te(J=>{function W(e,t){for(var n in e)t[n]=e[n]}function w(e,t){var n=e.prototype;if(!(n instanceof t)){let i=function(){};var r=i;i.prototype=t.prototype,i=new i,W(n,i),e.prototype=n=i}n.constructor!=e&&(typeof e!="function"&&console.error("unknow Class:"+e),n.constructor=e)}var wt="http://www.w3.org/1999/xhtml",T={},I=T.ELEMENT_NODE=1,k=T.ATTRIBUTE_NODE=2,re=T.TEXT_NODE=3,ke=T.CDATA_SECTION_NODE=4,Ve=T.ENTITY_REFERENCE_NODE=5,Tt=T.ENTITY_NODE=6,qe=T.PROCESSING_INSTRUCTION_NODE=7,Ye=T.COMMENT_NODE=8,Xe=T.DOCUMENT_NODE=9,ze=T.DOCUMENT_TYPE_NODE=10,R=T.DOCUMENT_FRAGMENT_NODE=11,_t=T.NOTATION_NODE=12,y={},N={},qt=y.INDEX_SIZE_ERR=(N[1]="Index size error",1),Yt=y.DOMSTRING_SIZE_ERR=(N[2]="DOMString size error",2),Ct=y.HIERARCHY_REQUEST_ERR=(N[3]="Hierarchy request error",3),Xt=y.WRONG_DOCUMENT_ERR=(N[4]="Wrong document",4),zt=y.INVALID_CHARACTER_ERR=(N[5]="Invalid character",5),jt=y.NO_DATA_ALLOWED_ERR=(N[6]="No data allowed",6),Gt=y.NO_MODIFICATION_ALLOWED_ERR=(N[7]="No modification allowed",7),xt=y.NOT_FOUND_ERR=(N[8]="Not found",8),Qt=y.NOT_SUPPORTED_ERR=(N[9]="Not supported",9),je=y.INUSE_ATTRIBUTE_ERR=(N[10]="Attribute in use",10),Wt=y.INVALID_STATE_ERR=(N[11]="Invalid state",11),Bt=y.SYNTAX_ERR=(N[12]="Syntax error",12),Zt=y.INVALID_MODIFICATION_ERR=(N[13]="Invalid modification",13),Kt=y.NAMESPACE_ERR=(N[14]="Invalid namespace",14),Jt=y.INVALID_ACCESS_ERR=(N[15]="Invalid access",15);function $(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,N[e]),this.message=N[e],Error.captureStackTrace&&Error.captureStackTrace(this,$);return n.code=e,t&&(this.message=this.message+": "+t),n}$.prototype=Error.prototype;W(y,$);function M(){}M.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var n=[],r=0;r=0){for(var i=t.length-1;r0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n){for(var r in n)if(n[r]==e)return r}t=t.nodeType==k?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&e in n)return n[e];t=t.nodeType==k?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){var t=this.lookupPrefix(e);return t==null}};function Ze(e){return e=="<"&&"<"||e==">"&&">"||e=="&"&&"&"||e=='"'&&"""||""+e.charCodeAt()+";"}W(T,D);W(T,D.prototype);function B(e,t){if(t(e))return!0;if(e=e.firstChild)do if(B(e,t))return!0;while(e=e.nextSibling)}function Z(){}function It(e,t,n){e&&e._inc++;var r=n.namespaceURI;r=="http://www.w3.org/2000/xmlns/"&&(t._nsMap[n.prefix?n.localName:""]=n.value)}function Ke(e,t,n,r){e&&e._inc++;var i=n.namespaceURI;i=="http://www.w3.org/2000/xmlns/"&&delete t._nsMap[n.prefix?n.localName:""]}function de(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var i=t.firstChild,s=0;i;)r[s++]=i,i=i.nextSibling;r.length=s}}}function Je(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,de(e.ownerDocument,e),t}function He(e,t,n){var r=t.parentNode;if(r&&r.removeChild(t),t.nodeType===R){var i=t.firstChild;if(i==null)return t;var s=t.lastChild}else i=s=t;var a=n?n.previousSibling:e.lastChild;i.previousSibling=a,s.nextSibling=n,a?a.nextSibling=i:e.firstChild=i,n==null?e.lastChild=s:n.previousSibling=s;do i.parentNode=e;while(i!==s&&(i=i.nextSibling));return de(e.ownerDocument||e,e),t.nodeType==R&&(t.firstChild=t.lastChild=null),t}function At(e,t){var n=t.parentNode;if(n){var r=e.lastChild;n.removeChild(t);var r=e.lastChild}var r=e.lastChild;return t.parentNode=e,t.previousSibling=r,t.nextSibling=null,r?r.nextSibling=t:e.firstChild=t,e.lastChild=t,de(e.ownerDocument,e,t),t}Z.prototype={nodeName:"#document",nodeType:Xe,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==R){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return this.documentElement==null&&e.nodeType==I&&(this.documentElement=e),He(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),Je(this,e)},importNode:function(e,t){return at(this,e,t)},getElementById:function(e){var t=null;return B(this.documentElement,function(n){if(n.nodeType==I&&n.getAttribute("id")==e)return t=n,!0}),t},getElementsByClassName:function(e){var t=new RegExp("(^|\\\\s)"+e+"(\\\\s|$)");return new V(this,function(n){var r=[];return B(n.documentElement,function(i){i!==n&&i.nodeType==I&&t.test(i.getAttribute("class"))&&r.push(i)}),r})},createElement:function(e){var t=new q;t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new M;var n=t.attributes=new ie;return n._ownerElement=t,t},createDocumentFragment:function(){var e=new se;return e.ownerDocument=this,e.childNodes=new M,e},createTextNode:function(e){var t=new ve;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new ge;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new Ee;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new De;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new ae;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new ye;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new q,r=t.split(":"),i=n.attributes=new ie;return n.childNodes=new M,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,r.length==2?(n.prefix=r[0],n.localName=r[1]):n.localName=t,i._ownerElement=n,n},createAttributeNS:function(e,t){var n=new ae,r=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,r.length==2?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}};w(Z,D);function q(){this._nsMap={}}q.prototype={nodeType:I,hasAttribute:function(e){return this.getAttributeNode(e)!=null},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===R?this.insertBefore(e,null):At(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return this.getAttributeNodeNS(e,t)!=null},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new V(this,function(t){var n=[];return B(t,function(r){r!==t&&r.nodeType==I&&(e==="*"||r.tagName==e)&&n.push(r)}),n})},getElementsByTagNameNS:function(e,t){return new V(this,function(n){var r=[];return B(n,function(i){i!==n&&i.nodeType===I&&(e==="*"||i.namespaceURI===e)&&(t==="*"||i.localName==t)&&r.push(i)}),r})}};Z.prototype.getElementsByTagName=q.prototype.getElementsByTagName;Z.prototype.getElementsByTagNameNS=q.prototype.getElementsByTagNameNS;w(q,D);function ae(){}ae.prototype.nodeType=k;w(ae,D);function K(){}K.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(N[Ct])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){var r=this.data.substring(0,e),i=this.data.substring(e+t);n=r+n+i,this.nodeValue=this.data=n,this.length=n.length}};w(K,D);function ve(){}ve.prototype={nodeName:"#text",nodeType:re,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}};w(ve,K);function ge(){}ge.prototype={nodeName:"#comment",nodeType:Ye};w(ge,K);function Ee(){}Ee.prototype={nodeName:"#cdata-section",nodeType:ke};w(Ee,K);function Ne(){}Ne.prototype.nodeType=ze;w(Ne,D);function et(){}et.prototype.nodeType=_t;w(et,D);function tt(){}tt.prototype.nodeType=Tt;w(tt,D);function ye(){}ye.prototype.nodeType=Ve;w(ye,D);function se(){}se.prototype.nodeName="#document-fragment";se.prototype.nodeType=R;w(se,D);function De(){}De.prototype.nodeType=qe;w(De,D);function nt(){}nt.prototype.serializeToString=function(e,t,n){return rt.call(e,t,n)};D.prototype.toString=rt;function rt(e,t){var n=[],r=this.nodeType==9&&this.documentElement||this,i=r.prefix,s=r.namespaceURI;if(s&&i==null){var i=r.lookupPrefix(s);if(i==null)var a=[{namespace:s,prefix:null}]}return Y(this,n,e,t,a),n.join("")}function it(e,t,n){var r=e.prefix||"",i=e.namespaceURI;if(!r&&!i||r==="xml"&&i==="http://www.w3.org/XML/1998/namespace"||i=="http://www.w3.org/2000/xmlns/")return!1;for(var s=n.length;s--;){var a=n[s];if(a.prefix==r)return a.namespace!=i}return!0}function Y(e,t,n,r,i){if(r)if(e=r(e),e){if(typeof e=="string"){t.push(e);return}}else return;switch(e.nodeType){case I:i||(i=[]);var s=i.length,a=e.attributes,o=a.length,c=e.firstChild,l=e.tagName;n=wt===e.namespaceURI||n,t.push("<",l);for(var u=0;u"),n&&/^script$/i.test(l))for(;c;)c.data?t.push(c.data):Y(c,t,n,r,i),c=c.nextSibling;else for(;c;)Y(c,t,n,r,i),c=c.nextSibling;t.push("",l,">")}else t.push("/>");return;case Xe:case R:for(var c=e.firstChild;c;)Y(c,t,n,r,i),c=c.nextSibling;return;case k:return t.push(" ",e.name,'="',e.value.replace(/[<&"]/g,Ze),'"');case re:return t.push(e.data.replace(/[<&]/g,Ze).replace(/]]>/g,"]]>"));case ke:return t.push("");case Ye:return t.push("");case ze:var g=e.publicId,d=e.systemId;if(t.push("");else if(d&&d!=".")t.push(" SYSTEM ",d,">");else{var O=e.internalSubset;O&&t.push(" [",O,"]"),t.push(">")}return;case qe:return t.push("",e.target," ",e.data,"?>");case Ve:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function at(e,t,n){var r;switch(t.nodeType){case I:r=t.cloneNode(!1),r.ownerDocument=e;case R:break;case k:n=!0;break}if(r||(r=t.cloneNode(!1)),r.ownerDocument=e,r.parentNode=null,n)for(var i=t.firstChild;i;)r.appendChild(at(e,i,n)),i=i.nextSibling;return r}function be(e,t,n){var r=new t.constructor;for(var i in t){var s=t[i];typeof s!="object"&&s!=r[i]&&(r[i]=s)}switch(t.childNodes&&(r.childNodes=new M),r.ownerDocument=e,r.nodeType){case I:var a=t.attributes,o=r.attributes=new ie,c=a.length;o._ownerElement=r;for(var l=0;l{function ot(e){this.options=e||{locator:{}}}ot.prototype.parseFromString=function(e,t){var n=this.options,r=new St,i=n.domBuilder||new H,s=n.errorHandler,a=n.locator,o=n.xmlns||{},c=/\\/x?html?$/.test(t),l=c?Ot.entityMap:{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return a&&i.setDocumentLocator(a),r.errorHandler=Rt(s,i,a),r.domBuilder=n.domBuilder||i,c&&(o[""]="http://www.w3.org/1999/xhtml"),o.xml=o.xml||"http://www.w3.org/XML/1998/namespace",e&&typeof e=="string"?r.parse(e,o,l):r.errorHandler.error("invalid doc source"),i.doc};function Rt(e,t,n){if(!e){if(t instanceof H)return t;e=t}var r={},i=e instanceof Function;n=n||{};function s(a){var o=e[a];!o&&i&&(o=e.length==2?function(c){e(a,c)}:e),r[a]=o&&function(c){o("[xmldom "+a+"] "+c+Te(n))}||function(){}}return s("warning"),s("error"),s("fatalError"),r}function H(){this.cdata=!1}function X(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}H.prototype={startDocument:function(){this.doc=new $t().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,r){var i=this.doc,s=i.createElementNS(e,n||t),a=r.length;oe(this,s),this.currentElement=s,this.locator&&X(this.locator,s);for(var o=0;o=t+n||t?new java.lang.String(e,t,n)+"":e}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\\w+/g,function(e){H.prototype[e]=function(){return null}});function oe(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}var Ot=Re(),lt=Pe(),St=lt.XMLReader,Mt=lt.ParseError,$t=ee.DOMImplementation=we().DOMImplementation;ee.XMLSerializer=we().XMLSerializer;ee.DOMParser=ot;ee.__DOMHandler=H});function ce(e,t){return(e%t+t)%t}function fe(e){return"ID_xyxyxyxyxyxy".replace(/[xy]/g,function(t){var n=Math.random()*16|0,r=t=="x"?n:n&3|8;return r.toString(16)})}var{DOMParser:Ft}=ct(),Ut=/(<(span|div).*?<\\/(span|div)>)/g,A=self,ft=class{constructor(){this.queue=[];this.parsing=!1;this.parseTitle=!1;A.addEventListener("message",t=>{if(t.data.type=="options"){let{defaultCalendar:n,addToDefaultIfMissing:r,format:i,parseTitle:s,debug:a}=t.data;this.addToDefaultIfMissing=r,this.defaultCalendar=n,this.format=i,this.parseTitle=s,this.debug=a,this.debug&&console.debug("Received options message")}}),A.addEventListener("message",t=>{if(t.data.type=="calendars"){let{calendars:n}=t.data;this.calendars=[...n],this.debug&&console.debug("Received calendars message")}}),A.addEventListener("message",t=>{t.data.type=="queue"&&(this.add(...t.data.paths),this.debug&&console.debug(\`Received queue message for \${t.data.paths.length} paths\`))})}add(...t){this.debug&&console.debug(\`Adding \${t.length} paths to queue\`),this.queue.push(...t),this.parsing||this.parse()}async parse(){for(this.parsing=!0;this.queue.length;){let t=this.queue.shift();this.debug&&console.debug(\`Parsing \${t} for calendar events (\${this.queue.length} to go)\`),await this.getFileData(t)}this.parsing=!1,this.debug&&console.info("Parsing complete"),A.postMessage({type:"save"})}async getFileData(t){let n=this;return new Promise(r=>{function i(s){if(s.data.type=="queue"){A.removeEventListener("message",i),r();return}if(s.data.type!="file"||s.data.path!=t)return;A.removeEventListener("message",i);let{data:a,cache:o,allTags:c,file:l}=s.data;n.parseFileForEvents(a,o,c,l),r()}setTimeout(()=>r(),500),A.addEventListener("message",i),A.postMessage({path:t,type:"get"})})}getDataFromFrontmatter(t){let n,r,i;return t&&"fc-ignore"in t?{}:(t&&(n=t==null?void 0:t["fc-calendar"],r=t==null?void 0:t["fc-category"],i=t==null?void 0:t["fc-display-name"]),this.addToDefaultIfMissing&&(!n||!n.length)&&(n=this.defaultCalendar),n=n==null?void 0:n.toLowerCase(),{calendar:this.calendars.find(a=>n==a.name.toLowerCase()),fcCategory:r,eventDisplayName:i})}removeEventsFromFile(t){for(let n of this.calendars)for(let r=0;rh.replace(/#/,"")).includes(o.timelineTag.replace(/#/,""))&&(u=this.parseTimelineEvents(o,t,i,c),s.push(...u));let m=this.parseFrontmatterEvents(o,c,a,i,l);if(s.push(...m),!s||!s.length){this.removeEventsFromFile(i.path);return}let p=0;for(let h of s){let f=o.events.find(b=>b.note==i.path&&(!h.timestamp||b.timestamp==h.timestamp));(f==null?void 0:f.date.day)==h.date.day&&(f==null?void 0:f.date.month)==h.date.month&&(f==null?void 0:f.date.year)==h.date.year&&((v=f==null?void 0:f.end)==null?void 0:v.day)==((_=h.end)==null?void 0:_.day)&&((g=f==null?void 0:f.end)==null?void 0:g.month)==((d=h.end)==null?void 0:d.month)&&((O=f==null?void 0:f.end)==null?void 0:O.year)==((z=h.end)==null?void 0:z.year)&&(f==null?void 0:f.category)==h.category&&(f==null?void 0:f.name)==h.name&&(!h.timestamp&&!(f==null?void 0:f.timestamp)||(f==null?void 0:f.timestamp)==h.timestamp)||(A.postMessage({type:"update",id:o.id,index:f?o.events.findIndex(b=>b.id==(f==null?void 0:f.id)):-1,event:h,original:f}),p++)}this.debug&&s.length>0&&console.info(\`\${p}/\${s.length} (\${m.length} from frontmatter, \${u.length} from timelines) event operations completed on \${o.name} for \${i.basename}\`)}parseFrontmatterEvents(t,n,r,i,s){let{date:a,end:o}=this.getDates(r,this.parseTitle?i.basename:"");if(!a)return[];if((a==null?void 0:a.month)&&typeof(a==null?void 0:a.month)=="string"){let u=t.static.months.find(m=>m.name==a.month);u?a.month=t.static.months.indexOf(u):a.month=null}else(a==null?void 0:a.month)&&typeof(a==null?void 0:a.month)=="number"&&(a.month=ce(a.month-1,t.static.months.length));if((o==null?void 0:o.month)&&typeof(o==null?void 0:o.month)=="string"){let u=t.static.months.find(m=>m.name==o.month);u?o.month=t.static.months.indexOf(u):o.month=null}else(o==null?void 0:o.month)&&typeof(o==null?void 0:o.month)=="number"&&(o.month=ce(o.month-1,t.static.months.length));let c=Number(\`\${a.year}\${a.month}\${a.day}00\`),l=t.categories.find(u=>(u==null?void 0:u.name)==n);return[{id:fe(6),name:s!=null?s:i.basename,note:i.path,date:a,end:o,category:l==null?void 0:l.id,description:"",auto:!0}]}parseTimelineEvents(t,n,r,i){var o;let s=[],a=new Ft;for(let c of n.matchAll(Ut)){let l=a.parseFromString(c[0],"text/html"),u={class:l.documentElement.getAttribute("class"),dataset:{date:l.documentElement.getAttribute("data-date"),title:l.documentElement.getAttribute("data-title"),class:l.documentElement.getAttribute("data-class"),end:l.documentElement.getAttribute("data-end")},content:l.documentElement.textContent};if(u.class!=="ob-timelines"||!u.dataset.date)continue;let m=Number(u.dataset.date[0]=="-"?+u.dataset.date.substring(1,u.dataset.date.length).split("-").join("")*-1:+u.dataset.date.split("-").join("")),p=u.dataset.date.split(/(?(d==null?void 0:d.name)==u.dataset.class);s.push({id:fe(6),name:(o=u.dataset.title)!=null?o:r.basename,note:r.path,date:v,end:_,timestamp:m,category:g==null?void 0:g.id,description:u.content,auto:!0})}return s}parseDate(t){var n;if(typeof t=="string"){if(!/\\d+[./-]\\d+[./-]\\d+/.test(t))return;try{let[r]=(n=t.match(/\\d+[./-]\\d+[./-]\\d+/))!=null?n:[];if(!r)return;let i=r.split(/[.\\-\\/]/).map(a=>Number(a)),s=[...new Set(this.format.replace(/[^\\w]/g,"").toUpperCase().split(""))];return{year:i[s.indexOf("Y")],month:i[s.indexOf("M")],day:i[s.indexOf("D")]}}catch(r){return}}else return t}getDates(t={},n){let r="fc-date"in t?"fc-date":"fc-start",i;t&&r in t&&(i=t[r]),i||(i=n);let s=this.parseDate(i),a="fc-end"in t?t["fc-end"]:null,o=this.parseDate(a);return{date:s,end:o}}};new ft;
+`)}var Kh=class extends Qt.FuzzySuggestModal{constructor(e){super(e.app);this.plugin=e}getItems(){return this.plugin.data.calendars}getItemText(e){return e.name}onChooseItem(e,n){this.chosen=e,this.close()}},Ts=class extends Qt.Component{constructor(e){super();this.plugin=e;this.queue=new Set;this.tree=new Map;this.worker=new Fs}get calendars(){return this.plugin.data.calendars}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:()=>{this.plugin.data.debug&&console.info("Beginning full rescan for calendar events"),this.start()}}),this.plugin.addCommand({id:"rescan-events-for-calendar",name:"Rescan Events for Calendar",callback:()=>{let e=new Kh(this.plugin);e.onClose=()=>{e.chosen&&(this.plugin.data.debug&&console.info("Beginning full rescan for calendar events for calendar "+e.chosen.name),this.start(e.chosen))},e.open()}}),this.worker.postMessage({type:"calendars",calendars:this.calendars}),this.registerEvent(this.plugin.app.workspace.on("fantasy-calendars-updated",()=>{this.worker.postMessage({type:"calendars",calendars:this.calendars})})),this.worker.postMessage({type:"options",parseTitle:this.plugin.data.parseDates,addToDefaultIfMissing:this.plugin.data.addToDefaultIfMissing,format:this.plugin.format,defaultCalendar:this.plugin.defaultCalendar?.name,debug:this.plugin.data.debug}),this.registerEvent(this.plugin.app.workspace.on("fantasy-calendar-settings-change",()=>{this.worker.postMessage({type:"options",parseTitle:this.plugin.data.parseDates,addToDefaultIfMissing:this.plugin.data.addToDefaultIfMissing,format:this.plugin.format,defaultCalendar:this.plugin.defaultCalendar?.name,debug:this.plugin.data.debug})})),this.registerEvent(this.metadataCache.on("changed",e=>{this.queue.has(e.path)||this.startParsing([e.path])})),this.registerEvent(this.vault.on("rename",async(e,n)=>{if(!!this.calendars.length&&e instanceof Qt.TFile){for(let a of this.calendars)a.events=a.events.filter(r=>r.note!=n);this.worker.postMessage({type:"calendars",calendars:this.calendars}),this.startParsing([e.path])}})),this.registerEvent(this.vault.on("delete",async e=>{if(e instanceof Qt.TFile){for(let n of this.calendars){let a=n.events.filter(r=>r.note===e.path);n.events=n.events.filter(r=>r.note!=e.path);for(let r of a)this.addToTree(n,r)}await this.plugin.saveCalendar(),this.plugin.app.workspace.trigger("fantasy-calendars-event-update",this.tree),this.tree=new Map}})),this.worker.addEventListener("message",async e=>{if(e.data.type=="get"){let{path:n}=e.data;this.queue.delete(n);let a=this.plugin.app.vault.getAbstractFileByPath(n);if(a instanceof Qt.TFile){let r=this.metadataCache.getFileCache(a),i=(0,Qt.getAllTags)(r),o=await this.vault.cachedRead(a);this.worker.postMessage({type:"file",path:n,cache:r,file:{path:a.path,basename:a.basename},allTags:i,data:o})}else if(a instanceof Qt.TFolder){let r=a.children.map(i=>i.path);this.startParsing(r)}}}),this.worker.addEventListener("message",async e=>{if(e.data.type=="update"){let{id:n,index:a,event:r,original:i}=e.data,o=this.calendars.find(l=>l.id==n);if(!o)return;a==-1?(this.plugin.data.debug&&console.debug(`Adding '${r.name}' to ${o.name}`),o.events.push(r)):(this.plugin.data.debug&&console.debug(`Updating '${r.name}' in calendar ${o.name}`),o.events.splice(a,a>=0?1:0,r)),this.addToTree(o,r),i&&this.addToTree(o,i)}}),this.worker.addEventListener("message",async e=>{if(e.data.type=="delete"){let{id:n,index:a,event:r}=e.data;if(!r)return;let i=this.calendars.find(o=>o.id==n);if(!i)return;this.plugin.data.debug&&console.debug(`Removing '${r.name}' from ${i.name}`),i.events=i.events.filter(o=>o.id!=r.id),this.addToTree(i,r)}}),this.worker.addEventListener("message",async e=>{e.data.type=="save"&&(this.plugin.data.debug&&console.debug("Received save event from file watcher"),this.plugin.app.workspace.trigger("fantasy-calendars-event-update",this.tree),this.tree=new Map,await this.plugin.saveCalendar())}),this.start()}start(e){let n=e?[e]:this.calendars;if(!n.length)return;let a=new Set;for(let r of n){if(!r||!r.autoParse)continue;let i=this.vault.getAbstractFileByPath(r.path);if(!(!i||!(i instanceof Qt.TFolder)))for(let o of i.children)a.add(o.path)}!a.size||(this.plugin.data.debug&&console.info(e?`Starting rescan for ${e.name} (${a.size})`:`Starting rescan for ${n.length} calendars (${a.size})`),this.startParsing([...a]))}addToTree(e,n){this.tree.has(e.id)||this.tree.set(e.id,new Set);let a=this.tree.get(e.id);if(!a.has(n.date.year)&&(a.add(n.date.year),n.end&&n.end.year!=n.date.year))for(let r=n.date.year+1;r<=n.end.year;r++)a.add(n.date.year)}startParsing(e){for(let n of e)this.queue.add(n);this.worker.postMessage({type:"queue",paths:e})}onunload(){this.worker.terminate(),this.worker=null}};var Ss=Fe(require("obsidian"));var Bs=class{constructor(e){this.plugin=e}getCalendars(){return this.plugin.data.calendars}getMoons(e,n){let a=n?this.plugin.data.calendars.find(({name:s})=>s==n):this.plugin.defaultCalendar??this.plugin.defaultCalendar,r=this.getHelper(a),i=e||r.current,o=r.getDayForDate(i),l=[];for(let[s,d]of o.moons){let u=createSpan();new jn({target:u,props:{moon:s,phase:d}}),l.push({icon:u,moon:s,phase:d})}return l}getDay(e,n=this.plugin.defaultCalendar){if(!e||typeof e!="object"||e.year==null||e.month==null||e.day==null){new Ss.Notice("The Date parameter is required and must have the day, month and year.");return}typeof n=="string"&&(n=this.plugin.data.calendars.find(o=>o.name==n)??this.plugin.defaultCalendar);let a=this.getHelper(n),r;if(typeof e.month=="string"?r=a.data.months.findIndex(o=>o.name==e.month):r=e.month,isNaN(e.year)||isNaN(r)||r==-1||isNaN(e.day)){let o=[];isNaN(e.year)&&o.push("The year must be a number."),(isNaN(r)||r==-1)&&(typeof e.month=="string"?o.push(`Could not find ${e.month} in the Months list for ${a.calendar.name}`):o.push("The month must be a number or the name of a month in the list of months for the selected calendar.")),isNaN(e.day)&&o.push("The year must be a number."),new Ss.Notice(`There was an issue with the provided date.
+
+${o.join(`
+`)}`);return}let i=a.getDayForDate({year:e.year,month:r,day:e.day});return{moons:i.moons,events:i.events,date:i.date,longDate:i.longDate,leapDay:i.leapday,weekday:i.weekday,displayDate:rn(i.date,a.data.months)}}getHelper(e=this.plugin.defaultCalendar){return new La(e,this.plugin)}};var Ns=Fe(Nn());var Qh=ja.Platform.isMacOS?"Meta":"Control",lr={name:null,description:null,id:null,static:{incrementDay:!1,firstWeekDay:null,overflow:!0,weekdays:[],months:[],moons:[],displayMoons:!0,displayDayNumber:!1,leapDays:[],eras:[]},current:{year:null,month:null,day:null},events:[],categories:[],autoParse:!1,path:"/",supportTimelines:!1,syncTimelines:!0,timelineTag:"#timeline"},Xh={addToDefaultIfMissing:!0,calendars:[],configDirectory:null,currentCalendar:null,dailyNotes:!1,dateFormat:"YYYY-MM-DD",defaultCalendar:null,eventPreview:!1,exit:{saving:!1,event:!1,calendar:!1},eventFrontmatter:!1,parseDates:!1,settingsToggleState:{calendars:!1,events:!1,advanced:!0},showIntercalary:!1,version:{major:null,minor:null,patch:null},debug:!1},Ms=class extends ja.Plugin{constructor(){super(...arguments);this.api=new Bs(this);this.watcher=new Ts(this)}async addNewCalendar(e,n){let a=!n||e.name!=n?.name||e.autoParse&&!n?.autoParse||e.path!=n?.path;n==null?this.data.calendars.push(e):this.data.calendars.splice(this.data.calendars.indexOf(n),1,e),this.data.defaultCalendar||(this.data.defaultCalendar=e.id),a&&this.watcher.start(e),await this.saveCalendar()}get currentCalendar(){return this.data.calendars.find(e=>e.id==this.data.currentCalendar)}get canUseDailyNotes(){return this.dailyNotes._loaded}get dailyNotes(){return this.app.internalPlugins.getPluginById("daily-notes")}get canUseTimelines(){return this.app.plugins.getPlugin("obsidian-timelines")!=null}syncTimelines(e){return e.syncTimelines&&this.canUseTimelines}timelineTag(e){let n=e.timelineTag;return this.syncTimelines(e)&&(n=this.app.plugins.getPlugin("obsidian-timelines").settings.timelineTag),/^#/.test(n)||(n=`#${n}`),n??e.timelineTag??""}get format(){return(this.data.dailyNotes&&this.canUseDailyNotes?this.dailyNotes.instance.options.format:this.data.dateFormat)??"YYYY-MM-DD"}get defaultCalendar(){return this.data.calendars.find(e=>e.id==this.data.defaultCalendar)??this.data.calendars[0]}get view(){let e=this.app.workspace.getLeavesOfType(Kt),n=e.length?e[0]:null;if(n&&n.view&&n.view instanceof Hn)return n.view}get full(){let e=this.app.workspace.getLeavesOfType(ua),n=e.length?e[0]:null;if(n&&n.view&&n.view instanceof Hn)return n.view}async onload(){console.log("Loading Fantasy Calendars v"+this.manifest.version),(window.FantasyCalendarAPI=this.api)&&this.register(()=>delete window.FantasyCalendarAPI),this.registerView(Kt,e=>new Hn(this,e)),this.registerView(ua,e=>new Hn(this,e,{full:!0})),this.app.workspace.onLayoutReady(async()=>{await this.loadSettings(),this.watcher.load(),this.addCommands(),this.addSettingTab(new Ei(this)),this.addCalendarView(!0)}),this.addRibbonIcon(Kt,"Open Large Fantasy Calendar",e=>{this.app.workspace.getLeaf(e.getModifierState(Qh)).setViewState({type:ua})})}async onunload(){console.log("Unloading Fantasy Calendars v"+this.manifest.version),this.app.workspace.getLeavesOfType(Kt).forEach(e=>e.detach()),this.app.workspace.getLeavesOfType(ua).forEach(e=>e.detach()),this.watcher.unload()}addCommands(){this.addCommand({id:"open-fantasy-calendar",name:"Open Fantasy Calendar",callback:()=>{this.addCalendarView()}}),this.addCommand({id:"open-big-fantasy-calendar",name:"Open Large Fantasy Calendar",callback:()=>{this.addFullCalendarView()}}),this.addCommand({id:"toggle-moons",name:"Toggle Moons",checkCallback:e=>{let n=this.app.workspace.getLeavesOfType(Kt);if(n&&n.length)return e||n[0].view.toggleMoons(),!0}}),this.addCommand({id:"view-date",name:"View Date",checkCallback:e=>{let n=this.app.workspace.getLeavesOfType(Kt);if(n&&n.length)return e||n[0].view.openDate(),!0}}),this.addCommand({id:"view-date",name:"View Note Event",checkCallback:e=>{let n=this.app.workspace.getLeavesOfType(Kt);if(n&&n.length&&n[0].view instanceof Hn){let a=this.app.workspace.getActiveFile();if(a){let r=n[0].view.calendar.events.find(i=>i.note==a.path);if(r)return e||n[0].view.openDay(r.date),!0}}}})}async addCalendarView(e=!1){e&&this.app.workspace.getLeavesOfType(Kt)?.length||(await this.app.workspace.getRightLeaf(!1).setViewState({type:Kt}),this.view&&this.app.workspace.revealLeaf(this.view.leaf))}async addFullCalendarView(e=!1){e&&this.app.workspace.getLeavesOfType(ua)?.length||(this.app.workspace.getLeaf(!1).setViewState({type:ua}),this.full&&this.app.workspace.revealLeaf(this.full.leaf))}async loadSettings(){if(this.data={...(0,Ns.default)(Xh),...await this.loadData()},this.configDirectory&&await this.app.vault.adapter.exists(this.configFilePath)&&(this.data=Object.assign({},this.data,JSON.parse(await this.app.vault.adapter.read(this.configFilePath)))),!this.data.defaultCalendar&&this.data.calendars.length&&(this.data.defaultCalendar=this.data.calendars[0].id),this.data.calendars.length&&!this.data.calendars.find(e=>e.id==this.data.defaultCalendar)&&(this.data.defaultCalendar=this.data.calendars[0].id),this.data.autoParse&&this.data.calendars.length){for(let e of this.data.calendars)e.autoParse=this.data.autoParse,e.path=this.data.path;delete this.data.autoParse,delete this.data.path}for(let e of this.data.calendars)e.static.eras&&e.static.eras.length&&e.static.eras.some(n=>!n.id)&&(e.static.eras=e.static.eras.map(n=>({...(0,Ns.default)(n),id:n.id??Ze(6),restart:n.restart??!1,endsYear:n.endsYear??!1,event:n.event??!1})));await this.saveSettings(),this.settingsLoaded=!0,this.app.workspace.trigger("fantasy-calendars-settings-loaded")}onSettingsLoad(e){this.settingsLoaded?e():this.app.workspace.on("fantasy-calendars-settings-loaded",()=>e())}async saveCalendar(){await this.saveSettings(),this.app.workspace.trigger("fantasy-calendars-updated")}get configDirectory(){if(!(!this.data||!this.data.configDirectory))return`${this.data.configDirectory}/plugins/fantasy-calendar`}get configFilePath(){if(!!this.data.configDirectory)return`${this.configDirectory}/data.json`}async saveSettings(){await this.saveData(this.data),this.app.workspace.trigger("fantasy-calendar-settings-change")}async saveData(e){if(this.configDirectory)try{await this.app.vault.adapter.exists(this.configDirectory)||await this.app.vault.adapter.mkdir(this.configDirectory),await this.app.vault.adapter.write(this.configFilePath,JSON.stringify(e))}catch(n){console.error(n),new ja.Notice("There was an error saving into the configured directory.")}await super.saveData(e)}};
+/*! *****************************************************************************
+Copyright (c) Microsoft Corporation.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+***************************************************************************** */
+/*! https://mths.be/he v1.2.0 by @mathias | MIT license */
+/**
+ * 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
+ */
diff --git a/.obsidian/plugins/fantasy-calendar/manifest.json b/.obsidian/plugins/fantasy-calendar/manifest.json
new file mode 100644
index 0000000..68ff0e6
--- /dev/null
+++ b/.obsidian/plugins/fantasy-calendar/manifest.json
@@ -0,0 +1,10 @@
+{
+ "id": "fantasy-calendar",
+ "name": "Fantasy Calendar",
+ "version": "2.3.10",
+ "minAppVersion": "0.12.10",
+ "author": "Jeremy Valentine",
+ "description": "Fantasy calendars in Obsidian!",
+ "authorUrl": "https://github.com/fantasycalendar/obsidian-fantasy-calendar",
+ "isDesktopOnly": false
+}
diff --git a/.obsidian/plugins/fantasy-calendar/styles.css b/.obsidian/plugins/fantasy-calendar/styles.css
new file mode 100644
index 0000000..933f85e
--- /dev/null
+++ b/.obsidian/plugins/fantasy-calendar/styles.css
@@ -0,0 +1 @@
+.fantasy-calendar-date-fields{display:flex;justify-content:space-between;align-items:flex-start;gap:.5rem;padding-bottom:.75rem}.fantasy-calendar-date-fields .fantasy-calendar-date-field{display:flex;flex-flow:column nowrap}.fantasy-calendar-picker{padding:5px 15px;display:flex;flex-flow:column nowrap;justify-content:flex-start}.fantasy-calendar-view .view-content{padding:.5rem}.fantasy-calendar-full.view-content{display:flex;flex-flow:column;width:100%}.fantasy-calendar-dropdown{display:flex;flex-flow:column;width:100%;padding-bottom:.75rem}.fantasy-calendar-view-event .modal-content{max-width:75vw}.fantasy-no-calendar{color:var(--text-muted);display:flex;justify-content:center;text-align:center;padding:.5rem}.fantasy-title{margin:0}.full-view .fantasy-title{grid-column:span 3}body:not(.is-mobile) .modal.mod-settings .vertical-tab-content-container .vertical-tab-content.fantasy-calendar-settings.fantasy-calendar-creator-open{overflow:hidden}.fantasy-calendar-settings,.fantasy-calendar-settings-content{background-color:inherit;position:relative}.fantasy-calendar-confirm-buttons-container{display:flex;justify-content:space-between;align-items:center}.fantasy-calendar-confirm-buttons-container .dont-ask{cursor:pointer}.fantasy-calendar-confirm-buttons{display:flex;justify-content:flex-end;align-items:center;gap:.5rem}.modal.mod-settings .vertical-tab-content-container .vertical-tab-content.fantasy-calendar-settings{position:relative}.modal.mod-settings .vertical-tab-content.fantasy-calendar-settings .fantasy-calendar-settings-content h2:first-child{margin-top:initial}details.fantasy-calendar-nested-settings>summary{outline:none;display:block!important;list-style:none!important;list-style-type:none!important;min-height:1rem;border-top-left-radius:.1rem;border-top-right-radius:.1rem;cursor:pointer;position:relative}details.fantasy-calendar-nested-settings>summary::-webkit-details-marker,details.fantasy-calendar-nested-settings>summary::marker{display:none!important}details.fantasy-calendar-nested-settings>summary>.collapser{position:absolute;top:50%;right:8px;transform:translateY(-50%);content:""}details.fantasy-calendar-nested-settings>summary>.collapser>.handle{transform:rotate(0);transition:transform .25s;background-color:currentColor;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-image:var(--admonition-details-icon);mask-image:var(--admonition-details-icon);width:20px;height:20px}details.fantasy-calendar-nested-settings[open]>summary>.collapser>.handle{transform:rotate(90deg)}.fantasy-calendar-settings .fantasy-calendars{border-bottom:1px solid var(--background-modifier-border);border-top:1px solid var(--background-modifier-border);padding:18px 0 0}.fantasy-calendar-create-calendar input[disabled]{cursor:not-allowed}.fantasy-calendar-settings .fantasy-calendar-warning.date-format{color:red}.fantasy-calendar-settings .fantasy-calendar-warning{display:flex;align-items:center;gap:.25rem}.fantasy-calendar-settings .existing-calendars{padding:18px}.fantasy-calendar-settings .existing-calendars>span{display:block;text-align:center;color:var(--text-muted)}.fantasy-calendar-nested-settings .setting-item{border:0px;padding-bottom:0}.fantasy-calendar-nested-settings{padding-bottom:18px}.fantasy-calendar-nested-settings:not([open]) .setting-item-heading{border-bottom:1px solid transparent}.fantasy-calendar-nested-settings[open] .setting-item-heading,.fantasy-calendar-nested-settings:not(details) .setting-item-heading{border-top:0px;border-bottom:1px solid var(--background-modifier-border)}.fantasy-calendar-nested-settings .warning-container{position:relative;display:flex;align-items:center;gap:.25rem}.fantasy-calendar-settings .fantasy-calendar-config .setting-item-name{display:flex;gap:.25rem;align-items:center}.fantasy-context-buttons{display:flex;justify-content:flex-end;align-items:center;gap:.25rem}.fantasy-calendar-create-event .event-info{display:flex;flex-flow:column nowrap;width:100%;justify-content:flex-start;align-items:flex-start;gap:.5rem}.fantasy-calendar-create-event .event-info>*,.fantasy-calendar-create-event .setting-item{width:100%;padding-top:0;padding-bottom:.75rem;border:0}.fantasy-calendar-create-event .event-info>.event-description{display:flex;flex-flow:column nowrap}.fantasy-calendar-create-event .event-info textarea{resize:vertical}.fantasy-calendar-choose-preset .fantasy-calendar-preset-container{display:grid;grid-template-columns:1fr 1fr 1fr;grid-auto-rows:1fr;gap:1rem;align-items:center;justify-content:flex-start;margin:5px}.fantasy-calendar-choose-preset .fantasy-calendar-preset-container button{height:100%;width:100%;white-space:pre-line;max-width:250px}.fantasy-calendar-choose-preset .fantasy-calendar-preset-container button.mod-cta{box-shadow:0 0 10px var(--background-modifier-success)}.fantasy-leap-day-interval-description{color:var(--text-muted);border:0}.fantasy-calendar-event-date{display:grid;grid-template-columns:1fr auto;align-items:center;gap:.5rem}.fantasy-calendar-event-formula .setting-item-control{gap:.25rem}.era-event{flex-grow:1}
diff --git a/.obsidian/plugins/rpg-manager/data.json b/.obsidian/plugins/rpg-manager/data.json
index 23d3ed9..9e9a9aa 100644
--- a/.obsidian/plugins/rpg-manager/data.json
+++ b/.obsidian/plugins/rpg-manager/data.json
@@ -66,7 +66,7 @@
},
{
"field": 3,
- "checked": true,
+ "checked": false,
"required": false
},
{
@@ -212,7 +212,7 @@
},
{
"field": 3,
- "checked": true,
+ "checked": false,
"required": false
},
{
diff --git a/Absolue Nécessitée.md b/Absolue Nécessitée.md
index 4f520c3..9d7f923 100644
--- a/Absolue Nécessitée.md
+++ b/Absolue Nécessitée.md
@@ -1,9 +1,9 @@
-
---
alias: []
tags: []
banner: "https://cdnb.artstation.com/p/assets/images/images/017/547/695/large/marc-simonetti-img-20190424-170658-527.jpg?1556439881"
banner_y: 0.572
+fc-calendar: Calendrier d'Eana (Joueurs)
---
```RpgManagerData
plot:
diff --git a/Clues/Boite d'Allumette de l'Hydre Cristalline.md b/Clues/Boite d'Allumette de l'Hydre Cristalline.md
index b551953..fac28e4 100644
--- a/Clues/Boite d'Allumette de l'Hydre Cristalline.md
+++ b/Clues/Boite d'Allumette de l'Hydre Cristalline.md
@@ -5,7 +5,7 @@ tags: []
```RpgManagerData
data:
synopsis: "Boite d'allumette au nom de l'[[Hydre Cristalline]]"
- complete: false
+ complete: true
found:
relationships: []
```
diff --git a/Events/Assassinat d'Althéa.md b/Events/Assassinat d'Althéa.md
new file mode 100644
index 0000000..84b5a5a
--- /dev/null
+++ b/Events/Assassinat d'Althéa.md
@@ -0,0 +1,36 @@
+---
+fc-calendar: Calendrier d'Eana (Joueurs)
+fc-date: 330-5-36
+alias: []
+tags: []
+---
+```RpgManagerData
+data:
+ synopsis: "[[Althéa Temperenza|Althéa]] se fait attaquer par [[Derlynn Boyau-Gravier|Derlynn]] ( Voir [[1.1 - L'Assassinat raté]] )"
+ complete: false
+ date: "330-5-36"
+```
+```RpgManager
+models:
+ header: true
+ lists:
+ subplots:
+ pcs:
+ npcs:
+ clues:
+ locations:
+```
+---
+### Event Details
+ -
+
+---
+```RpgManagerID
+### DO NOT EDIT MANUALLY IF NOT INSTRUCTED TO DO SO ###
+type: 256
+campaignSettings: 0
+id: "322f10cf-baef-4951-9908-8a5daf4eade9"
+campaignId: "160d7ffd-1d69-4848-b5e5-443eb5992dea"
+parentId: "160d7ffd-1d69-4848-b5e5-443eb5992dea"
+positionInParent: 0
+```
diff --git a/Factions/Aïpio.md b/Factions/Aïpio.md
index acd85dd..6ac8df6 100644
--- a/Factions/Aïpio.md
+++ b/Factions/Aïpio.md
@@ -1,11 +1,15 @@
---
alias: []
tags: []
+banner_icon: ☠️
---
```RpgManagerData
data:
synopsis: "Organisation criminelle géré par les élénions qui gère la contrebande de poison et de drogues ainsi que les faux papiers et autres faussaires"
complete: false
+ images:
+ - path: "Illustrations/Logo/Aïpio.png"
+ caption: ""
```
```RpgManager
models:
@@ -21,6 +25,7 @@ models:
- Aïpio est une organisation criminelle qui ne s’assume pas totalement en tant que telle. Elle ressemble à une association de dilettantes elenions à l’élégance indolente. Elle contrôle toute la contrebande en provenance d’Ellerìna, et en particulier l’arrivée de poisons et drogues qui se diffuseront ensuite dans les autres quartiers.
- Outre cette spécialité, Aïpio est très active dans les délits de papier : escroquerie, faux, chantage, etc. De manière générale, ses membres se tiennent à l’écart de la violence brutale et des crimes de sang. Ils n’en savent pas moins se défendre si nécessaire et emploient volontiers des méthodes sophistiquées.
- Dans le monde clandestin de la Cité Franche, Aïpio a aussi la particularité d’offrir un terrain neutre aux négociations entre criminels. Quand on veut discuter avec une personne dangereuse, le terrain neutre par excellence est un établissement du quartier de l’Étoile. La garde vigente n’y arrête que les individus qui se montrent physiquement agressifs, et elle est zélée pour ce qui est de garantir le calme. Grâce à cette forme d’association contre-nature avec les forces de l’ordre, Aïpio est respectée et bien informée. En retour de ce service, les membres d’Aïpio bénéficient d’une large immunité auprès de tous les membres de guildes de voleurs.
+-
---
```RpgManagerID
diff --git a/Factions/Eglise de la Nuit.md b/Factions/Eglise de la Nuit.md
new file mode 100644
index 0000000..c2f8532
--- /dev/null
+++ b/Factions/Eglise de la Nuit.md
@@ -0,0 +1,42 @@
+---
+alias: []
+tags: []
+---
+```RpgManagerData
+data:
+ synopsis:
+ complete: false
+ images:
+ - path: "https://www.worldanvil.com/uploads/images/6287ac4ce365a00dd7ec1b840f2a230c.png"
+ caption: ""
+```
+```RpgManager
+models:
+ header: true
+ lists:
+ pcs:
+ npcs:
+ locations:
+ subplots:
+```
+---
+Xonim, également appelée la Dame de la Nuit, est une déesse récente (à l'échelle divine), mais qui a déjà indiscutablement posé sa marque sur le monde, avec un style particulier. On lui attribue notamment la création des dopplegänger, et possiblement aussi celle des Vampire.
+
+Associée à la magie et aux ténèbres, dotée d'activités subversives, on pourrait penser que le culte de cette déesse serait universellement -- ou presque -- interdit. Pourtant il n'en est rien. Il est effectivement risqué de l'honorer en Lothrienne, mais dans la Cité Franche, dans les Drakenbergen ou les Royaumes des Sables, cette foi est parfaitement admise.
+
+## Politique
+Le secret du succès du clergé de Xonim n'a rien de mystérieux, il est en fait même assez simple et tient aux "**Liens de Xonim**". Il s'agit d'un objet magique, ayant généralement la forme de chaînes ou de menottes, qui prive le prisonnier de la capacité à utiliser des sorts. Il s'agit du moyen idéal de coercition pour transporter un magicien ou un sorcier. La sécurité qu'offrent les liens de Xonim est un soulagement pour les gardes de ville. Il suffit de savoir qu'il en existe un exemplaire au poste de garde qu'on pourra chercher en cas de besoin pour se sentir mieux préparé pour gérer un incident. Ces objets magiques appréciés des forces de l'ordre sont souvent offerts ou vendus pour une somme modique (au regard de la valeur de l'enchantement), une manière de s'assurer que les temples pourront prospérer.
+
+## Foi
+Les prêtres de Xonim, craints et enviés, deviennent souvent conseillers – d’une guilde, d’une faction ou d’un roi. Leur dogme les incite à défendre du mieux qu’ils peuvent les intérêts du camp qu’ils choisissent, même s’ils doivent s’opposer pour cela à d’autres prêtres de même obédience. À eux de démontrer leurs mérites et leur intelligence dans cette compétition qui se joue durant toute leur vie.
+
+---
+```RpgManagerID
+### DO NOT EDIT MANUALLY IF NOT INSTRUCTED TO DO SO ###
+type: 1024
+campaignSettings: 0
+id: "2871ca3f-9eb4-491c-a66a-cda5a5f5923b"
+campaignId: "160d7ffd-1d69-4848-b5e5-443eb5992dea"
+parentId: "160d7ffd-1d69-4848-b5e5-443eb5992dea"
+positionInParent: 0
+```
diff --git a/Factions/Empire de Kartaçöl.md b/Factions/Empire de Kartaçöl.md
new file mode 100644
index 0000000..5246155
--- /dev/null
+++ b/Factions/Empire de Kartaçöl.md
@@ -0,0 +1,34 @@
+---
+alias: ["Kartaçöl"]
+tags: []
+banner: "https://www.worldanvil.com/media/cache/cover/uploads/images/e29dbed6f8fa3c7806d191582592d832.jpg"
+banner_y: 0.816
+---
+```RpgManagerData
+data:
+ synopsis: "Ce jeune empire conquérant, né dans le [[Kaan]] autour du territoire de l'ancienne cité-état [[Easafir]] est aujourd'hui dirigé par un souverain surnommé [[l'Immortel]]. Voilà quelques années, fort d'une marine puissante, il conquit [[Moramiek]] , en [[Arolavie]] . On dit même qu'il envisageait d'intégrer la karalieva - dirigeante du royaume - à son harem."
+ complete: false
+```
+```RpgManager
+models:
+ header: true
+ lists:
+ pcs:
+ npcs:
+ locations:
+ subplots:
+```
+---
+### Faction Details
+ -
+
+---
+```RpgManagerID
+### DO NOT EDIT MANUALLY IF NOT INSTRUCTED TO DO SO ###
+type: 1024
+campaignSettings: 0
+id: "05b0efdf-a6bc-400d-a866-093ecbce8faa"
+campaignId: "160d7ffd-1d69-4848-b5e5-443eb5992dea"
+parentId: "160d7ffd-1d69-4848-b5e5-443eb5992dea"
+positionInParent: 0
+```
diff --git a/Factions/La Main.md b/Factions/La Main.md
index 6aff14f..8f95250 100644
--- a/Factions/La Main.md
+++ b/Factions/La Main.md
@@ -52,5 +52,4 @@ positionInParent: 0
[[Lunarion Agnadelle|]]
[[L’Assemblée|]]
[[Grand Palais|]]
-[[République|]]
diff --git a/Factions/République.md b/Factions/République.md
index 729f50a..dd0ef5f 100644
--- a/Factions/République.md
+++ b/Factions/République.md
@@ -50,6 +50,7 @@ Pratiquement tous les vestiges royaux que vous pourriez croiser datent de cette
La Resgrande Riporte a considérablement grandi sous leur règne, pour prendre peu à peu le visage que vous lui connaissez. Ils ont inauguré la cathédrale de Flore et Givreuse et le grand sanctuaire de Forgeron. L’abandon de la vieille nécropole au profit du Cimetière de la Plaine est également de leur fait ; l’installation de la Steinbank aussi. En dépit de forces indéniables, le royaume souffrait de défauts qui précipitèrent sa perte. Les familles guildiennes en particulier étaient insatisfaites de la politique fiscale imposée indirectement par le trône cyrillan. La révolution à venir se nourrissait à la fois du ressentiment d’être un pays vassal, de la pression économique, du souvenir des idéaux ayant mené à renverser le royaume de Barruna, et de la relative faiblesse de la Cyrillane alors prise dans une tentative malheureuse de conquérir le royaume de Ghardat.
L’ultime facteur déclenchant fut un concours de circonstances, une suite d’accidents et de décès tragiques qui menèrent sur le trône Alexis III, un jeune souverain généreux, mais qui mesurait mal la succession d’événements qu’il allait déclencher. Soucieux du bien-être de son peuple, il décida de plaider sa cause auprès de l’empereur, en se rendant en personne à Kratéïra avec une délégation guildienne.
+
Il existe plusieurs versions, contradictoires, des événements. Toujours est-il qu’Alexis III Drae mourut au cours du voyage – de maladie ou d’un empoisonnement –, et que certains guildiens furent arrêtés et exécutés pour sédition. Pour l’anecdote, la guilde d’especiel, qui contrôle le commerce des épices, et la guilde des alchimistes sont encore soupçonnées par certains d’avoir assassiné alors le souverain pour provoquer une révolte contre la Cyrillane et obtenir l’indépendance. La population assemblée dans l’ancien palais vota solennellement pour l’établissement de la République. Une époque venait de s’achever.
diff --git a/Illustrations/Logo/Aïpio.png b/Illustrations/Logo/Aïpio.png
new file mode 100644
index 0000000..8c2d6e2
--- /dev/null
+++ b/Illustrations/Logo/Aïpio.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:edad7ce9607397afcf60e50411b4614de782065e027979ad27e49c3f80f32f98
+size 698354
diff --git a/Illustrations/Pasted image 20230101224516.png b/Illustrations/Portraits/Pasted image 20230101224516.png
similarity index 100%
rename from Illustrations/Pasted image 20230101224516.png
rename to Illustrations/Portraits/Pasted image 20230101224516.png
diff --git a/Illustrations/dai_lavellan_by_nanoetetsu_d8ajxjc-fullview.jpg b/Illustrations/dai_lavellan_by_nanoetetsu_d8ajxjc-fullview.jpg
new file mode 100644
index 0000000..599283e
--- /dev/null
+++ b/Illustrations/dai_lavellan_by_nanoetetsu_d8ajxjc-fullview.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:07ffab1535a565f25d43d02d0a287ce12edaeb9ea73b64a25141c2f990580bc9
+size 90149
diff --git a/Locations/Cyfandir.md b/Locations/Cyfandir.md
index 01bfa42..a4059bc 100644
--- a/Locations/Cyfandir.md
+++ b/Locations/Cyfandir.md
@@ -12,6 +12,9 @@ relationships:
- type: "child"
path: "Locations/Ouestrie.md"
description:
+ - type: "child"
+ path: "Locations/Cyrillanne.md"
+ description:
```
```RpgManager
models:
@@ -44,3 +47,4 @@ parentId: "160d7ffd-1d69-4848-b5e5-443eb5992dea"
positionInParent: 0
```
[[Ouestrie|]]
+[[Cyrillanne|]]
diff --git a/Locations/Cyrillanne.md b/Locations/Cyrillanne.md
index f9532ce..a3d809d 100644
--- a/Locations/Cyrillanne.md
+++ b/Locations/Cyrillanne.md
@@ -1,12 +1,21 @@
---
alias: []
tags: []
+banner: "https://cdnb.artstation.com/p/assets/images/images/002/707/821/medium/mathias-zamecki-return.jpg?1464804782"
+banner_y: 0.252
---
```RpgManagerData
data:
- synopsis:
+ synopsis: "Empire autrefois glorieux, la Cyrillane est aujourd'hui déchirée par une guerre civile terrible. Elle est le jouet des factions et des puissances. [[Empire de Kartaçöl]] a envoyé des troupes à l'est du pays, sous le motif officiel de venir en aide aux populations civiles. Du point de vue de l'[[Arolavie]] , c'est aussi une occasion pour Kartaçöl d'établir une tête de pont sur le Cyfandir et de pouvoir prendre à terme l'Arolavie en tenaille, avec une attaque par la terre et une autre par la mer. Inacceptable pour la Karalieva ."
complete: false
address:
+ images:
+ - path: "https://cdnb.artstation.com/p/assets/images/images/002/707/821/medium/mathias-zamecki-return.jpg?1464804782"
+ caption: ""
+relationships:
+ - type: "child"
+ path: "Locations/Kratéïra.md"
+ description:
```
```RpgManager
models:
@@ -38,3 +47,4 @@ campaignId: "160d7ffd-1d69-4848-b5e5-443eb5992dea"
parentId: "160d7ffd-1d69-4848-b5e5-443eb5992dea"
positionInParent: 0
```
+[[Kratéïra|]]
diff --git a/NonPlayerCharacters/Artistophane Ipato.md b/NonPlayerCharacters/Artistophane Ipato.md
new file mode 100644
index 0000000..94b1790
--- /dev/null
+++ b/NonPlayerCharacters/Artistophane Ipato.md
@@ -0,0 +1,45 @@
+---
+alias: []
+tags: []
+race: humain
+---
+```RpgManagerData
+data:
+ synopsis:
+ death:
+ dob:
+ goals:
+ pronoun:
+ complete: false
+```
+```RpgManager
+models:
+ header: true
+ lists:
+ subplots:
+ pcs:
+ relationship: "unidirectional"
+ npcs:
+ relationship: "unidirectional"
+ factions:
+ locations:
+ events:
+ clues:
+```
+---
+### Non Player Character Notes
+ -
+
+### Non Player Character Story
+ -
+
+---
+```RpgManagerID
+### DO NOT EDIT MANUALLY IF NOT INSTRUCTED TO DO SO ###
+type: 64
+campaignSettings: 0
+id: "d2e8a920-1536-4301-8fca-920d3bfec987"
+campaignId: "160d7ffd-1d69-4848-b5e5-443eb5992dea"
+parentId: "160d7ffd-1d69-4848-b5e5-443eb5992dea"
+positionInParent: 0
+```
diff --git a/NonPlayerCharacters/Baron de l'Éther.md b/NonPlayerCharacters/Baron de l'Éther.md
new file mode 100644
index 0000000..90cea01
--- /dev/null
+++ b/NonPlayerCharacters/Baron de l'Éther.md
@@ -0,0 +1,45 @@
+---
+alias: ["Baron Volant"]
+tags: []
+race: gnome
+---
+```RpgManagerData
+data:
+ synopsis:
+ death:
+ dob:
+ goals:
+ pronoun:
+ complete: false
+```
+```RpgManager
+models:
+ header: true
+ lists:
+ subplots:
+ pcs:
+ relationship: "unidirectional"
+ npcs:
+ relationship: "unidirectional"
+ factions:
+ locations:
+ events:
+ clues:
+```
+---
+### Non Player Character Notes
+ -
+
+### Non Player Character Story
+ -
+
+---
+```RpgManagerID
+### DO NOT EDIT MANUALLY IF NOT INSTRUCTED TO DO SO ###
+type: 64
+campaignSettings: 0
+id: "5364cb8e-2ada-4c12-a323-a12cda5e8cc4"
+campaignId: "160d7ffd-1d69-4848-b5e5-443eb5992dea"
+parentId: "160d7ffd-1d69-4848-b5e5-443eb5992dea"
+positionInParent: 0
+```
diff --git a/NonPlayerCharacters/Erulissen.md b/NonPlayerCharacters/Erulissen.md
index 5445a3a..0c90e64 100644
--- a/NonPlayerCharacters/Erulissen.md
+++ b/NonPlayerCharacters/Erulissen.md
@@ -1,5 +1,5 @@
---
-alias: []
+alias: ["Erulissen de la Maison Étoilée","Erulissen Arinwe"]
tags: []
race: elenion
class: Pègre
@@ -36,11 +36,13 @@ models:
```
---
### Non Player Character Notes
- - Erulissen ne désire pas etre sur les devants de la scéne, mais il sait que le pouvoir politique pourrait lui ouvrir enormement de portes. Avec
+ - Erulissen ne désire pas etre sur les devants de la scéne, mais il sait que le pouvoir politique pourrait lui ouvrir enormement de portes. Avec son groupe politique et son homme de main [[Zefyris]], ils tentent de prendre petit à petit le controle politique de la Cité.
+ - Son nom complet est Erulissen Arinwe, traduit de l'elfique en "Erulissen de la Maison Étoilée"
+ - Il a une soeur, [[Liréa Arinwe]]
### Non Player Character Story
- Erulissen est un élégant et fort jeune elenion du quartier de l’Étoile. Ce gracieux dandy au sourire doux et au regard froid est l’un des membres de plus haut rang d’[[Aïpio]], la guilde criminelle qui contrôle ce secteur.
- - Les elfes natifs de la Cité Franche sont rares – la plupart y viennent lors de leur grand voyage visant à découvrir le monde –, mais Erulissen est l’un d’eux. Il connaît le palais depuis son enfance, et ses parents désormais retournés en [[Ellerìna]], sont également impliqués dans les activités d’Aïpio.
+ - Les elfes natifs de la Cité Franche sont rares – la plupart y viennent lors de leur grand voyage visant à découvrir le monde –, mais Erulissen est l’un d’eux. Il connaît le palais depuis son enfance, et ses parents, de la maison Arinwe, désormais retournés en [[Ellerìna]], sont également impliqués dans les activités d’Aïpio.
- Le jeune homme se distingue par son ambition dévorante, une capacité de travail rare, et un perfectionnisme de la planification qui fait de lui un marionnettiste désireux de conquérir tout l’échiquier des ombres de la ville.
---
diff --git a/NonPlayerCharacters/Liréa Arinwe.md b/NonPlayerCharacters/Liréa Arinwe.md
new file mode 100644
index 0000000..f20e20f
--- /dev/null
+++ b/NonPlayerCharacters/Liréa Arinwe.md
@@ -0,0 +1,44 @@
+---
+alias: []
+tags: []
+---
+```RpgManagerData
+data:
+ synopsis: "La Soeur d'[[Erulissen]] et une artiste talentueuse, qui cherche avant tout à créer de l'émotion et de la beauté. Elle est très proche de son frère et de [[Zefyris]], mais elle reste indépendante et libre de ses choix."
+ death:
+ dob:
+ goals:
+ pronoun:
+ complete: false
+```
+```RpgManager
+models:
+ header: true
+ lists:
+ subplots:
+ pcs:
+ relationship: "unidirectional"
+ npcs:
+ relationship: "unidirectional"
+ factions:
+ locations:
+ events:
+ clues:
+```
+---
+### Non Player Character Notes
+ - Elle prie majoritairement [[Xonim]]
+
+### Non Player Character Story
+ -
+
+---
+```RpgManagerID
+### DO NOT EDIT MANUALLY IF NOT INSTRUCTED TO DO SO ###
+type: 64
+campaignSettings: 0
+id: "a6eea5b5-3b13-47d2-a24b-0e1e66cb1edd"
+campaignId: "160d7ffd-1d69-4848-b5e5-443eb5992dea"
+parentId: "160d7ffd-1d69-4848-b5e5-443eb5992dea"
+positionInParent: 0
+```
diff --git a/NonPlayerCharacters/Tamerakh.md b/NonPlayerCharacters/Tamerakh.md
new file mode 100644
index 0000000..dfe0323
--- /dev/null
+++ b/NonPlayerCharacters/Tamerakh.md
@@ -0,0 +1,44 @@
+---
+alias: []
+tags: []
+---
+```RpgManagerData
+data:
+ synopsis:
+ death:
+ dob:
+ goals:
+ pronoun:
+ complete: false
+```
+```RpgManager
+models:
+ header: true
+ lists:
+ subplots:
+ pcs:
+ relationship: "unidirectional"
+ npcs:
+ relationship: "unidirectional"
+ factions:
+ locations:
+ events:
+ clues:
+```
+---
+### Non Player Character Notes
+ -
+
+### Non Player Character Story
+ -
+
+---
+```RpgManagerID
+### DO NOT EDIT MANUALLY IF NOT INSTRUCTED TO DO SO ###
+type: 64
+campaignSettings: 0
+id: "4f46cd80-35d3-47a6-ae65-37108bc3e0b9"
+campaignId: "160d7ffd-1d69-4848-b5e5-443eb5992dea"
+parentId: "160d7ffd-1d69-4848-b5e5-443eb5992dea"
+positionInParent: 0
+```
diff --git a/NonPlayerCharacters/Xonim.md b/NonPlayerCharacters/Xonim.md
new file mode 100644
index 0000000..cba1ee4
--- /dev/null
+++ b/NonPlayerCharacters/Xonim.md
@@ -0,0 +1,57 @@
+---
+alias: ["Nuit","La Magicienne","La Dame","La Vigilante"]
+tags: []
+---
+```RpgManagerData
+data:
+ synopsis: "Xonim, également appelée la Dame de la Nuit, est une déesse récente (à l'échelle divine), mais qui a déjà indiscutablement posé sa marque sur le monde, avec un style particulier. Associée à la magie et aux ténébres, son culte tient son succès grace aux **Liens de Xonim**"
+ death:
+ dob:
+ goals:
+ pronoun:
+ complete: false
+ images:
+ - path: "https://www.worldanvil.com/media/cache/cover/uploads/images/e911fc29d8a7386aee8a9efcfaf07799.jpg"
+ caption: ""
+relationships:
+ - type: "bidirectional"
+ path: "Factions/Eglise de la Nuit.md"
+ description:
+```
+```RpgManager
+models:
+ header: true
+ lists:
+ subplots:
+ pcs:
+ relationship: "unidirectional"
+ npcs:
+ relationship: "unidirectional"
+ factions:
+ locations:
+ events:
+ clues:
+```
+---
+De son vivant, Xonim fut la mère du conquérant [[Tamerakh]], une magicienne et une femme politique avisée. Elle accéda à la divinité grâce à son fils qui vint la libérer du monde des morts. Dorénavant, elle est la déesse de la magie, de l’obscurité, des intrigues, de la beauté et de la richesse. Elle est connue pour son ambivalence et pour sa sympathie à l’égard des Tiefflin qu’elle protège, peu importe leurs actes. Politicienne avisée, elle a rendu son clergé indispensable en lui permettant de fabriquer les célèbres liens de Xonim, des chaînes qui privent les lanceurs de sort entravés de tout pouvoir.
+
+### Histoire Personnelle
+
+Mortelle, Xonim était une [Humaine](https://www.worldanvil.com/w/eana-lucasdlk/a/humains-species), prêtresse de [Mort](https://www.worldanvil.com/w/eana-lucasdlk/a/mort-person) et magicienne, initiée aux plus grands secrets du [Kaan](https://www.worldanvil.com/w/eana-lucasdlk/a/kaan-location). Visions et recherches lui permirent de comprendre la nature profonde du Destin. Ses études l’amenèrent à pousser le souverain [Orc](https://www.worldanvil.com/w/eana-lucasdlk/a/orcs-species), le puissant Khüch’adal, à faire d’elle sa troisième épouse et la mère de son cinquième enfant, celui qui deviendrait le seigneur de Horde et conquérant, [Tamerakh](https://www.worldanvil.com/w/eana-lucasdlk/a/tamerakh-person). Armée de sa maîtrise du chaos et des entrelacs de coïncidences qui forment le tissu emmêlé de la destinée, Xonim conseilla et guida Tamerakh sur le chemin de la gloire intemporelle. Tous deux connaissaient leur nature d’élus d’[Éternité](https://www.worldanvil.com/w/eana-lucasdlk/a/Eternite-location?preview=true) et la fragilité de ce don. Certaines exégèses des _Versets de Minuit_ estiment que certaines conquêtes furent motivées par la recherche d’antiques sites de pouvoir. La [Forge du Destin](https://www.worldanvil.com/w/eana-lucasdlk/a/forge-du-destin-item) était l’œuvre et l’instrument des [Voyageurs](https://www.worldanvil.com/w/eana-lucasdlk/a/voyageurs-species), il fallait comprendre leurs études sur la réalité, la volonté, l’inertie, les chaînes de causalité et la complexité de l’interdépendance pour être prêts à abattre la dernière limite : la mort elle-même. Xonim et Tamerakh se rendirent dans le [Septentrion](https://www.worldanvil.com/w/eana-lucasdlk/a/septentrion-location), ils traversèrent les [Drakenbergen](https://www.worldanvil.com/w/eana-lucasdlk/a/drakenbergen-location) et y demeurèrent trois hivers, laissant la suite de la conquête à leurs généraux. Ils avaient trouvé, ici, quelque part, des réponses à leurs questions. Elles existent toujours. La Dame n’a pas détruit la source de la connaissance. Elle l’a laissée pour ceux qui seraient assez persévérants, astucieux – et chanceux – pour la découvrir. Hélas, les efforts et les épreuves venaient à bout des forces de l’enveloppe charnelle de Xonim. Elle mourut avant de pouvoir retourner à [Mangulik](https://www.worldanvil.com/w/eana-lucasdlk/a/mangulik-settlement). Son fils, dans la force de l’âge et au sommet de sa gloire savait quoi faire dorénavant. Il jeta toutes ses forces dans cette nouvelle bataille. Maître d’un empire exceptionnel, il devait désormais vaincre le destin et la mort. Il se rendit sur Éternité, il traversa le labyrinthe, il accéda à la Forge, il devint un dieu. Cependant le fruit des années de travail de Xonim lui donnait un avantage qu’aucun mortel ni dieu n’a : il fut en mesure non seulement d’arracher la Dame à la mort, mais aussi de faire d’elle une déesse.
+
+### Réussites et Succès
+
+#### La rune de sang de Xonim
+
+ Déesse sorcière et maîtresse de la nuit, Xonim est réputée avoir étudié une forme de magie du sang durant son existence de mortelle. Les arcanistes lui prêtent une théorie sur la transformation de l’énergie radiante en énergie nécrotique par l’intermédiaire du sang. Grâce à cette rune de sang, il serait possible d’accomplir de puissants rites impliquant des sacrifices. Xonim aurait compilé le résultat de ses recherches dans un ouvrage nommé le _[Tome de l’Écarlate](https://www.worldanvil.com/w/eana-lucasdlk/a/tome-de-lE28099Ecarlate-item?preview=true)_, qui est aujourd’hui l’objet de bien des convoitises. La plupart des érudits n’ont accès qu’à des fragments de ce livre, mais les rumeurs les plus folles courent à son sujet. Certains sont ainsi convaincus que les vampires ont acquis leur nature par le « baiser de la dame », un rituel qui en serait issu. Certains cherchent ainsi l’Écarlate pour trouver un moyen de contrecarrer cette malédiction, d’autres pour en bénéficier à leur tour.
+---
+```RpgManagerID
+### DO NOT EDIT MANUALLY IF NOT INSTRUCTED TO DO SO ###
+type: 64
+campaignSettings: 0
+id: "6884bfa5-aab9-467e-bbe5-90410dba8a8a"
+campaignId: "160d7ffd-1d69-4848-b5e5-443eb5992dea"
+parentId: "160d7ffd-1d69-4848-b5e5-443eb5992dea"
+positionInParent: 0
+```
+[[Eglise de la Nuit|]]
diff --git a/NonPlayerCharacters/Zefyris.md b/NonPlayerCharacters/Zefyris.md
new file mode 100644
index 0000000..46b83c3
--- /dev/null
+++ b/NonPlayerCharacters/Zefyris.md
@@ -0,0 +1,56 @@
+---
+alias: []
+tags: []
+---
+```RpgManagerData
+data:
+ synopsis: "L'homme de main d'[[Erulissen]] et le leader politique des Elenions à [[L’Assemblée]]"
+ death:
+ dob:
+ goals: "- Accéder à [[La Main]]\n- Dominer les races inférieurs et assurer la suprématie elfique"
+ pronoun:
+ complete: false
+ images:
+ - path: "Illustrations/dai_lavellan_by_nanoetetsu_d8ajxjc-fullview.jpg"
+ caption: "dai lavellan, by nanoetetsu"
+relationships:
+ - type: "unidirectional"
+ path: "NonPlayerCharacters/Erulissen.md"
+ description:
+```
+```RpgManager
+models:
+ header: true
+ lists:
+ subplots:
+ pcs:
+ relationship: "unidirectional"
+ npcs:
+ relationship: "unidirectional"
+ factions:
+ locations:
+ events:
+ clues:
+```
+---
+### Non Player Character Notes
+ - N'a jamais mis les pieds en [[Ellerìna]], et ne l'avouera jamais ! Il fantasme complétement la grandeur de sa race.
+ - Est un mëlessë, mais ne supporte pas ce fait. Il sur-compense cet héritage en prônant la cause elfique jusqu'à l'extreme. Il rêve d'avoir un nom, et est secretement amoureux de la soeur d'[[Erulissen]] : [[]] . Il espere qu'apres tout ces services rendus, il pourra lui demander sa main.
+ - Les autres Elenions, et en particulier [[Erulissen]], ne veulent pas trop attirer l'attention. Aussi, avoir un elfe au sang chaud comme Zefyris est une aubaine, car tout les regards sont porté sur lui.
+
+### Non Player Character Story
+ - Zefyris a été élevé dans une famille elfique très traditionnelle et nationaliste, qui valorisait les traits physiques et culturels typiques de leur peuple, et qui méprisait les autres races. Zefyris a donc grandi en croyant que les elfes étaient supérieurs aux autres peuples, et que cela justifiait qu'ils occupent une place de choix dans la société. Il est convaincu que les elfes doivent être dirigés par des elfes, et que les autres races doivent être soumises à leur autorité. Cette conviction est renforcée par son fanatisme religieux, puisqu'il croit en [[Xonim|Nuit]], déesse de la magie et de la beauté, et particulièrement vénérée par les elfes.
+ - Zefyris a été éduqué dans la croyance que les elfes ont été choisis par Nuit pour être les gardiens et les maîtres de la magie, et que cela confère une responsabilité et une supériorité particulières à leur peuple. Selon lui, toute personne de race différente qui cherche à pratiquer la magie doit être empêchée et punie, car elle porte atteinte à la position privilégiée des elfes dans le monde. Il utilise donc sa position de bras droit d'[[Erulissen]] pour influencer les décisions politiques en faveur des elfes et s'opposer à toutes les actions qui pourraient nuire à leur hégémonie.
+ - En tant qu'adepte fanatique, il est prêt à tout pour défendre sa foi et ses convictions, même à recourir à la violence ou à la ruse. Cependant, il essaie de dissimuler sa véritable nature derrière un masque de courtoisie et de diplomatie, afin de ne pas se mettre à dos ses alliés et ses supérieurs.
+
+---
+```RpgManagerID
+### DO NOT EDIT MANUALLY IF NOT INSTRUCTED TO DO SO ###
+type: 64
+campaignSettings: 0
+id: "f5a10adc-9d9f-4b02-a381-6a925ae43e79"
+campaignId: "160d7ffd-1d69-4848-b5e5-443eb5992dea"
+parentId: "160d7ffd-1d69-4848-b5e5-443eb5992dea"
+positionInParent: 0
+```
+[[Erulissen|]]
diff --git a/NonPlayerCharacters/Zerka Valtor.md b/NonPlayerCharacters/Zerka Valtor.md
new file mode 100644
index 0000000..6df7afa
--- /dev/null
+++ b/NonPlayerCharacters/Zerka Valtor.md
@@ -0,0 +1,45 @@
+---
+alias: []
+tags: []
+race: nain
+---
+```RpgManagerData
+data:
+ synopsis:
+ death:
+ dob:
+ goals:
+ pronoun:
+ complete: false
+```
+```RpgManager
+models:
+ header: true
+ lists:
+ subplots:
+ pcs:
+ relationship: "unidirectional"
+ npcs:
+ relationship: "unidirectional"
+ factions:
+ locations:
+ events:
+ clues:
+```
+---
+### Non Player Character Notes
+ -
+
+### Non Player Character Story
+ -
+
+---
+```RpgManagerID
+### DO NOT EDIT MANUALLY IF NOT INSTRUCTED TO DO SO ###
+type: 64
+campaignSettings: 0
+id: "a2664262-ed02-4db8-bd1e-11e3d5bd205c"
+campaignId: "160d7ffd-1d69-4848-b5e5-443eb5992dea"
+parentId: "160d7ffd-1d69-4848-b5e5-443eb5992dea"
+positionInParent: 0
+```
diff --git a/Notes/Pistes - Idées.md b/Notes/Pistes - Idées.md
index c0eed64..182429b 100644
--- a/Notes/Pistes - Idées.md
+++ b/Notes/Pistes - Idées.md
@@ -53,7 +53,7 @@
- En chemin, ils découvriront un pays au bord de la guerre : les citoyens sont mécontents, l'armée est sans moyen, les cultes nihilistes s'en donnent à cœur joie et Kartaçol et l'Arolavie se disputent les territoires d'une terre qu'ils considèrent déjà perdu.
- Une fois à [[Krateira]], ils pourront aider l'une des factions en place :
- **Kartaçol**, qui a la main mise sur tout le sud-est du territoire et possède une ambassade à [[Krateira]]. Il cherche à prendre le pouvoir diplomatiquement
- - l'**Arolavie**, qui conteste le nord de la Cyrillanne à Kartaçol et cherche à interrompre l'expansion de [[Kartaçöl]].
+ - l'**Arolavie**, qui conteste le nord de la Cyrillanne à Kartaçol et cherche à interrompre l'expansion de [[Empire de Kartaçöl]].
- La **Rébellion**, mené dans l'ombre par [[Mégare de Cyrillanne]], qui cherche à renverser la dynastie Kadméïde et s'inspirer de la République afin d'asseoir un parlement citoyen a la tête du pays.
- Peu importe qui ils choisissent d'aider, une bataille éclate dans la capitale, et les membres de la famille royale sont exécutés. C'est la fin de la dynastie.
- Les répercussions de la bataille dépendent de qui les joueurs ont décidé d'aider, mais dans tout les cas, un énorme flot de réfugiés viendra trouver refuge dans la [[Cité Franche]], ce qui menera au [[Chapitre 2 - Mensonges]]. En effet, le flot migratoire entraînera une panique au sujet des éveillé non contrôlé et c'est Althéa qui proposera un fichage des éveillé. Un membre de la main assassiné et l'assemblé subjugué par ce deal, elle sera propulsé Absolue, afin de diriger cette crise sans précédent. #ch1/Cyrillanne
diff --git a/Scenes/Trouver la boite d'allumette.md b/Scenes/Trouver la boite d'allumette.md
index 32d8316..2edd553 100644
--- a/Scenes/Trouver la boite d'allumette.md
+++ b/Scenes/Trouver la boite d'allumette.md
@@ -5,7 +5,7 @@ tags: []
```RpgManagerData
data:
synopsis: "Trouver la [[Boite d'Allumette de l'Hydre Cristalline]] sur le corps de [[Derlynn Boyau-Gravier|Derlynn]]"
- complete: false
+ complete: true
sessionId: 0
action:
trigger: