diff --git a/.obsidian/plugins/better-export-pdf/main.js b/.obsidian/plugins/better-export-pdf/main.js index 927237da..49782061 100644 --- a/.obsidian/plugins/better-export-pdf/main.js +++ b/.obsidian/plugins/better-export-pdf/main.js @@ -19928,6 +19928,9 @@ function copyAttributes(node, attributes) { node.setAttribute(attr.name, attr.value); }); } +function isNumber(str) { + return !isNaN(parseFloat(str)); +} // src/pdf.ts async function getDestPosition(pdfDoc) { @@ -20154,27 +20157,31 @@ function setMetadata(pdfDoc, { title, author, keywords, subject, creator, create pdfDoc.setModificationDate(new Date(updated_at != null ? updated_at : /* @__PURE__ */ new Date())); } async function exportToPDF(outputFile, config, w, { doc, frontMatter }) { - var _a, _b, _c, _d, _e, _f, _g, _h, _i; + var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j; console.log("output pdf:", outputFile); let pageSize = config["pageSize"]; if (config["pageSize"] == "Custom" && config["pageWidth"] && config["pageHeight"]) { pageSize = { - width: parseFloat((_a = config["pageWidth"]) != null ? _a : "0") / 25.4, - height: parseFloat((_b = config["pageHeight"]) != null ? _b : "0") / 25.4 + width: parseFloat((_a = config["pageWidth"]) != null ? _a : "210") / 25.4, + height: parseFloat((_b = config["pageHeight"]) != null ? _b : "297") / 25.4 }; } + let scale2 = (_c = config == null ? void 0 : config["scale"]) != null ? _c : 100; + if (scale2 > 200 || scale2 < 10) { + scale2 = 100; + } const printOptions = { landscape: config == null ? void 0 : config["landscape"], printBackground: config == null ? void 0 : config["printBackground"], generateTaggedPDF: config == null ? void 0 : config["generateTaggedPDF"], pageSize, - scale: config["scale"] / 100, + scale: scale2 / 100, margins: { marginType: "default" }, displayHeaderFooter: config["displayHeader"] || config["displayFooter"], - headerTemplate: config["displayHeader"] ? (_c = frontMatter == null ? void 0 : frontMatter["headerTemplate"]) != null ? _c : config["headerTemplate"] : "", - footerTemplate: config["displayFooter"] ? (_d = frontMatter == null ? void 0 : frontMatter["footerTemplate"]) != null ? _d : config["footerTemplate"] : "" + headerTemplate: config["displayHeader"] ? (_d = frontMatter == null ? void 0 : frontMatter["headerTemplate"]) != null ? _d : config["headerTemplate"] : "", + footerTemplate: config["displayFooter"] ? (_e = frontMatter == null ? void 0 : frontMatter["footerTemplate"]) != null ? _e : config["footerTemplate"] : "" }; if (config.marginType == "0") { printOptions["margins"] = { @@ -20199,10 +20206,10 @@ async function exportToPDF(outputFile, config, w, { doc, frontMatter }) { } else if (config.marginType == "3") { printOptions["margins"] = { marginType: "custom", - top: parseFloat((_e = config["marginTop"]) != null ? _e : "0") / 25.4, - bottom: parseFloat((_f = config["marginBottom"]) != null ? _f : "0") / 25.4, - left: parseFloat((_g = config["marginLeft"]) != null ? _g : "0") / 25.4, - right: parseFloat((_h = config["marginRight"]) != null ? _h : "0") / 25.4 + top: parseFloat((_f = config["marginTop"]) != null ? _f : "0") / 25.4, + bottom: parseFloat((_g = config["marginBottom"]) != null ? _g : "0") / 25.4, + left: parseFloat((_h = config["marginLeft"]) != null ? _h : "0") / 25.4, + right: parseFloat((_i = config["marginRight"]) != null ? _i : "0") / 25.4 }; } try { @@ -20211,7 +20218,7 @@ async function exportToPDF(outputFile, config, w, { doc, frontMatter }) { headings: getHeadingTree(doc), frontMatter, displayMetadata: config == null ? void 0 : config.displayMetadata, - maxLevel: parseInt((_i = config == null ? void 0 : config.maxLevel) != null ? _i : "6") + maxLevel: parseInt((_j = config == null ? void 0 : config.maxLevel) != null ? _j : "6") }); await fs.writeFile(outputFile, data); if (config.open) { @@ -20308,6 +20315,11 @@ body { break-after: auto; } } + +img.__canvas__ { + width: 100% !important; + height: 100% !important; +} `; function getPatchStyle() { return [CSS_PATCH, ...getPrintStyle()]; @@ -20760,8 +20772,7 @@ ${px2mm(width)}\xD7${px2mm(height)}mm`; await this.appendWebviews(el); this.togglePrintSize(); }); - const contentEl = wrapper.createDiv(); - contentEl.setAttribute("style", "width:320px;margin-left:16px;"); + const contentEl = wrapper.createDiv({ attr: { class: "setting-wrapper" } }); contentEl.addEventListener("keyup", (event) => { if (event.key === "Enter") { handleExport(); @@ -20769,8 +20780,15 @@ ${px2mm(width)}\xD7${px2mm(height)}mm`; }); this.generateForm(contentEl); const handleExport = async () => { + var _a2, _b2; this.plugin.settings.prevConfig = this.config; await this.plugin.saveSettings(); + if (this.config["pageSize"] == "Custom") { + if (!isNumber((_a2 = this.config["pageWidth"]) != null ? _a2 : "") || !isNumber((_b2 = this.config["pageHeight"]) != null ? _b2 : "")) { + alert("When the page size is Custom, the Width/Height cannot be empty."); + return; + } + } if (this.multiplePdf) { const outputPath = await getOutputPath(title); console.log("output:", outputPath); diff --git a/.obsidian/plugins/better-export-pdf/manifest.json b/.obsidian/plugins/better-export-pdf/manifest.json index e74b4ebc..13e08e0b 100644 --- a/.obsidian/plugins/better-export-pdf/manifest.json +++ b/.obsidian/plugins/better-export-pdf/manifest.json @@ -1,7 +1,7 @@ { "id": "better-export-pdf", "name": "Better Export PDF", - "version": "1.10.0", + "version": "1.10.2", "minAppVersion": "0.15.0", "description": "Export your notes to PDF, support export preview, add bookmarks outline and header/footer.", "author": "l1xnan", diff --git a/.obsidian/plugins/better-export-pdf/styles.css b/.obsidian/plugins/better-export-pdf/styles.css index 1ae02d66..6c7d758b 100644 --- a/.obsidian/plugins/better-export-pdf/styles.css +++ b/.obsidian/plugins/better-export-pdf/styles.css @@ -50,3 +50,12 @@ height: 100%; width: 100%; } + +#better-export-pdf .setting-wrapper { + width: 320px; + margin-left: 16px; +} + +#better-export-pdf .setting-wrapper .setting-item[hidden] { + display: none; +} diff --git a/.obsidian/plugins/consistent-attachments-and-links/main.js b/.obsidian/plugins/consistent-attachments-and-links/main.js index d5d5e500..0ecdc5a5 100644 --- a/.obsidian/plugins/consistent-attachments-and-links/main.js +++ b/.obsidian/plugins/consistent-attachments-and-links/main.js @@ -3,85 +3,149 @@ THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source, please visit the github repository of this plugin */ -function __extractDefault(module2) { +(function initCjs() { + const globalThisRecord = globalThis; + globalThisRecord["__name"] ??= name; + const originalRequire = require; + if (originalRequire && !originalRequire.__isPatched) { + require = Object.assign( + (id) => requirePatched(id), + originalRequire, + { + __isPatched: true + } + ); + } + const newFuncs = { + __extractDefault: () => extractDefault, + process: () => { + const browserProcess = { + browser: true, + cwd: () => "/", + env: {}, + platform: "android" + }; + return browserProcess; + } + }; + for (const key of Object.keys(newFuncs)) { + globalThisRecord[key] ??= newFuncs[key]?.(); + } + function name(obj) { + return obj; + } + function extractDefault(module2) { return module2 && module2.__esModule && module2.default ? module2.default : module2; } + function requirePatched(id) { + const module2 = originalRequire?.(id); + if (module2) { + return extractDefault(module2); + } + if (id === "process" || id === "node:process") { + console.error(`Module not found: ${id}. Fake process object is returned instead.`); + return globalThis.process; + } + console.error(`Module not found: ${id}. Empty object is returned instead.`); + return {}; + } +})(); -(function patchRequireEsmDefault() { - const __require = require; - require = Object.assign((id) => { - const module2 = __require(id) ?? {}; - return __extractDefault(module2); - }, __require); - })() - -"use strict";var Rh=Object.create;var xr=Object.defineProperty;var Dh=Object.getOwnPropertyDescriptor;var Mh=Object.getOwnPropertyNames;var jh=Object.getPrototypeOf,Bh=Object.prototype.hasOwnProperty;var b=(e,t)=>()=>(e&&(t=e(e=0)),t);var N=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),_r=(e,t)=>{for(var r in t)xr(e,r,{get:t[r],enumerable:!0})},ja=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Mh(t))!Bh.call(e,i)&&i!==r&&xr(e,i,{get:()=>t[i],enumerable:!(n=Dh(t,i))||n.enumerable});return e};var H=(e,t,r)=>(r=e!=null?Rh(jh(e)):{},ja(t||!e||!e.__esModule?xr(r,"default",{value:e,enumerable:!0}):r,e)),Vn=e=>ja(xr({},"__esModule",{value:!0}),e);var ot=N((sC,za)=>{function zh(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return zh(n)},t)})();var Wn=Object.defineProperty,Vh=Object.getOwnPropertyDescriptor,Wh=Object.getOwnPropertyNames,Uh=Object.prototype.hasOwnProperty,Hh=(e,t)=>{for(var r in t)Wn(e,r,{get:t[r],enumerable:!0})},$h=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Wh(t))!Uh.call(e,i)&&i!==r&&Wn(e,i,{get:()=>t[i],enumerable:!(n=Vh(t,i))||n.enumerable});return e},Gh=e=>$h(Wn({},"__esModule",{value:!0}),e),Ba={};Hh(Ba,{noop:()=>Jh,noopAsync:()=>Qh,omitAsyncReturnType:()=>Yh,omitReturnType:()=>Kh});za.exports=Gh(Ba);function Jh(){}async function Qh(){}function Yh(e){return async(...t)=>{await e(...t)}}function Kh(e){return(...t)=>{e(...t)}}});var Ct=N((lC,Ha)=>{"use strict";var Un=Object.defineProperty,Xh=Object.getOwnPropertyDescriptor,Zh=Object.getOwnPropertyNames,ed=Object.prototype.hasOwnProperty,td=(e,t)=>{for(var r in t)Un(e,r,{get:t[r],enumerable:!0})},rd=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Zh(t))!ed.call(e,i)&&i!==r&&Un(e,i,{get:()=>t[i],enumerable:!(n=Xh(t,i))||n.enumerable});return e},nd=e=>rd(Un({},"__esModule",{value:!0}),e),Va={};td(Va,{CustomArrayDictImpl:()=>dd,FileExtension:()=>cd,InternalPluginName:()=>He,ViewType:()=>J,createTFileInstance:()=>md,createTFolderInstance:()=>Gn,getAllPropertiesViewConstructor:()=>gd,getAppConstructor:()=>od,getAudioViewConstructor:()=>Ed,getBacklinkViewConstructor:()=>Dd,getBookmarksViewConstructor:()=>Pd,getBrowserHistoryViewConstructor:()=>qd,getBrowserViewConstructor:()=>vd,getCanvasViewConstructor:()=>wd,getEmptyViewConstructor:()=>Ad,getFileExplorerViewConstructor:()=>kd,getFilePropertiesViewConstructor:()=>Cd,getGraphViewConstructor:()=>Ld,getImageViewConstructor:()=>Id,getInternalPluginConstructor:()=>ud,getInternalPluginsConstructor:()=>sd,getLocalGraphViewConstructor:()=>Td,getMarkdownViewConstructor:()=>bd,getOutgoingLinkViewConstructor:()=>yd,getOutlineViewConstructor:()=>Sd,getPdfViewConstructor:()=>xd,getReleaseNotesViewConstructor:()=>Rd,getSearchViewConstructor:()=>_d,getSyncViewConstructor:()=>Nd,getTFileConstructor:()=>Ua,getTFolderConstructor:()=>Wa,getTagViewConstructor:()=>Fd,getVideoViewConstructor:()=>Od,getViewConstructorByViewType:()=>Q,isEmbedCache:()=>pd,isFrontmatterLinkCache:()=>hd,isLinkCache:()=>fd,isReferenceCache:()=>Hn,parentFolderPath:()=>$n});Ha.exports=nd(Va);var id=require("obsidian");function od(){return id.App}var ad=require("obsidian");function Wa(){return ad.TFolder}function sd(e){return e.internalPlugins.constructor}var ld=require("obsidian");function Ua(){return ld.TFile}function ud(e){let t=Object.values(e.internalPlugins.plugins)[0];if(!t)throw new Error("No internal plugin found");return t.constructor}var He={AudioRecorder:"audio-recorder",Backlink:"backlink",Bookmarks:"bookmarks",Browser:"browser",Canvas:"canvas",CommandPalette:"command-palette",DailyNotes:"daily-notes",EditorStatus:"editor-status",FileExplorer:"file-explorer",FileRecovery:"file-recovery",GlobalSearch:"global-search",Graph:"graph",MarkdownImporter:"markdown-importer",NoteComposer:"note-composer",OutgoingLink:"outgoing-link",Outline:"outline",PagePreview:"page-preview",Properties:"properties",Publish:"publish",RandomNote:"random-note",SlashCommand:"slash-command",Slides:"slides",Switcher:"switcher",Sync:"sync",TagPane:"tag-pane",Templates:"templates",WordCount:"word-count",Workspaces:"workspaces",ZkPrefixer:"zk-prefixer"},cd={_3gp:"3gp",avif:"avif",bmp:"bmp",canvas:"canvas",flac:"flac",gif:"gif",jpeg:"jpeg",jpg:"jpg",m4a:"m4a",md:"md",mkv:"mkv",mov:"mov",mp3:"mp3",mp4:"mp4",oga:"oga",ogg:"ogg",ogv:"ogv",opus:"opus",pdf:"pdf",png:"png",svg:"svg",wav:"wav",webm:"webm",webp:"webp"},J={AllProperties:"all-properties",Audio:"audio",Backlink:He.Backlink,Bookmarks:He.Bookmarks,Browser:"browser",BrowserHistory:"browser-history",Canvas:He.Canvas,Empty:"empty",FileExplorer:He.FileExplorer,FileProperties:"file-properties",Graph:He.Graph,Image:"image",LocalGraph:"localgraph",Markdown:"markdown",OutgoingLink:He.OutgoingLink,Outline:He.Outline,Pdf:"pdf",ReleaseNotes:"release-notes",Search:"search",Sync:"sync",Tag:"tag",Video:"video"};function Hn(e){return!!e.position}function fd(e){return Hn(e)&&e.original[0]!=="!"}function pd(e){return Hn(e)&&e.original[0]==="!"}function hd(e){return!!e.key}var dd=class{data=new Map;add(e,t){let r=this.get(e);r||(r=[],this.data.set(e,r)),r.includes(t)||r.push(t)}remove(e,t){let r=this.get(e);r&&(r.remove(t),r.length===0&&this.clear(e))}get(e){return this.data.get(e)||null}keys(){return Array.from(this.data.keys())}clear(e){this.data.delete(e)}clearAll(){this.data.clear()}contains(e,t){return!!this.get(e)?.contains(t)}count(){let e=0;for(let t in this.keys())e+=this.get(t)?.length??0;return e}};function $n(e){return e.replace(/\/?[^\/]*$/,"")||"/"}function Gn(e,t){let r=e.vault.getFolderByPath(t);return r||(r=new(Wa())(e.vault,t),r.parent=Gn(e,$n(t)),r.deleted=!0,r)}function md(e,t){let r=e.vault.getFileByPath(t);return r||(r=new(Ua())(e.vault,t),r.parent=Gn(e,$n(t)),r.deleted=!0,r)}function Q(e,t){let r=e.workspace.createLeafInTabGroup();try{let n=e.viewRegistry.getViewCreatorByType(t);if(!n)throw new Error("View creator not found");return n(r).constructor}finally{r.detach()}}function gd(e){return Q(e,J.AllProperties)}function bd(e){return Q(e,J.Markdown)}function wd(e){return Q(e,J.Canvas)}function kd(e){return Q(e,J.FileExplorer)}function yd(e){return Q(e,J.OutgoingLink)}function vd(e){return Q(e,J.Browser)}function xd(e){return Q(e,J.Pdf)}function _d(e){return Q(e,J.Search)}function Cd(e){return Q(e,J.FileProperties)}function Pd(e){return Q(e,J.Bookmarks)}function Ad(e){return Q(e,J.Empty)}function Ed(e){return Q(e,J.Audio)}function Sd(e){return Q(e,J.Outline)}function Fd(e){return Q(e,J.Tag)}function Od(e){return Q(e,J.Video)}function Ld(e){return Q(e,J.Graph)}function Td(e){return Q(e,J.LocalGraph)}function Id(e){return Q(e,J.Image)}function qd(e){return Q(e,J.BrowserHistory)}function Nd(e){return Q(e,J.Sync)}function Rd(e){return Q(e,J.ReleaseNotes)}function Dd(e){return Q(e,J.Backlink)}});var Ja=N((cC,Ga)=>{var Md=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"};function Ie(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function $a(e,t){for(var r="",n=0,i=-1,o=0,a,s=0;s<=e.length;++s){if(s2){var l=r.lastIndexOf("/");if(l!==r.length-1){l===-1?(r="",n=0):(r=r.slice(0,l),n=r.length-1-r.lastIndexOf("/")),i=s,o=0;continue}}else if(r.length===2||r.length===1){r="",n=0,i=s,o=0;continue}}t&&(r.length>0?r+="/..":r="..",n=2)}else r.length>0?r+="/"+e.slice(i+1,s):r=e.slice(i+1,s),n=s-i-1;i=s,o=0}else a===46&&o!==-1?++o:o=-1}return r}function jd(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+e+n:n}var Pt={resolve:function(){for(var t="",r=!1,n,i=arguments.length-1;i>=-1&&!r;i--){var o;i>=0?o=arguments[i]:(n===void 0&&(n=Md.cwd()),o=n),Ie(o),o.length!==0&&(t=o+"/"+t,r=o.charCodeAt(0)===47)}return t=$a(t,!r),r?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(Ie(t),t.length===0)return".";var r=t.charCodeAt(0)===47,n=t.charCodeAt(t.length-1)===47;return t=$a(t,!r),t.length===0&&!r&&(t="."),t.length>0&&n&&(t+="/"),r?"/"+t:t},isAbsolute:function(t){return Ie(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,r=0;r0&&(t===void 0?t=n:t+="/"+n)}return t===void 0?".":Pt.normalize(t)},relative:function(t,r){if(Ie(t),Ie(r),t===r||(t=Pt.resolve(t),r=Pt.resolve(r),t===r))return"";for(var n=1;nc){if(r.charCodeAt(a+f)===47)return r.slice(a+f+1);if(f===0)return r.slice(a+f)}else o>c&&(t.charCodeAt(n+f)===47?u=f:f===0&&(u=0));break}var p=t.charCodeAt(n+f),h=r.charCodeAt(a+f);if(p!==h)break;p===47&&(u=f)}var w="";for(f=n+u+1;f<=i;++f)(f===i||t.charCodeAt(f)===47)&&(w.length===0?w+="..":w+="/..");return w.length>0?w+r.slice(a+u):(a+=u,r.charCodeAt(a)===47&&++a,r.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(Ie(t),t.length===0)return".";for(var r=t.charCodeAt(0),n=r===47,i=-1,o=!0,a=t.length-1;a>=1;--a)if(r=t.charCodeAt(a),r===47){if(!o){i=a;break}}else o=!1;return i===-1?n?"/":".":n&&i===1?"//":t.slice(0,i)},basename:function(t,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');Ie(t);var n=0,i=-1,o=!0,a;if(r!==void 0&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var s=r.length-1,l=-1;for(a=t.length-1;a>=0;--a){var c=t.charCodeAt(a);if(c===47){if(!o){n=a+1;break}}else l===-1&&(o=!1,l=a+1),s>=0&&(c===r.charCodeAt(s)?--s===-1&&(i=a):(s=-1,i=l))}return n===i?i=l:i===-1&&(i=t.length),t.slice(n,i)}else{for(a=t.length-1;a>=0;--a)if(t.charCodeAt(a)===47){if(!o){n=a+1;break}}else i===-1&&(o=!1,i=a+1);return i===-1?"":t.slice(n,i)}},extname:function(t){Ie(t);for(var r=-1,n=0,i=-1,o=!0,a=0,s=t.length-1;s>=0;--s){var l=t.charCodeAt(s);if(l===47){if(!o){n=s+1;break}continue}i===-1&&(o=!1,i=s+1),l===46?r===-1?r=s:a!==1&&(a=1):r!==-1&&(a=-1)}return r===-1||i===-1||a===0||a===1&&r===i-1&&r===n+1?"":t.slice(r,i)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return jd("/",t)},parse:function(t){Ie(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return r;var n=t.charCodeAt(0),i=n===47,o;i?(r.root="/",o=1):o=0;for(var a=-1,s=0,l=-1,c=!0,u=t.length-1,f=0;u>=o;--u){if(n=t.charCodeAt(u),n===47){if(!c){s=u+1;break}continue}l===-1&&(c=!1,l=u+1),n===46?a===-1?a=u:f!==1&&(f=1):a!==-1&&(f=-1)}return a===-1||l===-1||f===0||f===1&&a===l-1&&a===s+1?l!==-1&&(s===0&&i?r.base=r.name=t.slice(1,l):r.base=r.name=t.slice(s,l)):(s===0&&i?(r.name=t.slice(1,a),r.base=t.slice(1,l)):(r.name=t.slice(s,a),r.base=t.slice(s,l)),r.ext=t.slice(a,l)),s>0?r.dir=t.slice(0,s-1):i&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};Pt.posix=Pt;Ga.exports=Pt});var Ya=N((fC,Jn)=>{"use strict";var Bd=Object.prototype.hasOwnProperty,fe="~";function Ut(){}Object.create&&(Ut.prototype=Object.create(null),new Ut().__proto__||(fe=!1));function zd(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function Qa(e,t,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var o=new zd(r,n||e,i),a=fe?fe+t:t;return e._events[a]?e._events[a].fn?e._events[a]=[e._events[a],o]:e._events[a].push(o):(e._events[a]=o,e._eventsCount++),e}function Cr(e,t){--e._eventsCount===0?e._events=new Ut:delete e._events[t]}function ae(){this._events=new Ut,this._eventsCount=0}ae.prototype.eventNames=function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)Bd.call(r,n)&&t.push(fe?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};ae.prototype.listeners=function(t){var r=fe?fe+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,a=new Array(o);i{function Vd(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return Vd(n)},t)})();var Qn=Object.defineProperty,Wd=Object.getOwnPropertyDescriptor,Ud=Object.getOwnPropertyNames,Hd=Object.prototype.hasOwnProperty,$d=(e,t)=>{for(var r in t)Qn(e,r,{get:t[r],enumerable:!0})},Gd=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ud(t))!Hd.call(e,i)&&i!==r&&Qn(e,i,{get:()=>t[i],enumerable:!(n=Wd(t,i))||n.enumerable});return e},Jd=e=>Gd(Qn({},"__esModule",{value:!0}),e),Ka={};$d(Ka,{emitAsyncErrorEvent:()=>Yd,errorToString:()=>Kd,getStackTrace:()=>Xd,printError:()=>Xa,registerAsyncErrorEventHandler:()=>Zd,throwExpression:()=>em});Za.exports=Jd(Ka);var Qd=Ya(),Pr="asyncError",Ar=new Qd.EventEmitter;Ar.on(Pr,tm);function Yd(e){Ar.emit(Pr,e)}function Kd(e){return Yn(e).map(t=>" ".repeat(t.level)+t.message).join(` -`)}function Xd(e=0){return(new Error().stack??"").split(` -`).slice(e+2).join(` -`)}function Xa(e){let t=Yn(e);for(let r of t)r.shouldClearAnsiSequence?console.error(`\x1B[0m${r.message}\x1B[0m`):console.error(r.message)}function Zd(e){return Ar.on(Pr,e),()=>Ar.off(Pr,e)}function em(e){throw e}function tm(e){Xa(new Error("An unhandled error occurred executing async operation",{cause:e}))}function Yn(e,t=0,r=[]){if(e===void 0)return r;if(!(e instanceof Error)){let i="";return e===null?i="(null)":typeof e=="string"?i=e:i=JSON.stringify(e),r.push({level:t,message:i}),r}let n=`${e.name}: ${e.message}`;if(r.push({level:t,message:n,shouldClearAnsiSequence:!0}),e.stack){let i=e.stack.startsWith(n)?e.stack.slice(n.length+1):e.stack;r.push({level:t,message:`Error stack: -${i}`})}return e.cause!==void 0&&(r.push({level:t,message:"Caused by:"}),Yn(e.cause,t+1,r)),r}});var Er=N((hC,ts)=>{function rm(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return rm(n)},t)})();var Kn=Object.defineProperty,nm=Object.getOwnPropertyDescriptor,im=Object.getOwnPropertyNames,om=Object.prototype.hasOwnProperty,am=(e,t)=>{for(var r in t)Kn(e,r,{get:t[r],enumerable:!0})},sm=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of im(t))!om.call(e,i)&&i!==r&&Kn(e,i,{get:()=>t[i],enumerable:!(n=nm(t,i))||n.enumerable});return e},lm=e=>sm(Kn({},"__esModule",{value:!0}),e),es={};am(es,{escapeRegExp:()=>um,isValidRegExp:()=>cm});ts.exports=lm(es);function um(e){return e.replaceAll(/[.*+?^${}()|[\]\\]/g,"\\$&")}function cm(e){try{return new RegExp(e),!0}catch{return!1}}});var Sr=N((dC,ns)=>{function fm(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return fm(n)},t)})();var Xn=Object.defineProperty,pm=Object.getOwnPropertyDescriptor,hm=Object.getOwnPropertyNames,dm=Object.prototype.hasOwnProperty,mm=(e,t)=>{for(var r in t)Xn(e,r,{get:t[r],enumerable:!0})},gm=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of hm(t))!dm.call(e,i)&&i!==r&&Xn(e,i,{get:()=>t[i],enumerable:!(n=pm(t,i))||n.enumerable});return e},bm=e=>gm(Xn({},"__esModule",{value:!0}),e),rs={};mm(rs,{resolveValue:()=>wm});ns.exports=bm(rs);async function wm(e,...t){return km(e)?await e(...t):e}function km(e){return typeof e=="function"}});var At=N((mC,ls)=>{function ym(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return ym(n)},t)})();var Zn=Object.defineProperty,vm=Object.getOwnPropertyDescriptor,xm=Object.getOwnPropertyNames,_m=Object.prototype.hasOwnProperty,Cm=(e,t)=>{for(var r in t)Zn(e,r,{get:t[r],enumerable:!0})},Pm=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of xm(t))!_m.call(e,i)&&i!==r&&Zn(e,i,{get:()=>t[i],enumerable:!(n=vm(t,i))||n.enumerable});return e},Am=e=>Pm(Zn({},"__esModule",{value:!0}),e),is={};Cm(is,{ensureEndsWith:()=>Fm,ensureStartsWith:()=>Om,escape:()=>Lm,insertAt:()=>Tm,makeValidVariableName:()=>Im,normalize:()=>qm,replace:()=>ei,replaceAllAsync:()=>Nm,trimEnd:()=>Rm,trimStart:()=>Dm,unescape:()=>Mm});ls.exports=Am(is);var os=ze(),Em=Er(),Sm=Sr(),as={"\n":"\\n","\r":"\\r"," ":"\\t","\b":"\\b","\f":"\\f","'":"\\'",'"':'\\"',"\\":"\\\\"},ss={};for(let[e,t]of Object.entries(as))ss[t]=e;function Fm(e,t){return e.endsWith(t)?e:e+t}function Om(e,t){return e.startsWith(t)?e:t+e}function Lm(e){return ei(e,as)}function Tm(e,t,r,n){return n??=r,e.slice(0,r)+t+e.slice(n)}function Im(e){return e.replace(/[^a-zA-Z0-9_]/g,"_")}function qm(e){return e.replace(/\u00A0|\u202F/g," ").normalize("NFC")}function ei(e,t){let r=new RegExp(Object.keys(t).map(n=>(0,Em.escapeRegExp)(n)).join("|"),"g");return e.replaceAll(r,n=>t[n]??(0,os.throwExpression)(new Error(`Unexpected replacement source: ${n}`)))}async function Nm(e,t,r){let n=[];e.replaceAll(t,(o,...a)=>(n.push((0,Sm.resolveValue)(r,o,...a)),o));let i=await Promise.all(n);return e.replaceAll(t,()=>i.shift()??(0,os.throwExpression)(new Error("Unexpected empty replacement")))}function Rm(e,t,r){if(e.endsWith(t))return e.slice(0,-t.length);if(r)throw new Error(`String ${e} does not end with suffix ${t}`);return e}function Dm(e,t,r){if(e.startsWith(t))return e.slice(t.length);if(r)throw new Error(`String ${e} does not start with prefix ${t}`);return e}function Mm(e){return ei(e,ss)}});var Ve=N((gC,bs)=>{function us(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return us(n)},t)})();var jm=Object.create,Fr=Object.defineProperty,Bm=Object.getOwnPropertyDescriptor,zm=Object.getOwnPropertyNames,Vm=Object.getPrototypeOf,Wm=Object.prototype.hasOwnProperty,Um=(e,t)=>{for(var r in t)Fr(e,r,{get:t[r],enumerable:!0})},cs=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of zm(t))!Wm.call(e,i)&&i!==r&&Fr(e,i,{get:()=>t[i],enumerable:!(n=Bm(t,i))||n.enumerable});return e},Hm=(e,t,r)=>(r=e!=null?jm(Vm(e)):{},cs(t||!e||!e.__esModule?Fr(r,"default",{value:e,enumerable:!0}):r,e)),$m=e=>cs(Fr({},"__esModule",{value:!0}),e),fs={};Um(fs,{basename:()=>Ym,delimiter:()=>Jm,dirname:()=>ds,extname:()=>Km,format:()=>Xm,getDirname:()=>ig,getFilename:()=>ms,isAbsolute:()=>Zm,join:()=>eg,makeFileName:()=>og,normalize:()=>tg,normalizeIfRelative:()=>ag,parse:()=>rg,posix:()=>Ae,relative:()=>ng,resolve:()=>gs,sep:()=>Qm,toPosixBuffer:()=>sg,toPosixPath:()=>ti});bs.exports=$m(fs);var ps=Hm(us(Ja()),1),Gm=At(),hs=/[a-zA-Z]:\/[^:]*$/,Ae=ps.default.posix,Jm=Ae.delimiter,Qm=ps.default.posix.sep,Ym=Ae.basename,ds=Ae.dirname,Km=Ae.extname,Xm=Ae.format;function Zm(e){return Ae.isAbsolute(e)||hs.exec(e)?.[0]===e}var eg=Ae.join,tg=Ae.normalize,rg=Ae.parse,ng=Ae.relative;function ig(e){return ds(ms(e))}function ms(e){return gs(new URL(e).pathname)}function og(e,t){return t?`${e}.${t}`:e}function ag(e){return e.startsWith("/")||e.includes(":")?e:(0,Gm.ensureStartsWith)(e,"./")}function gs(...e){let t=Ae.resolve(...e);return t=ti(t),hs.exec(t)?.[0]??t}function sg(e){return Buffer.from(ti(e.toString()))}function ti(e){return e.replace(/\\/g,"/")}});var Oe=N((bC,Es)=>{function lg(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return lg(n)},t)})();var ri=Object.defineProperty,ug=Object.getOwnPropertyDescriptor,cg=Object.getOwnPropertyNames,fg=Object.prototype.hasOwnProperty,pg=(e,t)=>{for(var r in t)ri(e,r,{get:t[r],enumerable:!0})},hg=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of cg(t))!fg.call(e,i)&&i!==r&&ri(e,i,{get:()=>t[i],enumerable:!(n=ug(t,i))||n.enumerable});return e},dg=e=>hg(ri({},"__esModule",{value:!0}),e),ks={};pg(ks,{CANVAS_FILE_EXTENSION:()=>vs,MARKDOWN_FILE_EXTENSION:()=>ii,checkExtension:()=>oi,getAbstractFile:()=>gg,getAbstractFileOrNull:()=>Gt,getFile:()=>bg,getFileOrNull:()=>Or,getFolder:()=>xs,getFolderOrNull:()=>ai,getMarkdownFiles:()=>wg,getOrCreateFile:()=>kg,getOrCreateFolder:()=>_s,getPath:()=>yg,isAbstractFile:()=>si,isCanvasFile:()=>Cs,isFile:()=>li,isFolder:()=>Ps,isMarkdownFile:()=>Ht,isNote:()=>vg,trimMarkdownExtension:()=>xg});Es.exports=dg(ks);var $t=require("obsidian"),ni=Ct(),ys=Ve(),mg=At(),ii="md",vs="canvas";function oi(e,t,r){if(li(t))return t.extension===r;if(typeof t=="string"){let n=Or(e,t);return n?n.extension===r:(0,ys.extname)(t).slice(1)===r}return!1}function gg(e,t,r){let n=Gt(e,t,r);if(!n)throw new Error(`Abstract file not found: ${t}`);return n}function Gt(e,t,r){if(t===null)return null;if(si(t))return t;let n=ws(e,t,r);if(n)return n;let i=As(t);return i===t?null:ws(e,i,r)}function bg(e,t,r,n){let i=Or(e,t,n);if(!i)if(r)i=(0,ni.createTFileInstance)(e,t);else throw new Error(`File not found: ${t}`);return i}function Or(e,t,r){let n=Gt(e,t,r);return li(n)?n:null}function xs(e,t,r,n){let i=ai(e,t,n);if(!i)if(r)i=(0,ni.createTFolderInstance)(e,t);else throw new Error(`Folder not found: ${t}`);return i}function ai(e,t,r){let n=Gt(e,t,r);return Ps(n)?n:null}function wg(e,t,r){let n=xs(e,t),i=[];return r?$t.Vault.recurseChildren(n,o=>{Ht(e,o)&&i.push(o)}):i=n.children.filter(o=>Ht(e,o)),i=i.sort((o,a)=>o.path.localeCompare(a.path)),i}async function kg(e,t){let r=Or(e,t);if(r)return r;let n=(0,ni.parentFolderPath)(t);return await _s(e,n),await e.vault.create(t,"")}async function _s(e,t){let r=ai(e,t);return r||await e.vault.createFolder(t)}function yg(e,t){if(si(t))return t.path;let r=Gt(e,t);return r?r.path:As(t)}function si(e){return e instanceof $t.TAbstractFile}function Cs(e,t){return oi(e,t,vs)}function li(e){return e instanceof $t.TFile}function Ps(e){return e instanceof $t.TFolder}function Ht(e,t){return oi(e,t,ii)}function vg(e,t){return Ht(e,t)||Cs(e,t)}function xg(e,t){return Ht(e,t)?(0,mg.trimEnd)(t.path,"."+ii):t.path}function ws(e,t,r){return r?e.vault.getAbstractFileByPathInsensitive(t):e.vault.getAbstractFileByPath(t)}function As(e){return(0,$t.normalizePath)((0,ys.resolve)("/",e))}});var Fs=N((wC,Ss)=>{var Et=1e3,St=Et*60,Ft=St*60,at=Ft*24,_g=at*7,Cg=at*365.25;Ss.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return Pg(e);if(r==="number"&&isFinite(e))return t.long?Eg(e):Ag(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Pg(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Cg;case"weeks":case"week":case"w":return r*_g;case"days":case"day":case"d":return r*at;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Ft;case"minutes":case"minute":case"mins":case"min":case"m":return r*St;case"seconds":case"second":case"secs":case"sec":case"s":return r*Et;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function Ag(e){var t=Math.abs(e);return t>=at?Math.round(e/at)+"d":t>=Ft?Math.round(e/Ft)+"h":t>=St?Math.round(e/St)+"m":t>=Et?Math.round(e/Et)+"s":e+"ms"}function Eg(e){var t=Math.abs(e);return t>=at?Lr(e,t,at,"day"):t>=Ft?Lr(e,t,Ft,"hour"):t>=St?Lr(e,t,St,"minute"):t>=Et?Lr(e,t,Et,"second"):e+" ms"}function Lr(e,t,r,n){var i=t>=r*1.5;return Math.round(e/r)+" "+n+(i?"s":"")}});var ui=N((kC,Os)=>{function Sg(e){r.debug=r,r.default=r,r.coerce=l,r.disable=a,r.enable=i,r.enabled=s,r.humanize=Fs(),r.destroy=c,Object.keys(e).forEach(u=>{r[u]=e[u]}),r.names=[],r.skips=[],r.formatters={};function t(u){let f=0;for(let p=0;p{if(v==="%%")return"%";V++;let D=r.formatters[q];if(typeof D=="function"){let O=x[V];v=D.call(k,O),x.splice(V,1),V--}return v}),r.formatArgs.call(k,x),(k.log||r.log).apply(k,x)}return g.namespace=u,g.useColors=r.useColors(),g.color=r.selectColor(u),g.extend=n,g.destroy=r.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(h!==r.namespaces&&(h=r.namespaces,w=r.enabled(u)),w),set:x=>{p=x}}),typeof r.init=="function"&&r.init(g),g}function n(u,f){let p=r(this.namespace+(typeof f>"u"?":":f)+u);return p.log=this.log,p}function i(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let f=(typeof u=="string"?u:"").trim().replace(" ",",").split(",").filter(Boolean);for(let p of f)p[0]==="-"?r.skips.push(p.slice(1)):r.names.push(p)}function o(u,f){let p=0,h=0,w=-1,g=0;for(;p"-"+f)].join(",");return r.enable(""),u}function s(u){for(let f of r.skips)if(o(u,f))return!1;for(let f of r.names)if(o(u,f))return!0;return!1}function l(u){return u instanceof Error?u.stack||u.message:u}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}Os.exports=Sg});var Ls=N((ye,Tr)=>{var ci=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"};ye.formatArgs=Og;ye.save=Lg;ye.load=Tg;ye.useColors=Fg;ye.storage=Ig();ye.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();ye.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Fg(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Og(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+Tr.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),e.splice(n,0,t)}ye.log=console.debug||console.log||(()=>{});function Lg(e){try{e?ye.storage.setItem("debug",e):ye.storage.removeItem("debug")}catch{}}function Tg(){let e;try{e=ye.storage.getItem("debug")}catch{}return!e&&typeof ci<"u"&&"env"in ci&&(e=ci.env.DEBUG),e}function Ig(){try{return localStorage}catch{}}Tr.exports=ui()(ye);var{formatters:qg}=Tr.exports;qg.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Is=N((yC,Ts)=>{var Ng=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"};Ts.exports=(e,t=Ng.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return n!==-1&&(i===-1||n{var Ns=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"},Rg=require("os"),qs=require("tty"),Ee=Is(),{env:ee}=Ns,$e;Ee("no-color")||Ee("no-colors")||Ee("color=false")||Ee("color=never")?$e=0:(Ee("color")||Ee("colors")||Ee("color=true")||Ee("color=always"))&&($e=1);"FORCE_COLOR"in ee&&(ee.FORCE_COLOR==="true"?$e=1:ee.FORCE_COLOR==="false"?$e=0:$e=ee.FORCE_COLOR.length===0?1:Math.min(parseInt(ee.FORCE_COLOR,10),3));function fi(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function pi(e,t){if($e===0)return 0;if(Ee("color=16m")||Ee("color=full")||Ee("color=truecolor"))return 3;if(Ee("color=256"))return 2;if(e&&!t&&$e===void 0)return 0;let r=$e||0;if(ee.TERM==="dumb")return r;if(Ns.platform==="win32"){let n=Rg.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in ee)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in ee)||ee.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in ee)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ee.TEAMCITY_VERSION)?1:0;if(ee.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in ee){let n=parseInt((ee.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ee.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(ee.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ee.TERM)||"COLORTERM"in ee?1:r}function Dg(e){let t=pi(e,e&&e.isTTY);return fi(t)}Rs.exports={supportsColor:Dg,stdout:fi(pi(!0,qs.isatty(1))),stderr:fi(pi(!0,qs.isatty(2)))}});var js=N((te,qr)=>{var st=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"},Mg=require("tty"),Ir=require("util");te.init=Hg;te.log=Vg;te.formatArgs=Bg;te.save=Wg;te.load=Ug;te.useColors=jg;te.destroy=Ir.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");te.colors=[6,2,3,4,5,1];try{let e=Ds();e&&(e.stderr||e).level>=2&&(te.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}te.inspectOpts=Object.keys(st.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),n=st.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[r]=n,e},{});function jg(){return"colors"in te.inspectOpts?!!te.inspectOpts.colors:Mg.isatty(st.stderr.fd)}function Bg(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${t} \x1B[0m`;e[0]=o+e[0].split(` +"use strict";var pp=Object.create;var ri=Object.defineProperty;var gp=Object.getOwnPropertyDescriptor;var wp=Object.getOwnPropertyNames;var kp=Object.getPrototypeOf,yp=Object.prototype.hasOwnProperty;var Xe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),bl=(e,t)=>{for(var n in t)ri(e,n,{get:t[n],enumerable:!0})},vl=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of wp(t))!yp.call(e,o)&&o!==n&&ri(e,o,{get:()=>t[o],enumerable:!(i=gp(t,o))||i.enumerable});return e};var je=(e,t,n)=>(n=e!=null?pp(kp(e)):{},vl(t||!e||!e.__esModule?ri(n,"default",{value:e,enumerable:!0}):n,e)),xp=e=>vl(ri({},"__esModule",{value:!0}),e);var Al=Xe((cy,Tl)=>{"use strict";function kt(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function El(e,t){for(var n="",i=0,o=-1,s=0,l,u=0;u<=e.length;++u){if(u2){var f=n.lastIndexOf("/");if(f!==n.length-1){f===-1?(n="",i=0):(n=n.slice(0,f),i=n.length-1-n.lastIndexOf("/")),o=u,s=0;continue}}else if(n.length===2||n.length===1){n="",i=0,o=u,s=0;continue}}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(o+1,u):n=e.slice(o+1,u),i=u-o-1;o=u,s=0}else l===46&&s!==-1?++s:s=-1}return n}function Sp(e,t){var n=t.dir||t.root,i=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+i:n+e+i:i}var Mn={resolve:function(){for(var t="",n=!1,i,o=arguments.length-1;o>=-1&&!n;o--){var s;o>=0?s=arguments[o]:(i===void 0&&(i=process.cwd()),s=i),kt(s),s.length!==0&&(t=s+"/"+t,n=s.charCodeAt(0)===47)}return t=El(t,!n),n?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(kt(t),t.length===0)return".";var n=t.charCodeAt(0)===47,i=t.charCodeAt(t.length-1)===47;return t=El(t,!n),t.length===0&&!n&&(t="."),t.length>0&&i&&(t+="/"),n?"/"+t:t},isAbsolute:function(t){return kt(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,n=0;n0&&(t===void 0?t=i:t+="/"+i)}return t===void 0?".":Mn.normalize(t)},relative:function(t,n){if(kt(t),kt(n),t===n||(t=Mn.resolve(t),n=Mn.resolve(n),t===n))return"";for(var i=1;im){if(n.charCodeAt(l+p)===47)return n.slice(l+p+1);if(p===0)return n.slice(l+p)}else s>m&&(t.charCodeAt(i+p)===47?h=p:p===0&&(h=0));break}var w=t.charCodeAt(i+p),k=n.charCodeAt(l+p);if(w!==k)break;w===47&&(h=p)}var v="";for(p=i+h+1;p<=o;++p)(p===o||t.charCodeAt(p)===47)&&(v.length===0?v+="..":v+="/..");return v.length>0?v+n.slice(l+h):(l+=h,n.charCodeAt(l)===47&&++l,n.slice(l))},_makeLong:function(t){return t},dirname:function(t){if(kt(t),t.length===0)return".";for(var n=t.charCodeAt(0),i=n===47,o=-1,s=!0,l=t.length-1;l>=1;--l)if(n=t.charCodeAt(l),n===47){if(!s){o=l;break}}else s=!1;return o===-1?i?"/":".":i&&o===1?"//":t.slice(0,o)},basename:function(t,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');kt(t);var i=0,o=-1,s=!0,l;if(n!==void 0&&n.length>0&&n.length<=t.length){if(n.length===t.length&&n===t)return"";var u=n.length-1,f=-1;for(l=t.length-1;l>=0;--l){var m=t.charCodeAt(l);if(m===47){if(!s){i=l+1;break}}else f===-1&&(s=!1,f=l+1),u>=0&&(m===n.charCodeAt(u)?--u===-1&&(o=l):(u=-1,o=f))}return i===o?o=f:o===-1&&(o=t.length),t.slice(i,o)}else{for(l=t.length-1;l>=0;--l)if(t.charCodeAt(l)===47){if(!s){i=l+1;break}}else o===-1&&(s=!1,o=l+1);return o===-1?"":t.slice(i,o)}},extname:function(t){kt(t);for(var n=-1,i=0,o=-1,s=!0,l=0,u=t.length-1;u>=0;--u){var f=t.charCodeAt(u);if(f===47){if(!s){i=u+1;break}continue}o===-1&&(s=!1,o=u+1),f===46?n===-1?n=u:l!==1&&(l=1):n!==-1&&(l=-1)}return n===-1||o===-1||l===0||l===1&&n===o-1&&n===i+1?"":t.slice(n,o)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return Sp("/",t)},parse:function(t){kt(t);var n={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return n;var i=t.charCodeAt(0),o=i===47,s;o?(n.root="/",s=1):s=0;for(var l=-1,u=0,f=-1,m=!0,h=t.length-1,p=0;h>=s;--h){if(i=t.charCodeAt(h),i===47){if(!m){u=h+1;break}continue}f===-1&&(m=!1,f=h+1),i===46?l===-1?l=h:p!==1&&(p=1):l!==-1&&(p=-1)}return l===-1||f===-1||p===0||p===1&&l===f-1&&l===u+1?f!==-1&&(u===0&&o?n.base=n.name=t.slice(1,f):n.base=n.name=t.slice(u,f)):(u===0&&o?(n.name=t.slice(1,l),n.base=t.slice(1,f)):(n.name=t.slice(u,l),n.base=t.slice(u,f)),n.ext=t.slice(l,f)),u>0?n.dir=t.slice(0,u-1):o&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};Mn.posix=Mn;Tl.exports=Mn});var Pl=Xe((fy,os)=>{"use strict";var _p=Object.prototype.hasOwnProperty,De="~";function dr(){}Object.create&&(dr.prototype=Object.create(null),new dr().__proto__||(De=!1));function Ep(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function Fl(e,t,n,i,o){if(typeof n!="function")throw new TypeError("The listener must be a function");var s=new Ep(n,i||e,o),l=De?De+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function oi(e,t){--e._eventsCount===0?e._events=new dr:delete e._events[t]}function Ae(){this._events=new dr,this._eventsCount=0}Ae.prototype.eventNames=function(){var t=[],n,i;if(this._eventsCount===0)return t;for(i in n=this._events)_p.call(n,i)&&t.push(De?i.slice(1):i);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(n)):t};Ae.prototype.listeners=function(t){var n=De?De+t:t,i=this._events[n];if(!i)return[];if(i.fn)return[i.fn];for(var o=0,s=i.length,l=new Array(s);o{var On=1e3,Dn=On*60,Rn=Dn*60,fn=Rn*24,Dp=fn*7,Rp=fn*365.25;$l.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return Np(e);if(n==="number"&&isFinite(e))return t.long?Wp(e):Yp(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Np(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),i=(t[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return n*Rp;case"weeks":case"week":case"w":return n*Dp;case"days":case"day":case"d":return n*fn;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Rn;case"minutes":case"minute":case"mins":case"min":case"m":return n*Dn;case"seconds":case"second":case"secs":case"sec":case"s":return n*On;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function Yp(e){var t=Math.abs(e);return t>=fn?Math.round(e/fn)+"d":t>=Rn?Math.round(e/Rn)+"h":t>=Dn?Math.round(e/Dn)+"m":t>=On?Math.round(e/On)+"s":e+"ms"}function Wp(e){var t=Math.abs(e);return t>=fn?ci(e,t,fn,"day"):t>=Rn?ci(e,t,Rn,"hour"):t>=Dn?ci(e,t,Dn,"minute"):t>=On?ci(e,t,On,"second"):e+" ms"}function ci(e,t,n,i){var o=t>=n*1.5;return Math.round(e/n)+" "+i+(o?"s":"")}});var cs=Xe((Oy,Gl)=>{function zp(e){n.debug=n,n.default=n,n.coerce=f,n.disable=l,n.enable=o,n.enabled=u,n.humanize=jl(),n.destroy=m,Object.keys(e).forEach(h=>{n[h]=e[h]}),n.names=[],n.skips=[],n.formatters={};function t(h){let p=0;for(let w=0;w{if(_==="%%")return"%";Y++;let j=n.formatters[J];if(typeof j=="function"){let G=T[Y];_=j.call(C,G),T.splice(Y,1),Y--}return _}),n.formatArgs.call(C,T),(C.log||n.log).apply(C,T)}return F.namespace=h,F.useColors=n.useColors(),F.color=n.selectColor(h),F.extend=i,F.destroy=n.destroy,Object.defineProperty(F,"enabled",{enumerable:!0,configurable:!1,get:()=>w!==null?w:(k!==n.namespaces&&(k=n.namespaces,v=n.enabled(h)),v),set:T=>{w=T}}),typeof n.init=="function"&&n.init(F),F}function i(h,p){let w=n(this.namespace+(typeof p>"u"?":":p)+h);return w.log=this.log,w}function o(h){n.save(h),n.namespaces=h,n.names=[],n.skips=[];let p=(typeof h=="string"?h:"").trim().replace(" ",",").split(",").filter(Boolean);for(let w of p)w[0]==="-"?n.skips.push(w.slice(1)):n.names.push(w)}function s(h,p){let w=0,k=0,v=-1,F=0;for(;w"-"+p)].join(",");return n.enable(""),h}function u(h){for(let p of n.skips)if(s(h,p))return!1;for(let p of n.names)if(s(h,p))return!0;return!1}function f(h){return h instanceof Error?h.stack||h.message:h}function m(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}Gl.exports=zp});var ql=Xe((Ge,fi)=>{Ge.formatArgs=Hp;Ge.save=Up;Ge.load=Vp;Ge.useColors=Bp;Ge.storage=$p();Ge.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Ge.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Bp(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Hp(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+fi.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(n++,o==="%c"&&(i=n))}),e.splice(i,0,t)}Ge.log=console.debug||console.log||(()=>{});function Up(e){try{e?Ge.storage.setItem("debug",e):Ge.storage.removeItem("debug")}catch{}}function Vp(){let e;try{e=Ge.storage.getItem("debug")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function $p(){try{return localStorage}catch{}}fi.exports=cs()(Ge);var{formatters:jp}=fi.exports;jp.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Ql=Xe((Dy,Zl)=>{"use strict";Zl.exports=(e,t=process.argv)=>{let n=e.startsWith("-")?"":e.length===1?"-":"--",i=t.indexOf(n+e),o=t.indexOf("--");return i!==-1&&(o===-1||i{"use strict";var Gp=require("os"),Jl=require("tty"),nt=Ql(),{env:xe}=process,$t;nt("no-color")||nt("no-colors")||nt("color=false")||nt("color=never")?$t=0:(nt("color")||nt("colors")||nt("color=true")||nt("color=always"))&&($t=1);"FORCE_COLOR"in xe&&(xe.FORCE_COLOR==="true"?$t=1:xe.FORCE_COLOR==="false"?$t=0:$t=xe.FORCE_COLOR.length===0?1:Math.min(parseInt(xe.FORCE_COLOR,10),3));function fs(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ds(e,t){if($t===0)return 0;if(nt("color=16m")||nt("color=full")||nt("color=truecolor"))return 3;if(nt("color=256"))return 2;if(e&&!t&&$t===void 0)return 0;let n=$t||0;if(xe.TERM==="dumb")return n;if(process.platform==="win32"){let i=Gp.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in xe)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(i=>i in xe)||xe.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in xe)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(xe.TEAMCITY_VERSION)?1:0;if(xe.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in xe){let i=parseInt((xe.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(xe.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(xe.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(xe.TERM)||"COLORTERM"in xe?1:n}function qp(e){let t=ds(e,e&&e.isTTY);return fs(t)}Kl.exports={supportsColor:qp,stdout:fs(ds(!0,Jl.isatty(1))),stderr:fs(ds(!0,Jl.isatty(2)))}});var tu=Xe((be,hi)=>{var Zp=require("tty"),di=require("util");be.init=ng;be.log=Xp;be.formatArgs=Jp;be.save=eg;be.load=tg;be.useColors=Qp;be.destroy=di.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");be.colors=[6,2,3,4,5,1];try{let e=Xl();e&&(e.stderr||e).level>=2&&(be.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}be.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),i=process.env[t];return/^(yes|on|true|enabled)$/i.test(i)?i=!0:/^(no|off|false|disabled)$/i.test(i)?i=!1:i==="null"?i=null:i=Number(i),e[n]=i,e},{});function Qp(){return"colors"in be.inspectOpts?!!be.inspectOpts.colors:Zp.isatty(process.stderr.fd)}function Jp(e){let{namespace:t,useColors:n}=this;if(n){let i=this.color,o="\x1B[3"+(i<8?i:"8;5;"+i),s=` ${o};1m${t} \x1B[0m`;e[0]=s+e[0].split(` `).join(` -`+o),e.push(i+"m+"+qr.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=zg()+t+" "+e[0]}function zg(){return te.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Vg(...e){return st.stderr.write(Ir.formatWithOptions(te.inspectOpts,...e)+` -`)}function Wg(e){e?st.env.DEBUG=e:delete st.env.DEBUG}function Ug(){return st.env.DEBUG}function Hg(e){e.inspectOpts={};let t=Object.keys(te.inspectOpts);for(let r=0;rt.trim()).join(" ")};Ms.O=function(e){return this.inspectOpts.colors=this.useColors,Ir.inspect(e,this.inspectOpts)}});var di=N((xC,hi)=>{var Nr=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"};typeof Nr>"u"||Nr.type==="renderer"||Nr.browser===!0||Nr.__nwjs?hi.exports=Ls():hi.exports=js()});var lt=N((_C,Hs)=>{function Bs(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return Bs(n)},t)})();var $g=Object.create,Dr=Object.defineProperty,Gg=Object.getOwnPropertyDescriptor,Jg=Object.getOwnPropertyNames,Qg=Object.getPrototypeOf,Yg=Object.prototype.hasOwnProperty,Kg=(e,t)=>{for(var r in t)Dr(e,r,{get:t[r],enumerable:!0})},zs=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Jg(t))!Yg.call(e,i)&&i!==r&&Dr(e,i,{get:()=>t[i],enumerable:!(n=Gg(t,i))||n.enumerable});return e},Xg=(e,t,r)=>(r=e!=null?$g(Qg(e)):{},zs(t||!e||!e.__esModule?Dr(r,"default",{value:e,enumerable:!0}):r,e)),Zg=e=>zs(Dr({},"__esModule",{value:!0}),e),Vs={};Kg(Vs,{getDebugger:()=>eb,initDebugHelpers:()=>tb});Hs.exports=Zg(Vs);var Jt=Xg(Bs(di()),1),Ws=",",Rr="-";function eb(e){let t=Jt.default.default(e);return t.log=(r,...n)=>{ib(e,r,...n)},t.printStackTrace=(r,n)=>{Us(e,r,n)},t}function tb(){window.DEBUG={disable:rb,enable:nb,get:mi,set:gi}}function rb(e){let t=new Set(mi());for(let r of Qt(e)){if(r.startsWith(Rr))continue;let n=Rr+r;t.has(r)&&t.delete(r),t.add(n)}gi(Array.from(t))}function nb(e){let t=new Set(mi());for(let r of Qt(e)){if(!r.startsWith(Rr)){let n=Rr+r;t.has(n)&&t.delete(n)}t.add(r)}gi(Array.from(t))}function mi(){return Qt(Jt.default.load()??"")}function ib(e,t,...r){if(!Jt.default.enabled(e))return;let o=(new Error().stack?.split(` -`)??[])[4]??"";console.debug(t,...r),Us(e,o,"Original debug message caller")}function Us(e,t,r){Jt.default.enabled(e)&&(t||(t="(unavailable)"),r||(r="Caller stack trace"),console.debug(`NotError:${e}:${r} -${t}`))}function gi(e){Jt.default.enable(Qt(e).join(Ws))}function Qt(e){return typeof e=="string"?e.split(Ws).filter(Boolean):e.flatMap(Qt)}});var Js=N((PC,Gs)=>{function ob(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return ob(n)},t)})();var bi=Object.defineProperty,ab=Object.getOwnPropertyDescriptor,sb=Object.getOwnPropertyNames,lb=Object.prototype.hasOwnProperty,ub=(e,t)=>{for(var r in t)bi(e,r,{get:t[r],enumerable:!0})},cb=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of sb(t))!lb.call(e,i)&&i!==r&&bi(e,i,{get:()=>t[i],enumerable:!(n=ab(t,i))||n.enumerable});return e},fb=e=>cb(bi({},"__esModule",{value:!0}),e),$s={};ub($s,{loop:()=>db});Gs.exports=fb($s);var pb=lt(),hb=ze(),CC=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"};async function db(e){let t=e.items,r=0,n=new Notice("",0);for(let i of t){if(e.abortSignal?.aborted){n.hide();return}r++;let o=`# ${r.toString()} / ${t.length.toString()}`,a=e.buildNoticeMessage(i,o);n.setMessage(a),(0,pb.getDebugger)("obsidian-dev-utils:loop")(a);try{await e.processItem(i)}catch(s){if(e.shouldContinueOnError)(0,hb.emitAsyncErrorEvent)(s);else throw n.hide(),s}}n.hide()}});var yi=N((AC,Ks)=>{function mb(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return mb(n)},t)})();var ki=Object.defineProperty,gb=Object.getOwnPropertyDescriptor,bb=Object.getOwnPropertyNames,wb=Object.prototype.hasOwnProperty,kb=(e,t)=>{for(var r in t)ki(e,r,{get:t[r],enumerable:!0})},yb=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of bb(t))!wb.call(e,i)&&i!==r&&ki(e,i,{get:()=>t[i],enumerable:!(n=gb(t,i))||n.enumerable});return e},vb=e=>yb(ki({},"__esModule",{value:!0}),e),Ys={};kb(Ys,{alert:()=>xb});Ks.exports=vb(Ys);var Qs=require("obsidian"),wi=class extends Qs.Modal{constructor(t,r){super(t.app),this.resolve=r;let n={app:t.app,message:"",okButtonStyles:{},okButtonText:"OK",title:""};this.options={...n,...t}}options;onClose(){this.resolve()}onOpen(){this.titleEl.setText(this.options.title),this.contentEl.createEl("p").setText(this.options.message);let r=new Qs.ButtonComponent(this.contentEl);r.setButtonText(this.options.okButtonText),r.setCta(),r.onClick(this.close.bind(this)),Object.assign(r.buttonEl.style,this.options.okButtonStyles)}};async function xb(e){return new Promise(t=>{new wi(e,t).open()})}});var xi=N((SC,nl)=>{function el(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return el(n)},t)})();var _b=Object.create,Mr=Object.defineProperty,Cb=Object.getOwnPropertyDescriptor,Pb=Object.getOwnPropertyNames,Ab=Object.getPrototypeOf,Eb=Object.prototype.hasOwnProperty,Sb=(e,t)=>{for(var r in t)Mr(e,r,{get:t[r],enumerable:!0})},tl=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Pb(t))!Eb.call(e,i)&&i!==r&&Mr(e,i,{get:()=>t[i],enumerable:!(n=Cb(t,i))||n.enumerable});return e},Fb=(e,t,r)=>(r=e!=null?_b(Ab(e)):{},tl(t||!e||!e.__esModule?Mr(r,"default",{value:e,enumerable:!0}):r,e)),Ob=e=>tl(Mr({},"__esModule",{value:!0}),e),rl={};Sb(rl,{PluginBase:()=>vi});nl.exports=Ob(rl);var Lb=Fb(el(di()),1),Xs=require("obsidian"),Tb=lt(),Ib=ze(),Zs=ot(),EC=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"},vi=class extends Xs.Plugin{consoleDebug;get abortSignal(){return this._abortSignal}get settingsCopy(){return this.createPluginSettings(this.settings.toJSON())}get settings(){return this._settings}_abortSignal;_settings;notice;constructor(t,r){super(t,r),(0,Tb.initDebugHelpers)(),this.consoleDebug=Lb.default.default(r.id),console.debug(`Debug messages for plugin '${r.name}' are not shown by default. Set window.DEBUG.enable('${r.id}') to see them. See https://github.com/debug-js/debug?tab=readme-ov-file for more information`)}async onload(){this.register((0,Ib.registerAsyncErrorEventHandler)(()=>{this.showNotice("An unhandled error occurred. Please check the console for more information.")})),await this.loadSettings();let t=this.createPluginSettingsTab();t&&this.addSettingTab(t);let r=new AbortController;this._abortSignal=r.signal,this.register(()=>{r.abort()}),await this.onloadComplete(),this.app.workspace.onLayoutReady(this.onLayoutReady.bind(this))}async saveSettings(t){let r=t.toJSON();this._settings=this.createPluginSettings(r),await this.saveData(r)}onLayoutReady(){(0,Zs.noop)()}onloadComplete(){(0,Zs.noop)()}showNotice(t){this.notice&&this.notice.hide(),this.notice=new Xs.Notice(`${this.manifest.name} -${t}`)}async loadSettings(){let t=await this.loadData();this._settings=this.createPluginSettings(t),this._settings.shouldSaveAfterLoad()&&await this.saveSettings(this._settings)}}});var zr=N((FC,ll)=>{function qb(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return qb(n)},t)})();var Pi=Object.defineProperty,Nb=Object.getOwnPropertyDescriptor,Rb=Object.getOwnPropertyNames,Db=Object.prototype.hasOwnProperty,Mb=(e,t)=>{for(var r in t)Pi(e,r,{get:t[r],enumerable:!0})},jb=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Rb(t))!Db.call(e,i)&&i!==r&&Pi(e,i,{get:()=>t[i],enumerable:!(n=Nb(t,i))||n.enumerable});return e},Bb=e=>jb(Pi({},"__esModule",{value:!0}),e),il={};Mb(il,{addErrorHandler:()=>ol,asyncFilter:()=>zb,asyncFlatMap:()=>Vb,asyncMap:()=>Ai,convertAsyncToSync:()=>Wb,convertSyncToAsync:()=>Ub,invokeAsyncSafely:()=>al,marksAsTerminateRetry:()=>Hb,retryWithTimeout:()=>$b,runWithTimeout:()=>sl,sleep:()=>Br,timeout:()=>Gb,toArray:()=>Jb});ll.exports=Bb(il);var _i=lt(),Ci=ze(),jr=(0,_i.getDebugger)("obsidian-dev-utils:Async:retryWithTimeout");async function ol(e){try{await e()}catch(t){(0,Ci.emitAsyncErrorEvent)(t)}}async function zb(e,t){let r=await Ai(e,t);return e.filter((n,i)=>r[i])}async function Vb(e,t){return(await Ai(e,t)).flat()}async function Ai(e,t){return await Promise.all(e.map(t))}function Wb(e){return(...t)=>{al(()=>e(...t))}}function Ub(e){return(...t)=>Promise.resolve().then(()=>e(...t))}function al(e){ol(e)}function Hb(e){return Object.assign(e,{__terminateRetry:!0})}async function $b(e,t={},r){r??=(0,Ci.getStackTrace)(1);let i={...{retryDelayInMilliseconds:100,shouldRetryOnError:!1,timeoutInMilliseconds:5e3},...t};await sl(i.timeoutInMilliseconds,async()=>{let o=0;for(;;){i.abortSignal?.throwIfAborted(),o++;let a;try{a=await e()}catch(s){if(!i.shouldRetryOnError||s.__terminateRetry)throw s;(0,Ci.printError)(s),a=!1}if(a){o>1&&(jr(`Retry completed successfully after ${o.toString()} attempts`),jr.printStackTrace(r));return}jr(`Retry attempt ${o.toString()} completed unsuccessfully. Trying again in ${i.retryDelayInMilliseconds.toString()} milliseconds`,{fn:e}),jr.printStackTrace(r),await Br(i.retryDelayInMilliseconds)}})}async function sl(e,t){let r=!0,n=null,i=performance.now();if(await Promise.race([o(),a()]),r)throw new Error("Timed out");return n;async function o(){n=await t(),r=!1;let s=performance.now()-i;(0,_i.getDebugger)("obsidian-dev-utils:Async:runWithTimeout")(`Execution time: ${s.toString()} milliseconds`,{fn:t})}async function a(){if(!r||(await Br(e),!r))return;let s=performance.now()-i;console.warn(`Timed out in ${s.toString()} milliseconds`,{fn:t}),(0,_i.getDebugger)("obsidian-dev-utils:Async:timeout").enabled&&(console.warn("The execution is not terminated because debugger obsidian-dev-utils:Async:timeout is enabled. See window.DEBUG.enable('obsidian-dev-utils:Async:timeout') and https://github.com/debug-js/debug?tab=readme-ov-file for more information"),await a())}}async function Br(e){await new Promise(t=>setTimeout(t,e))}async function Gb(e){throw await Br(e),new Error(`Timed out in ${e.toString()} milliseconds`)}async function Jb(e){let t=[];for await(let r of e)t.push(r);return t}});var Si=N((OC,cl)=>{function Qb(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return Qb(n)},t)})();var Ei=Object.defineProperty,Yb=Object.getOwnPropertyDescriptor,Kb=Object.getOwnPropertyNames,Xb=Object.prototype.hasOwnProperty,Zb=(e,t)=>{for(var r in t)Ei(e,r,{get:t[r],enumerable:!0})},ew=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Kb(t))!Xb.call(e,i)&&i!==r&&Ei(e,i,{get:()=>t[i],enumerable:!(n=Yb(t,i))||n.enumerable});return e},tw=e=>ew(Ei({},"__esModule",{value:!0}),e),ul={};Zb(ul,{ValueWrapper:()=>Vr,getApp:()=>rw,getObsidianDevUtilsState:()=>nw});cl.exports=tw(ul);var Vr=class{constructor(t){this.value=t}};function rw(){let e;try{globalThis.require.resolve("obsidian/app"),e=!0}catch{e=!1}if(e)return globalThis.require("obsidian/app");let t=globalThis.app;if(t)return t;throw new Error("Obsidian app not found")}function nw(e,t,r){let n=e,i=n.obsidianDevUtilsState??={};return i[t]??=new Vr(r)}});var hl=N((LC,pl)=>{function iw(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return iw(n)},t)})();var Fi=Object.defineProperty,ow=Object.getOwnPropertyDescriptor,aw=Object.getOwnPropertyNames,sw=Object.prototype.hasOwnProperty,lw=(e,t)=>{for(var r in t)Fi(e,r,{get:t[r],enumerable:!0})},uw=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of aw(t))!sw.call(e,i)&&i!==r&&Fi(e,i,{get:()=>t[i],enumerable:!(n=ow(t,i))||n.enumerable});return e},cw=e=>uw(Fi({},"__esModule",{value:!0}),e),fl={};lw(fl,{invokeAsyncAndLog:()=>hw});pl.exports=cw(fl);var fw=lt(),pw=ze(),Ot=(0,fw.getDebugger)("obsidian-dev-utils:Logger:invokeAsyncAndLog");async function hw(e,t,r){let n=performance.now();r??=(0,pw.getStackTrace)(1),Ot(`${e}:start`,{fn:t,timestampStart:n}),Ot.printStackTrace(r);try{await t();let i=performance.now();Ot(`${e}:end`,{duration:i-n,fn:t,timestampEnd:i,timestampStart:n}),Ot.printStackTrace(r)}catch(i){let o=performance.now();throw Ot(`${e}:error`,{duration:o-n,error:i,fn:t,timestampEnd:o,timestampStart:n}),Ot.printStackTrace(r),i}}});var Ti=N((IC,kl)=>{function dw(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return dw(n)},t)})();var Oi=Object.defineProperty,mw=Object.getOwnPropertyDescriptor,gw=Object.getOwnPropertyNames,bw=Object.prototype.hasOwnProperty,ww=(e,t)=>{for(var r in t)Oi(e,r,{get:t[r],enumerable:!0})},kw=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of gw(t))!bw.call(e,i)&&i!==r&&Oi(e,i,{get:()=>t[i],enumerable:!(n=mw(t,i))||n.enumerable});return e},yw=e=>kw(Oi({},"__esModule",{value:!0}),e),ml={};ww(ml,{addToQueue:()=>Cw,addToQueueAndWait:()=>Li,flushQueue:()=>Pw});kl.exports=yw(ml);var dl=zr(),gl=ze(),vw=ot(),xw=Si(),_w=hl(),TC=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"};function Cw(e,t,r,n){n??=(0,gl.getStackTrace)(1),Li(e,t,r,n)}async function Li(e,t,r,n){r??=6e4,n??=(0,gl.getStackTrace)(1);let o=bl(e).value;o.items.push({fn:t,stackTrace:n,timeoutInMilliseconds:r}),o.promise=o.promise.then(()=>wl(e)),await o.promise}async function Pw(e){await Li(e,vw.noop)}function bl(e){return(0,xw.getObsidianDevUtilsState)(e,"queue",{items:[],promise:Promise.resolve()})}async function wl(e){let t=bl(e).value,r=t.items[0];r&&(await(0,dl.addErrorHandler)(()=>(0,dl.runWithTimeout)(r.timeoutInMilliseconds,()=>(0,_w.invokeAsyncAndLog)(wl.name,r.fn,r.stackTrace))),t.items.shift())}});var yl=N(Yt=>{"use strict";function Aw(e,t){let r=Object.keys(t).map(n=>Ew(e,n,t[n]));return r.length===1?r[0]:function(){r.forEach(n=>n())}}function Ew(e,t,r){let n=e[t],i=e.hasOwnProperty(t),o=i?n:function(){return Object.getPrototypeOf(e)[t].apply(this,arguments)},a=r(o);return n&&Object.setPrototypeOf(a,n),Object.setPrototypeOf(s,a),e[t]=s,l;function s(...c){return a===o&&e[t]===s&&l(),a.apply(this,c)}function l(){e[t]===s&&(i?e[t]=o:delete e[t]),a!==o&&(a=o,Object.setPrototypeOf(s,n||Function))}}function Sw(e,t,r){return n[e]=e,n;function n(...i){return(t[e]===e?t:r).apply(this,i)}}function Ii(e,t){return e.then(t,t)}function Fw(e){let t=Promise.resolve();function r(...n){return t=new Promise((i,o)=>{Ii(t,()=>{e.apply(this,n).then(i,o)})})}return r.after=function(){return t=new Promise((n,i)=>{Ii(t,n)})},r}Yt.after=Ii;Yt.around=Aw;Yt.dedupe=Sw;Yt.serialize=Fw});var ut=N((RC,Pl)=>{function Ow(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return Ow(n)},t)})();var qi=Object.defineProperty,Lw=Object.getOwnPropertyDescriptor,Tw=Object.getOwnPropertyNames,Iw=Object.prototype.hasOwnProperty,qw=(e,t)=>{for(var r in t)qi(e,r,{get:t[r],enumerable:!0})},Nw=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Tw(t))!Iw.call(e,i)&&i!==r&&qi(e,i,{get:()=>t[i],enumerable:!(n=Lw(t,i))||n.enumerable});return e},Rw=e=>Nw(qi({},"__esModule",{value:!0}),e),vl={};qw(vl,{assignWithNonEnumerableProperties:()=>Mw,cloneWithNonEnumerableProperties:()=>jw,deepEqual:()=>xl,deleteProperties:()=>Bw,deleteProperty:()=>_l,getNestedPropertyValue:()=>zw,getPrototypeOf:()=>Wr,nameof:()=>Vw,normalizeOptionalProperties:()=>Ww,setNestedPropertyValue:()=>Uw,toJson:()=>Hw});Pl.exports=Rw(vl);var Dw=ze(),NC=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"};function Mw(e,...t){return Cl(e,...t)}function jw(e){return Object.create(Wr(e),Object.getOwnPropertyDescriptors(e))}function xl(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e===null||t===null)return!1;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;let i=e,o=t;for(let a of r)if(!n.includes(a)||!xl(i[a],o[a]))return!1;return!0}function Bw(e,t){let r=!1;for(let n of t)r=_l(e,n)||r;return r}function _l(e,t){return Object.prototype.hasOwnProperty.call(e,t)?(delete e[t],!0):!1}function zw(e,t){let r=e,n=t.split(".");for(let i of n){if(r===void 0)return;r=r[i]}return r}function Wr(e){return e==null?e:Object.getPrototypeOf(e)}function Vw(e){return e}function Ww(e){return e}function Uw(e,t,r){let n=new Error(`Property path ${t} not found`),i=e,o=t.split(".");for(let s of o.slice(0,-1)){if(i===void 0)throw n;i=i[s]}let a=o.at(-1);if(i===void 0||a===void 0)throw n;i[a]=r}function Hw(e,t={}){let{shouldHandleFunctions:r=!1,space:n=2}=t;if(!r)return JSON.stringify(e,null,n);let i=[],a=JSON.stringify(e,(s,l)=>{if(typeof l=="function"){let c=i.length;return i.push(l.toString()),`__FUNCTION_${c.toString()}`}return l},n);return a=a.replaceAll(/"__FUNCTION_(\d+)"/g,(s,l)=>i[parseInt(l)]??(0,Dw.throwExpression)(new Error(`Function with index ${l} not found`))),a}function Cl(e,...t){for(let n of t)Object.defineProperties(e,Object.getOwnPropertyDescriptors(n));let r=t.map(n=>Wr(n)).filter(n=>!!n);if(r.length>0){let n=Cl({},Wr(e),...r);Object.setPrototypeOf(e,n)}return e}});var Mi=N((DC,Ol)=>{function $w(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return $w(n)},t)})();var Di=Object.defineProperty,Gw=Object.getOwnPropertyDescriptor,Jw=Object.getOwnPropertyNames,Qw=Object.prototype.hasOwnProperty,Yw=(e,t)=>{for(var r in t)Di(e,r,{get:t[r],enumerable:!0})},Kw=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Jw(t))!Qw.call(e,i)&&i!==r&&Di(e,i,{get:()=>t[i],enumerable:!(n=Gw(t,i))||n.enumerable});return e},Xw=e=>Kw(Di({},"__esModule",{value:!0}),e),El={};Yw(El,{getAttachmentFilePath:()=>Sl,getAttachmentFolderPath:()=>Ri,getAvailablePathForAttachments:()=>Fl,hasOwnAttachmentFolder:()=>ek});Ol.exports=Xw(El);var Zw=Ct(),Ur=Ve(),Ni=At(),Kt=Oe();async function Sl(e,t,r){let n=(0,Kt.getPath)(e,t),i=(0,Kt.getPath)(e,r),o=(0,Kt.getFile)(e,i,!0),a=(0,Ur.extname)(n),s=(0,Ur.basename)(n,a),l=e.vault.getAvailablePathForAttachments;return l.isExtended?l(s,a.slice(1),o,!0):await Fl(e,s,a.slice(1),o,!0)}async function Ri(e,t){return(0,Zw.parentFolderPath)(await Sl(e,"DUMMY_FILE.pdf",t))}async function Fl(e,t,r,n,i){let o=e.vault.getConfig("attachmentFolderPath"),a=o==="."||o==="./",s=null;o.startsWith("./")&&(s=(0,Ni.trimStart)(o,"./")),a?o=n?n.parent?.path??"":"":s&&(o=(n?n.parent?.getParentPrefix()??"":"")+s),o=(0,Ni.normalize)(Al(o)),t=(0,Ni.normalize)(Al(t));let l=(0,Kt.getFolderOrNull)(e,o,!0);!l&&s&&(i?l=(0,Kt.getFolder)(e,o,!0):l=await e.vault.createFolder(o));let c=l?.getParentPrefix()??"";return e.vault.getAvailablePath(c+t,r)}async function ek(e,t){let r=await Ri(e,t),n=await Ri(e,(0,Ur.join)((0,Ur.dirname)(t),"DUMMY_FILE.md"));return r!==n}function Al(e){return e=e.replace(/([\\/])+/g,"/"),e=e.replace(/(^\/+|\/+$)/g,""),e||"/"}});function ct(e,t){let r=t||tk,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,i=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return Tl(e,n,i)}function Tl(e,t,r){if(rk(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Ll(e.children,t,r)}return Array.isArray(e)?Ll(e,t,r):""}function Ll(e,t,r){let n=[],i=-1;for(;++i{tk={}});var Hr=b(()=>{Il()});var ji,ql=b(()=>{ji={AElig:"\xC6",AMP:"&",Aacute:"\xC1",Abreve:"\u0102",Acirc:"\xC2",Acy:"\u0410",Afr:"\u{1D504}",Agrave:"\xC0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2A53",Aogon:"\u0104",Aopf:"\u{1D538}",ApplyFunction:"\u2061",Aring:"\xC5",Ascr:"\u{1D49C}",Assign:"\u2254",Atilde:"\xC3",Auml:"\xC4",Backslash:"\u2216",Barv:"\u2AE7",Barwed:"\u2306",Bcy:"\u0411",Because:"\u2235",Bernoullis:"\u212C",Beta:"\u0392",Bfr:"\u{1D505}",Bopf:"\u{1D539}",Breve:"\u02D8",Bscr:"\u212C",Bumpeq:"\u224E",CHcy:"\u0427",COPY:"\xA9",Cacute:"\u0106",Cap:"\u22D2",CapitalDifferentialD:"\u2145",Cayleys:"\u212D",Ccaron:"\u010C",Ccedil:"\xC7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010A",Cedilla:"\xB8",CenterDot:"\xB7",Cfr:"\u212D",Chi:"\u03A7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",Colon:"\u2237",Colone:"\u2A74",Congruent:"\u2261",Conint:"\u222F",ContourIntegral:"\u222E",Copf:"\u2102",Coproduct:"\u2210",CounterClockwiseContourIntegral:"\u2233",Cross:"\u2A2F",Cscr:"\u{1D49E}",Cup:"\u22D3",CupCap:"\u224D",DD:"\u2145",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040F",Dagger:"\u2021",Darr:"\u21A1",Dashv:"\u2AE4",Dcaron:"\u010E",Dcy:"\u0414",Del:"\u2207",Delta:"\u0394",Dfr:"\u{1D507}",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",Diamond:"\u22C4",DifferentialD:"\u2146",Dopf:"\u{1D53B}",Dot:"\xA8",DotDot:"\u20DC",DotEqual:"\u2250",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",Downarrow:"\u21D3",Dscr:"\u{1D49F}",Dstrok:"\u0110",ENG:"\u014A",ETH:"\xD0",Eacute:"\xC9",Ecaron:"\u011A",Ecirc:"\xCA",Ecy:"\u042D",Edot:"\u0116",Efr:"\u{1D508}",Egrave:"\xC8",Element:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25FB",EmptyVerySmallSquare:"\u25AB",Eogon:"\u0118",Eopf:"\u{1D53C}",Epsilon:"\u0395",Equal:"\u2A75",EqualTilde:"\u2242",Equilibrium:"\u21CC",Escr:"\u2130",Esim:"\u2A73",Eta:"\u0397",Euml:"\xCB",Exists:"\u2203",ExponentialE:"\u2147",Fcy:"\u0424",Ffr:"\u{1D509}",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",Fopf:"\u{1D53D}",ForAll:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\u{1D50A}",Gg:"\u22D9",Gopf:"\u{1D53E}",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",Gt:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",HilbertSpace:"\u210B",Hopf:"\u210D",HorizontalLine:"\u2500",Hscr:"\u210B",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xCD",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Igrave:"\xCC",Im:"\u2111",Imacr:"\u012A",ImaginaryI:"\u2148",Implies:"\u21D2",Int:"\u222C",Integral:"\u222B",Intersection:"\u22C2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Iogon:"\u012E",Iopf:"\u{1D540}",Iota:"\u0399",Iscr:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\u{1D50D}",Jopf:"\u{1D541}",Jscr:"\u{1D4A5}",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\u{1D50E}",Kopf:"\u{1D542}",Kscr:"\u{1D4A6}",LJcy:"\u0409",LT:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Larr:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",LeftRightArrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",Leftarrow:"\u21D0",Leftrightarrow:"\u21D4",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",Lfr:"\u{1D50F}",Ll:"\u22D8",Lleftarrow:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",LongLeftRightArrow:"\u27F7",LongRightArrow:"\u27F6",Longleftarrow:"\u27F8",Longleftrightarrow:"\u27FA",Longrightarrow:"\u27F9",Lopf:"\u{1D543}",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",Lscr:"\u2112",Lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",MinusPlus:"\u2213",Mopf:"\u{1D544}",Mscr:"\u2133",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:` -`,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',Qfr:"\u{1D514}",Qopf:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\u{1D54B}",TripleDot:"\u20DB",Tscr:"\u{1D4AF}",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\u{1D518}",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",Uopf:"\u{1D54C}",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",UpTee:"\u22A5",UpTeeArrow:"\u21A5",Uparrow:"\u21D1",Updownarrow:"\u21D5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\u{1D4B0}",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",Vopf:"\u{1D54D}",Vscr:"\u{1D4B1}",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",Wfr:"\u{1D51A}",Wopf:"\u{1D54E}",Wscr:"\u{1D4B2}",Xfr:"\u{1D51B}",Xi:"\u039E",Xopf:"\u{1D54F}",Xscr:"\u{1D4B3}",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\u{1D51C}",Yopf:"\u{1D550}",Yscr:"\u{1D4B4}",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",ZeroWidthSpace:"\u200B",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\u{1D4B5}",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acute:"\xB4",acy:"\u0430",aelig:"\xE6",af:"\u2061",afr:"\u{1D51E}",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",amp:"&",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",aopf:"\u{1D552}",ap:"\u2248",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",apid:"\u224B",apos:"'",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",ascr:"\u{1D4B6}",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",beta:"\u03B2",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",bprime:"\u2035",breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",bumpeq:"\u224F",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cedil:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",cfr:"\u{1D520}",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledR:"\xAE",circledS:"\u24C8",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",conint:"\u222E",copf:"\u{1D554}",coprod:"\u2210",copy:"\xA9",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dArr:"\u21D3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",ddotseq:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",dharl:"\u21C3",dharr:"\u21C2",diam:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",dot:"\u02D9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eDDot:"\u2A77",eDot:"\u2251",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",ecirc:"\xEA",ecolon:"\u2255",ecy:"\u044D",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",equals:"=",equest:"\u225F",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",erarr:"\u2971",escr:"\u212F",esdot:"\u2250",esim:"\u2242",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",gE:"\u2267",gEl:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gammad:"\u03DD",gap:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",grave:"`",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hArr:"\u21D4",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",hbar:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",horbar:"\u2015",hscr:"\u{1D4BD}",hslash:"\u210F",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",ic:"\u2063",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",intcal:"\u22BA",integers:"\u2124",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\u{1D55A}",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",isin:"\u2208",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\u{1D527}",jmath:"\u0237",jopf:"\u{1D55B}",jscr:"\u{1D4BF}",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\u{1D528}",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\u{1D55C}",kscr:"\u{1D4C0}",lAarr:"\u21DA",lArr:"\u21D0",lAtail:"\u291B",lBarr:"\u290E",lE:"\u2266",lEg:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",laquo:"\xAB",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lceil:"\u2308",lcub:"{",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21A2",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",leftthreetimes:"\u22CB",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",measuredangle:"\u2221",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",mp:"\u2213",mscr:"\u{1D4C2}",mstpos:"\u223E",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nGtv:"\u226B\u0338",nLeftarrow:"\u21CD",nLeftrightarrow:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nLtv:"\u226A\u0338",nRightarrow:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",neArr:"\u21D7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",ngsim:"\u2275",ngt:"\u226F",ngtr:"\u226F",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",nlArr:"\u21CD",nlE:"\u2266\u0338",nlarr:"\u219A",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nlsim:"\u2274",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nmid:"\u2224",nopf:"\u{1D55F}",not:"\xAC",notin:"\u2209",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24C8",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",ocy:"\u043E",odash:"\u229D",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\u{1D52C}",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",opar:"\u29B7",operp:"\u29B9",oplus:"\u2295",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oscr:"\u2134",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimes:"\u2297",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",pointint:"\u2A15",popf:"\u{1D561}",pound:"\xA3",pr:"\u227A",prE:"\u2AB3",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",primes:"\u2119",prnE:"\u2AB5",prnap:"\u2AB9",prnsim:"\u22E8",prod:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",psi:"\u03C8",puncsp:"\u2008",qfr:"\u{1D52E}",qint:"\u2A0C",qopf:"\u{1D562}",qprime:"\u2057",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',rAarr:"\u21DB",rArr:"\u21D2",rAtail:"\u291C",rBarr:"\u290F",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",rightarrow:"\u2192",rightarrowtail:"\u21A3",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",rightthreetimes:"\u22CC",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",rsaquo:"\u203A",rscr:"\u{1D4C7}",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",sbquo:"\u201A",sc:"\u227B",scE:"\u2AB4",scap:"\u2AB8",scaron:"\u0161",sccue:"\u227D",sce:"\u2AB0",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",scnap:"\u2ABA",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",seArr:"\u21D8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",subE:"\u2AC5",subdot:"\u2ABD",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",supE:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tbrk:"\u23B4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",there4:"\u2234",therefore:"\u2234",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",tilde:"\u02DC",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uArr:"\u21D1",uHar:"\u2963",uacute:"\xFA",uarr:"\u2191",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udarr:"\u21C5",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",ugrave:"\xF9",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uml:"\xA8",uogon:"\u0173",uopf:"\u{1D566}",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",upsi:"\u03C5",upsih:"\u03D2",upsilon:"\u03C5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\u{1D4CA}",utdot:"\u22F0",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",uwangle:"\u29A7",vArr:"\u21D5",vBar:"\u2AE8",vBarv:"\u2AE9",vDash:"\u22A8",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vcy:"\u0432",vdash:"\u22A2",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",vert:"|",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\u{1D536}",yicy:"\u0457",yopf:"\u{1D56A}",yscr:"\u{1D4CE}",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeetrf:"\u2128",zeta:"\u03B6",zfr:"\u{1D537}",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"}});function Lt(e){return nk.call(ji,e)?ji[e]:!1}var nk,$r=b(()=>{ql();nk={}.hasOwnProperty});function oe(e,t,r,n){let i=e.length,o=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,r=r>0?r:0,n.length<1e4)a=Array.from(n),a.unshift(t,r),e.splice(...a);else for(r&&e.splice(t,r);o0?(oe(e,e.length,0,t),e):t}var Ge=b(()=>{});function Rl(e){let t={},r=-1;for(;++r{Ge();Nl={}.hasOwnProperty});function Gr(e,t){let r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"\uFFFD":String.fromCodePoint(r)}var Bi=b(()=>{});function We(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Jr=b(()=>{});function Xt(e){return e!==null&&(e<32||e===127)}function E(e){return e!==null&&e<-2}function Y(e){return e!==null&&(e<0||e===32)}function R(e){return e===-2||e===-1||e===32}function Je(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}var ve,he,Ml,Zt,jl,Bl,zl,Vl,$=b(()=>{ve=Je(/[A-Za-z]/),he=Je(/[\dA-Za-z]/),Ml=Je(/[#-'*+\--9=?A-Z^-~]/);Zt=Je(/\d/),jl=Je(/[\dA-Fa-f]/),Bl=Je(/[!-/:-@[-`{-~]/);zl=Je(/\p{P}|\p{S}/u),Vl=Je(/\s/)});function j(e,t,r,n){let i=n?n-1:Number.POSITIVE_INFINITY,o=0;return a;function a(l){return R(l)?(e.enter(r),s(l)):t(l)}function s(l){return R(l)&&o++{$()});function ak(e){let t=e.attempt(this.parser.constructs.contentInitial,n,i),r;return t;function n(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),j(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),o(s)}function o(s){let l=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=l),r=l,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return E(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),a)}}var Wl,Ul=b(()=>{re();$();Wl={tokenize:ak}});function sk(e){let t=this,r=[],n=0,i,o,a;return s;function s(_){if(na))return;let q=t.events.length,D=q,O,P;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(O){P=t.events[D][1].end;break}O=!0}for(k(n),v=q;v_;){let I=r[V];t.containerState=I[1],I[0].exit.call(t,e)}r.length=_}function F(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function lk(e,t,r){return j(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}var $l,Hl,Gl=b(()=>{re();$();Ge();$l={tokenize:sk},Hl={tokenize:lk}});function Tt(e){if(e===null||Y(e)||Vl(e))return 1;if(zl(e))return 2}var zi=b(()=>{$()});function It(e,t,r){let n=[],i=-1;for(;++i{});function uk(e,t){let r=-1,n,i,o,a,s,l,c,u;for(;++r1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;let f={...e[n][1].end},p={...e[r][1].start};Jl(f,-l),Jl(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[n][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:p},o={type:l>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[r][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[n][1].end={...a.start},e[r][1].start={...s.end},c=[],e[n][1].end.offset-e[n][1].start.offset&&(c=pe(c,[["enter",e[n][1],t],["exit",e[n][1],t]])),c=pe(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),c=pe(c,It(t.parser.constructs.insideSpan.null,e.slice(n+1,r),t)),c=pe(c,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[r][1].end.offset-e[r][1].start.offset?(u=2,c=pe(c,[["enter",e[r][1],t],["exit",e[r][1],t]])):u=0,oe(e,n-1,r-n+3,c),r=n+c.length-u-2;break}}for(r=-1;++r{Ge();zi();Qr();er={name:"attention",resolveAll:uk,tokenize:ck}});function fk(e,t,r){let n=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return ve(h)?(e.consume(h),a):h===64?r(h):c(h)}function a(h){return h===43||h===45||h===46||he(h)?(n=1,s(h)):c(h)}function s(h){return h===58?(e.consume(h),n=0,l):(h===43||h===45||h===46||he(h))&&n++<32?(e.consume(h),s):(n=0,c(h))}function l(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||Xt(h)?r(h):(e.consume(h),l)}function c(h){return h===64?(e.consume(h),u):Ml(h)?(e.consume(h),c):r(h)}function u(h){return he(h)?f(h):r(h)}function f(h){return h===46?(e.consume(h),n=0,u):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):p(h)}function p(h){if((h===45||he(h))&&n++<63){let w=h===45?p:f;return e.consume(h),w}return r(h)}}var Vi,Yl=b(()=>{$();Vi={name:"autolink",tokenize:fk}});function pk(e,t,r){return n;function n(o){return R(o)?j(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||E(o)?t(o):r(o)}}var Qe,Yr=b(()=>{re();$();Qe={partial:!0,tokenize:pk}});function hk(e,t,r){let n=this;return i;function i(a){if(a===62){let s=n.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return r(a)}function o(a){return R(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function dk(e,t,r){let n=this;return i;function i(a){return R(a)?j(e,o,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(Kr,t,r)(a)}}function mk(e){e.exit("blockQuote")}var Kr,Kl=b(()=>{re();$();Kr={continuation:{tokenize:dk},exit:mk,name:"blockQuote",tokenize:hk}});function gk(e,t,r){return n;function n(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Bl(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(o)}}var Xr,Xl=b(()=>{$();Xr={name:"characterEscape",tokenize:gk}});function bk(e,t,r){let n=this,i=0,o,a;return s;function s(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,a=he,u(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=jl,u):(e.enter("characterReferenceValue"),o=7,a=Zt,u(f))}function u(f){if(f===59&&i){let p=e.exit("characterReferenceValue");return a===he&&!Lt(n.sliceSerialize(p))?r(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(f)&&i++{$r();$();Zr={name:"characterReference",tokenize:bk}});function wk(e,t,r){let n=this,i={partial:!0,tokenize:I},o=0,a=0,s;return l;function l(v){return c(v)}function c(v){let q=n.events[n.events.length-1];return o=q&&q[1].type==="linePrefix"?q[2].sliceSerialize(q[1],!0).length:0,s=v,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(v)}function u(v){return v===s?(a++,e.consume(v),u):a<3?r(v):(e.exit("codeFencedFenceSequence"),R(v)?j(e,f,"whitespace")(v):f(v))}function f(v){return v===null||E(v)?(e.exit("codeFencedFence"),n.interrupt?t(v):e.check(eu,g,V)(v)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===null||E(v)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(v)):R(v)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),j(e,h,"whitespace")(v)):v===96&&v===s?r(v):(e.consume(v),p)}function h(v){return v===null||E(v)?f(v):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(v))}function w(v){return v===null||E(v)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(v)):v===96&&v===s?r(v):(e.consume(v),w)}function g(v){return e.attempt(i,V,x)(v)}function x(v){return e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),k}function k(v){return o>0&&R(v)?j(e,F,"linePrefix",o+1)(v):F(v)}function F(v){return v===null||E(v)?e.check(eu,g,V)(v):(e.enter("codeFlowValue"),_(v))}function _(v){return v===null||E(v)?(e.exit("codeFlowValue"),F(v)):(e.consume(v),_)}function V(v){return e.exit("codeFenced"),t(v)}function I(v,q,D){let O=0;return P;function P(T){return v.enter("lineEnding"),v.consume(T),v.exit("lineEnding"),B}function B(T){return v.enter("codeFencedFence"),R(T)?j(v,z,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):z(T)}function z(T){return T===s?(v.enter("codeFencedFenceSequence"),S(T)):D(T)}function S(T){return T===s?(O++,v.consume(T),S):O>=a?(v.exit("codeFencedFenceSequence"),R(T)?j(v,L,"whitespace")(T):L(T)):D(T)}function L(T){return T===null||E(T)?(v.exit("codeFencedFence"),q(T)):D(T)}}}function kk(e,t,r){let n=this;return i;function i(a){return a===null?r(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return n.parser.lazy[n.now().line]?r(a):t(a)}}var eu,en,tu=b(()=>{re();$();eu={partial:!0,tokenize:kk},en={concrete:!0,name:"codeFenced",tokenize:wk}});function vk(e,t,r){let n=this;return i;function i(c){return e.enter("codeIndented"),j(e,o,"linePrefix",5)(c)}function o(c){let u=n.events[n.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?a(c):r(c)}function a(c){return c===null?l(c):E(c)?e.attempt(yk,a,l)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||E(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),s)}function l(c){return e.exit("codeIndented"),t(c)}}function xk(e,t,r){let n=this;return i;function i(a){return n.parser.lazy[n.now().line]?r(a):E(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):j(e,o,"linePrefix",5)(a)}function o(a){let s=n.events[n.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):E(a)?i(a):r(a)}}var tr,yk,ru=b(()=>{re();$();tr={name:"codeIndented",tokenize:vk},yk={partial:!0,tokenize:xk}});function _k(e){let t=e.length-4,r=3,n,i;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=r;++n{$();Wi={name:"codeText",previous:Ck,resolve:_k,tokenize:Pk}});function rr(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r{tn=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(t,r,n){let i=r||0;this.setCursor(Math.trunc(t));let o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&rr(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),rr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),rr(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t{Ge();iu()});function Sk(e){return rn(e),e}function Fk(e,t){let r;return n;function n(s){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?o(s):E(s)?e.check(Ek,a,o)(s):(e.consume(s),i)}function o(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function a(s){return e.consume(s),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,i}}function Ok(e,t,r){let n=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),j(e,o,"linePrefix")}function o(a){if(a===null||E(a))return r(a);let s=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):e.interrupt(n.parser.constructs.flow,r,t)(a)}}var Hi,Ek,ou=b(()=>{re();$();Ui();Hi={resolve:Sk,tokenize:Fk},Ek={partial:!0,tokenize:Ok}});function nn(e,t,r,n,i,o,a,s,l){let c=l||Number.POSITIVE_INFINITY,u=0;return f;function f(k){return k===60?(e.enter(n),e.enter(i),e.enter(o),e.consume(k),e.exit(o),p):k===null||k===32||k===41||Xt(k)?r(k):(e.enter(n),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),g(k))}function p(k){return k===62?(e.enter(o),e.consume(k),e.exit(o),e.exit(i),e.exit(n),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),h(k))}function h(k){return k===62?(e.exit("chunkString"),e.exit(s),p(k)):k===null||k===60||E(k)?r(k):(e.consume(k),k===92?w:h)}function w(k){return k===60||k===62||k===92?(e.consume(k),h):h(k)}function g(k){return!u&&(k===null||k===41||Y(k))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(n),t(k)):u{$()});function on(e,t,r,n,i,o){let a=this,s=0,l;return c;function c(h){return e.enter(n),e.enter(i),e.consume(h),e.exit(i),e.enter(o),u}function u(h){return s>999||h===null||h===91||h===93&&!l||h===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?r(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(n),t):E(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||E(h)||s++>999?(e.exit("chunkString"),u(h)):(e.consume(h),l||(l=!R(h)),h===92?p:f)}function p(h){return h===91||h===92||h===93?(e.consume(h),s++,f):f(h)}}var Gi=b(()=>{$()});function an(e,t,r,n,i,o){let a;return s;function s(p){return p===34||p===39||p===40?(e.enter(n),e.enter(i),e.consume(p),e.exit(i),a=p===40?41:p,l):r(p)}function l(p){return p===a?(e.enter(i),e.consume(p),e.exit(i),e.exit(n),t):(e.enter(o),c(p))}function c(p){return p===a?(e.exit(o),l(a)):p===null?r(p):E(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),j(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===a||p===null||E(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?f:u)}function f(p){return p===a||p===92?(e.consume(p),u):u(p)}}var Ji=b(()=>{re();$()});function ft(e,t){let r;return n;function n(i){return E(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),r=!0,n):R(i)?j(e,n,r?"linePrefix":"lineSuffix")(i):t(i)}}var Qi=b(()=>{re();$()});function Tk(e,t,r){let n=this,i;return o;function o(h){return e.enter("definition"),a(h)}function a(h){return on.call(n,e,s,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function s(h){return i=We(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),l):r(h)}function l(h){return Y(h)?ft(e,c)(h):c(h)}function c(h){return nn(e,u,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return e.attempt(Lk,f,f)(h)}function f(h){return R(h)?j(e,p,"whitespace")(h):p(h)}function p(h){return h===null||E(h)?(e.exit("definition"),n.parser.defined.push(i),t(h)):r(h)}}function Ik(e,t,r){return n;function n(s){return Y(s)?ft(e,i)(s):r(s)}function i(s){return an(e,o,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return R(s)?j(e,a,"whitespace")(s):a(s)}function a(s){return s===null||E(s)?t(s):r(s)}}var Yi,Lk,au=b(()=>{$i();Gi();re();Ji();Qi();$();Jr();Yi={name:"definition",tokenize:Tk},Lk={partial:!0,tokenize:Ik}});function qk(e,t,r){return n;function n(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return E(o)?(e.exit("hardBreakEscape"),t(o)):r(o)}}var Ki,su=b(()=>{$();Ki={name:"hardBreakEscape",tokenize:qk}});function Nk(e,t){let r=e.length-2,n=3,i,o;return e[n][1].type==="whitespace"&&(n+=2),r-2>n&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&e[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(i={type:"atxHeadingText",start:e[n][1].start,end:e[r][1].end},o={type:"chunkText",start:e[n][1].start,end:e[r][1].end,contentType:"text"},oe(e,n,r-n+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Rk(e,t,r){let n=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),a(u)}function a(u){return u===35&&n++<6?(e.consume(u),a):u===null||Y(u)?(e.exit("atxHeadingSequence"),s(u)):r(u)}function s(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||E(u)?(e.exit("atxHeading"),t(u)):R(u)?j(e,s,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),s(u))}function c(u){return u===null||u===35||Y(u)?(e.exit("atxHeadingText"),s(u)):(e.consume(u),c)}}var Xi,lu=b(()=>{re();$();Ge();Xi={name:"headingAtx",resolve:Nk,tokenize:Rk}});var uu,Zi,cu=b(()=>{uu=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Zi=["pre","script","style","textarea"]});function jk(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Bk(e,t,r){let n=this,i,o,a,s,l;return c;function c(m){return u(m)}function u(m){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(m),f}function f(m){return m===33?(e.consume(m),p):m===47?(e.consume(m),o=!0,g):m===63?(e.consume(m),i=3,n.interrupt?t:d):ve(m)?(e.consume(m),a=String.fromCharCode(m),x):r(m)}function p(m){return m===45?(e.consume(m),i=2,h):m===91?(e.consume(m),i=5,s=0,w):ve(m)?(e.consume(m),i=4,n.interrupt?t:d):r(m)}function h(m){return m===45?(e.consume(m),n.interrupt?t:d):r(m)}function w(m){let we="CDATA[";return m===we.charCodeAt(s++)?(e.consume(m),s===we.length?n.interrupt?t:z:w):r(m)}function g(m){return ve(m)?(e.consume(m),a=String.fromCharCode(m),x):r(m)}function x(m){if(m===null||m===47||m===62||Y(m)){let we=m===47,rt=a.toLowerCase();return!we&&!o&&Zi.includes(rt)?(i=1,n.interrupt?t(m):z(m)):uu.includes(a.toLowerCase())?(i=6,we?(e.consume(m),k):n.interrupt?t(m):z(m)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(m):o?F(m):_(m))}return m===45||he(m)?(e.consume(m),a+=String.fromCharCode(m),x):r(m)}function k(m){return m===62?(e.consume(m),n.interrupt?t:z):r(m)}function F(m){return R(m)?(e.consume(m),F):P(m)}function _(m){return m===47?(e.consume(m),P):m===58||m===95||ve(m)?(e.consume(m),V):R(m)?(e.consume(m),_):P(m)}function V(m){return m===45||m===46||m===58||m===95||he(m)?(e.consume(m),V):I(m)}function I(m){return m===61?(e.consume(m),v):R(m)?(e.consume(m),I):_(m)}function v(m){return m===null||m===60||m===61||m===62||m===96?r(m):m===34||m===39?(e.consume(m),l=m,q):R(m)?(e.consume(m),v):D(m)}function q(m){return m===l?(e.consume(m),l=null,O):m===null||E(m)?r(m):(e.consume(m),q)}function D(m){return m===null||m===34||m===39||m===47||m===60||m===61||m===62||m===96||Y(m)?I(m):(e.consume(m),D)}function O(m){return m===47||m===62||R(m)?_(m):r(m)}function P(m){return m===62?(e.consume(m),B):r(m)}function B(m){return m===null||E(m)?z(m):R(m)?(e.consume(m),B):r(m)}function z(m){return m===45&&i===2?(e.consume(m),A):m===60&&i===1?(e.consume(m),U):m===62&&i===4?(e.consume(m),Pe):m===63&&i===3?(e.consume(m),d):m===93&&i===5?(e.consume(m),X):E(m)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Dk,De,S)(m)):m===null||E(m)?(e.exit("htmlFlowData"),S(m)):(e.consume(m),z)}function S(m){return e.check(Mk,L,De)(m)}function L(m){return e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),T}function T(m){return m===null||E(m)?S(m):(e.enter("htmlFlowData"),z(m))}function A(m){return m===45?(e.consume(m),d):z(m)}function U(m){return m===47?(e.consume(m),a="",K):z(m)}function K(m){if(m===62){let we=a.toLowerCase();return Zi.includes(we)?(e.consume(m),Pe):z(m)}return ve(m)&&a.length<8?(e.consume(m),a+=String.fromCharCode(m),K):z(m)}function X(m){return m===93?(e.consume(m),d):z(m)}function d(m){return m===62?(e.consume(m),Pe):m===45&&i===2?(e.consume(m),d):z(m)}function Pe(m){return m===null||E(m)?(e.exit("htmlFlowData"),De(m)):(e.consume(m),Pe)}function De(m){return e.exit("htmlFlow"),t(m)}}function zk(e,t,r){let n=this;return i;function i(a){return E(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):r(a)}function o(a){return n.parser.lazy[n.now().line]?r(a):t(a)}}function Vk(e,t,r){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Qe,t,r)}}var eo,Dk,Mk,fu=b(()=>{$();cu();Yr();eo={concrete:!0,name:"htmlFlow",resolveTo:jk,tokenize:Bk},Dk={partial:!0,tokenize:Vk},Mk={partial:!0,tokenize:zk}});function Wk(e,t,r){let n=this,i,o,a;return s;function s(d){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(d),l}function l(d){return d===33?(e.consume(d),c):d===47?(e.consume(d),I):d===63?(e.consume(d),_):ve(d)?(e.consume(d),D):r(d)}function c(d){return d===45?(e.consume(d),u):d===91?(e.consume(d),o=0,w):ve(d)?(e.consume(d),F):r(d)}function u(d){return d===45?(e.consume(d),h):r(d)}function f(d){return d===null?r(d):d===45?(e.consume(d),p):E(d)?(a=f,U(d)):(e.consume(d),f)}function p(d){return d===45?(e.consume(d),h):f(d)}function h(d){return d===62?A(d):d===45?p(d):f(d)}function w(d){let Pe="CDATA[";return d===Pe.charCodeAt(o++)?(e.consume(d),o===Pe.length?g:w):r(d)}function g(d){return d===null?r(d):d===93?(e.consume(d),x):E(d)?(a=g,U(d)):(e.consume(d),g)}function x(d){return d===93?(e.consume(d),k):g(d)}function k(d){return d===62?A(d):d===93?(e.consume(d),k):g(d)}function F(d){return d===null||d===62?A(d):E(d)?(a=F,U(d)):(e.consume(d),F)}function _(d){return d===null?r(d):d===63?(e.consume(d),V):E(d)?(a=_,U(d)):(e.consume(d),_)}function V(d){return d===62?A(d):_(d)}function I(d){return ve(d)?(e.consume(d),v):r(d)}function v(d){return d===45||he(d)?(e.consume(d),v):q(d)}function q(d){return E(d)?(a=q,U(d)):R(d)?(e.consume(d),q):A(d)}function D(d){return d===45||he(d)?(e.consume(d),D):d===47||d===62||Y(d)?O(d):r(d)}function O(d){return d===47?(e.consume(d),A):d===58||d===95||ve(d)?(e.consume(d),P):E(d)?(a=O,U(d)):R(d)?(e.consume(d),O):A(d)}function P(d){return d===45||d===46||d===58||d===95||he(d)?(e.consume(d),P):B(d)}function B(d){return d===61?(e.consume(d),z):E(d)?(a=B,U(d)):R(d)?(e.consume(d),B):O(d)}function z(d){return d===null||d===60||d===61||d===62||d===96?r(d):d===34||d===39?(e.consume(d),i=d,S):E(d)?(a=z,U(d)):R(d)?(e.consume(d),z):(e.consume(d),L)}function S(d){return d===i?(e.consume(d),i=void 0,T):d===null?r(d):E(d)?(a=S,U(d)):(e.consume(d),S)}function L(d){return d===null||d===34||d===39||d===60||d===61||d===96?r(d):d===47||d===62||Y(d)?O(d):(e.consume(d),L)}function T(d){return d===47||d===62||Y(d)?O(d):r(d)}function A(d){return d===62?(e.consume(d),e.exit("htmlTextData"),e.exit("htmlText"),t):r(d)}function U(d){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),K}function K(d){return R(d)?j(e,X,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):X(d)}function X(d){return e.enter("htmlTextData"),a(d)}}var to,pu=b(()=>{re();$();to={name:"htmlText",tokenize:Wk}});function Gk(e){let t=-1,r=[];for(;++t{$i();Gi();Ji();Qi();$();Ge();Jr();Qr();pt={name:"labelEnd",resolveAll:Gk,resolveTo:Jk,tokenize:Qk},Uk={tokenize:Yk},Hk={tokenize:Kk},$k={tokenize:Xk}});function Zk(e,t,r){let n=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),o}function o(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):r(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(s):t(s)}}var ro,hu=b(()=>{sn();ro={name:"labelStartImage",resolveAll:pt.resolveAll,tokenize:Zk}});function ey(e,t,r){let n=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(a):t(a)}}var no,du=b(()=>{sn();no={name:"labelStartLink",resolveAll:pt.resolveAll,tokenize:ey}});function ty(e,t){return r;function r(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),j(e,t,"linePrefix")}}var nr,mu=b(()=>{re();nr={name:"lineEnding",tokenize:ty}});function ry(e,t,r){let n=0,i;return o;function o(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,s(c)}function s(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):n>=3&&(c===null||E(c))?(e.exit("thematicBreak"),t(c)):r(c)}function l(c){return c===i?(e.consume(c),n++,l):(e.exit("thematicBreakSequence"),R(c)?j(e,s,"whitespace")(c):s(c))}}var ht,io=b(()=>{re();$();ht={name:"thematicBreak",tokenize:ry}});function oy(e,t,r){let n=this,i=n.events[n.events.length-1],o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(h){let w=n.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!n.containerState.marker||h===n.containerState.marker:Zt(h)){if(n.containerState.type||(n.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(ht,r,c)(h):c(h);if(!n.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(h)}return r(h)}function l(h){return Zt(h)&&++a<10?(e.consume(h),l):(!n.interrupt||a<2)&&(n.containerState.marker?h===n.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),c(h)):r(h)}function c(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||h,e.check(Qe,n.interrupt?r:u,e.attempt(ny,p,f))}function u(h){return n.containerState.initialBlankLine=!0,o++,p(h)}function f(h){return R(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):r(h)}function p(h){return n.containerState.size=o+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function ay(e,t,r){let n=this;return n.containerState._closeFlow=void 0,e.check(Qe,i,o);function i(s){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,j(e,t,"listItemIndent",n.containerState.size+1)(s)}function o(s){return n.containerState.furtherBlankLines||!R(s)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,a(s)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(iy,t,a)(s))}function a(s){return n.containerState._closeFlow=!0,n.interrupt=void 0,j(e,e.attempt(se,t,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function sy(e,t,r){let n=this;return j(e,i,"listItemIndent",n.containerState.size+1);function i(o){let a=n.events[n.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===n.containerState.size?t(o):r(o)}}function ly(e){e.exit(this.containerState.type)}function uy(e,t,r){let n=this;return j(e,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){let a=n.events[n.events.length-1];return!R(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):r(o)}}var se,ny,iy,gu=b(()=>{re();$();Yr();io();se={continuation:{tokenize:ay},exit:ly,name:"list",tokenize:oy},ny={partial:!0,tokenize:uy},iy={partial:!0,tokenize:sy}});function cy(e,t){let r=e.length,n,i,o;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){n=r;break}e[r][1].type==="paragraph"&&(i=r)}else e[r][1].type==="content"&&e.splice(r,1),!o&&e[r][1].type==="definition"&&(o=r);let a={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=a,e.push(["exit",a,t]),e}function fy(e,t,r){let n=this,i;return o;function o(c){let u=n.events.length,f;for(;u--;)if(n.events[u][1].type!=="lineEnding"&&n.events[u][1].type!=="linePrefix"&&n.events[u][1].type!=="content"){f=n.events[u][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||f)?(e.enter("setextHeadingLine"),i=c,a(c)):r(c)}function a(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),R(c)?j(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||E(c)?(e.exit("setextHeadingLine"),t(c)):r(c)}}var ln,bu=b(()=>{re();$();ln={name:"setextUnderline",resolveTo:cy,tokenize:fy}});var oo=b(()=>{Ql();Yl();Yr();Kl();Xl();Zl();tu();ru();nu();ou();au();su();lu();fu();pu();sn();hu();du();mu();gu();bu();io()});function py(e){let t=this,r=e.attempt(Qe,n,e.attempt(this.parser.constructs.flowInitial,i,j(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Hi,i)),"linePrefix")));return r;function n(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,r}}var wu,ku=b(()=>{oo();re();wu={tokenize:py}});function _u(e){return{resolveAll:Cu(e==="text"?hy:void 0),tokenize:t};function t(r){let n=this,i=this.parser.constructs[e],o=r.attempt(i,a,s);return a;function a(u){return c(u)?o(u):s(u)}function s(u){if(u===null){r.consume(u);return}return r.enter("data"),r.consume(u),l}function l(u){return c(u)?(r.exit("data"),o(u)):(r.consume(u),l)}function c(u){if(u===null)return!0;let f=i[u],p=-1;if(f)for(;++p{yu={resolveAll:Cu()},vu=_u("string"),xu=_u("text")});var so={};_r(so,{attentionMarkers:()=>vy,contentInitial:()=>my,disable:()=>xy,document:()=>dy,flow:()=>by,flowInitial:()=>gy,insideSpan:()=>yy,string:()=>wy,text:()=>ky});var dy,my,gy,by,wy,ky,yy,vy,xy,Pu=b(()=>{oo();ao();dy={42:se,43:se,45:se,48:se,49:se,50:se,51:se,52:se,53:se,54:se,55:se,56:se,57:se,62:Kr},my={91:Yi},gy={[-2]:tr,[-1]:tr,32:tr},by={35:Xi,42:ht,45:[ln,ht],60:eo,61:ln,95:ht,96:en,126:en},wy={38:Zr,92:Xr},ky={[-5]:nr,[-4]:nr,[-3]:nr,33:ro,38:Zr,42:er,60:[Vi,to],91:no,92:[Ki,Xr],93:pt,95:er,96:Wi},yy={null:[er,yu]},vy={null:[42,95]},xy={null:[]}});function Au(e,t,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0},i={},o=[],a=[],s=[],l=!0,c={attempt:O(q),check:O(D),consume:V,enter:I,exit:v,interrupt:O(D,{interrupt:!0})},u={code:null,containerState:{},defineSkip:k,events:[],now:x,parser:e,previous:null,sliceSerialize:w,sliceStream:g,write:h},f=t.tokenize.call(u,c),p;return t.resolveAll&&o.push(t),u;function h(S){return a=pe(a,S),F(),a[a.length-1]!==null?[]:(P(t,0),u.events=It(o,u.events,u),u.events)}function w(S,L){return Cy(g(S),L)}function g(S){return _y(a,S)}function x(){let{_bufferIndex:S,_index:L,line:T,column:A,offset:U}=n;return{_bufferIndex:S,_index:L,line:T,column:A,offset:U}}function k(S){i[S.line]=S.column,z()}function F(){let S;for(;n._index-1){let s=a[0];typeof s=="string"?a[0]=s.slice(n):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function Cy(e,t){let r=-1,n=[],i;for(;++r{$();Ge();Qr()});function lo(e){let n={constructs:Rl([so,...(e||{}).extensions||[]]),content:i(Wl),defined:[],document:i($l),flow:i(wu),lazy:{},string:i(vu),text:i(xu)};return n;function i(o){return a;function a(s){return Au(n,o,s)}}}var Su=b(()=>{Dl();Ul();Gl();ku();ao();Pu();Eu()});function uo(e){for(;!rn(e););return e}var TA,Fu=b(()=>{Ui();TA=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"}});function co(){let e=1,t="",r=!0,n;return i;function i(o,a,s){let l=[],c,u,f,p,h;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),f=0,t="",r&&(o.charCodeAt(0)===65279&&f++,r=void 0);f{NA=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"},Ou=/[\0\t\n\r]/g});var DA,Tu=b(()=>{Su();Fu();Lu();DA=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"}});function un(e){return e.replace(Py,Ay)}function Ay(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){let i=r.charCodeAt(1),o=i===120||i===88;return Gr(r.slice(o?2:1),o?16:10)}return Lt(r)||e}var Py,fo=b(()=>{$r();Bi();Py=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi});function Ye(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Iu(e.position):"start"in e||"end"in e?Iu(e):"line"in e||"column"in e?po(e):""}function po(e){return qu(e&&e.line)+":"+qu(e&&e.column)}function Iu(e){return po(e&&e.start)+"-"+po(e&&e.end)}function qu(e){return e&&typeof e=="number"?e:1}var Nu=b(()=>{});var ho=b(()=>{Nu()});function mo(e,t,r){return typeof t!="string"&&(r=t,t=void 0),Ey(r)(uo(lo(r).document().write(co()(e,t,!0))))}function Ey(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Da),autolinkProtocol:O,autolinkEmail:O,atxHeading:o(qa),blockQuote:o(Me),characterEscape:O,characterReference:O,codeFenced:o(nt),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(nt,a),codeText:o(xt,a),codeTextData:O,data:O,codeFlowValue:O,definition:o(zn),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(Fh),hardBreakEscape:o(Na),hardBreakTrailing:o(Na),htmlFlow:o(Ra,a),htmlFlowData:O,htmlText:o(Ra,a),htmlTextData:O,image:o(Oh),label:a,link:o(Da),listItem:o(Lh),listItemValue:p,listOrdered:o(Ma,f),listUnordered:o(Ma),paragraph:o(Th),reference:m,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(qa),strong:o(Ih),thematicBreak:o(Nh)},exit:{atxHeading:l(),atxHeadingSequence:I,autolink:l(),autolinkEmail:zt,autolinkProtocol:ie,blockQuote:l(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:rt,characterReferenceMarkerNumeric:rt,characterReferenceValue:Bn,characterReference:vr,codeFenced:l(x),codeFencedFence:g,codeFencedFenceInfo:h,codeFencedFenceMeta:w,codeFlowValue:P,codeIndented:l(k),codeText:l(T),codeTextData:P,data:P,definition:l(),definitionDestinationString:V,definitionLabelString:F,definitionTitleString:_,emphasis:l(),hardBreakEscape:l(z),hardBreakTrailing:l(z),htmlFlow:l(S),htmlFlowData:P,htmlText:l(L),htmlTextData:P,image:l(U),label:X,labelText:K,lineEnding:B,link:l(A),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:we,resourceDestinationString:d,resourceTitleString:Pe,resource:De,setextHeading:l(D),setextHeadingLineSequence:q,setextHeadingText:v,strong:l(),thematicBreak:l()}};Mu(t,(e||{}).mdastExtensions||[]);let r={};return n;function n(y){let C={type:"root",children:[]},M={stack:[C],tokenStack:[],config:t,enter:s,exit:c,buffer:a,resume:u,data:r},W=[],G=-1;for(;++G0){let Fe=M.tokenStack[M.tokenStack.length-1];(Fe[1]||Ru).call(M,void 0,Fe[0])}for(C.position={start:Ke(y.length>0?y[0][1].start:{line:1,column:1,offset:0}),end:Ke(y.length>0?y[y.length-2][1].end:{line:1,column:1,offset:0})},G=-1;++G{Hr();Tu();Bi();fo();Jr();$r();ho();JA=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"},Du={}.hasOwnProperty});var Bu=b(()=>{ju()});function ir(e){let t=this;t.parser=r;function r(n){return mo(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}var zu=b(()=>{Bu()});var Vu={};_r(Vu,{default:()=>ir});var go=b(()=>{zu()});function Uu(e,t){let r=t||{};function n(i,...o){let a=n.invalid,s=n.handlers;if(i&&Wu.call(i,e)){let l=String(i[e]);a=Wu.call(s,l)?s[l]:n.unknown}if(a)return a.call(this,i,...o)}return n.handlers=r.handlers||{},n.invalid=r.invalid,n.unknown=r.unknown,n}var Wu,Hu=b(()=>{Wu={}.hasOwnProperty});function bo(e,t){let r=-1,n;if(t.extensions)for(;++r{Fy={}.hasOwnProperty});function Ju(e,t,r,n){let i=r.enter("blockquote"),o=r.createTracker(n);o.move("> "),o.shift(2);let a=r.indentLines(r.containerFlow(e,o.current()),Ly);return i(),a}function Ly(e,t,r){return">"+(r?"":" ")+e}var Qu=b(()=>{});function cn(e,t){return Yu(e,t.inConstruct,!0)&&!Yu(e,t.notInConstruct,!1)}function Yu(e,t,r){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return r;let n=-1;for(;++n{});function ko(e,t,r,n){let i=-1;for(;++i{wo()});function Xu(e,t){let r=String(e),n=r.indexOf(t),i=n,o=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;n!==-1;)n===i?++o>a&&(a=o):o=1,i=n+t.length,n=r.indexOf(t,i);return a}var Zu=b(()=>{});function or(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}var yo=b(()=>{});function ec(e){let t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}var tc=b(()=>{});function rc(e,t,r,n){let i=ec(r),o=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(or(e,r)){let f=r.enter("codeIndented"),p=r.indentLines(o,Ty);return f(),p}let s=r.createTracker(n),l=i.repeat(Math.max(Xu(o,i)+1,3)),c=r.enter("codeFenced"),u=s.move(l);if(e.lang){let f=r.enter(`codeFencedLang${a}`);u+=s.move(r.safe(e.lang,{before:u,after:" ",encode:["`"],...s.current()})),f()}if(e.lang&&e.meta){let f=r.enter(`codeFencedMeta${a}`);u+=s.move(" "),u+=s.move(r.safe(e.meta,{before:u,after:` -`,encode:["`"],...s.current()})),f()}return u+=s.move(` -`),o&&(u+=s.move(o+` -`)),u+=s.move(l),c(),u}function Ty(e,t,r){return(r?"":" ")+e}var nc=b(()=>{Zu();yo();tc()});function qt(e){let t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}var fn=b(()=>{});function ic(e,t,r,n){let i=qt(r),o=i==='"'?"Quote":"Apostrophe",a=r.enter("definition"),s=r.enter("label"),l=r.createTracker(n),c=l.move("[");return c+=l.move(r.safe(r.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=r.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(r.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=r.enter("destinationRaw"),c+=l.move(r.safe(e.url,{before:c,after:e.title?" ":` -`,...l.current()}))),s(),e.title&&(s=r.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(r.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),a(),c}var oc=b(()=>{fn()});function ac(e){let t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}var sc=b(()=>{});function xe(e){return"&#x"+e.toString(16).toUpperCase()+";"}var Nt=b(()=>{});function Rt(e,t,r){let n=Tt(e),i=Tt(t);return n===void 0?i===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}var vo=b(()=>{zi()});function xo(e,t,r,n){let i=ac(r),o=r.enter("emphasis"),a=r.createTracker(n),s=a.move(i),l=a.move(r.containerPhrasing(e,{after:i,before:s,...a.current()})),c=l.charCodeAt(0),u=Rt(n.before.charCodeAt(n.before.length-1),c,i);u.inside&&(l=xe(c)+l.slice(1));let f=l.charCodeAt(l.length-1),p=Rt(n.after.charCodeAt(0),f,i);p.inside&&(l=l.slice(0,-1)+xe(f));let h=a.move(i);return o(),r.attentionEncodeSurroundingInfo={after:p.outside,before:u.outside},s+l+h}function Iy(e,t,r){return r.options.emphasis||"*"}var lc=b(()=>{sc();Nt();vo();xo.peek=Iy});function qy(e){let t=[],r=-1;for(;++r{Dt=function(e){if(e==null)return Dy;if(typeof e=="function")return pn(e);if(typeof e=="object")return Array.isArray(e)?qy(e):Ny(e);if(typeof e=="string")return Ry(e);throw new Error("Expected function, string, or object as test")}});var _o=b(()=>{uc()});function cc(e){return"\x1B[33m"+e+"\x1B[39m"}var fc=b(()=>{});function Co(e,t,r,n){let i;typeof t=="function"&&typeof r!="function"?(n=r,r=t):i=t;let o=Dt(i),a=n?-1:1;s(e,void 0,[])();function s(l,c,u){let f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){let h=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(p,"name",{value:"node ("+cc(l.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=pc,w,g,x;if((!t||o(l,c,u[u.length-1]||void 0))&&(h=jy(r(l,u)),h[0]===dt))return h;if("children"in l&&l.children){let k=l;if(k.children&&h[0]!==dn)for(g=(n?k.children.length:-1)+a,x=u.concat(k);g>-1&&g{_o();fc();pc=[],hn=!0,dt=!1,dn="skip"});var Po=b(()=>{hc()});function Ao(e,t,r,n){let i,o,a;typeof t=="function"&&typeof r!="function"?(o=void 0,a=t,i=r):(o=t,a=r,i=n),Co(e,o,s,i);function s(l,c){let u=c[c.length-1],f=u?u.children.indexOf(l):void 0;return a(l,f,u)}}var dc=b(()=>{Po();Po()});var mc=b(()=>{dc()});function mn(e,t){let r=!1;return Ao(e,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return r=!0,dt}),!!((!e.depth||e.depth<3)&&ct(e)&&(t.options.setext||r))}var Eo=b(()=>{mc();Hr()});function gc(e,t,r,n){let i=Math.max(Math.min(6,e.depth||1),1),o=r.createTracker(n);if(mn(e,r)){let u=r.enter("headingSetext"),f=r.enter("phrasing"),p=r.containerPhrasing(e,{...o.current(),before:` +`+s),e.push(o+"m+"+hi.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=Kp()+t+" "+e[0]}function Kp(){return be.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Xp(...e){return process.stderr.write(di.formatWithOptions(be.inspectOpts,...e)+` +`)}function eg(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function tg(){return process.env.DEBUG}function ng(e){e.inspectOpts={};let t=Object.keys(be.inspectOpts);for(let n=0;nt.trim()).join(" ")};eu.O=function(e){return this.inspectOpts.colors=this.useColors,di.inspect(e,this.inspectOpts)}});var nu=Xe((Ny,hs)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?hs.exports=ql():hs.exports=tu()});var gu=Xe((xi,pu)=>{(function(e,t){typeof xi=="object"&&typeof pu<"u"?t(xi):typeof define=="function"&&define.amd?define(["exports"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.compareVersions={}))})(xi,function(e){"use strict";let t=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,n=T=>{if(typeof T!="string")throw new TypeError("Invalid argument expected string");let C=T.match(t);if(!C)throw new Error(`Invalid argument not valid semver ('${T}' received)`);return C.shift(),C},i=T=>T==="*"||T==="x"||T==="X",o=T=>{let C=parseInt(T,10);return isNaN(C)?T:C},s=(T,C)=>typeof T!=typeof C?[String(T),String(C)]:[T,C],l=(T,C)=>{if(i(T)||i(C))return 0;let[A,P]=s(o(T),o(C));return A>P?1:A{for(let A=0;A{let A=n(T),P=n(C),Y=A.pop(),B=P.pop(),_=u(A,P);return _!==0?_:Y&&B?u(Y.split("."),B.split(".")):Y||B?Y?-1:1:0},m=(T,C,A)=>{w(A);let P=f(T,C);return h[A].includes(P)},h={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},p=Object.keys(h),w=T=>{if(typeof T!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof T}`);if(p.indexOf(T)===-1)throw new Error(`Invalid operator, expected one of ${p.join("|")}`)},k=(T,C)=>{if(C=C.replace(/([><=]+)\s+/g,"$1"),C.includes("||"))return C.split("||").some(ee=>k(T,ee));if(C.includes(" - ")){let[ee,ue]=C.split(" - ",2);return k(T,`>=${ee} <=${ue}`)}else if(C.includes(" "))return C.trim().replace(/\s{2,}/g," ").split(" ").every(ee=>k(T,ee));let A=C.match(/^([<>=~^]+)/),P=A?A[1]:"=";if(P!=="^"&&P!=="~")return m(T,C,P);let[Y,B,_,,J]=n(T),[j,G,ne,,oe]=n(C),X=[Y,B,_],N=[j,G??"x",ne??"x"];if(oe&&(!J||u(X,N)!==0||u(J.split("."),oe.split("."))===-1))return!1;let H=N.findIndex(ee=>ee!=="0")+1,W=P==="~"?2:H>1?H:1;return!(u(X.slice(0,W),N.slice(0,W))!==0||u(X.slice(W),N.slice(W))===-1)},v=T=>typeof T=="string"&&/^[v\d]/.test(T)&&t.test(T),F=T=>typeof T=="string"&&/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/.test(T);e.compare=m,e.compareVersions=f,e.satisfies=k,e.validate=v,e.validateStrict=F})});var jc=Xe((L1,$c)=>{"use strict";var $i=Object.prototype.hasOwnProperty,Vc=Object.prototype.toString,Yc=Object.defineProperty,Wc=Object.getOwnPropertyDescriptor,zc=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Vc.call(t)==="[object Array]"},Bc=function(t){if(!t||Vc.call(t)!=="[object Object]")return!1;var n=$i.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&$i.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;var o;for(o in t);return typeof o>"u"||$i.call(t,o)},Hc=function(t,n){Yc&&n.name==="__proto__"?Yc(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Uc=function(t,n){if(n==="__proto__")if($i.call(t,n)){if(Wc)return Wc(t,n).value}else return;return t[n]};$c.exports=function e(){var t,n,i,o,s,l,u=arguments[0],f=1,m=arguments.length,h=!1;for(typeof u=="boolean"&&(h=u,u=arguments[1]||{},f=2),(u==null||typeof u!="object"&&typeof u!="function")&&(u={});f{(function(e,t){typeof Pa=="object"&&typeof er<"u"?er.exports=t():typeof define=="function"&&define.amd?define(t):e.moment=t()})(Pa,function(){"use strict";var e;function t(){return e.apply(null,arguments)}function n(r){e=r}function i(r){return r instanceof Array||Object.prototype.toString.call(r)==="[object Array]"}function o(r){return r!=null&&Object.prototype.toString.call(r)==="[object Object]"}function s(r,a){return Object.prototype.hasOwnProperty.call(r,a)}function l(r){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(r).length===0;var a;for(a in r)if(s(r,a))return!1;return!0}function u(r){return r===void 0}function f(r){return typeof r=="number"||Object.prototype.toString.call(r)==="[object Number]"}function m(r){return r instanceof Date||Object.prototype.toString.call(r)==="[object Date]"}function h(r,a){var c=[],d,g=r.length;for(d=0;d>>0,d;for(d=0;d0)for(c=0;c=0;return(x?c?"+":"":"-")+Math.pow(10,Math.max(0,g)).toString().substr(1)+d}var ze=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,b=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Se={},_e={};function y(r,a,c,d){var g=d;typeof d=="string"&&(g=function(){return this[d]()}),r&&(_e[r]=g),a&&(_e[a[0]]=function(){return fe(g.apply(this,arguments),a[1],a[2])}),c&&(_e[c]=function(){return this.localeData().ordinal(g.apply(this,arguments),r)})}function Pe(r){return r.match(/\[[\s\S]/)?r.replace(/^\[|\]$/g,""):r.replace(/\\/g,"")}function Ct(r){var a=r.match(ze),c,d;for(c=0,d=a.length;c=0&&b.test(r);)r=r.replace(b,d),b.lastIndex=0,c-=1;return r}var pe={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function nn(r){var a=this._longDateFormat[r],c=this._longDateFormat[r.toUpperCase()];return a||!c?a:(this._longDateFormat[r]=c.match(ze).map(function(d){return d==="MMMM"||d==="MM"||d==="DD"||d==="dddd"?d.slice(1):d}).join(""),this._longDateFormat[r])}var st="Invalid date";function St(){return this._invalidDate}var zt="%d",tr=/\d{1,2}/;function Do(r){return this._ordinal.replace("%d",r)}var Yr={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Wr(r,a,c,d){var g=this._relativeTime[c];return oe(g)?g(r,a,c,d):g.replace(/%d/i,r)}function zr(r,a){var c=this._relativeTime[r>0?"future":"past"];return oe(c)?c(a):c.replace(/%s/i,a)}var Br={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Me(r){return typeof r=="string"?Br[r]||Br[r.toLowerCase()]:void 0}function Cn(r){var a={},c,d;for(d in r)s(r,d)&&(c=Me(d),c&&(a[c]=r[d]));return a}var Ro={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function No(r){var a=[],c;for(c in r)s(r,c)&&a.push({unit:c,priority:Ro[c]});return a.sort(function(d,g){return d.priority-g.priority}),a}var Hr=/\d/,Ie=/\d\d/,Ur=/\d{3}/,E=/\d{4}/,I=/[+-]?\d{6}/,L=/\d\d?/,q=/\d\d\d\d?/,re=/\d\d\d\d\d\d?/,Ee=/\d{1,3}/,at=/\d{1,4}/,Be=/[+-]?\d{1,6}/,Je=/\d+/,pt=/[+-]?\d+/,Le=/Z|[+-]\d\d:?\d\d/gi,lt=/Z|[+-]\d\d(?::?\d\d)?/gi,ut=/[+-]?\d+(\.\d{1,3})?/,nr=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Sn=/^[1-9]\d?/,Yo=/^([1-9]\d|\d)/,Vr;Vr={};function D(r,a,c){Vr[r]=oe(a)?a:function(d,g){return d&&c?c:a}}function Rf(r,a){return s(Vr,r)?Vr[r](a._strict,a._locale):new RegExp(Nf(r))}function Nf(r){return _t(r.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,c,d,g,x){return c||d||g||x}))}function _t(r){return r.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Ke(r){return r<0?Math.ceil(r)||0:Math.floor(r)}function Z(r){var a=+r,c=0;return a!==0&&isFinite(a)&&(c=Ke(a)),c}var Wo={};function ie(r,a){var c,d=a,g;for(typeof r=="string"&&(r=[r]),f(a)&&(d=function(x,S){S[a]=Z(x)}),g=r.length,c=0;c68?1900:2e3)};var Ra=_n("FullYear",!0);function Bf(){return $r(this.year())}function _n(r,a){return function(c){return c!=null?(Na(this,r,c),t.updateOffset(this,a),this):or(this,r)}}function or(r,a){if(!r.isValid())return NaN;var c=r._d,d=r._isUTC;switch(a){case"Milliseconds":return d?c.getUTCMilliseconds():c.getMilliseconds();case"Seconds":return d?c.getUTCSeconds():c.getSeconds();case"Minutes":return d?c.getUTCMinutes():c.getMinutes();case"Hours":return d?c.getUTCHours():c.getHours();case"Date":return d?c.getUTCDate():c.getDate();case"Day":return d?c.getUTCDay():c.getDay();case"Month":return d?c.getUTCMonth():c.getMonth();case"FullYear":return d?c.getUTCFullYear():c.getFullYear();default:return NaN}}function Na(r,a,c){var d,g,x,S,O;if(!(!r.isValid()||isNaN(c))){switch(d=r._d,g=r._isUTC,a){case"Milliseconds":return void(g?d.setUTCMilliseconds(c):d.setMilliseconds(c));case"Seconds":return void(g?d.setUTCSeconds(c):d.setSeconds(c));case"Minutes":return void(g?d.setUTCMinutes(c):d.setMinutes(c));case"Hours":return void(g?d.setUTCHours(c):d.setHours(c));case"Date":return void(g?d.setUTCDate(c):d.setDate(c));case"FullYear":break;default:return}x=c,S=r.month(),O=r.date(),O=O===29&&S===1&&!$r(x)?28:O,g?d.setUTCFullYear(x,S,O):d.setFullYear(x,S,O)}}function Hf(r){return r=Me(r),oe(this[r])?this[r]():this}function Uf(r,a){if(typeof r=="object"){r=Cn(r);var c=No(r),d,g=c.length;for(d=0;d=0?(O=new Date(r+400,a,c,d,g,x,S),isFinite(O.getFullYear())&&O.setFullYear(r)):O=new Date(r,a,c,d,g,x,S),O}function sr(r){var a,c;return r<100&&r>=0?(c=Array.prototype.slice.call(arguments),c[0]=r+400,a=new Date(Date.UTC.apply(null,c)),isFinite(a.getUTCFullYear())&&a.setUTCFullYear(r)):a=new Date(Date.UTC.apply(null,arguments)),a}function jr(r,a,c){var d=7+a-c,g=(7+sr(r,0,d).getUTCDay()-a)%7;return-g+d-1}function Ua(r,a,c,d,g){var x=(7+c-d)%7,S=jr(r,d,g),O=1+7*(a-1)+x+S,z,Q;return O<=0?(z=r-1,Q=ir(z)+O):O>ir(r)?(z=r+1,Q=O-ir(r)):(z=r,Q=O),{year:z,dayOfYear:Q}}function ar(r,a,c){var d=jr(r.year(),a,c),g=Math.floor((r.dayOfYear()-d-1)/7)+1,x,S;return g<1?(S=r.year()-1,x=g+At(S,a,c)):g>At(r.year(),a,c)?(x=g-At(r.year(),a,c),S=r.year()+1):(S=r.year(),x=g),{week:x,year:S}}function At(r,a,c){var d=jr(r,a,c),g=jr(r+1,a,c);return(ir(r)-d+g)/7}y("w",["ww",2],"wo","week"),y("W",["WW",2],"Wo","isoWeek"),D("w",L,Sn),D("ww",L,Ie),D("W",L,Sn),D("WW",L,Ie),rr(["w","ww","W","WW"],function(r,a,c,d){a[d.substr(0,1)]=Z(r)});function nd(r){return ar(r,this._week.dow,this._week.doy).week}var rd={dow:0,doy:6};function id(){return this._week.dow}function od(){return this._week.doy}function sd(r){var a=this.localeData().week(this);return r==null?a:this.add((r-a)*7,"d")}function ad(r){var a=ar(this,1,4).week;return r==null?a:this.add((r-a)*7,"d")}y("d",0,"do","day"),y("dd",0,0,function(r){return this.localeData().weekdaysMin(this,r)}),y("ddd",0,0,function(r){return this.localeData().weekdaysShort(this,r)}),y("dddd",0,0,function(r){return this.localeData().weekdays(this,r)}),y("e",0,0,"weekday"),y("E",0,0,"isoWeekday"),D("d",L),D("e",L),D("E",L),D("dd",function(r,a){return a.weekdaysMinRegex(r)}),D("ddd",function(r,a){return a.weekdaysShortRegex(r)}),D("dddd",function(r,a){return a.weekdaysRegex(r)}),rr(["dd","ddd","dddd"],function(r,a,c,d){var g=c._locale.weekdaysParse(r,d,c._strict);g!=null?a.d=g:v(c).invalidWeekday=r}),rr(["d","e","E"],function(r,a,c,d){a[d]=Z(r)});function ld(r,a){return typeof r!="string"?r:isNaN(r)?(r=a.weekdaysParse(r),typeof r=="number"?r:null):parseInt(r,10)}function ud(r,a){return typeof r=="string"?a.weekdaysParse(r)%7||7:isNaN(r)?null:r}function Bo(r,a){return r.slice(a,7).concat(r.slice(0,a))}var cd="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Va="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),fd="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),dd=nr,hd=nr,md=nr;function pd(r,a){var c=i(this._weekdays)?this._weekdays:this._weekdays[r&&r!==!0&&this._weekdays.isFormat.test(a)?"format":"standalone"];return r===!0?Bo(c,this._week.dow):r?c[r.day()]:c}function gd(r){return r===!0?Bo(this._weekdaysShort,this._week.dow):r?this._weekdaysShort[r.day()]:this._weekdaysShort}function wd(r){return r===!0?Bo(this._weekdaysMin,this._week.dow):r?this._weekdaysMin[r.day()]:this._weekdaysMin}function kd(r,a,c){var d,g,x,S=r.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],d=0;d<7;++d)x=w([2e3,1]).day(d),this._minWeekdaysParse[d]=this.weekdaysMin(x,"").toLocaleLowerCase(),this._shortWeekdaysParse[d]=this.weekdaysShort(x,"").toLocaleLowerCase(),this._weekdaysParse[d]=this.weekdays(x,"").toLocaleLowerCase();return c?a==="dddd"?(g=de.call(this._weekdaysParse,S),g!==-1?g:null):a==="ddd"?(g=de.call(this._shortWeekdaysParse,S),g!==-1?g:null):(g=de.call(this._minWeekdaysParse,S),g!==-1?g:null):a==="dddd"?(g=de.call(this._weekdaysParse,S),g!==-1||(g=de.call(this._shortWeekdaysParse,S),g!==-1)?g:(g=de.call(this._minWeekdaysParse,S),g!==-1?g:null)):a==="ddd"?(g=de.call(this._shortWeekdaysParse,S),g!==-1||(g=de.call(this._weekdaysParse,S),g!==-1)?g:(g=de.call(this._minWeekdaysParse,S),g!==-1?g:null)):(g=de.call(this._minWeekdaysParse,S),g!==-1||(g=de.call(this._weekdaysParse,S),g!==-1)?g:(g=de.call(this._shortWeekdaysParse,S),g!==-1?g:null))}function yd(r,a,c){var d,g,x;if(this._weekdaysParseExact)return kd.call(this,r,a,c);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;d<7;d++){if(g=w([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(g,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(g,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(g,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[d]||(x="^"+this.weekdays(g,"")+"|^"+this.weekdaysShort(g,"")+"|^"+this.weekdaysMin(g,""),this._weekdaysParse[d]=new RegExp(x.replace(".",""),"i")),c&&a==="dddd"&&this._fullWeekdaysParse[d].test(r))return d;if(c&&a==="ddd"&&this._shortWeekdaysParse[d].test(r))return d;if(c&&a==="dd"&&this._minWeekdaysParse[d].test(r))return d;if(!c&&this._weekdaysParse[d].test(r))return d}}function xd(r){if(!this.isValid())return r!=null?this:NaN;var a=or(this,"Day");return r!=null?(r=ld(r,this.localeData()),this.add(r-a,"d")):a}function bd(r){if(!this.isValid())return r!=null?this:NaN;var a=(this.day()+7-this.localeData()._week.dow)%7;return r==null?a:this.add(r-a,"d")}function vd(r){if(!this.isValid())return r!=null?this:NaN;if(r!=null){var a=ud(r,this.localeData());return this.day(this.day()%7?a:a-7)}else return this.day()||7}function Cd(r){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ho.call(this),r?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=dd),this._weekdaysStrictRegex&&r?this._weekdaysStrictRegex:this._weekdaysRegex)}function Sd(r){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ho.call(this),r?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=hd),this._weekdaysShortStrictRegex&&r?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function _d(r){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ho.call(this),r?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=md),this._weekdaysMinStrictRegex&&r?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ho(){function r(Oe,Lt){return Lt.length-Oe.length}var a=[],c=[],d=[],g=[],x,S,O,z,Q;for(x=0;x<7;x++)S=w([2e3,1]).day(x),O=_t(this.weekdaysMin(S,"")),z=_t(this.weekdaysShort(S,"")),Q=_t(this.weekdays(S,"")),a.push(O),c.push(z),d.push(Q),g.push(O),g.push(z),g.push(Q);a.sort(r),c.sort(r),d.sort(r),g.sort(r),this._weekdaysRegex=new RegExp("^("+g.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Uo(){return this.hours()%12||12}function Ed(){return this.hours()||24}y("H",["HH",2],0,"hour"),y("h",["hh",2],0,Uo),y("k",["kk",2],0,Ed),y("hmm",0,0,function(){return""+Uo.apply(this)+fe(this.minutes(),2)}),y("hmmss",0,0,function(){return""+Uo.apply(this)+fe(this.minutes(),2)+fe(this.seconds(),2)}),y("Hmm",0,0,function(){return""+this.hours()+fe(this.minutes(),2)}),y("Hmmss",0,0,function(){return""+this.hours()+fe(this.minutes(),2)+fe(this.seconds(),2)});function $a(r,a){y(r,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),a)})}$a("a",!0),$a("A",!1);function ja(r,a){return a._meridiemParse}D("a",ja),D("A",ja),D("H",L,Yo),D("h",L,Sn),D("k",L,Sn),D("HH",L,Ie),D("hh",L,Ie),D("kk",L,Ie),D("hmm",q),D("hmmss",re),D("Hmm",q),D("Hmmss",re),ie(["H","HH"],ge),ie(["k","kk"],function(r,a,c){var d=Z(r);a[ge]=d===24?0:d}),ie(["a","A"],function(r,a,c){c._isPm=c._locale.isPM(r),c._meridiem=r}),ie(["h","hh"],function(r,a,c){a[ge]=Z(r),v(c).bigHour=!0}),ie("hmm",function(r,a,c){var d=r.length-2;a[ge]=Z(r.substr(0,d)),a[ct]=Z(r.substr(d)),v(c).bigHour=!0}),ie("hmmss",function(r,a,c){var d=r.length-4,g=r.length-2;a[ge]=Z(r.substr(0,d)),a[ct]=Z(r.substr(d,2)),a[Tt]=Z(r.substr(g)),v(c).bigHour=!0}),ie("Hmm",function(r,a,c){var d=r.length-2;a[ge]=Z(r.substr(0,d)),a[ct]=Z(r.substr(d))}),ie("Hmmss",function(r,a,c){var d=r.length-4,g=r.length-2;a[ge]=Z(r.substr(0,d)),a[ct]=Z(r.substr(d,2)),a[Tt]=Z(r.substr(g))});function Td(r){return(r+"").toLowerCase().charAt(0)==="p"}var Ad=/[ap]\.?m?\.?/i,Fd=_n("Hours",!0);function Pd(r,a,c){return r>11?c?"pm":"PM":c?"am":"AM"}var Ga={calendar:ee,longDateFormat:pe,invalidDate:st,ordinal:zt,dayOfMonthOrdinalParse:tr,relativeTime:Yr,months:$f,monthsShort:Ya,week:rd,weekdays:cd,weekdaysMin:fd,weekdaysShort:Va,meridiemParse:Ad},le={},lr={},ur;function Md(r,a){var c,d=Math.min(r.length,a.length);for(c=0;c0;){if(g=Gr(x.slice(0,c).join("-")),g)return g;if(d&&d.length>=c&&Md(x,d)>=c-1)break;c--}a++}return ur}function Ld(r){return!!(r&&r.match("^[^/\\\\]*$"))}function Gr(r){var a=null,c;if(le[r]===void 0&&typeof er<"u"&&er&&er.exports&&Ld(r))try{a=ur._abbr,c=require,c("./locale/"+r),Bt(a)}catch{le[r]=null}return le[r]}function Bt(r,a){var c;return r&&(u(a)?c=Ft(r):c=Vo(r,a),c?ur=c:typeof console<"u"&&console.warn&&console.warn("Locale "+r+" not found. Did you forget to load it?")),ur._abbr}function Vo(r,a){if(a!==null){var c,d=Ga;if(a.abbr=r,le[r]!=null)ne("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),d=le[r]._config;else if(a.parentLocale!=null)if(le[a.parentLocale]!=null)d=le[a.parentLocale]._config;else if(c=Gr(a.parentLocale),c!=null)d=c._config;else return lr[a.parentLocale]||(lr[a.parentLocale]=[]),lr[a.parentLocale].push({name:r,config:a}),null;return le[r]=new H(N(d,a)),lr[r]&&lr[r].forEach(function(g){Vo(g.name,g.config)}),Bt(r),le[r]}else return delete le[r],null}function Od(r,a){if(a!=null){var c,d,g=Ga;le[r]!=null&&le[r].parentLocale!=null?le[r].set(N(le[r]._config,a)):(d=Gr(r),d!=null&&(g=d._config),a=N(g,a),d==null&&(a.abbr=r),c=new H(a),c.parentLocale=le[r],le[r]=c),Bt(r)}else le[r]!=null&&(le[r].parentLocale!=null?(le[r]=le[r].parentLocale,r===Bt()&&Bt(r)):le[r]!=null&&delete le[r]);return le[r]}function Ft(r){var a;if(r&&r._locale&&r._locale._abbr&&(r=r._locale._abbr),!r)return ur;if(!i(r)){if(a=Gr(r),a)return a;r=[r]}return Id(r)}function Dd(){return W(le)}function $o(r){var a,c=r._a;return c&&v(r).overflow===-2&&(a=c[Et]<0||c[Et]>11?Et:c[gt]<1||c[gt]>zo(c[Te],c[Et])?gt:c[ge]<0||c[ge]>24||c[ge]===24&&(c[ct]!==0||c[Tt]!==0||c[rn]!==0)?ge:c[ct]<0||c[ct]>59?ct:c[Tt]<0||c[Tt]>59?Tt:c[rn]<0||c[rn]>999?rn:-1,v(r)._overflowDayOfYear&&(agt)&&(a=gt),v(r)._overflowWeeks&&a===-1&&(a=Wf),v(r)._overflowWeekday&&a===-1&&(a=zf),v(r).overflow=a),r}var Rd=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Nd=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Yd=/Z|[+-]\d\d(?::?\d\d)?/,qr=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],jo=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Wd=/^\/?Date\((-?\d+)/i,zd=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Bd={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Za(r){var a,c,d=r._i,g=Rd.exec(d)||Nd.exec(d),x,S,O,z,Q=qr.length,Oe=jo.length;if(g){for(v(r).iso=!0,a=0,c=Q;air(S)||r._dayOfYear===0)&&(v(r)._overflowDayOfYear=!0),c=sr(S,0,r._dayOfYear),r._a[Et]=c.getUTCMonth(),r._a[gt]=c.getUTCDate()),a=0;a<3&&r._a[a]==null;++a)r._a[a]=d[a]=g[a];for(;a<7;a++)r._a[a]=d[a]=r._a[a]==null?a===2?1:0:r._a[a];r._a[ge]===24&&r._a[ct]===0&&r._a[Tt]===0&&r._a[rn]===0&&(r._nextDay=!0,r._a[ge]=0),r._d=(r._useUTC?sr:td).apply(null,d),x=r._useUTC?r._d.getUTCDay():r._d.getDay(),r._tzm!=null&&r._d.setUTCMinutes(r._d.getUTCMinutes()-r._tzm),r._nextDay&&(r._a[ge]=24),r._w&&typeof r._w.d<"u"&&r._w.d!==x&&(v(r).weekdayMismatch=!0)}}function Zd(r){var a,c,d,g,x,S,O,z,Q;a=r._w,a.GG!=null||a.W!=null||a.E!=null?(x=1,S=4,c=En(a.GG,r._a[Te],ar(ae(),1,4).year),d=En(a.W,1),g=En(a.E,1),(g<1||g>7)&&(z=!0)):(x=r._locale._week.dow,S=r._locale._week.doy,Q=ar(ae(),x,S),c=En(a.gg,r._a[Te],Q.year),d=En(a.w,Q.week),a.d!=null?(g=a.d,(g<0||g>6)&&(z=!0)):a.e!=null?(g=a.e+x,(a.e<0||a.e>6)&&(z=!0)):g=x),d<1||d>At(c,x,S)?v(r)._overflowWeeks=!0:z!=null?v(r)._overflowWeekday=!0:(O=Ua(c,d,g,x,S),r._a[Te]=O.year,r._dayOfYear=O.dayOfYear)}t.ISO_8601=function(){},t.RFC_2822=function(){};function qo(r){if(r._f===t.ISO_8601){Za(r);return}if(r._f===t.RFC_2822){Qa(r);return}r._a=[],v(r).empty=!0;var a=""+r._i,c,d,g,x,S,O=a.length,z=0,Q,Oe;for(g=tn(r._f,r._locale).match(ze)||[],Oe=g.length,c=0;c0&&v(r).unusedInput.push(S),a=a.slice(a.indexOf(d)+d.length),z+=d.length),_e[x]?(d?v(r).empty=!1:v(r).unusedTokens.push(x),Yf(x,d,r)):r._strict&&!d&&v(r).unusedTokens.push(x);v(r).charsLeftOver=O-z,a.length>0&&v(r).unusedInput.push(a),r._a[ge]<=12&&v(r).bigHour===!0&&r._a[ge]>0&&(v(r).bigHour=void 0),v(r).parsedDateParts=r._a.slice(0),v(r).meridiem=r._meridiem,r._a[ge]=Qd(r._locale,r._a[ge],r._meridiem),Q=v(r).era,Q!==null&&(r._a[Te]=r._locale.erasConvertYear(Q,r._a[Te])),Go(r),$o(r)}function Qd(r,a,c){var d;return c==null?a:r.meridiemHour!=null?r.meridiemHour(a,c):(r.isPM!=null&&(d=r.isPM(c),d&&a<12&&(a+=12),!d&&a===12&&(a=0)),a)}function Jd(r){var a,c,d,g,x,S,O=!1,z=r._f.length;if(z===0){v(r).invalidFormat=!0,r._d=new Date(NaN);return}for(g=0;gthis?this:r:C()});function Xa(r,a){var c,d;if(a.length===1&&i(a[0])&&(a=a[0]),!a.length)return ae();for(c=a[0],d=1;dthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function kh(){if(!u(this._isDSTShifted))return this._isDSTShifted;var r={},a;return Y(r,this),r=Ja(r),r._a?(a=r._isUTC?w(r._a):ae(r._a),this._isDSTShifted=this.isValid()&&uh(r._a,a.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function yh(){return this.isValid()?!this._isUTC:!1}function xh(){return this.isValid()?this._isUTC:!1}function tl(){return this.isValid()?this._isUTC&&this._offset===0:!1}var bh=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,vh=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ft(r,a){var c=r,d=null,g,x,S;return Qr(r)?c={ms:r._milliseconds,d:r._days,M:r._months}:f(r)||!isNaN(+r)?(c={},a?c[a]=+r:c.milliseconds=+r):(d=bh.exec(r))?(g=d[1]==="-"?-1:1,c={y:0,d:Z(d[gt])*g,h:Z(d[ge])*g,m:Z(d[ct])*g,s:Z(d[Tt])*g,ms:Z(Zo(d[rn]*1e3))*g}):(d=vh.exec(r))?(g=d[1]==="-"?-1:1,c={y:on(d[2],g),M:on(d[3],g),w:on(d[4],g),d:on(d[5],g),h:on(d[6],g),m:on(d[7],g),s:on(d[8],g)}):c==null?c={}:typeof c=="object"&&("from"in c||"to"in c)&&(S=Ch(ae(c.from),ae(c.to)),c={},c.ms=S.milliseconds,c.M=S.months),x=new Zr(c),Qr(r)&&s(r,"_locale")&&(x._locale=r._locale),Qr(r)&&s(r,"_isValid")&&(x._isValid=r._isValid),x}ft.fn=Zr.prototype,ft.invalid=lh;function on(r,a){var c=r&&parseFloat(r.replace(",","."));return(isNaN(c)?0:c)*a}function nl(r,a){var c={};return c.months=a.month()-r.month()+(a.year()-r.year())*12,r.clone().add(c.months,"M").isAfter(a)&&--c.months,c.milliseconds=+a-+r.clone().add(c.months,"M"),c}function Ch(r,a){var c;return r.isValid()&&a.isValid()?(a=Jo(a,r),r.isBefore(a)?c=nl(r,a):(c=nl(a,r),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function rl(r,a){return function(c,d){var g,x;return d!==null&&!isNaN(+d)&&(ne(a,"moment()."+a+"(period, number) is deprecated. Please use moment()."+a+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),x=c,c=d,d=x),g=ft(c,d),il(this,g,r),this}}function il(r,a,c,d){var g=a._milliseconds,x=Zo(a._days),S=Zo(a._months);r.isValid()&&(d=d??!0,S&&za(r,or(r,"Month")+S*c),x&&Na(r,"Date",or(r,"Date")+x*c),g&&r._d.setTime(r._d.valueOf()+g*c),d&&t.updateOffset(r,x||S))}var Sh=rl(1,"add"),_h=rl(-1,"subtract");function ol(r){return typeof r=="string"||r instanceof String}function Eh(r){return _(r)||m(r)||ol(r)||f(r)||Ah(r)||Th(r)||r===null||r===void 0}function Th(r){var a=o(r)&&!l(r),c=!1,d=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],g,x,S=d.length;for(g=0;gc.valueOf():c.valueOf()9999?Wt(c,a?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):oe(Date.prototype.toISOString)?a?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Wt(c,"Z")):Wt(c,a?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Hh(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var r="moment",a="",c,d,g,x;return this.isLocal()||(r=this.utcOffset()===0?"moment.utc":"moment.parseZone",a="Z"),c="["+r+'("]',d=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",g="-MM-DD[T]HH:mm:ss.SSS",x=a+'[")]',this.format(c+d+g+x)}function Uh(r){r||(r=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var a=Wt(this,r);return this.localeData().postformat(a)}function Vh(r,a){return this.isValid()&&(_(r)&&r.isValid()||ae(r).isValid())?ft({to:this,from:r}).locale(this.locale()).humanize(!a):this.localeData().invalidDate()}function $h(r){return this.from(ae(),r)}function jh(r,a){return this.isValid()&&(_(r)&&r.isValid()||ae(r).isValid())?ft({from:this,to:r}).locale(this.locale()).humanize(!a):this.localeData().invalidDate()}function Gh(r){return this.to(ae(),r)}function sl(r){var a;return r===void 0?this._locale._abbr:(a=Ft(r),a!=null&&(this._locale=a),this)}var al=j("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(r){return r===void 0?this.localeData():this.locale(r)});function ll(){return this._locale}var Kr=1e3,Tn=60*Kr,Xr=60*Tn,ul=(365*400+97)*24*Xr;function An(r,a){return(r%a+a)%a}function cl(r,a,c){return r<100&&r>=0?new Date(r+400,a,c)-ul:new Date(r,a,c).valueOf()}function fl(r,a,c){return r<100&&r>=0?Date.UTC(r+400,a,c)-ul:Date.UTC(r,a,c)}function qh(r){var a,c;if(r=Me(r),r===void 0||r==="millisecond"||!this.isValid())return this;switch(c=this._isUTC?fl:cl,r){case"year":a=c(this.year(),0,1);break;case"quarter":a=c(this.year(),this.month()-this.month()%3,1);break;case"month":a=c(this.year(),this.month(),1);break;case"week":a=c(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":a=c(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":a=c(this.year(),this.month(),this.date());break;case"hour":a=this._d.valueOf(),a-=An(a+(this._isUTC?0:this.utcOffset()*Tn),Xr);break;case"minute":a=this._d.valueOf(),a-=An(a,Tn);break;case"second":a=this._d.valueOf(),a-=An(a,Kr);break}return this._d.setTime(a),t.updateOffset(this,!0),this}function Zh(r){var a,c;if(r=Me(r),r===void 0||r==="millisecond"||!this.isValid())return this;switch(c=this._isUTC?fl:cl,r){case"year":a=c(this.year()+1,0,1)-1;break;case"quarter":a=c(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":a=c(this.year(),this.month()+1,1)-1;break;case"week":a=c(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":a=c(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":a=c(this.year(),this.month(),this.date()+1)-1;break;case"hour":a=this._d.valueOf(),a+=Xr-An(a+(this._isUTC?0:this.utcOffset()*Tn),Xr)-1;break;case"minute":a=this._d.valueOf(),a+=Tn-An(a,Tn)-1;break;case"second":a=this._d.valueOf(),a+=Kr-An(a,Kr)-1;break}return this._d.setTime(a),t.updateOffset(this,!0),this}function Qh(){return this._d.valueOf()-(this._offset||0)*6e4}function Jh(){return Math.floor(this.valueOf()/1e3)}function Kh(){return new Date(this.valueOf())}function Xh(){var r=this;return[r.year(),r.month(),r.date(),r.hour(),r.minute(),r.second(),r.millisecond()]}function em(){var r=this;return{years:r.year(),months:r.month(),date:r.date(),hours:r.hours(),minutes:r.minutes(),seconds:r.seconds(),milliseconds:r.milliseconds()}}function tm(){return this.isValid()?this.toISOString():null}function nm(){return T(this)}function rm(){return p({},v(this))}function im(){return v(this).overflow}function om(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}y("N",0,0,"eraAbbr"),y("NN",0,0,"eraAbbr"),y("NNN",0,0,"eraAbbr"),y("NNNN",0,0,"eraName"),y("NNNNN",0,0,"eraNarrow"),y("y",["y",1],"yo","eraYear"),y("y",["yy",2],0,"eraYear"),y("y",["yyy",3],0,"eraYear"),y("y",["yyyy",4],0,"eraYear"),D("N",Xo),D("NN",Xo),D("NNN",Xo),D("NNNN",gm),D("NNNNN",wm),ie(["N","NN","NNN","NNNN","NNNNN"],function(r,a,c,d){var g=c._locale.erasParse(r,d,c._strict);g?v(c).era=g:v(c).invalidEra=r}),D("y",Je),D("yy",Je),D("yyy",Je),D("yyyy",Je),D("yo",km),ie(["y","yy","yyy","yyyy"],Te),ie(["yo"],function(r,a,c,d){var g;c._locale._eraYearOrdinalRegex&&(g=r.match(c._locale._eraYearOrdinalRegex)),c._locale.eraYearOrdinalParse?a[Te]=c._locale.eraYearOrdinalParse(r,g):a[Te]=parseInt(r,10)});function sm(r,a){var c,d,g,x=this._eras||Ft("en")._eras;for(c=0,d=x.length;c=0)return x[d]}function lm(r,a){var c=r.since<=r.until?1:-1;return a===void 0?t(r.since).year():t(r.since).year()+(a-r.offset)*c}function um(){var r,a,c,d=this.localeData().eras();for(r=0,a=d.length;rx&&(a=x),_m.call(this,r,a,c,d,g))}function _m(r,a,c,d,g){var x=Ua(r,a,c,d,g),S=sr(x.year,0,x.dayOfYear);return this.year(S.getUTCFullYear()),this.month(S.getUTCMonth()),this.date(S.getUTCDate()),this}y("Q",0,"Qo","quarter"),D("Q",Hr),ie("Q",function(r,a){a[Et]=(Z(r)-1)*3});function Em(r){return r==null?Math.ceil((this.month()+1)/3):this.month((r-1)*3+this.month()%3)}y("D",["DD",2],"Do","date"),D("D",L,Sn),D("DD",L,Ie),D("Do",function(r,a){return r?a._dayOfMonthOrdinalParse||a._ordinalParse:a._dayOfMonthOrdinalParseLenient}),ie(["D","DD"],gt),ie("Do",function(r,a){a[gt]=Z(r.match(L)[0])});var hl=_n("Date",!0);y("DDD",["DDDD",3],"DDDo","dayOfYear"),D("DDD",Ee),D("DDDD",Ur),ie(["DDD","DDDD"],function(r,a,c){c._dayOfYear=Z(r)});function Tm(r){var a=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return r==null?a:this.add(r-a,"d")}y("m",["mm",2],0,"minute"),D("m",L,Yo),D("mm",L,Ie),ie(["m","mm"],ct);var Am=_n("Minutes",!1);y("s",["ss",2],0,"second"),D("s",L,Yo),D("ss",L,Ie),ie(["s","ss"],Tt);var Fm=_n("Seconds",!1);y("S",0,0,function(){return~~(this.millisecond()/100)}),y(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),y(0,["SSS",3],0,"millisecond"),y(0,["SSSS",4],0,function(){return this.millisecond()*10}),y(0,["SSSSS",5],0,function(){return this.millisecond()*100}),y(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),y(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),y(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),y(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),D("S",Ee,Hr),D("SS",Ee,Ie),D("SSS",Ee,Ur);var Ht,ml;for(Ht="SSSS";Ht.length<=9;Ht+="S")D(Ht,Je);function Pm(r,a){a[rn]=Z(("0."+r)*1e3)}for(Ht="S";Ht.length<=9;Ht+="S")ie(Ht,Pm);ml=_n("Milliseconds",!1),y("z",0,0,"zoneAbbr"),y("zz",0,0,"zoneName");function Mm(){return this._isUTC?"UTC":""}function Im(){return this._isUTC?"Coordinated Universal Time":""}var M=B.prototype;M.add=Sh,M.calendar=Mh,M.clone=Ih,M.diff=Wh,M.endOf=Zh,M.format=Uh,M.from=Vh,M.fromNow=$h,M.to=jh,M.toNow=Gh,M.get=Hf,M.invalidAt=im,M.isAfter=Lh,M.isBefore=Oh,M.isBetween=Dh,M.isSame=Rh,M.isSameOrAfter=Nh,M.isSameOrBefore=Yh,M.isValid=nm,M.lang=al,M.locale=sl,M.localeData=ll,M.max=nh,M.min=th,M.parsingFlags=rm,M.set=Uf,M.startOf=qh,M.subtract=_h,M.toArray=Xh,M.toObject=em,M.toDate=Kh,M.toISOString=Bh,M.inspect=Hh,typeof Symbol<"u"&&Symbol.for!=null&&(M[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),M.toJSON=tm,M.toString=zh,M.unix=Jh,M.valueOf=Qh,M.creationData=om,M.eraName=um,M.eraNarrow=cm,M.eraAbbr=fm,M.eraYear=dm,M.year=Ra,M.isLeapYear=Bf,M.weekYear=ym,M.isoWeekYear=xm,M.quarter=M.quarters=Em,M.month=Ba,M.daysInMonth=Kf,M.week=M.weeks=sd,M.isoWeek=M.isoWeeks=ad,M.weeksInYear=Cm,M.weeksInWeekYear=Sm,M.isoWeeksInYear=bm,M.isoWeeksInISOWeekYear=vm,M.date=hl,M.day=M.days=xd,M.weekday=bd,M.isoWeekday=vd,M.dayOfYear=Tm,M.hour=M.hours=Fd,M.minute=M.minutes=Am,M.second=M.seconds=Fm,M.millisecond=M.milliseconds=ml,M.utcOffset=fh,M.utc=hh,M.local=mh,M.parseZone=ph,M.hasAlignedHourOffset=gh,M.isDST=wh,M.isLocal=yh,M.isUtcOffset=xh,M.isUtc=tl,M.isUTC=tl,M.zoneAbbr=Mm,M.zoneName=Im,M.dates=j("dates accessor is deprecated. Use date instead.",hl),M.months=j("months accessor is deprecated. Use month instead",Ba),M.years=j("years accessor is deprecated. Use year instead",Ra),M.zone=j("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",dh),M.isDSTShifted=j("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",kh);function Lm(r){return ae(r*1e3)}function Om(){return ae.apply(null,arguments).parseZone()}function pl(r){return r}var te=H.prototype;te.calendar=ue,te.longDateFormat=nn,te.invalidDate=St,te.ordinal=Do,te.preparse=pl,te.postformat=pl,te.relativeTime=Wr,te.pastFuture=zr,te.set=X,te.eras=sm,te.erasParse=am,te.erasConvertYear=lm,te.erasAbbrRegex=mm,te.erasNameRegex=hm,te.erasNarrowRegex=pm,te.months=qf,te.monthsShort=Zf,te.monthsParse=Jf,te.monthsRegex=ed,te.monthsShortRegex=Xf,te.week=nd,te.firstDayOfYear=od,te.firstDayOfWeek=id,te.weekdays=pd,te.weekdaysMin=wd,te.weekdaysShort=gd,te.weekdaysParse=yd,te.weekdaysRegex=Cd,te.weekdaysShortRegex=Sd,te.weekdaysMinRegex=_d,te.isPM=Td,te.meridiem=Pd;function ti(r,a,c,d){var g=Ft(),x=w().set(d,a);return g[c](x,r)}function gl(r,a,c){if(f(r)&&(a=r,r=void 0),r=r||"",a!=null)return ti(r,a,c,"month");var d,g=[];for(d=0;d<12;d++)g[d]=ti(r,d,c,"month");return g}function ts(r,a,c,d){typeof r=="boolean"?(f(a)&&(c=a,a=void 0),a=a||""):(a=r,c=a,r=!1,f(a)&&(c=a,a=void 0),a=a||"");var g=Ft(),x=r?g._week.dow:0,S,O=[];if(c!=null)return ti(a,(c+x)%7,d,"day");for(S=0;S<7;S++)O[S]=ti(a,(S+x)%7,d,"day");return O}function Dm(r,a){return gl(r,a,"months")}function Rm(r,a){return gl(r,a,"monthsShort")}function Nm(r,a,c){return ts(r,a,c,"weekdays")}function Ym(r,a,c){return ts(r,a,c,"weekdaysShort")}function Wm(r,a,c){return ts(r,a,c,"weekdaysMin")}Bt("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(r){var a=r%10,c=Z(r%100/10)===1?"th":a===1?"st":a===2?"nd":a===3?"rd":"th";return r+c}}),t.lang=j("moment.lang is deprecated. Use moment.locale instead.",Bt),t.langData=j("moment.langData is deprecated. Use moment.localeData instead.",Ft);var Pt=Math.abs;function zm(){var r=this._data;return this._milliseconds=Pt(this._milliseconds),this._days=Pt(this._days),this._months=Pt(this._months),r.milliseconds=Pt(r.milliseconds),r.seconds=Pt(r.seconds),r.minutes=Pt(r.minutes),r.hours=Pt(r.hours),r.months=Pt(r.months),r.years=Pt(r.years),this}function wl(r,a,c,d){var g=ft(a,c);return r._milliseconds+=d*g._milliseconds,r._days+=d*g._days,r._months+=d*g._months,r._bubble()}function Bm(r,a){return wl(this,r,a,1)}function Hm(r,a){return wl(this,r,a,-1)}function kl(r){return r<0?Math.floor(r):Math.ceil(r)}function Um(){var r=this._milliseconds,a=this._days,c=this._months,d=this._data,g,x,S,O,z;return r>=0&&a>=0&&c>=0||r<=0&&a<=0&&c<=0||(r+=kl(ns(c)+a)*864e5,a=0,c=0),d.milliseconds=r%1e3,g=Ke(r/1e3),d.seconds=g%60,x=Ke(g/60),d.minutes=x%60,S=Ke(x/60),d.hours=S%24,a+=Ke(S/24),z=Ke(yl(a)),c+=z,a-=kl(ns(z)),O=Ke(c/12),c%=12,d.days=a,d.months=c,d.years=O,this}function yl(r){return r*4800/146097}function ns(r){return r*146097/4800}function Vm(r){if(!this.isValid())return NaN;var a,c,d=this._milliseconds;if(r=Me(r),r==="month"||r==="quarter"||r==="year")switch(a=this._days+d/864e5,c=this._months+yl(a),r){case"month":return c;case"quarter":return c/3;case"year":return c/12}else switch(a=this._days+Math.round(ns(this._months)),r){case"week":return a/7+d/6048e5;case"day":return a+d/864e5;case"hour":return a*24+d/36e5;case"minute":return a*1440+d/6e4;case"second":return a*86400+d/1e3;case"millisecond":return Math.floor(a*864e5)+d;default:throw new Error("Unknown unit "+r)}}function Mt(r){return function(){return this.as(r)}}var xl=Mt("ms"),$m=Mt("s"),jm=Mt("m"),Gm=Mt("h"),qm=Mt("d"),Zm=Mt("w"),Qm=Mt("M"),Jm=Mt("Q"),Km=Mt("y"),Xm=xl;function ep(){return ft(this)}function tp(r){return r=Me(r),this.isValid()?this[r+"s"]():NaN}function sn(r){return function(){return this.isValid()?this._data[r]:NaN}}var np=sn("milliseconds"),rp=sn("seconds"),ip=sn("minutes"),op=sn("hours"),sp=sn("days"),ap=sn("months"),lp=sn("years");function up(){return Ke(this.days()/7)}var It=Math.round,Fn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function cp(r,a,c,d,g){return g.relativeTime(a||1,!!c,r,d)}function fp(r,a,c,d){var g=ft(r).abs(),x=It(g.as("s")),S=It(g.as("m")),O=It(g.as("h")),z=It(g.as("d")),Q=It(g.as("M")),Oe=It(g.as("w")),Lt=It(g.as("y")),Ut=x<=c.ss&&["s",x]||x0,Ut[4]=d,cp.apply(null,Ut)}function dp(r){return r===void 0?It:typeof r=="function"?(It=r,!0):!1}function hp(r,a){return Fn[r]===void 0?!1:a===void 0?Fn[r]:(Fn[r]=a,r==="s"&&(Fn.ss=a-1),!0)}function mp(r,a){if(!this.isValid())return this.localeData().invalidDate();var c=!1,d=Fn,g,x;return typeof r=="object"&&(a=r,r=!1),typeof r=="boolean"&&(c=r),typeof a=="object"&&(d=Object.assign({},Fn,a),a.s!=null&&a.ss==null&&(d.ss=a.s-1)),g=this.localeData(),x=fp(this,!c,d,g),c&&(x=g.pastFuture(+this,x)),g.postformat(x)}var rs=Math.abs;function Pn(r){return(r>0)-(r<0)||+r}function ni(){if(!this.isValid())return this.localeData().invalidDate();var r=rs(this._milliseconds)/1e3,a=rs(this._days),c=rs(this._months),d,g,x,S,O=this.asSeconds(),z,Q,Oe,Lt;return O?(d=Ke(r/60),g=Ke(d/60),r%=60,d%=60,x=Ke(c/12),c%=12,S=r?r.toFixed(3).replace(/\.?0+$/,""):"",z=O<0?"-":"",Q=Pn(this._months)!==Pn(O)?"-":"",Oe=Pn(this._days)!==Pn(O)?"-":"",Lt=Pn(this._milliseconds)!==Pn(O)?"-":"",z+"P"+(x?Q+x+"Y":"")+(c?Q+c+"M":"")+(a?Oe+a+"D":"")+(g||d||r?"T":"")+(g?Lt+g+"H":"")+(d?Lt+d+"M":"")+(r?Lt+S+"S":"")):"P0D"}var K=Zr.prototype;K.isValid=ah,K.abs=zm,K.add=Bm,K.subtract=Hm,K.as=Vm,K.asMilliseconds=xl,K.asSeconds=$m,K.asMinutes=jm,K.asHours=Gm,K.asDays=qm,K.asWeeks=Zm,K.asMonths=Qm,K.asQuarters=Jm,K.asYears=Km,K.valueOf=Xm,K._bubble=Um,K.clone=ep,K.get=tp,K.milliseconds=np,K.seconds=rp,K.minutes=ip,K.hours=op,K.days=sp,K.weeks=up,K.months=ap,K.years=lp,K.humanize=mp,K.toISOString=ni,K.toString=ni,K.toJSON=ni,K.locale=sl,K.localeData=ll,K.toIsoString=j("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ni),K.lang=al,y("X",0,0,"unix"),y("x",0,0,"valueOf"),D("x",pt),D("X",ut),ie("X",function(r,a,c){c._d=new Date(parseFloat(r)*1e3)}),ie("x",function(r,a,c){c._d=new Date(Z(r))});return t.version="2.30.1",n(ae),t.fn=M,t.min=rh,t.max=ih,t.now=oh,t.utc=w,t.unix=Lm,t.months=Dm,t.isDate=m,t.locale=Bt,t.invalid=C,t.duration=ft,t.isMoment=_,t.weekdays=Nm,t.parseZone=Om,t.localeData=Ft,t.isDuration=Qr,t.monthsShort=Rm,t.weekdaysMin=Wm,t.defineLocale=Vo,t.updateLocale=Od,t.locales=Dd,t.weekdaysShort=Ym,t.normalizeUnits=Me,t.relativeTimeRounding=dp,t.relativeTimeThreshold=hp,t.calendarFormat=Ph,t.prototype=M,t.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},t})});var ry={};bl(ry,{default:()=>ny});module.exports=xp(ry);var ye=require("obsidian");(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();function wt(){}async function is(){}function fr(e){return async(...t)=>{await e(...t)}}var xt=require("obsidian");var bp=require("obsidian"),Cl=require("obsidian"),Sl=require("obsidian"),ay=require("obsidian"),ly=require("obsidian");var an={AudioRecorder:"audio-recorder",Backlink:"backlink",Bookmarks:"bookmarks",Browser:"browser",Canvas:"canvas",CommandPalette:"command-palette",DailyNotes:"daily-notes",EditorStatus:"editor-status",FileExplorer:"file-explorer",FileRecovery:"file-recovery",GlobalSearch:"global-search",Graph:"graph",MarkdownImporter:"markdown-importer",NoteComposer:"note-composer",OutgoingLink:"outgoing-link",Outline:"outline",PagePreview:"page-preview",Properties:"properties",Publish:"publish",RandomNote:"random-note",SlashCommand:"slash-command",Slides:"slides",Switcher:"switcher",Sync:"sync",TagPane:"tag-pane",Templates:"templates",WordCount:"word-count",Workspaces:"workspaces",ZkPrefixer:"zk-prefixer"},sy={AllProperties:"all-properties",Audio:"audio",Backlink:an.Backlink,Bookmarks:an.Bookmarks,Browser:"browser",BrowserHistory:"browser-history",Canvas:an.Canvas,Empty:"empty",FileExplorer:an.FileExplorer,FileProperties:"file-properties",Graph:an.Graph,Image:"image",LocalGraph:"localgraph",Markdown:"markdown",OutgoingLink:an.OutgoingLink,Outline:an.Outline,Pdf:"pdf",ReleaseNotes:"release-notes",Search:"search",Sync:"sync",Tag:"tag",Video:"video"};function vp(){return Cl.TFile}function Cp(){return Sl.TFolder}function dt(e){return e.replace(/\/?[^\/]*$/,"")||"/"}function ii(e,t){let n=e.vault.getFolderByPath(t);return n||(n=new(Cp())(e.vault,t),n.parent=ii(e,dt(t)),n.deleted=!0,n)}function _l(e,t){let n=e.vault.getFileByPath(t);return n||(n=new(vp())(e.vault,t),n.parent=ii(e,dt(t)),n.deleted=!0,n)}function Vt(e){return!!e.position}function Ot(e){return!!e.key}var us=je(Al(),1);var ss=je(Pl(),1);(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var si="asyncError",ai=new ss.default;ai.on(si,Tp);function li(e){ai.emit(si,e)}function Ml(e){return as(e).map(t=>" ".repeat(t.level)+t.message).join(` +`)}function ln(e=0){return(new Error().stack??"").split(` +`).slice(e+2).join(` +`)}function hr(e,t){t??=globalThis.console;let n=as(e);for(let i of n)i.shouldClearAnsiSequence?t.error(`\x1B[0m${i.message}\x1B[0m`):t.error(i.message)}function Il(e){return ai.on(si,e),()=>ai.off(si,e)}function un(e){throw e}function Tp(e){hr(new Error("An unhandled error occurred executing async operation",{cause:e}))}function as(e,t=0,n=[]){if(e===void 0)return n;if(!(e instanceof Error)){let o;return e===null?o="(null)":typeof e=="string"?o=e:o=JSON.stringify(e)??"undefined",n.push({level:t,message:o}),n}let i=`${e.name}: ${e.message}`;if(n.push({level:t,message:i,shouldClearAnsiSequence:!0}),e.stack){let o=e.stack.startsWith(i)?e.stack.slice(i.length+1):e.stack;n.push({level:t,message:`Error stack: +${o}`})}return e.cause!==void 0&&(n.push({level:t,message:"Caused by:"}),as(e.cause,t+1,n)),n}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();function ls(e){return e.replaceAll(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ll(e){try{return new RegExp(e),!0}catch{return!1}}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();async function mr(e,...t){return Ap(e)?await e(...t):e}function Ap(e){return typeof e=="function"}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Fp={"\n":"\\n","\r":"\\r"," ":"\\t","\b":"\\b","\f":"\\f","'":"\\'",'"':'\\"',"\\":"\\\\"},Pp={};for(let[e,t]of Object.entries(Fp))Pp[t]=e;function Ol(e,t,n,i){return i??=n,e.slice(0,n)+t+e.slice(i)}function pr(e){return He(e,/\u00A0|\u202F/g," ").normalize("NFC")}function He(e,t,n){return typeof n>"u"?e:(t instanceof RegExp&&!t.global&&(t=new RegExp(t.source,`${t.flags}g`)),typeof n=="string"?e.replaceAll(t,n):e.replaceAll(t,(i,...o)=>{let l=typeof o.at(-1)=="object",u=l?o.length-2:o.length-1,f={groups:l?o.at(-1):void 0,offset:o.at(u-1),source:o.at(u),substring:i},m=o.slice(0,u-1);return n(f,...m)??f.substring}))}function Dl(e,t,n){if(e.endsWith(t))return e.slice(0,-t.length);if(n)throw new Error(`String ${e} does not end with suffix ${t}`);return e}function Dt(e,t,n){if(e.startsWith(t))return e.slice(t.length);if(n)throw new Error(`String ${e} does not start with prefix ${t}`);return e}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Mp=/[a-zA-Z]:\/[^:]*$/,yt=us.default.posix,Cy=yt.delimiter,Sy=us.default.posix.sep,Re=yt.basename,se=yt.dirname,et=yt.extname,_y=yt.format;var we=yt.join,Ey=yt.normalize,Ty=yt.parse,In=yt.relative;function Rl(e,t){return t?`${e}.${t}`:e}function Nl(...e){let t=yt.resolve(...e);return t=Ip(t),Mp.exec(t)?.[0]??t}function Ip(e){return He(e,"\\","/")}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var ui="md",Lp="canvas";function Wl(e,t,n){if(tt(t))return t.extension===n;if(typeof t=="string"){let i=ce(e,t);return i?i.extension===n:et(t).slice(1)===n}return!1}function gr(e,t,n){if(t===null)return null;if(Hl(t))return t;let i=Yl(e,t,n);if(i)return i;let o=Vl(t);return o===t?null:Yl(e,o,n)}function Ne(e,t,n,i){let o=ce(e,t,i);if(!o)if(n)o=_l(e,t);else throw new Error(`File not found: ${t}`);return o}function ce(e,t,n){let i=gr(e,t,n);return tt(i)?i:null}function Ln(e,t,n,i){let o=ht(e,t,i);if(!o)if(n)o=ii(e,t);else throw new Error(`Folder not found: ${t}`);return o}function ht(e,t,n){let i=gr(e,t,n);return wr(i)?i:null}function zl(e,t,n){let i=Ln(e,t),o=[];return n?xt.Vault.recurseChildren(i,s=>{ke(e,s)&&o.push(s)}):o=i.children.filter(s=>ke(e,s)),o=o.sort((s,l)=>s.path.localeCompare(l.path)),o}async function Bl(e,t){let n=ce(e,t);if(n)return n;let i=dt(t);return await Op(e,i),await e.vault.create(t,"")}async function Op(e,t){let n=ht(e,t);return n||await e.vault.createFolder(t)}function he(e,t){if(Hl(t))return t.path;let n=gr(e,t);return n?n.path:Vl(t)}function Hl(e){return e instanceof xt.TAbstractFile}function cn(e,t){return Wl(e,t,Lp)}function tt(e){return e instanceof xt.TFile}function wr(e){return e instanceof xt.TFolder}function ke(e,t){return Wl(e,t,ui)}function Rt(e,t){return ke(e,t)||cn(e,t)}function Ul(e,t){return ke(e,t)?Dl(t.path,`.${ui}`):t.path}function Yl(e,t,n){return n?e.vault.getAbstractFileByPathInsensitive(t):e.vault.getAbstractFileByPath(t)}function Vl(e){return(0,xt.normalizePath)(Nl("/",e))}var ws=je(nu(),1);(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var ms="19.6.0",mi="obsidian-dev-utils",ru=`.obsidian-dev-utils :invalid { + box-shadow: 0 0 0 2px var(--text-error); +} +.obsidian-dev-utils.modal-container .ok-button { + margin-right: 10px; + margin-top: 20px; +} +.obsidian-dev-utils .multiple-dropdown-component select, +.obsidian-dev-utils .multiple-dropdown-component select:focus, +.obsidian-dev-utils .multiple-dropdown-component .dropdown { + height: auto; +} +.obsidian-dev-utils .multiple-dropdown-component select option:checked, +.obsidian-dev-utils .multiple-dropdown-component select:focus option:checked, +.obsidian-dev-utils .multiple-dropdown-component .dropdown option:checked { + background-color: #1967d2; + color: #fff; +} +.obsidian-dev-utils.prompt-modal .text-box { + width: 100%; +} + +/*# sourceMappingURL=data:application/json;charset=utf-8,%7B%22version%22:3,%22sourceRoot%22:%22%22,%22sources%22:%5B%22../src/styles/main.scss%22%5D,%22names%22:%5B%5D,%22mappings%22:%22AACE;EACE;;AAIA;EACE;EACA;;AAKF;AAAA;AAAA;EAGE;;AAEA;AAAA;AAAA;EACE;EACA;;AAMJ;EACE%22,%22file%22:%22styles.css%22,%22sourcesContent%22:%5B%22.obsidian-dev-utils%20%7B%5Cn%20%20:invalid%20%7B%5Cn%20%20%20%20box-shadow:%200%200%200%202px%20var(--text-error);%5Cn%20%20%7D%5Cn%5Cn%20%20&.modal-container%20%7B%5Cn%20%20%20%20.ok-button%20%7B%5Cn%20%20%20%20%20%20margin-right:%2010px;%5Cn%20%20%20%20%20%20margin-top:%2020px;%5Cn%20%20%20%20%7D%5Cn%20%20%7D%5Cn%5Cn%20%20.multiple-dropdown-component%20%7B%5Cn%20%20%20%20select,%5Cn%20%20%20%20select:focus,%5Cn%20%20%20%20.dropdown%20%7B%5Cn%20%20%20%20%20%20height:%20auto;%5Cn%5Cn%20%20%20%20%20%20option:checked%20%7B%5Cn%20%20%20%20%20%20%20%20background-color:%20%231967d2;%5Cn%20%20%20%20%20%20%20%20color:%20%23fff;%5Cn%20%20%20%20%20%20%7D%5Cn%20%20%20%20%7D%5Cn%20%20%7D%5Cn%5Cn%20%20&.prompt-modal%20%7B%5Cn%20%20%20%20.text-box%20%7B%5Cn%20%20%20%20%20%20width:%20100%25;%5Cn%20%20%20%20%7D%5Cn%20%20%7D%5Cn%7D%5Cn%22%5D%7D */ +`;(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var ps=class{constructor(t){this.value=t}};function iu(){try{return globalThis.require("obsidian/app")}catch{return globalThis.app??un(new Error("Obsidian app not found"))}}function jt(e,t,n){let i=e;return i.obsidianDevUtilsState??={},i.obsidianDevUtilsState[t]??=new ps(n)}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var gs="__no-plugin-id-initialized__",ou=gs;function rt(){return ou}function su(e){e&&(ou=e)}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var au=",",pi="-";function lu(){return{disable:rg,enable:ig,get:wi,set:kr}}function gi(e,t=0){let n=Nn()(e);return n.log=(i,...o)=>{og(e,t,i,...o)},n.printStackTrace=(i,o)=>{fu(e,i,o)},n}function Ue(e){let t=rt(),n=t===gs?"":`${t}:`;return gi(`${n}${mi}:${e}`)}function uu(e){let t=Nn().enabled(e),n=t?"enabled":"disabled",i=t?"disable":"enable",o=wi();kr(e),gi(e)(`Debug messages for plugin ${e} are ${n}. See https://github.com/mnaoumov/obsidian-dev-utils/?tab=readme-ov-file#debugging how to ${i} them.`),kr(o)}function rg(e){let t=new Set(wi());for(let n of yr(e)){if(n.startsWith(pi))continue;let i=pi+n;t.has(n)&&t.delete(n),t.add(i)}kr(Array.from(t))}function ig(e){let t=new Set(wi());for(let n of yr(e)){if(!n.startsWith(pi)){let i=pi+n;t.has(i)&&t.delete(i)}t.add(n)}kr(Array.from(t))}function wi(){return yr(Nn().load()??"")}function Nn(){if(typeof window>"u")return ws.default;let e=iu();return jt(e,"debug",ws.default).value}function cu(){return typeof window<"u"}function og(e,t,n,...i){if(!Nn().enabled(e))return;let l=(new Error().stack?.split(` +`)??[])[4+t]??"";console.debug(n,...i),cu()&&fu(e,l,"Debug message caller")}function fu(e,t,n){let i=Nn()(e);if(!i.enabled)return;t||(t="(unavailable)"),n||(n="Caller stack trace"),i(n);let o=cu()?`StackTraceFakeError +`:"";console.debug(`${o}${t}`)}function kr(e){Nn().enable(yr(e).join(au))}function yr(e){return typeof e=="string"?e.split(au).filter(Boolean):e.flatMap(yr)}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();async function dn(e){let t=e.items,n=0,i=new Notice("",0);for(let o of t){if(e.abortSignal?.aborted){i.hide();return}n++;let s=`# ${n.toString()} / ${t.length.toString()}`,l=e.buildNoticeMessage(o,s);i.setMessage(l),Ue("Loop")(l);try{await e.processItem(o)}catch(u){if(e.shouldContinueOnError)throw i.hide(),u;li(u)}}i.hide()}var mu=require("obsidian");(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var $=(e=>(e.AlertModal="alert-modal",e.CancelButton="cancel-button",e.ConfirmModal="confirm-modal",e.DateComponent="date-component",e.DateTimeComponent="datetime-component",e.EmailComponent="email-component",e.FileComponent="file-component",e.LibraryName="obsidian-dev-utils",e.MonthComponent="month-component",e.MultipleDropdownComponent="multiple-dropdown-component",e.MultipleEmailComponent="multiple-email-component",e.MultipleFileComponent="multiple-file-component",e.MultipleTextComponent="multiple-text-component",e.NumberComponent="number-component",e.OkButton="ok-button",e.PluginSettingsTab="plugin-settings-tab",e.PromptModal="prompt-modal",e.SelectItemModal="select-item-modal",e.TextBox="text-box",e.TimeComponent="time-component",e.UrlComponent="url-component",e.WeekComponent="week-component",e))($||{});var du=require("obsidian");(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var ki=class extends du.Modal{constructor(t,n,i){super(t.app),this.resolve=n,this.containerEl.addClass($.LibraryName,rt(),i),t.cssClass&&this.containerEl.addClass(t.cssClass)}};async function hu(e){return await new Promise(t=>{e(t).open()})}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var ks=class extends ki{options;constructor(t,n){super(t,n,$.AlertModal);let i={app:t.app,cssClass:"",message:t.message,okButtonText:"OK",title:""};this.options={...i,...t}}onClose(){this.resolve()}onOpen(){this.titleEl.setText(this.options.title),this.contentEl.createEl("p",{text:this.options.message});let t=new mu.ButtonComponent(this.contentEl);t.setButtonText(this.options.okButtonText),t.setCta(),t.onClick(this.close.bind(this)),t.setClass($.OkButton)}};async function yi(e){await hu(t=>new ks(e,t))}var vi=require("obsidian");var ku=je(gu(),1);(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var wu=`${mi}-styles`;function yu(e,t){su(t),uu(t);let n=jt(e,"lastLibraryVersion","0.0.0");if((0,ku.compareVersions)(ms,n.value)<=0)return;n.value=ms;let i=sg();i.DEBUG=lu(),document.head.querySelector(`#${wu}`)?.remove(),document.head.createEl("style",{attr:{id:wu},text:ru})}function sg(){return window}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var bi=class extends vi.Plugin{get abortSignal(){return this._abortSignal}get settings(){return this._settings}get settingsClone(){return this.createPluginSettings(this.settings.toJSON())}_abortSignal;_settings;notice;consoleDebug(t,...n){gi(this.manifest.id,1)(t,...n)}async onExternalSettingsChange(){await this.loadSettings()}async onload(){yu(this.app,this.manifest.id),this.register(Il(()=>{this.showNotice("An unhandled error occurred. Please check the console for more information.")})),await this.loadSettings();let t=this.createPluginSettingsTab();t&&this.addSettingTab(t);let n=new AbortController;this._abortSignal=n.signal,this.register(()=>{n.abort()}),await this.onloadComplete(),setTimeout(()=>{this.app.workspace.onLayoutReady(this.onLayoutReady.bind(this))},0)}async saveSettings(t){let n=t.toJSON();this._settings=this.createPluginSettings(n),await this.saveData(n)}onLayoutReady(){}onloadComplete(){}showNotice(t){this.notice&&this.notice.hide(),this.notice=new vi.Notice(`${this.manifest.name} +${t}`)}async loadSettings(){let t=await this.loadData();this._settings=this.createPluginSettings(t),this.settings.shouldSaveAfterLoad&&await this.saveSettings(this._settings)}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();async function ys(e){try{await e()}catch(t){li(t)}}function xs(e){return(...t)=>{xr(()=>e(...t))}}function xr(e){ys(e)}async function br(e,t,n){let i=Ue("Async:retryWithTimeout");n??=ln(1);let s={...{retryDelayInMilliseconds:100,shouldRetryOnError:!1,timeoutInMilliseconds:5e3},...t};await bs(s.timeoutInMilliseconds,async()=>{let l=0;for(;;){s.abortSignal?.throwIfAborted(),l++;let u;try{u=await e()}catch(f){if(!s.shouldRetryOnError||f.__terminateRetry)throw f;hr(f),u=!1}if(u){l>1&&(i(`Retry completed successfully after ${l.toString()} attempts`),i.printStackTrace(n));return}i(`Retry attempt ${l.toString()} completed unsuccessfully. Trying again in ${s.retryDelayInMilliseconds.toString()} milliseconds`,{fn:e}),i.printStackTrace(n),await xu(s.retryDelayInMilliseconds)}})}async function bs(e,t){let n=!0,i=null,o=performance.now();if(await Promise.race([s(),l()]),n)throw new Error("Timed out");return i;async function s(){i=await t(),n=!1;let u=performance.now()-o;Ue("Async:runWithTimeout")(`Execution time: ${u.toString()} milliseconds`,{fn:t})}async function l(){if(!n||(await xu(e),!n))return;let u=performance.now()-o;console.warn(`Timed out in ${u.toString()} milliseconds`,{fn:t});let f=Ue("Async:runWithTimeout:timeout");f.enabled&&(f(`The execution is not terminated because debugger ${f.namespace} is enabled. See https://github.com/mnaoumov/obsidian-dev-utils/?tab=readme-ov-file#debugging for more information`),await l())}}async function xu(e){await new Promise(t=>{setTimeout(t,e)})}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();async function bu(e,t,n){let i=Ue("Logger:invokeAsyncAndLog"),o=performance.now();n??=ln(1),i(`${e}:start`,{fn:t,timestampStart:o}),i.printStackTrace(n);try{await t();let s=performance.now();i(`${e}:end`,{duration:s-o,fn:t,timestampEnd:s,timestampStart:o}),i.printStackTrace(n)}catch(s){let l=performance.now();throw i(`${e}:error`,{duration:l-o,error:s,fn:t,timestampEnd:l,timestampStart:o}),i.printStackTrace(n),s}}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();function it(e,t,n,i){i??=ln(1),xr(()=>ag(e,t,n,i))}async function ag(e,t,n,i){n??=6e4,i??=ln(1);let s=vu(e).value;s.items.push({fn:t,stackTrace:i,timeoutInMilliseconds:n}),s.promise=s.promise.then(()=>Cu(e)),await s.promise}function vu(e){return jt(e,"queue",{items:[],promise:Promise.resolve()})}async function Cu(e){let t=vu(e).value,n=t.items[0];n&&(await ys(()=>bs(n.timeoutInMilliseconds,()=>bu(Cu.name,n.fn,n.stackTrace))),t.items.shift())}function Su(e,t){let n=Object.keys(t).map(i=>lg(e,i,t[i]));return n.length===1?n[0]:function(){n.forEach(i=>i())}}function lg(e,t,n){let i=e[t],o=e.hasOwnProperty(t),s=o?i:function(){return Object.getPrototypeOf(e)[t].apply(this,arguments)},l=n(s);return i&&Object.setPrototypeOf(l,i),Object.setPrototypeOf(u,l),e[t]=u,f;function u(...m){return l===s&&e[t]===u&&f(),l.apply(this,m)}function f(){e[t]===u&&(o?e[t]=s:delete e[t]),l!==s&&(l=s,Object.setPrototypeOf(u,i||Function))}}var kf=require("obsidian");(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var _u=".";function Cs(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e===null||t===null)return!1;let n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;let o=e,s=t;for(let l of n)if(!i.includes(l)||!Cs(o[l],s[l]))return!1;return!0}function Ci(e,t){let n=e,i=t.split(_u);for(let o of i){if(n===void 0)return;n=n[o]}return n}function Eu(e,t,n){let i=new Error(`Property path ${t} not found`),o=e,s=t.split(_u);for(let u of s.slice(0,-1)){if(o===void 0)throw i;o=o[u]}let l=s.at(-1);if(o===void 0||l===void 0)throw i;o[l]=n}function Si(e,t={}){let n={functionHandlingMode:"exclude",maxDepth:-1,shouldCatchToJSONErrors:!1,shouldHandleCircularReferences:!1,shouldHandleErrors:!1,shouldHandleUndefined:!1,shouldSortKeys:!1,space:2,tokenSubstitutions:{circularReference:vs("CircularReference"),maxDepthLimitReached:vs("MaxDepthLimitReached"),toJSONFailed:vs("ToJSONFailed")}},i={...n,...t,tokenSubstitutions:{...n.tokenSubstitutions,...t.tokenSubstitutions}};i.maxDepth===-1&&(i.maxDepth=1/0);let o=[],l=_i(e,"",0,!0,i,o,new WeakSet),u=JSON.stringify(l,null,i.space)??"";return u=He(u,/"\[\[(?[A-Za-z]+)(?\d*)\]\]"/g,(f,m,h)=>ug({functionTexts:o,index:h?parseInt(h,10):0,key:m,substitutions:i.tokenSubstitutions})),u}function ug(e){switch(e.key){case"CircularReference":return e.substitutions.circularReference;case"Function":return e.functionTexts[e.index]??un(new Error(`Function with index ${e.index.toString()} not found`));case"MaxDepthLimitReached":return e.substitutions.maxDepthLimitReached;case"MaxDepthLimitReachedArray":return`Array(${e.index.toString()})`;case"ToJSONFailed":return e.substitutions.toJSONFailed;case"Undefined":return"undefined";default:break}}function cg(e,t,n,i,o,s){return t>i.maxDepth?Yn("MaxDepthLimitReachedArray",e.length):e.map((l,u)=>_i(l,u.toString(),t+1,n,i,o,s))}function fg(e,t,n){if(n.shouldHandleCircularReferences)return Yn("CircularReference");let i=e.constructor.name||"Object";throw new TypeError(`Converting circular structure to JSON +--> starting at object with constructor '${i}' +--- property '${t}' closes the circle`)}function dg(e,t,n){if(n.functionHandlingMode==="exclude")return;let i=t.length,o=n.functionHandlingMode==="full"?e.toString():`function ${e.name||"anonymous"}() { /* ... */ }`;return t.push(o),Yn("Function",i)}function hg(e,t,n,i,o,s,l){if(l.has(e))return fg(e,t,o);if(l.add(e),i){let u=pg(e,t,n,o,s,l);if(u!==void 0)return u}return Array.isArray(e)?cg(e,n,i,o,s,l):n>o.maxDepth?Yn("MaxDepthLimitReached"):e instanceof Error&&o.shouldHandleErrors?Ml(e):mg(e,n,i,o,s,l)}function mg(e,t,n,i,o,s){let l=Object.entries(e);return i.shouldSortKeys&&l.sort(([u],[f])=>u.localeCompare(f)),Object.fromEntries(l.map(([u,f])=>[u,_i(f,u,t+1,n,i,o,s)]))}function vs(e){return`{ "[[${e}]]": null }`}function Yn(e,t){return`[[${e}${t?.toString()??""}]]`}function _i(e,t,n,i,o,s,l){return e===void 0?n===0||o.shouldHandleUndefined?Yn("Undefined"):void 0:typeof e=="function"?dg(e,s,o):typeof e!="object"||e===null?e:hg(e,t,n,i,o,s,l)}function pg(e,t,n,i,o,s){let l=e.toJSON;if(typeof l=="function")try{let u=l.call(e,t);return _i(u,t,n,!1,i,o,s)}catch(u){if(i.shouldCatchToJSONErrors)return Yn("ToJSONFailed");throw u}}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();async function Ss(e,t,n){let i=he(e,t),o=he(e,n),s=Ne(e,o,!0),l=et(i),u=Re(i,l),f=e.vault.getAvailablePathForAttachments;return f.isExtended?f(u,l.slice(1),s,!0):await gg(e,u,l.slice(1),s,!0)}async function Wn(e,t){return dt(await Ss(e,"DUMMY_FILE.pdf",t))}async function gg(e,t,n,i,o){let s=e.vault.getConfig("attachmentFolderPath"),l=s==="."||s==="./",u=null;s.startsWith("./")&&(u=Dt(s,"./")),l?s=i?i.parent?.path??"":"":u&&(s=(i?i.parent?.getParentPrefix()??"":"")+u),s=pr(Tu(s)),t=pr(Tu(t));let f=ht(e,s,!0);!f&&u&&(o?f=Ln(e,s,!0):f=await e.vault.createFolder(s));let m=f?.getParentPrefix()??"";return e.vault.getAvailablePath(m+t,n)}async function _s(e,t){let n=await Wn(e,t),i=await Wn(e,we(se(t),"DUMMY_FILE.md"));return n!==i}function Tu(e){return e=He(e,/(?:[\\/])+/g,"/"),e=He(e,/^\/+|\/+$/g,""),e||"/"}var to=require("obsidian");var wg={};function hn(e,t){let n=t||wg,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Fu(e,i,o)}function Fu(e,t,n){if(kg(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Au(e.children,t,n)}return Array.isArray(e)?Au(e,t,n):""}function Au(e,t,n){let i=[],o=-1;for(;++oo?0:o+t:t=t>o?o:t,n=n>0?n:0,i.length<1e4)l=Array.from(i),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);s0?(Ce(e,e.length,0,t),e):t}var Mu={}.hasOwnProperty;function Iu(e){let t={},n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"\uFFFD":String.fromCodePoint(n)}function Nt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var qe=Gt(/[A-Za-z]/),We=Gt(/[\dA-Za-z]/),Lu=Gt(/[#-'*+\--9=?A-Z^-~]/);function vr(e){return e!==null&&(e<32||e===127)}var Cr=Gt(/\d/),Ou=Gt(/[\dA-Fa-f]/),Du=Gt(/[!-/:-@[-`{-~]/);function R(e){return e!==null&&e<-2}function me(e){return e!==null&&(e<0||e===32)}function U(e){return e===-2||e===-1||e===32}var Ru=Gt(/\p{P}|\p{S}/u),Nu=Gt(/\s/);function Gt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function V(e,t,n,i){let o=i?i-1:Number.POSITIVE_INFINITY,s=0;return l;function l(f){return U(f)?(e.enter(n),u(f)):t(f)}function u(f){return U(f)&&s++l))return;let J=t.events.length,j=J,G,ne;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){if(G){ne=t.events[j][1].end;break}G=!0}for(C(i),_=J;_P;){let B=n[Y];t.containerState=B[1],B[0].exit.call(t,e)}n.length=P}function A(){o.write([null]),s=void 0,o=void 0,t.containerState._closeFlow=void 0}}function Cg(e,t,n){return V(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Bn(e){if(e===null||me(e)||Nu(e))return 1;if(Ru(e))return 2}function Hn(e,t,n){let i=[],o=-1;for(;++o1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let p={...e[i][1].end},w={...e[n][1].start};Bu(p,-f),Bu(w,f),l={type:f>1?"strongSequence":"emphasisSequence",start:p,end:{...e[i][1].end}},u={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:w},s={type:f>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},o={type:f>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},e[i][1].end={...l.start},e[n][1].start={...u.end},m=[],e[i][1].end.offset-e[i][1].start.offset&&(m=Ye(m,[["enter",e[i][1],t],["exit",e[i][1],t]])),m=Ye(m,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",s,t]]),m=Ye(m,Hn(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),m=Ye(m,[["exit",s,t],["enter",u,t],["exit",u,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,m=Ye(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,Ce(e,i-1,n-i+3,m),n=i+m.length-h-2;break}}for(n=-1;++n0&&U(_)?V(e,A,"linePrefix",s+1)(_):A(_)}function A(_){return _===null||R(_)?e.check(Hu,F,Y)(_):(e.enter("codeFlowValue"),P(_))}function P(_){return _===null||R(_)?(e.exit("codeFlowValue"),A(_)):(e.consume(_),P)}function Y(_){return e.exit("codeFenced"),t(_)}function B(_,J,j){let G=0;return ne;function ne(W){return _.enter("lineEnding"),_.consume(W),_.exit("lineEnding"),oe}function oe(W){return _.enter("codeFencedFence"),U(W)?V(_,X,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):X(W)}function X(W){return W===u?(_.enter("codeFencedFenceSequence"),N(W)):j(W)}function N(W){return W===u?(G++,_.consume(W),N):G>=l?(_.exit("codeFencedFenceSequence"),U(W)?V(_,H,"whitespace")(W):H(W)):j(W)}function H(W){return W===null||R(W)?(_.exit("codeFencedFence"),J(W)):j(W)}}}function Og(e,t,n){let i=this;return o;function o(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s)}function s(l){return i.parser.lazy[i.now().line]?n(l):t(l)}}var _r={name:"codeIndented",tokenize:Rg},Dg={partial:!0,tokenize:Ng};function Rg(e,t,n){let i=this;return o;function o(m){return e.enter("codeIndented"),V(e,s,"linePrefix",5)(m)}function s(m){let h=i.events[i.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?l(m):n(m)}function l(m){return m===null?f(m):R(m)?e.attempt(Dg,l,f)(m):(e.enter("codeFlowValue"),u(m))}function u(m){return m===null||R(m)?(e.exit("codeFlowValue"),l(m)):(e.consume(m),u)}function f(m){return e.exit("codeIndented"),t(m)}}function Ng(e,t,n){let i=this;return o;function o(l){return i.parser.lazy[i.now().line]?n(l):R(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):V(e,s,"linePrefix",5)(l)}function s(l){let u=i.events[i.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):R(l)?o(l):n(l)}}var Ts={name:"codeText",previous:Wg,resolve:Yg,tokenize:zg};function Yg(e){let t=e.length-4,n=3,i,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){let o=n||0;this.setCursor(Math.trunc(t));let s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&Er(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Er(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Er(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(l):e.interrupt(i.parser.constructs.flow,n,t)(l)}}function Li(e,t,n,i,o,s,l,u,f){let m=f||Number.POSITIVE_INFINITY,h=0;return p;function p(C){return C===60?(e.enter(i),e.enter(o),e.enter(s),e.consume(C),e.exit(s),w):C===null||C===32||C===41||vr(C)?n(C):(e.enter(i),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),F(C))}function w(C){return C===62?(e.enter(s),e.consume(C),e.exit(s),e.exit(o),e.exit(i),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),k(C))}function k(C){return C===62?(e.exit("chunkString"),e.exit(u),w(C)):C===null||C===60||R(C)?n(C):(e.consume(C),C===92?v:k)}function v(C){return C===60||C===62||C===92?(e.consume(C),k):k(C)}function F(C){return!h&&(C===null||C===41||me(C))?(e.exit("chunkString"),e.exit(u),e.exit(l),e.exit(i),t(C)):h999||k===null||k===91||k===93&&!f||k===94&&!u&&"_hiddenFootnoteSupport"in l.parser.constructs?n(k):k===93?(e.exit(s),e.enter(o),e.consume(k),e.exit(o),e.exit(i),t):R(k)?(e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===null||k===91||k===93||R(k)||u++>999?(e.exit("chunkString"),h(k)):(e.consume(k),f||(f=!U(k)),k===92?w:p)}function w(k){return k===91||k===92||k===93?(e.consume(k),u++,p):p(k)}}function Di(e,t,n,i,o,s){let l;return u;function u(w){return w===34||w===39||w===40?(e.enter(i),e.enter(o),e.consume(w),e.exit(o),l=w===40?41:w,f):n(w)}function f(w){return w===l?(e.enter(o),e.consume(w),e.exit(o),e.exit(i),t):(e.enter(s),m(w))}function m(w){return w===l?(e.exit(s),f(l)):w===null?n(w):R(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),V(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(w))}function h(w){return w===l||w===null||R(w)?(e.exit("chunkString"),m(w)):(e.consume(w),w===92?p:h)}function p(w){return w===l||w===92?(e.consume(w),h):h(w)}}function mn(e,t){let n;return i;function i(o){return R(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):U(o)?V(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}var Fs={name:"definition",tokenize:Gg},jg={partial:!0,tokenize:qg};function Gg(e,t,n){let i=this,o;return s;function s(k){return e.enter("definition"),l(k)}function l(k){return Oi.call(i,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(k)}function u(k){return o=Nt(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),f):n(k)}function f(k){return me(k)?mn(e,m)(k):m(k)}function m(k){return Li(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(k)}function h(k){return e.attempt(jg,p,p)(k)}function p(k){return U(k)?V(e,w,"whitespace")(k):w(k)}function w(k){return k===null||R(k)?(e.exit("definition"),i.parser.defined.push(o),t(k)):n(k)}}function qg(e,t,n){return i;function i(u){return me(u)?mn(e,o)(u):n(u)}function o(u){return Di(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function s(u){return U(u)?V(e,l,"whitespace")(u):l(u)}function l(u){return u===null||R(u)?t(u):n(u)}}var Ps={name:"hardBreakEscape",tokenize:Zg};function Zg(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return R(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}var Ms={name:"headingAtx",resolve:Qg,tokenize:Jg};function Qg(e,t){let n=e.length-2,i=3,o,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Ce(e,i,n-i+1,[["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t]])),e}function Jg(e,t,n){let i=0;return o;function o(h){return e.enter("atxHeading"),s(h)}function s(h){return e.enter("atxHeadingSequence"),l(h)}function l(h){return h===35&&i++<6?(e.consume(h),l):h===null||me(h)?(e.exit("atxHeadingSequence"),u(h)):n(h)}function u(h){return h===35?(e.enter("atxHeadingSequence"),f(h)):h===null||R(h)?(e.exit("atxHeading"),t(h)):U(h)?V(e,u,"whitespace")(h):(e.enter("atxHeadingText"),m(h))}function f(h){return h===35?(e.consume(h),f):(e.exit("atxHeadingSequence"),u(h))}function m(h){return h===null||h===35||me(h)?(e.exit("atxHeadingText"),u(h)):(e.consume(h),m)}}var Uu=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Is=["pre","script","style","textarea"];var Ls={concrete:!0,name:"htmlFlow",resolveTo:ew,tokenize:tw},Kg={partial:!0,tokenize:rw},Xg={partial:!0,tokenize:nw};function ew(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function tw(e,t,n){let i=this,o,s,l,u,f;return m;function m(y){return h(y)}function h(y){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(y),p}function p(y){return y===33?(e.consume(y),w):y===47?(e.consume(y),s=!0,F):y===63?(e.consume(y),o=3,i.interrupt?t:b):qe(y)?(e.consume(y),l=String.fromCharCode(y),T):n(y)}function w(y){return y===45?(e.consume(y),o=2,k):y===91?(e.consume(y),o=5,u=0,v):qe(y)?(e.consume(y),o=4,i.interrupt?t:b):n(y)}function k(y){return y===45?(e.consume(y),i.interrupt?t:b):n(y)}function v(y){let Pe="CDATA[";return y===Pe.charCodeAt(u++)?(e.consume(y),u===Pe.length?i.interrupt?t:X:v):n(y)}function F(y){return qe(y)?(e.consume(y),l=String.fromCharCode(y),T):n(y)}function T(y){if(y===null||y===47||y===62||me(y)){let Pe=y===47,Ct=l.toLowerCase();return!Pe&&!s&&Is.includes(Ct)?(o=1,i.interrupt?t(y):X(y)):Uu.includes(l.toLowerCase())?(o=6,Pe?(e.consume(y),C):i.interrupt?t(y):X(y)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(y):s?A(y):P(y))}return y===45||We(y)?(e.consume(y),l+=String.fromCharCode(y),T):n(y)}function C(y){return y===62?(e.consume(y),i.interrupt?t:X):n(y)}function A(y){return U(y)?(e.consume(y),A):ne(y)}function P(y){return y===47?(e.consume(y),ne):y===58||y===95||qe(y)?(e.consume(y),Y):U(y)?(e.consume(y),P):ne(y)}function Y(y){return y===45||y===46||y===58||y===95||We(y)?(e.consume(y),Y):B(y)}function B(y){return y===61?(e.consume(y),_):U(y)?(e.consume(y),B):P(y)}function _(y){return y===null||y===60||y===61||y===62||y===96?n(y):y===34||y===39?(e.consume(y),f=y,J):U(y)?(e.consume(y),_):j(y)}function J(y){return y===f?(e.consume(y),f=null,G):y===null||R(y)?n(y):(e.consume(y),J)}function j(y){return y===null||y===34||y===39||y===47||y===60||y===61||y===62||y===96||me(y)?B(y):(e.consume(y),j)}function G(y){return y===47||y===62||U(y)?P(y):n(y)}function ne(y){return y===62?(e.consume(y),oe):n(y)}function oe(y){return y===null||R(y)?X(y):U(y)?(e.consume(y),oe):n(y)}function X(y){return y===45&&o===2?(e.consume(y),ee):y===60&&o===1?(e.consume(y),ue):y===62&&o===4?(e.consume(y),Se):y===63&&o===3?(e.consume(y),b):y===93&&o===5?(e.consume(y),ze):R(y)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(Kg,_e,N)(y)):y===null||R(y)?(e.exit("htmlFlowData"),N(y)):(e.consume(y),X)}function N(y){return e.check(Xg,H,_e)(y)}function H(y){return e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),W}function W(y){return y===null||R(y)?N(y):(e.enter("htmlFlowData"),X(y))}function ee(y){return y===45?(e.consume(y),b):X(y)}function ue(y){return y===47?(e.consume(y),l="",fe):X(y)}function fe(y){if(y===62){let Pe=l.toLowerCase();return Is.includes(Pe)?(e.consume(y),Se):X(y)}return qe(y)&&l.length<8?(e.consume(y),l+=String.fromCharCode(y),fe):X(y)}function ze(y){return y===93?(e.consume(y),b):X(y)}function b(y){return y===62?(e.consume(y),Se):y===45&&o===2?(e.consume(y),b):X(y)}function Se(y){return y===null||R(y)?(e.exit("htmlFlowData"),_e(y)):(e.consume(y),Se)}function _e(y){return e.exit("htmlFlow"),t(y)}}function nw(e,t,n){let i=this;return o;function o(l){return R(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):n(l)}function s(l){return i.parser.lazy[i.now().line]?n(l):t(l)}}function rw(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(qt,t,n)}}var Os={name:"htmlText",tokenize:iw};function iw(e,t,n){let i=this,o,s,l;return u;function u(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),f}function f(b){return b===33?(e.consume(b),m):b===47?(e.consume(b),B):b===63?(e.consume(b),P):qe(b)?(e.consume(b),j):n(b)}function m(b){return b===45?(e.consume(b),h):b===91?(e.consume(b),s=0,v):qe(b)?(e.consume(b),A):n(b)}function h(b){return b===45?(e.consume(b),k):n(b)}function p(b){return b===null?n(b):b===45?(e.consume(b),w):R(b)?(l=p,ue(b)):(e.consume(b),p)}function w(b){return b===45?(e.consume(b),k):p(b)}function k(b){return b===62?ee(b):b===45?w(b):p(b)}function v(b){let Se="CDATA[";return b===Se.charCodeAt(s++)?(e.consume(b),s===Se.length?F:v):n(b)}function F(b){return b===null?n(b):b===93?(e.consume(b),T):R(b)?(l=F,ue(b)):(e.consume(b),F)}function T(b){return b===93?(e.consume(b),C):F(b)}function C(b){return b===62?ee(b):b===93?(e.consume(b),C):F(b)}function A(b){return b===null||b===62?ee(b):R(b)?(l=A,ue(b)):(e.consume(b),A)}function P(b){return b===null?n(b):b===63?(e.consume(b),Y):R(b)?(l=P,ue(b)):(e.consume(b),P)}function Y(b){return b===62?ee(b):P(b)}function B(b){return qe(b)?(e.consume(b),_):n(b)}function _(b){return b===45||We(b)?(e.consume(b),_):J(b)}function J(b){return R(b)?(l=J,ue(b)):U(b)?(e.consume(b),J):ee(b)}function j(b){return b===45||We(b)?(e.consume(b),j):b===47||b===62||me(b)?G(b):n(b)}function G(b){return b===47?(e.consume(b),ee):b===58||b===95||qe(b)?(e.consume(b),ne):R(b)?(l=G,ue(b)):U(b)?(e.consume(b),G):ee(b)}function ne(b){return b===45||b===46||b===58||b===95||We(b)?(e.consume(b),ne):oe(b)}function oe(b){return b===61?(e.consume(b),X):R(b)?(l=oe,ue(b)):U(b)?(e.consume(b),oe):G(b)}function X(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),o=b,N):R(b)?(l=X,ue(b)):U(b)?(e.consume(b),X):(e.consume(b),H)}function N(b){return b===o?(e.consume(b),o=void 0,W):b===null?n(b):R(b)?(l=N,ue(b)):(e.consume(b),N)}function H(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||me(b)?G(b):(e.consume(b),H)}function W(b){return b===47||b===62||me(b)?G(b):n(b)}function ee(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function ue(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),fe}function fe(b){return U(b)?V(e,ze,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):ze(b)}function ze(b){return e.enter("htmlTextData"),l(b)}}var pn={name:"labelEnd",resolveAll:lw,resolveTo:uw,tokenize:cw},ow={tokenize:fw},sw={tokenize:dw},aw={tokenize:hw};function lw(e){let t=-1,n=[];for(;++t=3&&(m===null||R(m))?(e.exit("thematicBreak"),t(m)):n(m)}function f(m){return m===o?(e.consume(m),i++,f):(e.exit("thematicBreakSequence"),U(m)?V(e,u,"whitespace")(m):u(m))}}var Fe={continuation:{tokenize:bw},exit:Cw,name:"list",tokenize:xw},kw={partial:!0,tokenize:Sw},yw={partial:!0,tokenize:vw};function xw(e,t,n){let i=this,o=i.events[i.events.length-1],s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,l=0;return u;function u(k){let v=i.containerState.type||(k===42||k===43||k===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!i.containerState.marker||k===i.containerState.marker:Cr(k)){if(i.containerState.type||(i.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),k===42||k===45?e.check(gn,n,m)(k):m(k);if(!i.interrupt||k===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(k)}return n(k)}function f(k){return Cr(k)&&++l<10?(e.consume(k),f):(!i.interrupt||l<2)&&(i.containerState.marker?k===i.containerState.marker:k===41||k===46)?(e.exit("listItemValue"),m(k)):n(k)}function m(k){return e.enter("listItemMarker"),e.consume(k),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||k,e.check(qt,i.interrupt?n:h,e.attempt(kw,w,p))}function h(k){return i.containerState.initialBlankLine=!0,s++,w(k)}function p(k){return U(k)?(e.enter("listItemPrefixWhitespace"),e.consume(k),e.exit("listItemPrefixWhitespace"),w):n(k)}function w(k){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(k)}}function bw(e,t,n){let i=this;return i.containerState._closeFlow=void 0,e.check(qt,o,s);function o(u){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,V(e,t,"listItemIndent",i.containerState.size+1)(u)}function s(u){return i.containerState.furtherBlankLines||!U(u)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,l(u)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(yw,t,l)(u))}function l(u){return i.containerState._closeFlow=!0,i.interrupt=void 0,V(e,e.attempt(Fe,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function vw(e,t,n){let i=this;return V(e,o,"listItemIndent",i.containerState.size+1);function o(s){let l=i.events[i.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===i.containerState.size?t(s):n(s)}}function Cw(e){e.exit(this.containerState.type)}function Sw(e,t,n){let i=this;return V(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){let l=i.events[i.events.length-1];return!U(s)&&l&&l[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}var Ri={name:"setextUnderline",resolveTo:_w,tokenize:Ew};function _w(e,t){let n=e.length,i,o,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);let l={type:"setextHeading",start:{...e[o][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",l,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=l,e.push(["exit",l,t]),e}function Ew(e,t,n){let i=this,o;return s;function s(m){let h=i.events.length,p;for(;h--;)if(i.events[h][1].type!=="lineEnding"&&i.events[h][1].type!=="linePrefix"&&i.events[h][1].type!=="content"){p=i.events[h][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||p)?(e.enter("setextHeadingLine"),o=m,l(m)):n(m)}function l(m){return e.enter("setextHeadingLineSequence"),u(m)}function u(m){return m===o?(e.consume(m),u):(e.exit("setextHeadingLineSequence"),U(m)?V(e,f,"lineSuffix")(m):f(m))}function f(m){return m===null||R(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}var Vu={tokenize:Tw};function Tw(e){let t=this,n=e.attempt(qt,i,e.attempt(this.parser.constructs.flowInitial,o,V(e,e.attempt(this.parser.constructs.flow,o,e.attempt(As,o)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}var $u={resolveAll:Zu()},ju=qu("string"),Gu=qu("text");function qu(e){return{resolveAll:Zu(e==="text"?Aw:void 0),tokenize:t};function t(n){let i=this,o=this.parser.constructs[e],s=n.attempt(o,l,u);return l;function l(h){return m(h)?s(h):u(h)}function u(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),f}function f(h){return m(h)?(n.exit("data"),s(h)):(n.consume(h),f)}function m(h){if(h===null)return!0;let p=o[h],w=-1;if(p)for(;++wRw,contentInitial:()=>Pw,disable:()=>Nw,document:()=>Fw,flow:()=>Iw,flowInitial:()=>Mw,insideSpan:()=>Dw,string:()=>Lw,text:()=>Ow});var Fw={42:Fe,43:Fe,45:Fe,48:Fe,49:Fe,50:Fe,51:Fe,52:Fe,53:Fe,54:Fe,55:Fe,56:Fe,57:Fe,62:Ti},Pw={91:Fs},Mw={[-2]:_r,[-1]:_r,32:_r},Iw={35:Ms,42:gn,45:[Ri,gn],60:Ls,61:Ri,95:gn,96:Pi,126:Pi},Lw={38:Fi,92:Ai},Ow={[-5]:Tr,[-4]:Tr,[-3]:Tr,33:Ds,38:Fi,42:Sr,60:[Es,Os],91:Rs,92:[Ps,Ai],93:pn,95:Sr,96:Ts},Dw={null:[Sr,$u]},Rw={null:[42,95]},Nw={null:[]};function Qu(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},o={},s=[],l=[],u=[],f=!0,m={attempt:G(J),check:G(j),consume:Y,enter:B,exit:_,interrupt:G(j,{interrupt:!0})},h={code:null,containerState:{},defineSkip:C,events:[],now:T,parser:e,previous:null,sliceSerialize:v,sliceStream:F,write:k},p=t.tokenize.call(h,m),w;return t.resolveAll&&s.push(t),h;function k(N){return l=Ye(l,N),A(),l[l.length-1]!==null?[]:(ne(t,0),h.events=Hn(s,h.events,h),h.events)}function v(N,H){return Ww(F(N),H)}function F(N){return Yw(l,N)}function T(){let{_bufferIndex:N,_index:H,line:W,column:ee,offset:ue}=i;return{_bufferIndex:N,_index:H,line:W,column:ee,offset:ue}}function C(N){o[N.line]=N.column,X()}function A(){let N;for(;i._index-1){let u=l[0];typeof u=="string"?l[0]=u.slice(i):l.shift()}s>0&&l.push(e[o].slice(0,s))}return l}function Ww(e,t){let n=-1,i=[],o;for(;++n0){let Ee=L.tokenStack[L.tokenStack.length-1];(Ee[1]||ec).call(L,void 0,Ee[0])}for(I.position={start:Qt(E.length>0?E[0][1].start:{line:1,column:1,offset:0}),end:Qt(E.length>0?E[E.length-2][1].end:{line:1,column:1,offset:0})},re=-1;++re "),s.shift(2);let l=n.indentLines(n.containerFlow(e,s.current()),jw);return o(),l}function jw(e,t,n){return">"+(n?"":" ")+e}function Yi(e,t){return ac(e,t.inConstruct,!0)&&!ac(e,t.notInConstruct,!1)}function ac(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++il&&(l=s):s=1,o=i+t.length,i=n.indexOf(t,o);return l}function Ar(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function uc(e){let t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function cc(e,t,n,i){let o=uc(n),s=e.value||"",l=o==="`"?"GraveAccent":"Tilde";if(Ar(e,n)){let p=n.enter("codeIndented"),w=n.indentLines(s,Gw);return p(),w}let u=n.createTracker(i),f=o.repeat(Math.max(lc(s,o)+1,3)),m=n.enter("codeFenced"),h=u.move(f);if(e.lang){let p=n.enter(`codeFencedLang${l}`);h+=u.move(n.safe(e.lang,{before:h,after:" ",encode:["`"],...u.current()})),p()}if(e.lang&&e.meta){let p=n.enter(`codeFencedMeta${l}`);h+=u.move(" "),h+=u.move(n.safe(e.meta,{before:h,after:` +`,encode:["`"],...u.current()})),p()}return h+=u.move(` +`),s&&(h+=u.move(s+` +`)),h+=u.move(f),m(),h}function Gw(e,t,n){return(n?"":" ")+e}function Vn(e){let t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function fc(e,t,n,i){let o=Vn(n),s=o==='"'?"Quote":"Apostrophe",l=n.enter("definition"),u=n.enter("label"),f=n.createTracker(i),m=f.move("[");return m+=f.move(n.safe(n.associationId(e),{before:m,after:"]",...f.current()})),m+=f.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),m+=f.move("<"),m+=f.move(n.safe(e.url,{before:m,after:">",...f.current()})),m+=f.move(">")):(u=n.enter("destinationRaw"),m+=f.move(n.safe(e.url,{before:m,after:e.title?" ":` +`,...f.current()}))),u(),e.title&&(u=n.enter(`title${s}`),m+=f.move(" "+o),m+=f.move(n.safe(e.title,{before:m,after:o,...f.current()})),m+=f.move(o),u()),l(),m}function dc(e){let t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Ze(e){return"&#x"+e.toString(16).toUpperCase()+";"}function $n(e,t,n){let i=Bn(e),o=Bn(t);return i===void 0?o===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}$s.peek=qw;function $s(e,t,n,i){let o=dc(n),s=n.enter("emphasis"),l=n.createTracker(i),u=l.move(o),f=l.move(n.containerPhrasing(e,{after:o,before:u,...l.current()})),m=f.charCodeAt(0),h=$n(i.before.charCodeAt(i.before.length-1),m,o);h.inside&&(f=Ze(m)+f.slice(1));let p=f.charCodeAt(f.length-1),w=$n(i.after.charCodeAt(0),p,o);w.inside&&(f=f.slice(0,-1)+Ze(p));let k=l.move(o);return s(),n.attentionEncodeSurroundingInfo={after:w.outside,before:h.outside},u+f+k}function qw(e,t,n){return n.options.emphasis||"*"}var jn=function(e){if(e==null)return Kw;if(typeof e=="function")return Wi(e);if(typeof e=="object")return Array.isArray(e)?Zw(e):Qw(e);if(typeof e=="string")return Jw(e);throw new Error("Expected function, string, or object as test")};function Zw(e){let t=[],n=-1;for(;++n":""))+")"})}return w;function w(){let k=mc,v,F,T;if((!t||s(f,m,h[h.length-1]||void 0))&&(k=ek(n(f,h)),k[0]===wn))return k;if("children"in f&&f.children){let C=f;if(C.children&&k[0]!==Bi)for(F=(i?C.children.length:-1)+l,T=h.concat(C);F>-1&&F{Nt();Eo()});function So(e){return e.value||""}function By(){return"<"}var wc=b(()=>{So.peek=By});function Fo(e,t,r,n){let i=qt(r),o=i==='"'?"Quote":"Apostrophe",a=r.enter("image"),s=r.enter("label"),l=r.createTracker(n),c=l.move("![");return c+=l.move(r.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=r.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(r.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=r.enter("destinationRaw"),c+=l.move(r.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=r.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(r.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),c+=l.move(")"),a(),c}function zy(){return"!"}var kc=b(()=>{fn();Fo.peek=zy});function Oo(e,t,r,n){let i=e.referenceType,o=r.enter("imageReference"),a=r.enter("label"),s=r.createTracker(n),l=s.move("!["),c=r.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();let u=r.stack;r.stack=[],a=r.enter("reference");let f=r.safe(r.associationId(e),{before:l,after:"]",...s.current()});return a(),r.stack=u,o(),i==="full"||!c||c!==f?l+=s.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function Vy(){return"!"}var yc=b(()=>{Oo.peek=Vy});function Lo(e,t,r){let n=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(n);)i+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++o{Lo.peek=Wy});function To(e,t){let r=ct(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}var xc=b(()=>{Hr()});function Io(e,t,r,n){let i=qt(r),o=i==='"'?"Quote":"Apostrophe",a=r.createTracker(n),s,l;if(To(e,r)){let u=r.stack;r.stack=[],s=r.enter("autolink");let f=a.move("<");return f+=a.move(r.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),s(),r.stack=u,f}s=r.enter("link"),l=r.enter("label");let c=a.move("[");return c+=a.move(r.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=r.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(r.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=r.enter("destinationRaw"),c+=a.move(r.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=r.enter(`title${o}`),c+=a.move(" "+i),c+=a.move(r.safe(e.title,{before:c,after:i,...a.current()})),c+=a.move(i),l()),c+=a.move(")"),s(),c}function Uy(e,t,r){return To(e,r)?"<":"["}var _c=b(()=>{fn();xc();Io.peek=Uy});function qo(e,t,r,n){let i=e.referenceType,o=r.enter("linkReference"),a=r.enter("label"),s=r.createTracker(n),l=s.move("["),c=r.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();let u=r.stack;r.stack=[],a=r.enter("reference");let f=r.safe(r.associationId(e),{before:l,after:"]",...s.current()});return a(),r.stack=u,o(),i==="full"||!c||c!==f?l+=s.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function Hy(){return"["}var Cc=b(()=>{qo.peek=Hy});function Mt(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}var gn=b(()=>{});function Pc(e){let t=Mt(e),r=e.options.bulletOther;if(!r)return t==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+r+"`) to be different");return r}var Ac=b(()=>{gn()});function Ec(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}var Sc=b(()=>{});function bn(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}var No=b(()=>{});function Fc(e,t,r,n){let i=r.enter("list"),o=r.bulletCurrent,a=e.ordered?Ec(r):Mt(r),s=e.ordered?a==="."?")":".":Pc(r),l=t&&r.bulletLastUsed?a===r.bulletLastUsed:!1;if(!e.ordered){let u=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&u&&(!u.children||!u.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(l=!0),bn(r)===a&&u){let f=-1;for(;++f{gn();Ac();Sc();No()});function Lc(e){let t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}var Tc=b(()=>{});function Ic(e,t,r,n){let i=Lc(r),o=r.bulletCurrent||Mt(r);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(r.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let a=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);let s=r.createTracker(n);s.move(o+" ".repeat(a-o.length)),s.shift(a);let l=r.enter("listItem"),c=r.indentLines(r.containerFlow(e,s.current()),u);return l(),c;function u(f,p,h){return p?(h?"":" ".repeat(a))+f:(h?o:o+" ".repeat(a-o.length))+f}}var qc=b(()=>{gn();Tc()});function Nc(e,t,r,n){let i=r.enter("paragraph"),o=r.enter("phrasing"),a=r.containerPhrasing(e,n);return o(),i(),a}var Rc=b(()=>{});var Ro,Dc=b(()=>{_o();Ro=Dt(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"])});var Mc=b(()=>{Dc()});function jc(e,t,r,n){return(e.children.some(function(a){return Ro(a)})?r.containerPhrasing:r.containerFlow).call(r,e,n)}var Bc=b(()=>{Mc()});function zc(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}var Vc=b(()=>{});function Do(e,t,r,n){let i=zc(r),o=r.enter("strong"),a=r.createTracker(n),s=a.move(i+i),l=a.move(r.containerPhrasing(e,{after:i,before:s,...a.current()})),c=l.charCodeAt(0),u=Rt(n.before.charCodeAt(n.before.length-1),c,i);u.inside&&(l=xe(c)+l.slice(1));let f=l.charCodeAt(l.length-1),p=Rt(n.after.charCodeAt(0),f,i);p.inside&&(l=l.slice(0,-1)+xe(f));let h=a.move(i+i);return o(),r.attentionEncodeSurroundingInfo={after:p.outside,before:u.outside},s+l+h}function $y(e,t,r){return r.options.strong||"*"}var Wc=b(()=>{Vc();Nt();vo();Do.peek=$y});function Uc(e,t,r,n){return r.safe(e.value,n)}var Hc=b(()=>{});function $c(e){let t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}var Gc=b(()=>{});function Jc(e,t,r){let n=(bn(r)+(r.options.ruleSpaces?" ":"")).repeat($c(r));return r.options.ruleSpaces?n.slice(0,-1):n}var Qc=b(()=>{Gc();No()});var Yc,Kc=b(()=>{Qu();Ku();nc();oc();lc();bc();wc();kc();yc();vc();_c();Cc();Oc();qc();Rc();Bc();Wc();Hc();Qc();Yc={blockquote:Ju,break:ko,code:rc,definition:ic,emphasis:xo,hardBreak:ko,heading:gc,html:So,image:Fo,imageReference:Oo,inlineCode:Lo,link:Io,linkReference:qo,list:Fc,listItem:Ic,paragraph:Nc,root:jc,strong:Do,text:Uc,thematicBreak:Jc}});function Gy(e,t,r,n){if(t.type==="code"&&or(t,n)&&(e.type==="list"||e.type===t.type&&or(e,n)))return!1;if("spread"in r&&typeof r.spread=="boolean")return e.type==="paragraph"&&(e.type===t.type||t.type==="definition"||t.type==="heading"&&mn(t,n))?void 0:r.spread?1:0}var Xc,Zc=b(()=>{yo();Eo();Xc=[Gy]});var mt,ef,tf=b(()=>{mt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],ef=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:` -`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:mt},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r -]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:mt},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r -*])`},{character:"*",inConstruct:"phrasing",notInConstruct:mt},{atBreak:!0,character:"+",after:`(?:[ \r +`});return p(),h(),w+` +`+(o===1?"=":"-").repeat(w.length-(Math.max(w.lastIndexOf("\r"),w.lastIndexOf(` +`))+1))}let l="#".repeat(o),u=n.enter("headingAtx"),f=n.enter("phrasing");s.move(l+" ");let m=n.containerPhrasing(e,{before:"# ",after:` +`,...s.current()});return/^[\t ]/.test(m)&&(m=Ze(m.charCodeAt(0))+m.slice(1)),m=m?l+" "+m:l,n.options.closeAtx&&(m+=" "+l),f(),u(),m}qs.peek=tk;function qs(e){return e.value||""}function tk(){return"<"}Zs.peek=nk;function Zs(e,t,n,i){let o=Vn(n),s=o==='"'?"Quote":"Apostrophe",l=n.enter("image"),u=n.enter("label"),f=n.createTracker(i),m=f.move("![");return m+=f.move(n.safe(e.alt,{before:m,after:"]",...f.current()})),m+=f.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),m+=f.move("<"),m+=f.move(n.safe(e.url,{before:m,after:">",...f.current()})),m+=f.move(">")):(u=n.enter("destinationRaw"),m+=f.move(n.safe(e.url,{before:m,after:e.title?" ":")",...f.current()}))),u(),e.title&&(u=n.enter(`title${s}`),m+=f.move(" "+o),m+=f.move(n.safe(e.title,{before:m,after:o,...f.current()})),m+=f.move(o),u()),m+=f.move(")"),l(),m}function nk(){return"!"}Qs.peek=rk;function Qs(e,t,n,i){let o=e.referenceType,s=n.enter("imageReference"),l=n.enter("label"),u=n.createTracker(i),f=u.move("!["),m=n.safe(e.alt,{before:f,after:"]",...u.current()});f+=u.move(m+"]["),l();let h=n.stack;n.stack=[],l=n.enter("reference");let p=n.safe(n.associationId(e),{before:f,after:"]",...u.current()});return l(),n.stack=h,s(),o==="full"||!m||m!==p?f+=u.move(p+"]"):o==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function rk(){return"!"}Js.peek=ik;function Js(e,t,n){let i=e.value||"",o="`",s=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(i);)o+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++s\u007F]/.test(e.url))}Xs.peek=ok;function Xs(e,t,n,i){let o=Vn(n),s=o==='"'?"Quote":"Apostrophe",l=n.createTracker(i),u,f;if(Ks(e,n)){let h=n.stack;n.stack=[],u=n.enter("autolink");let p=l.move("<");return p+=l.move(n.containerPhrasing(e,{before:p,after:">",...l.current()})),p+=l.move(">"),u(),n.stack=h,p}u=n.enter("link"),f=n.enter("label");let m=l.move("[");return m+=l.move(n.containerPhrasing(e,{before:m,after:"](",...l.current()})),m+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),m+=l.move("<"),m+=l.move(n.safe(e.url,{before:m,after:">",...l.current()})),m+=l.move(">")):(f=n.enter("destinationRaw"),m+=l.move(n.safe(e.url,{before:m,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${s}`),m+=l.move(" "+o),m+=l.move(n.safe(e.title,{before:m,after:o,...l.current()})),m+=l.move(o),f()),m+=l.move(")"),u(),m}function ok(e,t,n){return Ks(e,n)?"<":"["}ea.peek=sk;function ea(e,t,n,i){let o=e.referenceType,s=n.enter("linkReference"),l=n.enter("label"),u=n.createTracker(i),f=u.move("["),m=n.containerPhrasing(e,{before:f,after:"]",...u.current()});f+=u.move(m+"]["),l();let h=n.stack;n.stack=[],l=n.enter("reference");let p=n.safe(n.associationId(e),{before:f,after:"]",...u.current()});return l(),n.stack=h,s(),o==="full"||!m||m!==p?f+=u.move(p+"]"):o==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function sk(){return"["}function Gn(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function gc(e){let t=Gn(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function wc(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Ui(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function kc(e,t,n,i){let o=n.enter("list"),s=n.bulletCurrent,l=e.ordered?wc(n):Gn(n),u=e.ordered?l==="."?")":".":gc(n),f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){let h=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&h&&(!h.children||!h.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),Ui(n)===l&&h){let p=-1;for(;++p-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let l=s.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);let u=n.createTracker(i);u.move(s+" ".repeat(l-s.length)),u.shift(l);let f=n.enter("listItem"),m=n.indentLines(n.containerFlow(e,u.current()),h);return f(),m;function h(p,w,k){return w?(k?"":" ".repeat(l))+p:(k?s:s+" ".repeat(l-s.length))+p}}function bc(e,t,n,i){let o=n.enter("paragraph"),s=n.enter("phrasing"),l=n.containerPhrasing(e,i);return s(),o(),l}var ta=jn(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function vc(e,t,n,i){return(e.children.some(function(l){return ta(l)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function Cc(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}na.peek=ak;function na(e,t,n,i){let o=Cc(n),s=n.enter("strong"),l=n.createTracker(i),u=l.move(o+o),f=l.move(n.containerPhrasing(e,{after:o,before:u,...l.current()})),m=f.charCodeAt(0),h=$n(i.before.charCodeAt(i.before.length-1),m,o);h.inside&&(f=Ze(m)+f.slice(1));let p=f.charCodeAt(f.length-1),w=$n(i.after.charCodeAt(0),p,o);w.inside&&(f=f.slice(0,-1)+Ze(p));let k=l.move(o+o);return s(),n.attentionEncodeSurroundingInfo={after:w.outside,before:h.outside},u+f+k}function ak(e,t,n){return n.options.strong||"*"}function Sc(e,t,n,i){return n.safe(e.value,i)}function _c(e){let t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Ec(e,t,n){let i=(Ui(n)+(n.options.ruleSpaces?" ":"")).repeat(_c(n));return n.options.ruleSpaces?i.slice(0,-1):i}var Tc={blockquote:sc,break:Vs,code:cc,definition:fc,emphasis:$s,hardBreak:Vs,heading:pc,html:qs,image:Zs,imageReference:Qs,inlineCode:Js,link:Xs,linkReference:ea,list:kc,listItem:xc,paragraph:bc,root:vc,strong:na,text:Sc,thematicBreak:Ec};var Ac=[lk];function lk(e,t,n,i){if(t.type==="code"&&Ar(t,i)&&(e.type==="list"||e.type===t.type&&Ar(e,i)))return!1;if("spread"in n&&typeof n.spread=="boolean")return e.type==="paragraph"&&(e.type===t.type||t.type==="definition"||t.type==="heading"&&Hi(t,i))?void 0:n.spread?1:0}var kn=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],Fc=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:` +`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:kn},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r +]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:kn},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r +*])`},{character:"*",inConstruct:"phrasing",notInConstruct:kn},{atBreak:!0,character:"+",after:`(?:[ \r ])`},{atBreak:!0,character:"-",after:`(?:[ \r -])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r -]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:mt},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:mt},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:mt},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:mt},{atBreak:!0,character:"~"}]});function rf(e){return e.label||!e.identifier?e.label||"":un(e.identifier)}var nf=b(()=>{fo()});function of(e){if(!e._compiled){let t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}var af=b(()=>{});function sf(e,t,r){let n=t.indexStack,i=e.children||[],o=[],a=-1,s=r.before,l;n.push(-1);let c=t.createTracker(r);for(;++a0&&(s==="\r"||s===` -`)&&u.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),s=" ",c=t.createTracker(r),c.move(o.join("")));let p=t.handle(u,e,t,{...c.current(),after:f,before:s});l&&l===p.slice(0,1)&&(p=xe(l.charCodeAt(0))+p.slice(1));let h=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,l=void 0,h&&(o.length>0&&h.before&&s===o[o.length-1].slice(-1)&&(o[o.length-1]=o[o.length-1].slice(0,-1)+xe(s.charCodeAt(0))),h.after&&(l=f)),c.move(p),o.push(p),s=p.slice(-1)}return n.pop(),o.join("")}var lf=b(()=>{Nt()});function uf(e,t,r){let n=t.indexStack,i=e.children||[],o=t.createTracker(r),a=[],s=-1;for(n.push(-1);++s"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:kn},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:kn},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:kn},{atBreak:!0,character:"~"}];function Pc(e){return e.label||!e.identifier?e.label||"":Ni(e.identifier)}function Mc(e){if(!e._compiled){let t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function Ic(e,t,n){let i=t.indexStack,o=e.children||[],s=[],l=-1,u=n.before,f;i.push(-1);let m=t.createTracker(n);for(;++l0&&(u==="\r"||u===` +`)&&h.type==="html"&&(s[s.length-1]=s[s.length-1].replace(/(\r?\n|\r)$/," "),u=" ",m=t.createTracker(n),m.move(s.join("")));let w=t.handle(h,e,t,{...m.current(),after:p,before:u});f&&f===w.slice(0,1)&&(w=Ze(f.charCodeAt(0))+w.slice(1));let k=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,f=void 0,k&&(s.length>0&&k.before&&u===s[s.length-1].slice(-1)&&(s[s.length-1]=s[s.length-1].slice(0,-1)+Ze(u.charCodeAt(0))),k.after&&(f=p)),m.move(w),s.push(w),u=w.slice(-1)}return i.pop(),s.join("")}function Lc(e,t,n){let i=t.indexStack,o=e.children||[],s=t.createTracker(n),l=[],u=-1;for(i.push(-1);++u `}return` -`}var cf=b(()=>{});function ff(e,t){let r=[],n=0,i=0,o;for(;o=Qy.exec(e);)a(e.slice(n,o.index)),r.push(o[0]),n=o.index+o[0].length,i++;return a(e.slice(n)),r.join("");function a(s){r.push(t(s,i,!s))}}var Qy,pf=b(()=>{Qy=/\r?\n|\r/g});function df(e,t,r){let n=(r.before||"")+(t||"")+(r.after||""),i=[],o=[],a={},s=-1;for(;++s=c||u+1{Nt();wo()});function gf(e){let t=e||{},r=t.now||{},n=t.lineShift||0,i=r.line||1,o=r.column||1;return{move:l,current:a,shift:s};function a(){return{now:{line:i,column:o},lineShift:n}}function s(c){n+=c}function l(c){let u=c||"",f=u.split(/\r?\n|\r/g),p=f[f.length-1];return i+=f.length-1,o=f.length===1?o+p.length:1+p.length+n,u}}var bf=b(()=>{});function Mo(e,t){let r=t||{},n={associationId:rf,containerPhrasing:ev,containerFlow:tv,createTracker:gf,compilePattern:of,enter:o,handlers:{...Yc},handle:void 0,indentLines:ff,indexStack:[],join:[...Xc],options:{},safe:rv,stack:[],unsafe:[...ef]};bo(n,r),n.options.tightDefinitions&&n.join.push(Zy),n.handle=Uu("type",{invalid:Ky,unknown:Xy,handlers:n.handlers});let i=n.handle(e,void 0,n,{before:` +`}var ck=/\r?\n|\r/g;function Oc(e,t){let n=[],i=0,o=0,s;for(;s=ck.exec(e);)l(e.slice(i,s.index)),n.push(s[0]),i=s.index+s[0].length,o++;return l(e.slice(i)),n.join("");function l(u){n.push(t(u,o,!u))}}function Rc(e,t,n){let i=(n.before||"")+(t||"")+(n.after||""),o=[],s=[],l={},u=-1;for(;++u=m||h+1{Hu();Gu();Kc();Zc();tf();nf();af();lf();cf();pf();mf();bf()});var kf=b(()=>{wf()});function wn(e){let t=this;t.compiler=r;function r(n){return Mo(n,{...t.data("settings"),...e,extensions:t.data("toMarkdownExtensions")||[]})}}var yf=b(()=>{kf()});var vf=b(()=>{yf()});function jo(e){if(e)throw e}var xf=b(()=>{});var Lf=N((VF,Of)=>{"use strict";var kn=Object.prototype.hasOwnProperty,Ff=Object.prototype.toString,_f=Object.defineProperty,Cf=Object.getOwnPropertyDescriptor,Pf=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Ff.call(t)==="[object Array]"},Af=function(t){if(!t||Ff.call(t)!=="[object Object]")return!1;var r=kn.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&kn.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;var i;for(i in t);return typeof i>"u"||kn.call(t,i)},Ef=function(t,r){_f&&r.name==="__proto__"?_f(t,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):t[r.name]=r.newValue},Sf=function(t,r){if(r==="__proto__")if(kn.call(t,r)){if(Cf)return Cf(t,r).value}else return;return t[r]};Of.exports=function e(){var t,r,n,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for(typeof s=="boolean"&&(u=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l{});function Bo(){let e=[],t={run:r,use:n};return t;function r(...i){let o=-1,a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...i);function s(l,...c){let u=e[++o],f=-1;if(l){a(l);return}for(;++fa.length,l;s&&a.push(i);try{l=e.apply(this,a)}catch(c){let u=c;if(s&&r)throw u;return i(u)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){r||(r=!0,t(a,...s))}function o(a){i(null,a)}}var qf=b(()=>{});var Nf=b(()=>{qf()});var ne,Rf=b(()=>{ho();ne=class extends Error{constructor(t,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let i="",o={},a=!1;if(r&&("line"in r&&"column"in r?o={place:r}:"start"in r&&"end"in r?o={place:r}:"type"in r?o={ancestors:[r],place:r.position}:o={...r}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof n=="string"){let l=n.indexOf(":");l===-1?o.ruleId=n:(o.source=n.slice(0,l),o.ruleId=n.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){let l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}let s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=s?s.line:void 0,this.name=Ye(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}};ne.prototype.file="";ne.prototype.name="";ne.prototype.reason="";ne.prototype.message="";ne.prototype.stack="";ne.prototype.column=void 0;ne.prototype.line=void 0;ne.prototype.ancestors=void 0;ne.prototype.cause=void 0;ne.prototype.fatal=void 0;ne.prototype.place=void 0;ne.prototype.ruleId=void 0;ne.prototype.source=void 0});var Df=b(()=>{Rf()});var Se,Mf=b(()=>{Se=H(require("node:path"),1)});var zo,XF,jf=b(()=>{zo=H(require("node:process"),1),XF=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"}});function yn(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}var Bf=b(()=>{});var Vo,zf=b(()=>{Vo=require("node:url");Bf()});function Uo(e,t){if(e&&e.includes(Se.default.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Se.default.sep+"`")}function Ho(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Vf(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function nv(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var nO,Wo,sr,Wf=b(()=>{Df();Mf();jf();zf();nO=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"},Wo=["history","path","basename","stem","extname","dirname"],sr=class{constructor(t){let r;t?yn(t)?r={path:t}:typeof t=="string"||nv(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":zo.default.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n{Wf()});var Hf,$f=b(()=>{Hf=function(e){let n=this.constructor.prototype,i=n[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,n),o}});function $o(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Go(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Jo(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Gf(e){if(!ar(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Jf(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function vn(e){return ov(e)?e:new sr(e)}function ov(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function av(e){return typeof e=="string"||sv(e)}function sv(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var xn,pO,iv,Qo,Yo,Qf=b(()=>{xf();xn=H(Lf(),1);Tf();Nf();Uf();$f();pO=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"},iv={}.hasOwnProperty,Qo=class e extends Hf{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Bo()}copy(){let t=new e,r=-1;for(;++r0){let[h,...w]=u,g=n[p][1];ar(g)&&ar(h)&&(h=(0,xn.default)(!0,g,h)),n[p]=[c,h,...w]}}}},Yo=new Qo().freeze()});var Yf=b(()=>{Qf()});var Kf={};_r(Kf,{remark:()=>lv});var vO,lv,Xf=b(()=>{go();vf();Yf();vO=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"},lv=Yo().use(ir).use(wn).freeze()});var ep=N((PO,Zf)=>{(()=>{"use strict";var e={d:(w,g)=>{for(var x in g)e.o(g,x)&&!e.o(w,x)&&Object.defineProperty(w,x,{enumerable:!0,get:g[x]})},o:(w,g)=>Object.prototype.hasOwnProperty.call(w,g),r:w=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(w,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>h,wikiLinkPlugin:()=>p});var r={horizontalTab:-2,virtualSpace:-1,nul:0,eof:null,space:32};function n(w){return w{w.exports=function(g){var x,k;return g._compiled||(x=g.before?"(?:"+g.before+")":"",k=g.after?"(?:"+g.after+")":"",g.atBreak&&(x="[\\r\\n][\\t ]*"+x),g._compiled=new RegExp((x?"("+x+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(g.character)?"\\":"")+g.character+(k||""),"g")),g._compiled}},112:w=>{function g(x,k,F){var _;if(!k)return F;for(typeof k=="string"&&(k=[k]),_=-1;++_{w.exports=function(I,v,q){for(var D,O,P,B,z,S,L,T,A=(q.before||"")+(v||"")+(q.after||""),U=[],K=[],X={},d=-1;++d=T||P+1{var g=w&&w.__esModule?()=>w.default:()=>w;return s.d(g,{a:g}),g},s.d=(w,g)=>{for(var x in g)s.o(g,x)&&!s.o(w,x)&&Object.defineProperty(w,x,{enumerable:!0,get:g[x]})},s.o=(w,g)=>Object.prototype.hasOwnProperty.call(w,g);var l={};(()=>{function w(F={}){let _=F.permalinks||[],V=F.pageResolver||(P=>[P.replace(/ /g,"_").toLowerCase()]),I=F.newClassName||"new",v=F.wikiLinkClassName||"internal",q=F.hrefTemplate||(P=>`#/page/${P}`),D;function O(P){return P[P.length-1]}return{enter:{wikiLink:function(P){D={type:"wikiLink",value:null,data:{alias:null,permalink:null,exists:null}},this.enter(D,P)}},exit:{wikiLinkTarget:function(P){let B=this.sliceSerialize(P);O(this.stack).value=B},wikiLinkAlias:function(P){let B=this.sliceSerialize(P);O(this.stack).data.alias=B},wikiLink:function(P){this.exit(P);let B=D,z=V(B.value),S=z.find(K=>_.indexOf(K)!==-1),L=S!==void 0,T;T=L?S:z[0]||"";let A=B.value;B.data.alias&&(A=B.data.alias);let U=v;L||(U+=" "+I),B.data.alias=A,B.data.permalink=T,B.data.exists=L,B.data.hName="a",B.data.hProperties={className:U,href:q(T)},B.data.hChildren=[{type:"text",value:A}]}}}}s.d(l,{V:()=>w,x:()=>k});var g=s(113),x=s.n(g);function k(F={}){let _=F.aliasDivider||":";return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]},{character:"]",inConstruct:["label","reference"]}],handlers:{wikiLink:function(V,I,v){let q=v.enter("wikiLink"),D=x()(v,V.value,{before:"[",after:"]"}),O=x()(v,V.data.alias,{before:"[",after:"]"}),P;return P=O!==D?`[[${D}${_}${O}]]`:`[[${D}]]`,q(),P}}}}})();var c=l.V,u=l.x;let f=!1;function p(w={}){let g=this.data();function x(k,F){g[k]?g[k].push(F):g[k]=[F]}!f&&(this.Parser&&this.Parser.prototype&&this.Parser.prototype.blockTokenizers||this.Compiler&&this.Compiler.prototype&&this.Compiler.prototype.visitors)&&(f=!0,console.warn("[remark-wiki-link] Warning: please upgrade to remark 13 to use this plugin")),x("micromarkExtensions",function(){var k=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).aliasDivider||":",F="]]";return{text:{91:{tokenize:function(_,V,I){var v,q,D=0,O=0,P=0;return function(A){return A!=="[[".charCodeAt(O)?I(A):(_.enter("wikiLink"),_.enter("wikiLinkMarker"),B(A))};function B(A){return O===2?(_.exit("wikiLinkMarker"),function(U){return i(U)||U===r.eof?I(U):(_.enter("wikiLinkData"),_.enter("wikiLinkTarget"),z(U))}(A)):A!=="[[".charCodeAt(O)?I(A):(_.consume(A),O++,B)}function z(A){return A===k.charCodeAt(D)?v?(_.exit("wikiLinkTarget"),_.enter("wikiLinkAliasMarker"),S(A)):I(A):A===F.charCodeAt(P)?v?(_.exit("wikiLinkTarget"),_.exit("wikiLinkData"),_.enter("wikiLinkMarker"),T(A)):I(A):i(A)||A===r.eof?I(A):(n(A)||(v=!0),_.consume(A),z)}function S(A){return D===k.length?(_.exit("wikiLinkAliasMarker"),_.enter("wikiLinkAlias"),L(A)):A!==k.charCodeAt(D)?I(A):(_.consume(A),D++,S)}function L(A){return A===F.charCodeAt(P)?q?(_.exit("wikiLinkAlias"),_.exit("wikiLinkData"),_.enter("wikiLinkMarker"),T(A)):I(A):i(A)||A===r.eof?I(A):(n(A)||(q=!0),_.consume(A),L)}function T(A){return P===2?(_.exit("wikiLinkMarker"),_.exit("wikiLink"),V(A)):A!==F.charCodeAt(P)?I(A):(_.consume(A),P++,T)}}}}}}(w)),x("fromMarkdownExtensions",c(w)),x("toMarkdownExtensions",u(w))}let h=p;Zf.exports=t})()});var np=N((AO,rp)=>{function uv(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return uv(n)},t)})();var Ko=Object.defineProperty,cv=Object.getOwnPropertyDescriptor,fv=Object.getOwnPropertyNames,pv=Object.prototype.hasOwnProperty,hv=(e,t)=>{for(var r in t)Ko(e,r,{get:t[r],enumerable:!0})},dv=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of fv(t))!pv.call(e,i)&&i!==r&&Ko(e,i,{get:()=>t[i],enumerable:!(n=cv(t,i))||n.enumerable});return e},mv=e=>dv(Ko({},"__esModule",{value:!0}),e),tp={};hv(tp,{isUrl:()=>gv});rp.exports=mv(tp);function gv(e){try{return!e.includes("://")||e.trim()!==e?!1:(new URL(e),!0)}catch{return!1}}});var Zo=N((SO,op)=>{function bv(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return bv(n)},t)})();var Xo=Object.defineProperty,wv=Object.getOwnPropertyDescriptor,kv=Object.getOwnPropertyNames,yv=Object.prototype.hasOwnProperty,vv=(e,t)=>{for(var r in t)Xo(e,r,{get:t[r],enumerable:!0})},xv=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of kv(t))!yv.call(e,i)&&i!==r&&Xo(e,i,{get:()=>t[i],enumerable:!(n=wv(t,i))||n.enumerable});return e},_v=e=>xv(Xo({},"__esModule",{value:!0}),e),ip={};vv(ip,{parseFrontmatter:()=>Pv,setFrontmatter:()=>Av});op.exports=_v(ip);var _n=require("obsidian"),Cv=At(),EO=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"};function Pv(e){let t=(0,_n.getFrontMatterInfo)(e);return(0,_n.parseYaml)(t.frontmatter)??{}}function Av(e,t){let r=(0,_n.getFrontMatterInfo)(e);if(Object.keys(t).length===0)return e.slice(r.contentStart);let n=(0,_n.stringifyYaml)(t);return r.exists?(0,Cv.insertAt)(e,n,r.from,r.to):`--- -`+n+`--- -`+e}});var gt=N((LO,pp)=>{function Ev(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return Ev(n)},t)})();var ea=Object.defineProperty,Sv=Object.getOwnPropertyDescriptor,Fv=Object.getOwnPropertyNames,Ov=Object.prototype.hasOwnProperty,Lv=(e,t)=>{for(var r in t)ea(e,r,{get:t[r],enumerable:!0})},Tv=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Fv(t))!Ov.call(e,i)&&i!==r&&ea(e,i,{get:()=>t[i],enumerable:!(n=Sv(t,i))||n.enumerable});return e},Iv=e=>Tv(ea({},"__esModule",{value:!0}),e),ap={};Lv(ap,{copySafe:()=>Rv,createFolderSafe:()=>Pn,createTempFile:()=>Dv,createTempFolder:()=>Cn,getAvailablePath:()=>ta,getMarkdownFilesSorted:()=>Mv,getNoteFilesSorted:()=>jv,getSafeRenamePath:()=>lp,isEmptyFolder:()=>Bv,listSafe:()=>up,process:()=>zv,readSafe:()=>cp,renameSafe:()=>Vv});pp.exports=Iv(ap);var FO=require("obsidian"),lr=Ct(),qv=zr(),sp=ot(),qe=Ve(),Nv=Sr(),le=Oe(),OO=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"};async function Rv(e,t,r){let n=(0,le.getFile)(e,t),i=(0,lr.parentFolderPath)(r);await Pn(e,i);let o=ta(e,r);try{await e.vault.copy(n,o)}catch(a){if(!await e.vault.exists(o))throw a}return o}async function Pn(e,t){if(await e.vault.adapter.exists(t))return!1;try{return await e.vault.createFolder(t),!0}catch(r){if(!await e.vault.exists(t))throw r;return!0}}async function Dv(e,t){let r=(0,le.getFileOrNull)(e,t);if(r)return sp.noopAsync;let n=await Cn(e,(0,lr.parentFolderPath)(t));try{await e.vault.create(t,"")}catch(i){if(!await e.vault.exists(t))throw i}return r=(0,le.getFile)(e,t),async()=>{r.deleted||await e.fileManager.trashFile(r),await n()}}async function Cn(e,t){let r=(0,le.getFolderOrNull)(e,t);if(r)return sp.noopAsync;let n=(0,lr.parentFolderPath)(t);await Cn(e,n);let i=await Cn(e,(0,lr.parentFolderPath)(t));return await Pn(e,t),r=(0,le.getFolder)(e,t),async()=>{r.deleted||await e.fileManager.trashFile(r),await i()}}function ta(e,t){let r=(0,qe.extname)(t);return e.vault.getAvailablePath((0,qe.join)((0,qe.dirname)(t),(0,qe.basename)(t,r)),r.slice(1))}function Mv(e){return e.vault.getMarkdownFiles().sort((t,r)=>t.path.localeCompare(r.path))}function jv(e){return e.vault.getAllLoadedFiles().filter(t=>(0,le.isFile)(t)&&(0,le.isNote)(e,t)).sort((t,r)=>t.path.localeCompare(r.path))}function lp(e,t,r){let n=(0,le.getPath)(e,t);if(e.vault.adapter.insensitive){let i=(0,qe.dirname)(r),o=(0,qe.basename)(r),a=null;for(;a=(0,le.getFolderOrNull)(e,i,!0),!a;)o=(0,qe.join)((0,qe.basename)(i),o),i=(0,qe.dirname)(i);r=(0,qe.join)(a.getParentPrefix(),o)}return n.toLowerCase()===r.toLowerCase()?r:ta(e,r)}async function Bv(e,t){let r=await up(e,(0,le.getPath)(e,t));return r.files.length===0&&r.folders.length===0}async function up(e,t){let r=(0,le.getPath)(e,t),n={files:[],folders:[]};if((await e.vault.adapter.stat(r))?.type!=="folder")return n;try{return await e.vault.adapter.list(r)}catch(i){if(await e.vault.exists(r))throw i;return n}}async function zv(e,t,r,n={}){let o={...{shouldFailOnMissingFile:!0},...n};await(0,qv.retryWithTimeout)(async()=>{let a=await cp(e,t);if(a===null)return u();let s=await(0,Nv.resolveValue)(r,a);if(s===null)return!1;let l=!0;if(!await fp(e,t,async f=>{await e.vault.process(f,p=>p!==a?(console.warn("Content has changed since it was read. Retrying...",{actualContent:p,expectedContent:a,path:f.path}),l=!1,p):s)}))return u();return l;function u(){if(o.shouldFailOnMissingFile){let f=(0,le.getPath)(e,t);throw new Error(`File '${f}' not found`)}return!0}},o)}async function cp(e,t){let r=null;return await fp(e,t,async n=>{r=await e.vault.read(n)}),r}async function Vv(e,t,r){let n=(0,le.getFile)(e,t,!1,!0),i=lp(e,t,r);if(n.path.toLowerCase()===i.toLowerCase())return n.path!==r&&await e.vault.rename(n,i),i;let o=(0,lr.parentFolderPath)(i);await Pn(e,o);try{await e.vault.rename(n,i)}catch(a){if(!await e.vault.exists(i)||await e.vault.exists(n.path))throw a}return i}async function fp(e,t,r){let n=(0,le.getPath)(e,t),i=(0,le.getFileOrNull)(e,n);if(!i||i.deleted)return!1;try{return await r(i),!0}catch(o){let a=(0,le.getFileOrNull)(e,n);if(!a||a.deleted)return!1;throw o}}});var ia=N((IO,mp)=>{function Wv(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return Wv(n)},t)})();var na=Object.defineProperty,Uv=Object.getOwnPropertyDescriptor,Hv=Object.getOwnPropertyNames,$v=Object.prototype.hasOwnProperty,Gv=(e,t)=>{for(var r in t)na(e,r,{get:t[r],enumerable:!0})},Jv=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Hv(t))!$v.call(e,i)&&i!==r&&na(e,i,{get:()=>t[i],enumerable:!(n=Uv(t,i))||n.enumerable});return e},Qv=e=>Jv(na({},"__esModule",{value:!0}),e),dp={};Gv(dp,{applyFileChanges:()=>Xv,isContentChange:()=>Xe,isFrontmatterChange:()=>ur});mp.exports=Qv(dp);var ra=ut(),Yv=Sr(),An=Oe(),hp=Zo(),Kv=gt(),TO=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"};async function Xv(e,t,r,n={}){await(0,Kv.process)(e,t,async i=>{let o=await(0,Yv.resolveValue)(r),a=(0,An.isCanvasFile)(e,t)?JSON.parse(i):(0,hp.parseFrontmatter)(i);for(let u of o)if(Xe(u)){let f=i.slice(u.startIndex,u.endIndex);if(f!==u.oldContent)return console.warn("Content mismatch",{actualContent:f,endIndex:u.endIndex,expectedContent:u.oldContent,path:(0,An.getPath)(e,t),startIndex:u.startIndex}),null}else if(ur(u)){let f=(0,ra.getNestedPropertyValue)(a,u.frontmatterKey);if(f!==u.oldContent)return console.warn("Content mismatch",{actualContent:f,expectedContent:u.oldContent,frontmatterKey:u.frontmatterKey,path:(0,An.getPath)(e,t)}),null}o.sort((u,f)=>Xe(u)&&Xe(f)?u.startIndex-f.startIndex:ur(u)&&ur(f)?u.frontmatterKey.localeCompare(f.frontmatterKey):Xe(u)?-1:1),o=o.filter((u,f)=>u.oldContent===u.newContent?!1:f===0?!0:!(0,ra.deepEqual)(u,o[f-1]));for(let u=1;uf.startIndex)return console.warn("Overlapping changes",{change:f,previousChange:p}),null}let s="",l=0,c=!1;for(let u of o)Xe(u)?(s+=i.slice(l,u.startIndex),s+=u.newContent,l=u.endIndex):ur(u)&&((0,ra.setNestedPropertyValue)(a,u.frontmatterKey,u.newContent),c=!0);return(0,An.isCanvasFile)(e,t)?s=JSON.stringify(a,null," "):(s+=i.slice(l),c&&(s=(0,hp.setFrontmatter)(s,a))),s},n)}function Xe(e){return e.startIndex!==void 0}function ur(e){return e.frontmatterKey!==void 0}});var En=N((qO,bp)=>{function Zv(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return Zv(n)},t)})();var oa=Object.defineProperty,ex=Object.getOwnPropertyDescriptor,tx=Object.getOwnPropertyNames,rx=Object.prototype.hasOwnProperty,nx=(e,t)=>{for(var r in t)oa(e,r,{get:t[r],enumerable:!0})},ix=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of tx(t))!rx.call(e,i)&&i!==r&&oa(e,i,{get:()=>t[i],enumerable:!(n=ex(t,i))||n.enumerable});return e},ox=e=>ix(oa({},"__esModule",{value:!0}),e),gp={};nx(gp,{referenceToFileChange:()=>ax,sortReferences:()=>sx});bp.exports=ox(gp);var bt=Ct();function ax(e,t){if((0,bt.isReferenceCache)(e))return{endIndex:e.position.end.offset,newContent:t,oldContent:e.original,startIndex:e.position.start.offset};if((0,bt.isFrontmatterLinkCache)(e))return{frontmatterKey:e.key,newContent:t,oldContent:e.original};throw new Error("Unknown link type")}function sx(e){return e.sort((t,r)=>(0,bt.isFrontmatterLinkCache)(t)&&(0,bt.isFrontmatterLinkCache)(r)?t.key.localeCompare(r.key):(0,bt.isReferenceCache)(t)&&(0,bt.isReferenceCache)(r)?t.position.start.offset-r.position.start.offset:(0,bt.isFrontmatterLinkCache)(t)?1:-1)}});var jt=N((RO,Pp)=>{function lx(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return lx(n)},t)})();var aa=Object.defineProperty,ux=Object.getOwnPropertyDescriptor,cx=Object.getOwnPropertyNames,fx=Object.prototype.hasOwnProperty,px=(e,t)=>{for(var r in t)aa(e,r,{get:t[r],enumerable:!0})},hx=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of cx(t))!fx.call(e,i)&&i!==r&&aa(e,i,{get:()=>t[i],enumerable:!(n=ux(t,i))||n.enumerable});return e},dx=e=>hx(aa({},"__esModule",{value:!0}),e),wp={};px(wp,{ensureMetadataCacheReady:()=>yp,getAllLinks:()=>xx,getBacklinksForFileOrPath:()=>vp,getBacklinksForFileSafe:()=>_x,getCacheSafe:()=>sa,getFrontmatterSafe:()=>Cx,registerFile:()=>xp,tempRegisterFileAndRun:()=>_p});Pp.exports=dx(wp);var mx=require("obsidian"),wt=Ct(),kp=zr(),gx=lt(),bx=ot(),wx=ut(),Ue=Oe(),kx=Zo(),yx=En(),vx=gt(),NO=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"},cr=(0,gx.getDebugger)("obsidian-dev-utils:MetadataCache:getCacheSafe");async function yp(e){for(let[t,r]of Object.entries(e.metadataCache.fileCache))r.hash&&(e.metadataCache.metadataCache[r.hash]||await sa(e,t))}function xx(e){let t=[];return e.links&&t.push(...e.links),e.embeds&&t.push(...e.embeds),e.frontmatterLinks&&t.push(...e.frontmatterLinks),(0,yx.sortReferences)(t),t=t.filter((r,n)=>{if(n===0)return!0;let i=t[n-1];return i?(0,wt.isReferenceCache)(r)&&(0,wt.isReferenceCache)(i)?r.position.start.offset!==i.position.start.offset:(0,wt.isFrontmatterLinkCache)(r)&&(0,wt.isFrontmatterLinkCache)(i)?r.key!==i.key:!0:!0}),t}function vp(e,t){let r=(0,Ue.getFile)(e,t,!0);return _p(e,r,()=>e.metadataCache.getBacklinksForFile(r))}async function _x(e,t,r={}){let n=e.metadataCache.getBacklinksForFile.safe;if(n)return n(t);let i=null;return await(0,kp.retryWithTimeout)(async()=>{let o=(0,Ue.getFile)(e,t);await yp(e),i=vp(e,o);for(let a of i.keys()){let s=(0,Ue.getFileOrNull)(e,a);if(!s)return!1;await Cp(e,s);let l=await(0,vx.readSafe)(e,s);if(!l)return!1;let c=(0,kx.parseFrontmatter)(l),u=i.get(a);if(!u)return!1;for(let f of u){let p;if((0,wt.isReferenceCache)(f))p=l.slice(f.position.start.offset,f.position.end.offset);else if((0,wt.isFrontmatterLinkCache)(f)){let h=(0,wx.getNestedPropertyValue)(c,f.key);if(typeof h!="string")return!1;p=h}else return!0;if(p!==f.original)return!1}}return!0},r),i}async function sa(e,t,r={}){let n=null;return await(0,kp.retryWithTimeout)(async()=>{let i=(0,Ue.getFileOrNull)(e,t);if(!i||i.deleted)return n=null,!0;await Cp(e,i);let o=e.metadataCache.getFileInfo(i.path),a=await e.vault.adapter.stat(i.path);return o?a?i.stat.mtime{for(let i of r)delete e.vault.fileMap[i];(0,Ue.isFile)(t)&&e.metadataCache.uniqueFileLookup.remove(t.name.toLowerCase(),t)}}function _p(e,t,r){let n=xp(e,t);try{return r()}finally{n()}}async function Cp(e,t){if(!(0,Ue.isMarkdownFile)(e,t))return;let r=(0,Ue.getPath)(e,t);for(let n of e.workspace.getLeavesOfType("markdown"))n.view instanceof mx.MarkdownView&&n.view.file?.path===r&&await n.view.save()}});var Sp=N((DO,Ep)=>{function Px(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return Px(n)},t)})();var la=Object.defineProperty,Ax=Object.getOwnPropertyDescriptor,Ex=Object.getOwnPropertyNames,Sx=Object.prototype.hasOwnProperty,Fx=(e,t)=>{for(var r in t)la(e,r,{get:t[r],enumerable:!0})},Ox=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ex(t))!Sx.call(e,i)&&i!==r&&la(e,i,{get:()=>t[i],enumerable:!(n=Ax(t,i))||n.enumerable});return e},Lx=e=>Ox(la({},"__esModule",{value:!0}),e),Ap={};Fx(Ap,{shouldUseRelativeLinks:()=>Tx,shouldUseWikilinks:()=>Ix});Ep.exports=Lx(Ap);function Tx(e){return e.vault.getConfig("newLinkFormat")==="relative"}function Ix(e){return!e.vault.getConfig("useMarkdownLinks")}});var On=N((jO,Wp)=>{function Lp(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return Lp(n)},t)})();var qx=Object.create,Fn=Object.defineProperty,Nx=Object.getOwnPropertyDescriptor,Rx=Object.getOwnPropertyNames,Dx=Object.getPrototypeOf,Mx=Object.prototype.hasOwnProperty,jx=(e,t)=>{for(var r in t)Fn(e,r,{get:t[r],enumerable:!0})},Tp=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Rx(t))!Mx.call(e,i)&&i!==r&&Fn(e,i,{get:()=>t[i],enumerable:!(n=Nx(t,i))||n.enumerable});return e},Bx=(e,t,r)=>(r=e!=null?qx(Dx(e)):{},Tp(t||!e||!e.__esModule?Fn(r,"default",{value:e,enumerable:!0}):r,e)),zx=e=>Tp(Fn({},"__esModule",{value:!0}),e),Ip={};jx(Ip,{convertLink:()=>Rp,editBacklinks:()=>Qx,editLinks:()=>ua,extractLinkFile:()=>Dp,generateMarkdownLink:()=>Mp,parseLink:()=>fr,shouldResetAlias:()=>jp,splitSubpath:()=>ca,testAngleBrackets:()=>Bp,testEmbed:()=>fa,testLeadingDot:()=>zp,testWikilink:()=>pa,updateLink:()=>Vp,updateLinksInFile:()=>Yx});Wp.exports=zx(Ip);var qp=require("obsidian"),Vx=(Xf(),Vn(Kf)),Wx=Bx(Lp((go(),Vn(Vu))),1),Ux=ep(),Ze=ut(),de=Ve(),Np=At(),Fp=np(),Hx=ia(),me=Oe(),Sn=jt(),Op=Sp(),$x=En(),MO=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"},Gx=/[\\\x00\x08\x0B\x0C\x0E-\x1F ]/g,Jx=/[\\[\]<>_*~=`$]/g;function Rp(e){let t=Dp(e.app,e.link,e.oldSourcePathOrFile??e.newSourcePathOrFile);return t?Vp((0,Ze.normalizeOptionalProperties)({app:e.app,link:e.link,newSourcePathOrFile:e.newSourcePathOrFile,newTargetPathOrFile:t,oldSourcePathOrFile:e.oldSourcePathOrFile,shouldForceMarkdownLinks:e.shouldForceMarkdownLinks,shouldUpdateFilenameAlias:e.shouldUpdateFilenameAlias})):e.link.original}async function Qx(e,t,r,n={}){let i=await(0,Sn.getBacklinksForFileSafe)(e,t,n);for(let o of i.keys()){let a=i.get(o)??[],s=new Set(a.map(l=>(0,Ze.toJson)(l)));await ua(e,o,l=>{let c=(0,Ze.toJson)(l);if(s.has(c))return r(l)},n)}}async function ua(e,t,r,n={}){await(0,Hx.applyFileChanges)(e,t,async()=>{let i=await(0,Sn.getCacheSafe)(e,t);if(!i)return[];let o=[];for(let a of(0,Sn.getAllLinks)(i)){let s=await r(a);s!==void 0&&o.push((0,$x.referenceToFileChange)(a,s))}return o},n)}function Dp(e,t,r){let{linkPath:n}=ca(t.link);return e.metadataCache.getFirstLinkpathDest(n,(0,me.getPath)(e,r))}function Mp(e){let{app:t}=e,n=(t.fileManager.generateMarkdownLink.defaultOptionsFn??(()=>({})))();e={...{isEmptyEmbedAliasAllowed:!0},...n,...e};let o=(0,me.getFile)(t,e.targetPathOrFile,e.isNonExistingFileAllowed);return(0,Sn.tempRegisterFileAndRun)(t,o,()=>{let a=(0,me.getPath)(t,e.sourcePathOrFile),s=e.subpath??"",l=e.alias??"",c=e.isEmbed??(e.originalLink?fa(e.originalLink):void 0)??!(0,me.isMarkdownFile)(t,o),u=e.isWikilink??(e.originalLink?pa(e.originalLink):void 0)??(0,Op.shouldUseWikilinks)(t),f=e.shouldForceRelativePath??(0,Op.shouldUseRelativeLinks)(t),p=e.shouldUseLeadingDot??(e.originalLink?zp(e.originalLink):void 0)??!1,h=e.shouldUseAngleBrackets??(e.originalLink?Bp(e.originalLink):void 0)??!1,w=o.path===a&&s?s:f?(0,de.relative)((0,de.dirname)(a),u?(0,me.trimMarkdownExtension)(t,o):o.path)+s:t.metadataCache.fileToLinktext(o,a,u)+s;f&&p&&!w.startsWith(".")&&!w.startsWith("#")&&(w="./"+w);let g=c?"!":"";if(u){l&&l.toLowerCase()===w.toLowerCase()&&(w=l,l="");let x=l?`|${l}`:"";return`${g}[[${w}${x}]]`}else return h?w=`<${w}>`:w=w.replace(Gx,function(x){return encodeURIComponent(x)}),!l&&(!c||!e.isEmptyEmbedAliasAllowed)&&(l=!e.shouldIncludeAttachmentExtensionToEmbedAlias||(0,me.isMarkdownFile)(t,o)?o.basename:o.name),l=l.replace(Jx,"\\$&"),`${g}[${l}](${w})`})}function fr(e){if((0,Fp.isUrl)(e))return{isEmbed:!1,isExternal:!0,isWikilink:!1,url:e};let t="!",r="<",n="](",i=")",o="|",a=e.startsWith(t);a&&(e=(0,Np.trimStart)(e,t));let l=(0,Vx.remark)().use(Wx.default).use(Ux.wikiLinkPlugin,{aliasDivider:o}).parse(e);if(l.children.length!==1)return null;let c=l.children[0];if(c?.type!=="paragraph"||c.children.length!==1)return null;let u=c.children[0];if(u?.position?.start.offset!==0||u.position.end.offset!==e.length)return null;switch(u.type){case"link":{let f=u,p=f.children[0],h=e.slice((p?.position?.end.offset??1)+n.length,(f.position?.end.offset??0)-i.length),w=e.startsWith(r)||h.startsWith(r),g=(0,Fp.isUrl)(f.url),x=f.url;if(!g&&!w)try{x=decodeURIComponent(x)}catch(k){console.error(`Failed to decode URL ${x}`,k)}return(0,Ze.normalizeOptionalProperties)({alias:p?.value,hasAngleBrackets:w,isEmbed:a,isExternal:g,isWikilink:!1,title:f.title??void 0,url:x})}case"wikiLink":{let f=u;return(0,Ze.normalizeOptionalProperties)({alias:e.includes(o)?f.data.alias:void 0,isEmbed:a,isWikilink:!0,url:f.value})}default:return null}}function jp(e){let{app:t,displayText:r,isWikilink:n,newSourcePathOrFile:i,oldSourcePathOrFile:o,oldTargetPath:a,targetPathOrFile:s}=e;if(n===!1)return!1;if(!r)return!0;let l=(0,me.getFile)(t,s,!0),c=(0,me.getPath)(t,i),u=(0,me.getPath)(t,o??i),f=(0,de.dirname)(c),p=(0,de.dirname)(u),h=new Set;for(let g of[l.path,a]){if(!g)continue;let x=(0,me.getPath)(t,g);h.add(x),h.add((0,de.basename)(x)),h.add((0,de.relative)(f,x)),h.add((0,de.relative)(p,x))}for(let g of[u,c])h.add(t.metadataCache.fileToLinktext(l,g,!1));let w=(0,qp.normalizePath)(r.split(" > ")[0]??"").replace(/^\.\//,"").toLowerCase();for(let g of h){if(g.toLowerCase()===w)return!0;let x=(0,de.dirname)(g),k=(0,de.basename)(g,(0,de.extname)(g));if((0,de.join)(x,k).toLowerCase()===w)return!0}return!1}function ca(e){let t=(0,qp.parseLinktext)((0,Np.normalize)(e));return{linkPath:t.path,subpath:t.subpath}}function Bp(e){return fr(e)?.hasAngleBrackets??!1}function fa(e){return fr(e)?.isEmbed??!1}function zp(e){return fr(e)?.url.startsWith("./")??!1}function pa(e){return fr(e)?.isWikilink??!1}function Vp(e){let{app:t,link:r,newSourcePathOrFile:n,newTargetPathOrFile:i,oldSourcePathOrFile:o,oldTargetPathOrFile:a,shouldForceMarkdownLinks:s,shouldUpdateFilenameAlias:l}=e;if(!i)return r.original;let c=(0,me.getFile)(t,i,!0),u=(0,me.getPath)(t,a??i),f=pa(r.original)&&s!==!0,{subpath:p}=ca(r.link);if((0,me.isCanvasFile)(t,n))return c.path+p;let h=jp((0,Ze.normalizeOptionalProperties)({app:t,displayText:r.displayText,isWikilink:f,newSourcePathOrFile:n,oldSourcePathOrFile:o,oldTargetPath:u,targetPathOrFile:c}))?void 0:r.displayText;return(l??!0)&&(h===(0,de.basename)(u,(0,de.extname)(u))?h=c.basename:h===(0,de.basename)(u)&&(h=c.name)),Mp((0,Ze.normalizeOptionalProperties)({alias:h,app:t,isWikilink:s?!1:void 0,originalLink:r.original,sourcePathOrFile:n,subpath:p,targetPathOrFile:c}))}async function Yx(e){let{app:t,newSourcePathOrFile:r,oldSourcePathOrFile:n,shouldForceMarkdownLinks:i,shouldUpdateEmbedOnlyLinks:o,shouldUpdateFilenameAlias:a}=e;(0,me.isCanvasFile)(t,r)&&!t.internalPlugins.getEnabledPluginById("canvas")||await ua(t,r,s=>{let l=fa(s.original);if(!(o!==void 0&&o!==l))return Rp((0,Ze.normalizeOptionalProperties)({app:t,link:s,newSourcePathOrFile:r,oldSourcePathOrFile:n,shouldForceMarkdownLinks:i,shouldUpdateFilenameAlias:a}))},e)}});var ga=N((BO,Hp)=>{function Kx(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return Kx(n)},t)})();var da=Object.defineProperty,Xx=Object.getOwnPropertyDescriptor,Zx=Object.getOwnPropertyNames,e_=Object.prototype.hasOwnProperty,t_=(e,t)=>{for(var r in t)da(e,r,{get:t[r],enumerable:!0})},r_=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Zx(t))!e_.call(e,i)&&i!==r&&da(e,i,{get:()=>t[i],enumerable:!(n=Xx(t,i))||n.enumerable});return e},n_=e=>r_(da({},"__esModule",{value:!0}),e),Up={};t_(Up,{deleteEmptyFolderHierarchy:()=>a_,deleteSafe:()=>ma});Hp.exports=n_(Up);var i_=ze(),pr=Oe(),o_=jt(),ha=gt();async function a_(e,t){let r=(0,pr.getFolderOrNull)(e,t);for(;r;){if(!await(0,ha.isEmptyFolder)(e,r))return;let n=r.parent;await ma(e,r.path),r=n}}async function ma(e,t,r,n,i){let o=(0,pr.getAbstractFileOrNull)(e,t);if(!o)return!1;let a=(0,pr.isFile)(o)||(i??!0);if((0,pr.isFile)(o)){let s=await(0,o_.getBacklinksForFileSafe)(e,o);r&&s.clear(r),s.count()!==0&&(n&&new Notice(`Attachment ${o.path} is still used by other notes. It will not be deleted.`),a=!1)}else if((0,pr.isFolder)(o)){let s=await(0,ha.listSafe)(e,o);for(let l of[...s.files,...s.folders])a&&=await ma(e,l,r,n);a&&=await(0,ha.isEmptyFolder)(e,o)}if(a)try{await e.fileManager.trashFile(o)}catch(s){await e.vault.exists(o.path)&&((0,i_.printError)(new Error(`Failed to delete ${o.path}`,{cause:s})),a=!1)}return a}});var Xp=N((zO,Kp)=>{function s_(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return s_(n)},t)})();var va=Object.defineProperty,l_=Object.getOwnPropertyDescriptor,u_=Object.getOwnPropertyNames,c_=Object.prototype.hasOwnProperty,f_=(e,t)=>{for(var r in t)va(e,r,{get:t[r],enumerable:!0})},p_=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of u_(t))!c_.call(e,i)&&i!==r&&va(e,i,{get:()=>t[i],enumerable:!(n=l_(t,i))||n.enumerable});return e},h_=e=>p_(va({},"__esModule",{value:!0}),e),Qp={};f_(Qp,{registerRenameDeleteHandlers:()=>w_});Kp.exports=h_(Qp);var d_=yl(),m_=require("obsidian"),xa=lt(),g_=ot(),Tn=ut(),ge=Ve(),b_=Si(),hr=Mi(),_e=Oe(),dr=On(),kt=jt(),_a=Ti(),$p=gt(),wa=ga(),ka=new Map,mr=new Set,Ln=new Map;function w_(e,t){let r=In(e.app),n=e.manifest.id;r.set(n,t),Gp(e.app),e.register(()=>{r.delete(n),Gp(e.app)});let i=e.app;e.registerEvent(i.vault.on("delete",o=>{v_(e,o)})),e.registerEvent(i.vault.on("rename",(o,a)=>{P_(e,o,a)})),e.registerEvent(i.metadataCache.on("deleted",(o,a)=>{__(e,o,a)}))}async function k_(e,t,r,n,i){if(n.set(t,r),!(0,_e.isNote)(e,t))return;let o=gr(e),a=await(0,hr.getAttachmentFolderPath)(e,t),s=o.shouldRenameAttachmentFolder?await(0,hr.getAttachmentFolderPath)(e,r):a,l=(0,_e.getFolderOrNull)(e,a);if(!l||a===s&&!o.shouldRenameAttachmentFiles)return;let c=[];if(await(0,hr.hasOwnAttachmentFolder)(e,t))m_.Vault.recurseChildren(l,p=>{(0,_e.isFile)(p)&&c.push(p)});else for(let p of i){let h=(0,dr.extractLinkFile)(e,p,t);h&&h.path.startsWith(a)&&(await(0,kt.getBacklinksForFileSafe)(e,h)).keys().length===1&&c.push(h)}let u=(0,ge.basename)(t,(0,ge.extname)(t)),f=(0,ge.basename)(r,(0,ge.extname)(r));for(let p of c){if((0,_e.isNote)(e,p))continue;let h=(0,ge.relative)(a,p.path),w=(0,ge.join)(s,(0,ge.dirname)(h)),g=o.shouldRenameAttachmentFiles?p.basename.replaceAll(u,f):p.basename,x=(0,ge.join)(w,(0,ge.makeFileName)(g,p.extension));if(p.path!==x){if(o.shouldDeleteConflictingAttachments){let k=(0,_e.getFileOrNull)(e,x);k&&await e.fileManager.trashFile(k)}else x=e.vault.getAvailablePath((0,ge.join)(w,g),p.extension);n.set(p.path,x)}}}function In(e){return(0,b_.getObsidianDevUtilsState)(e,"renameDeleteHandlersMap",new Map).value}function gr(e){let t=In(e),r=Array.from(t.values()).reverse(),n={};for(let i of r){let o=i();n.shouldDeleteConflictingAttachments||=o.shouldDeleteConflictingAttachments??!1,n.shouldDeleteEmptyFolders||=o.shouldDeleteEmptyFolders??!1,n.shouldHandleDeletions||=o.shouldHandleDeletions??!1,n.shouldHandleRenames||=o.shouldHandleRenames??!1,n.shouldRenameAttachmentFiles||=o.shouldRenameAttachmentFiles??!1,n.shouldRenameAttachmentFolder||=o.shouldRenameAttachmentFolder??!1,n.shouldUpdateFilenameAliases||=o.shouldUpdateFilenameAliases??!1;let a=n.isPathIgnored;n.isPathIgnored=s=>a?.(s)??o.isPathIgnored?.(s)??!1}return n}async function y_(e,t){if((0,xa.getDebugger)("obsidian-dev-utils:RenameDeleteHandler:handleDelete")(`Handle Delete ${t}`),!(0,_e.isNote)(e,t))return;let r=gr(e);if(!r.shouldHandleDeletions||r.isPathIgnored?.(t))return;let n=ka.get(t);if(ka.delete(t),n){let a=(0,kt.getAllLinks)(n);for(let s of a){let l=(0,dr.extractLinkFile)(e,s,t);l&&((0,_e.isNote)(e,l)||await(0,wa.deleteSafe)(e,l,t,r.shouldDeleteEmptyFolders))}}let i=await(0,hr.getAttachmentFolderPath)(e,t),o=(0,_e.getFolderOrNull)(e,i);o&&await(0,hr.hasOwnAttachmentFolder)(e,t)&&await(0,wa.deleteSafe)(e,o,t,!1,r.shouldDeleteEmptyFolders)}function v_(e,t){let r=e.app;if(!Ca(e))return;let n=t.path;(0,_a.addToQueue)(r,()=>y_(r,n))}function x_(e,t,r){let n=gr(e);n.isPathIgnored?.(t.path)||n.shouldHandleDeletions&&(0,_e.isMarkdownFile)(e,t)&&r&&ka.set(t.path,r)}function __(e,t,r){Ca(e)&&x_(e.app,t,r)}function C_(e,t,r){let n=Yp(t,r);if((0,xa.getDebugger)("obsidian-dev-utils:RenameDeleteHandler:handleRename")(`Handle Rename ${n}`),mr.has(n)){mr.delete(n);return}let i=gr(e);if(!i.shouldHandleRenames||i.isPathIgnored?.(t)||i.isPathIgnored?.(r))return;let o=e.metadataCache.getCache(t)??e.metadataCache.getCache(r),a=o?(0,kt.getAllLinks)(o):[],s=(0,kt.getBacklinksForFileOrPath)(e,t).data;(0,_a.addToQueue)(e,()=>ya(e,t,r,s,a))}async function ya(e,t,r,n,i,o){let a=Ln.get(t);if(a){Ln.delete(t);for(let f of a)await ya(e,f.oldPath,r,n,i,f.combinedBacklinksMap)}let s=e.metadataCache.getCache(t)??e.metadataCache.getCache(r),l=s?(0,kt.getAllLinks)(s):[],c=(0,kt.getBacklinksForFileOrPath)(e,t).data;for(let f of l)i.includes(f)||i.push(f);if(e.vault.adapter.insensitive&&t.toLowerCase()===r.toLowerCase()){let f=(0,ge.join)((0,ge.dirname)(r),"__temp__"+(0,ge.basename)(r));await Jp(e,r,f),await ya(e,t,f,n,i),await e.vault.rename((0,_e.getFile)(e,f),r);return}let u=(0,d_.around)(e.fileManager,{updateAllLinks:()=>g_.noopAsync});try{let f=new Map;await k_(e,t,r,f,i);let p=new Map;ba(n,f,p,t),ba(c,f,p,t);for(let g of f.keys()){if(g===t)continue;let x=(await(0,kt.getBacklinksForFileSafe)(e,g)).data;ba(x,f,p,g)}let h=new Set;for(let[g,x]of f.entries()){if(g===t)continue;let k=await Jp(e,g,x);f.set(g,k),h.add((0,ge.dirname)(g))}let w=gr(e);if(w.shouldDeleteEmptyFolders)for(let g of h)await(0,wa.deleteEmptyFolderHierarchy)(e,g);for(let[g,x]of Array.from(p.entries()).concat(Array.from(o?.entries()??[])))await(0,dr.editLinks)(e,g,k=>{let F=x.get((0,Tn.toJson)(k));if(!F)return;let _=f.get(F);if(_)return(0,dr.updateLink)((0,Tn.normalizeOptionalProperties)({app:e,link:k,newSourcePathOrFile:g,newTargetPathOrFile:_,oldTargetPathOrFile:F,shouldUpdateFilenameAlias:w.shouldUpdateFilenameAliases}))},{shouldFailOnMissingFile:!1});if((0,_e.isNote)(e,r)&&await(0,dr.updateLinksInFile)((0,Tn.normalizeOptionalProperties)({app:e,newSourcePathOrFile:r,oldSourcePathOrFile:t,shouldFailOnMissingFile:!1,shouldUpdateFilenameAlias:w.shouldUpdateFilenameAliases})),!(0,_e.getFileOrNull)(e,r)){let g=Ln.get(r);g||(g=[],Ln.set(r,g)),g.push({combinedBacklinksMap:p,oldPath:t})}}finally{u();let f=Array.from(mr);(0,_a.addToQueue)(e,()=>{for(let p of f)mr.delete(p)})}}function P_(e,t,r){if(!Ca(e)||!(0,_e.isFile)(t))return;let n=t.path;C_(e.app,r,n)}function ba(e,t,r,n){for(let[i,o]of e.entries()){let a=t.get(i)??i,s=r.get(a)??new Map;r.set(a,s);for(let l of o)s.set((0,Tn.toJson)(l),n)}}function Gp(e){let t=In(e);(0,xa.getDebugger)("obsidian-dev-utils:RenameDeleteHandler:logRegisteredHandlers")(`Plugins with registered rename/delete handlers: ${JSON.stringify(Array.from(t.keys()))}`)}function Yp(e,t){return`${e} -> ${t}`}async function Jp(e,t,r){if(r=(0,$p.getSafeRenamePath)(e,t,r),t===r)return r;let n=Yp(t,r);return mr.add(n),r=await(0,$p.renameSafe)(e,t,r),r}function Ca(e){let t=e.app,r=e.manifest.id,n=In(t);return Array.from(n.keys())[0]===r}});var th=N((VO,eh)=>{function A_(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return A_(n)},t)})();var Aa=Object.defineProperty,E_=Object.getOwnPropertyDescriptor,S_=Object.getOwnPropertyNames,F_=Object.prototype.hasOwnProperty,O_=(e,t)=>{for(var r in t)Aa(e,r,{get:t[r],enumerable:!0})},L_=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of S_(t))!F_.call(e,i)&&i!==r&&Aa(e,i,{get:()=>t[i],enumerable:!(n=E_(t,i))||n.enumerable});return e},T_=e=>L_(Aa({},"__esModule",{value:!0}),e),Zp={};O_(Zp,{PluginSettingsBase:()=>Pa});eh.exports=T_(Zp);var Pa=class{init(t){if(t!=null){if(typeof t!="object"||Array.isArray(t)){let r=Array.isArray(t)?"Array":typeof t;console.error(`Invalid data type. Expected Object, got: ${r}`);return}this.initFromRecord(t)}}shouldSaveAfterLoad(){return!1}toJSON(){return Object.fromEntries(Object.entries(this))}initFromRecord(t){for(let[r,n]of Object.entries(t))r in this?this[r]=n:console.error(`Unknown property: ${r}`)}}});var uh=N((UO,lh)=>{function I_(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return I_(n)},t)})();var Ea=Object.defineProperty,q_=Object.getOwnPropertyDescriptor,N_=Object.getOwnPropertyNames,R_=Object.prototype.hasOwnProperty,D_=(e,t)=>{for(var r in t)Ea(e,r,{get:t[r],enumerable:!0})},M_=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of N_(t))!R_.call(e,i)&&i!==r&&Ea(e,i,{get:()=>t[i],enumerable:!(n=q_(t,i))||n.enumerable});return e},j_=e=>M_(Ea({},"__esModule",{value:!0}),e),sh={};D_(sh,{appendCodeBlock:()=>B_});lh.exports=j_(sh);function B_(e,t){e.createEl("strong",{cls:"markdown-rendered code"},r=>{r.createEl("code",{text:t})})}});var ph=N(($O,fh)=>{function z_(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return z_(n)},t)})();var Fa=Object.defineProperty,V_=Object.getOwnPropertyDescriptor,W_=Object.getOwnPropertyNames,U_=Object.prototype.hasOwnProperty,H_=(e,t)=>{for(var r in t)Fa(e,r,{get:t[r],enumerable:!0})},$_=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of W_(t))!U_.call(e,i)&&i!==r&&Fa(e,i,{get:()=>t[i],enumerable:!(n=V_(t,i))||n.enumerable});return e},G_=e=>$_(Fa({},"__esModule",{value:!0}),e),ch={};H_(ch,{PluginSettingsTabBase:()=>Sa});fh.exports=G_(ch);var J_=require("obsidian"),HO=xi(),Sa=class extends J_.PluginSettingTab{constructor(t){super(t.app,t),this.plugin=t}}});var gh=N((GO,mh)=>{function Q_(e){return e&&e.__esModule&&e.default?e.default:e}(function(){let t=require;require=Object.assign(r=>{let n=t(r)??{};return Q_(n)},t)})();var La=Object.defineProperty,Y_=Object.getOwnPropertyDescriptor,K_=Object.getOwnPropertyNames,X_=Object.prototype.hasOwnProperty,Z_=(e,t)=>{for(var r in t)La(e,r,{get:t[r],enumerable:!0})},eC=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of K_(t))!X_.call(e,i)&&i!==r&&La(e,i,{get:()=>t[i],enumerable:!(n=Y_(t,i))||n.enumerable});return e},tC=e=>eC(La({},"__esModule",{value:!0}),e),dh={};Z_(dh,{extend:()=>nC});mh.exports=tC(dh);var Nn=require("obsidian"),rC=ut(),Oa=class{constructor(t){this.valueComponent=t}asExtended(){return(0,rC.assignWithNonEnumerableProperties)({},this.valueComponent,this)}bind(t,r,n){let o={...{componentToPluginSettingsValueConverter:u=>u,pluginSettingsToComponentValueConverter:u=>u,shouldAutoSave:!0},...n},a=t,s=()=>o.pluginSettings??a.settingsCopy,l=u=>{if(!o.valueValidator)return!0;u??=this.valueComponent.getValue();let f=o.valueValidator(u),p=hh(this.valueComponent);return p&&(p.setCustomValidity(f??""),p.reportValidity()),!f};this.valueComponent.setValue(o.pluginSettingsToComponentValueConverter(s()[r])).onChange(async u=>{if(!l(u))return;let f=s();f[r]=o.componentToPluginSettingsValueConverter(u),o.shouldAutoSave&&await a.saveSettings(f),await o.onChanged?.()}),l();let c=hh(this.valueComponent);return c&&(c.addEventListener("focus",()=>l()),c.addEventListener("blur",()=>l())),this.asExtended()}};function nC(e){return new Oa(e).asExtended()}function hh(e){return e instanceof Nn.DropdownComponent?e.selectEl:e instanceof Nn.SliderComponent?e.sliderEl:e instanceof Nn.TextAreaComponent||e instanceof Nn.TextComponent?e.inputEl:null}});var oC={};_r(oC,{default:()=>iC});module.exports=Vn(oC);var Z=require("obsidian"),yr=H(ot(),1),be=H(Oe(),1),vt=H(Js(),1),Ph=H(yi(),1),Ah=H(xi(),1),et=H(Ti(),1),Eh=H(Xp(),1),tt=H(gt(),1),Sh=H(Ve(),1);var oh=H(th(),1),ah=H(Er(),1),rh=/(?:)/,nh=/$./,qn=class extends oh.PluginSettingsBase{autoCollectAttachments=!1;changeNoteBacklinksAlt=!0;consistencyReportFile="consistency-report.md";deleteAttachmentsWithNote=!1;deleteEmptyFolders=!0;deleteExistFilesWhenMoveNote=!1;moveAttachmentsWithNote=!1;showBackupWarning=!0;updateLinks=!0;get excludePaths(){return this.#e}set excludePaths(t){this.#e=t.filter(Boolean),this.#r=ih(this.#e,nh)}get hadDangerousSettingsReverted(){return this.#n}get includePaths(){return this.#t}set includePaths(t){this.#t=t.filter(Boolean),this.#i=ih(this.#t,rh)}#e=[];#r=nh;#n=!1;#t=[];#i=rh;constructor(t){super(),this.excludePaths=["/consistency-report\\.md$/"],this.init(t)}initFromRecord(t){let r=t;if(r.ignoreFiles||r.ignoreFolders){let n=r.excludePaths??[];for(let i of r.ignoreFiles??[])n.push(`/${i}$/`);for(let i of r.ignoreFolders??[])n.push(i);n.length>0&&(r.excludePaths=n),delete r.ignoreFiles,delete r.ignoreFolders}super.initFromRecord(r),this.showBackupWarning&&(this.#n=this.deleteAttachmentsWithNote||this.deleteExistFilesWhenMoveNote||this.moveAttachmentsWithNote||this.autoCollectAttachments,this.deleteAttachmentsWithNote=!1,this.deleteExistFilesWhenMoveNote=!1,this.moveAttachmentsWithNote=!1,this.autoCollectAttachments=!1)}isPathIgnored(t){return!this.#i.test(t)||this.#r.test(t)}toJSON(){return{...super.toJSON(),excludePaths:this.excludePaths,includePaths:this.includePaths}}};function ih(e,t){if(e.length===0)return t;let r=e.map(n=>n.startsWith("/")&&n.endsWith("/")?n.slice(1,-1):`^${(0,ah.escapeRegExp)(n)}`).map(n=>`(${n})`).join("|");return new RegExp(r)}var Ce=require("obsidian"),Ta=H(uh(),1),bh=H(yi(),1),wh=H(ph(),1),Le=H(gh(),1),kh=H(Er(),1),Rn=class extends wh.PluginSettingsTabBase{display(){this.containerEl.empty();let t="Move Attachments with Note";new Ce.Setting(this.containerEl).setName(t).setDesc("Automatically move attachments when a note is relocated. This includes attachments located in the same folder or any of its subfolders.").addToggle(a=>(0,Le.extend)(a).bind(this.plugin,"moveAttachmentsWithNote",{onChanged:async()=>{await this.checkDangerousSetting("moveAttachmentsWithNote",t)}}));let r="Delete Unused Attachments with Note";new Ce.Setting(this.containerEl).setName(r).setDesc("Automatically remove attachments that are no longer referenced in other notes when the note is deleted.").addToggle(a=>(0,Le.extend)(a).bind(this.plugin,"deleteAttachmentsWithNote",{onChanged:async()=>{await this.checkDangerousSetting("deleteAttachmentsWithNote",r)}})),new Ce.Setting(this.containerEl).setName("Update Links").setDesc("Automatically update links to attachments and other notes when moving notes or attachments.").addToggle(a=>(0,Le.extend)(a).bind(this.plugin,"updateLinks")),new Ce.Setting(this.containerEl).setName("Delete Empty Folders").setDesc("Automatically remove empty folders after moving notes with attachments.").addToggle(a=>(0,Le.extend)(a).bind(this.plugin,"deleteEmptyFolders"));let n="Delete Duplicate Attachments on Note Move";new Ce.Setting(this.containerEl).setName(n).setDesc("Automatically delete attachments when moving a note if a file with the same name exists in the destination folder. If disabled, the file will be renamed and moved.").addToggle(a=>(0,Le.extend)(a).bind(this.plugin,"deleteExistFilesWhenMoveNote",{onChanged:async()=>{await this.checkDangerousSetting("deleteExistFilesWhenMoveNote",n)}})),new Ce.Setting(this.containerEl).setName("Update Backlink Text on Note Rename").setDesc("When a note is renamed, its linked references are automatically updated. If this option is enabled, the text of backlinks to this note will also be modified.").addToggle(a=>(0,Le.extend)(a).bind(this.plugin,"changeNoteBacklinksAlt")),new Ce.Setting(this.containerEl).setName("Consistency Report Filename").setDesc("Specify the name of the file for the consistency report.").addText(a=>(0,Le.extend)(a).bind(this.plugin,"consistencyReportFile").setPlaceholder("Example: consistency-report.md"));let i={componentToPluginSettingsValueConverter:a=>a.split(` -`).filter(Boolean),pluginSettingsToComponentValueConverter:a=>a.join(` -`),valueValidator:a=>{let s=a.split(` -`);for(let l of s)if(l.startsWith("/")&&l.endsWith("/")){let c=l.slice(1,-1);if(!(0,kh.isValidRegExp)(c))return`Invalid regular expression ${l}`}return null}},o="Auto Collect Attachments";new Ce.Setting(this.containerEl).setName(o).setDesc("Automatically collect attachments when the note is edited.").addToggle(a=>(0,Le.extend)(a).bind(this.plugin,"autoCollectAttachments",{onChanged:async()=>{await this.checkDangerousSetting("autoCollectAttachments",o)}})),new Ce.Setting(this.containerEl).setName("Include paths").setDesc(createFragment(a=>{a.appendText("Include notes from the following paths"),a.createEl("br"),a.appendText("Insert each path on a new line"),a.createEl("br"),a.appendText("You can use path string or "),(0,Ta.appendCodeBlock)(a,"/regular expression/"),a.createEl("br"),a.appendText("If the setting is empty, all notes are included")})).addTextArea(a=>(0,Le.extend)(a).bind(this.plugin,"includePaths",i)),new Ce.Setting(this.containerEl).setName("Exclude paths").setDesc(createFragment(a=>{a.appendText("Exclude notes from the following paths"),a.createEl("br"),a.appendText("Insert each path on a new line"),a.createEl("br"),a.appendText("You can use path string or "),(0,Ta.appendCodeBlock)(a,"/regular expression/"),a.createEl("br"),a.appendText("If the setting is empty, no notes are excluded")})).addTextArea(a=>(0,Le.extend)(a).bind(this.plugin,"excludePaths",i))}async checkDangerousSetting(t,r){this.plugin.settingsCopy[t]&&await(0,bh.alert)({app:this.app,message:createFragment(n=>{n.createDiv({cls:"community-modal-readme"},i=>{i.appendText("You enabled "),i.createEl("strong",{cls:"markdown-rendered-code",text:r}),i.appendText(" setting. Without proper configuration it might lead to inconvenient attachment rearrangements or even data loss in your vault."),i.createEl("br"),i.appendText("It is "),i.createEl("strong",{text:"STRONGLY"}),i.appendText(" recommended to backup your vault before using the plugin."),i.createEl("br"),i.createEl("a",{href:"https://github.com/dy-sh/obsidian-consistent-attachments-and-links?tab=readme-ov-file",text:"Read more"}),i.appendText(" about how to use the plugin.")})}),title:createFragment(n=>{(0,Ce.setIcon)(n.createSpan(),"triangle-alert"),n.appendText(" Consistent Attachments and Links")})})}};var XO=require("obsidian"),_h=H(Mi(),1),wr=H(Oe(),1),Bt=H(On(),1),Mn=H(jt(),1),ce=H(gt(),1),Ch=H(ga(),1),Dn=H(Ve(),1);var yh=require("obsidian"),vh=H(ut(),1),Ia=H(ia(),1),Te=H(Oe(),1),ue=H(On(),1),Ne=H(jt(),1),xh=H(En(),1),Re=H(Ve(),1),yt=class extends Map{constructor(r){super();this.title=r}add(r,n){this.has(r)||this.set(r,[]);let i=this.get(r);i&&i.push(n)}toString(r,n){if(this.size>0){let i=`# ${this.title} (${this.size.toString()} files) -`;for(let o of this.keys()){let a=(0,Te.getFileOrNull)(r,o);if(!a)continue;let s=(0,ue.generateMarkdownLink)({app:r,sourcePathOrFile:n,targetPathOrFile:a});i+=`${s}: -`;for(let l of this.get(o)??[])i+=`- (line ${(l.position.start.line+1).toString()}): \`${l.link}\` -`;i+=` +`,now:{line:1,column:1},lineShift:0});return o&&o.charCodeAt(o.length-1)!==10&&o.charCodeAt(o.length-1)!==13&&(o+=` +`),o;function s(l){return i.stack.push(l),u;function u(){i.stack.pop()}}}function dk(e){throw new Error("Cannot handle value `"+e+"`, expected node")}function hk(e){let t=e;throw new Error("Cannot handle unknown node `"+t.type+"`")}function mk(e,t){if(e.type==="definition"&&e.type===t.type)return 0}function pk(e,t){return Ic(e,this,t)}function gk(e,t){return Lc(e,this,t)}function wk(e,t){return Rc(this,e,t)}function Vi(e){let t=this;t.compiler=n;function n(i){return ra(i,{...t.data("settings"),...e,extensions:t.data("toMarkdownExtensions")||[]})}}function ia(e){if(e)throw e}var qi=je(jc(),1);function Fr(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function oa(){let e=[],t={run:n,use:i};return t;function n(...o){let s=-1,l=o.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);u(null,...o);function u(f,...m){let h=e[++s],p=-1;if(f){l(f);return}for(;++pl.length,f;u&&l.push(o);try{f=e.apply(this,l)}catch(m){let h=m;if(u&&n)throw h;return o(h)}u||(f&&f.then&&typeof f.then=="function"?f.then(s,o):f instanceof Error?o(f):s(f))}function o(l,...u){n||(n=!0,t(l,...u))}function s(l){o(null,l)}}var ve=class extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let o="",s={},l=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?o=t:!s.cause&&t&&(l=!0,o=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof i=="string"){let f=i.indexOf(":");f===-1?s.ruleId=i:(s.source=i.slice(0,f),s.ruleId=i.slice(f+1))}if(!s.place&&s.ancestors&&s.ancestors){let f=s.ancestors[s.ancestors.length-1];f&&(s.place=f.position)}let u=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file,this.message=o,this.line=u?u.line:void 0,this.name=Zt(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=l&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual,this.expected,this.note,this.url}};ve.prototype.file="";ve.prototype.name="";ve.prototype.reason="";ve.prototype.message="";ve.prototype.stack="";ve.prototype.column=void 0;ve.prototype.line=void 0;ve.prototype.ancestors=void 0;ve.prototype.cause=void 0;ve.prototype.fatal=void 0;ve.prototype.place=void 0;ve.prototype.ruleId=void 0;ve.prototype.source=void 0;var ot=je(require("node:path"),1);var sa=je(require("node:process"),1);var aa=require("node:url");function ji(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}var la=["history","path","basename","stem","extname","dirname"],Pr=class{constructor(t){let n;t?ji(t)?n={path:t}:typeof t=="string"||kk(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":sa.default.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i0){let[k,...v]=h,F=i[w][1];Fr(F)&&Fr(k)&&(k=(0,qi.default)(!0,F,k)),i[w]=[m,k,...v]}}}},pa=new ma().freeze();function fa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function da(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ha(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Qc(e){if(!Fr(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Jc(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Gi(e){return xk(e)?e:new Pr(e)}function xk(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function bk(e){return typeof e=="string"||vk(e)}function vk(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Kc=pa().use(Un).use(Vi).freeze();var wa={d:(e,t)=>{for(var n in t)wa.o(t,n)&&!wa.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},ka={};wa.d(ka,{Z:()=>Ek,$:()=>nf});var qn={horizontalTab:-2,virtualSpace:-1,nul:0,eof:null,space:32};function Xc(e){return e{e.exports=function(t){var n,i;return t._compiled||(n=t.before?"(?:"+t.before+")":"",i=t.after?"(?:"+t.after+")":"",t.atBreak&&(n="[\\r\\n][\\t ]*"+n),t._compiled=new RegExp((n?"("+n+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(t.character)?"\\":"")+t.character+(i||""),"g")),t._compiled}},112:e=>{function t(n,i,o){var s;if(!i)return o;for(typeof i=="string"&&(i=[i]),s=-1;++s{e.exports=function(u,f,m){for(var h,p,w,k,v,F,T,C,A=(m.before||"")+(f||"")+(m.after||""),P=[],Y=[],B={},_=-1;++_=C||w+1{var t=e&&e.__esModule?()=>e.default:()=>e;return bt.d(t,{a:t}),t},bt.d=(e,t)=>{for(var n in t)bt.o(t,n)&&!bt.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},bt.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var ya={};(()=>{function e(o={}){let s=o.permalinks||[],l=o.pageResolver||(w=>[w.replace(/ /g,"_").toLowerCase()]),u=o.newClassName||"new",f=o.wikiLinkClassName||"internal",m=o.hrefTemplate||(w=>`#/page/${w}`),h;function p(w){return w[w.length-1]}return{enter:{wikiLink:function(w){h={type:"wikiLink",value:null,data:{alias:null,permalink:null,exists:null}},this.enter(h,w)}},exit:{wikiLinkTarget:function(w){let k=this.sliceSerialize(w);p(this.stack).value=k},wikiLinkAlias:function(w){let k=this.sliceSerialize(w);p(this.stack).data.alias=k},wikiLink:function(w){this.exit(w);let k=h,v=l(k.value),F=v.find(Y=>s.indexOf(Y)!==-1),T=F!==void 0,C;C=T?F:v[0]||"";let A=k.value;k.data.alias&&(A=k.data.alias);let P=f;T||(P+=" "+u),k.data.alias=A,k.data.permalink=C,k.data.exists=T,k.data.hName="a",k.data.hProperties={className:P,href:m(C)},k.data.hChildren=[{type:"text",value:A}]}}}}bt.d(ya,{V:()=>e,x:()=>i});var t=bt(113),n=bt.n(t);function i(o={}){let s=o.aliasDivider||":";return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]},{character:"]",inConstruct:["label","reference"]}],handlers:{wikiLink:function(l,u,f){let m=f.enter("wikiLink"),h=n()(f,l.value,{before:"[",after:"]"}),p=n()(f,l.data.alias,{before:"[",after:"]"}),w;return w=p!==h?`[[${h}${s}${p}]]`:`[[${h}]]`,m(),w}}}}})();var Sk=ya.V,_k=ya.x,tf=!1;function nf(e={}){let t=this.data();function n(i,o){t[i]?t[i].push(o):t[i]=[o]}!tf&&(this.Parser&&this.Parser.prototype&&this.Parser.prototype.blockTokenizers||this.Compiler&&this.Compiler.prototype&&this.Compiler.prototype.visitors)&&(tf=!0,console.warn("[remark-wiki-link] Warning: please upgrade to remark 13 to use this plugin")),n("micromarkExtensions",function(){var i=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).aliasDivider||":",o="]]";return{text:{91:{tokenize:function(s,l,u){var f,m,h=0,p=0,w=0;return function(A){return A!=="[[".charCodeAt(p)?u(A):(s.enter("wikiLink"),s.enter("wikiLinkMarker"),k(A))};function k(A){return p===2?(s.exit("wikiLinkMarker"),function(P){return ga(P)||P===qn.eof?u(P):(s.enter("wikiLinkData"),s.enter("wikiLinkTarget"),v(P))}(A)):A!=="[[".charCodeAt(p)?u(A):(s.consume(A),p++,k)}function v(A){return A===i.charCodeAt(h)?f?(s.exit("wikiLinkTarget"),s.enter("wikiLinkAliasMarker"),F(A)):u(A):A===o.charCodeAt(w)?f?(s.exit("wikiLinkTarget"),s.exit("wikiLinkData"),s.enter("wikiLinkMarker"),C(A)):u(A):ga(A)||A===qn.eof?u(A):(Xc(A)||(f=!0),s.consume(A),v)}function F(A){return h===i.length?(s.exit("wikiLinkAliasMarker"),s.enter("wikiLinkAlias"),T(A)):A!==i.charCodeAt(h)?u(A):(s.consume(A),h++,F)}function T(A){return A===o.charCodeAt(w)?m?(s.exit("wikiLinkAlias"),s.exit("wikiLinkData"),s.enter("wikiLinkMarker"),C(A)):u(A):ga(A)||A===qn.eof?u(A):(Xc(A)||(m=!0),s.consume(A),T)}function C(A){return w===2?(s.exit("wikiLinkMarker"),s.exit("wikiLink"),l(A)):A!==o.charCodeAt(w)?u(A):(s.consume(A),w++,C)}}}}}}(e)),n("fromMarkdownExtensions",Sk(e)),n("toMarkdownExtensions",_k(e))}var Ek=nf,h_=ka.Z,rf=ka.$;(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();function xa(e){try{return!e.includes("://")||e.trim()!==e?!1:(new URL(e),!0)}catch{return!1}}var yn=require("obsidian");(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();function Zi(e){let t=(0,yn.getFrontMatterInfo)(e);return(0,yn.parseYaml)(t.frontmatter)??{}}function of(e,t){let n=(0,yn.getFrontMatterInfo)(e);if(Object.keys(t).length===0)return e.slice(n.contentStart);let i=(0,yn.stringifyYaml)(t);return n.exists?Ol(e,i,n.from,n.to):`--- +${i}--- +${e}`}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();async function sf(e,t,n){let i=Ne(e,t),o=dt(n);await Zn(e,o);let s=Qi(e,n);try{await e.vault.copy(i,s)}catch(l){if(!await e.vault.exists(s))throw l}return s}async function Zn(e,t){if(await e.vault.adapter.exists(t))return!1;try{return await e.vault.createFolder(t),!0}catch(n){if(!await e.vault.exists(t))throw n;return!0}}function Qi(e,t){let n=et(t);return e.vault.getAvailablePath(we(se(t),Re(t,n)),n.slice(1))}function Qn(e){return e.vault.getMarkdownFiles().sort((t,n)=>t.path.localeCompare(n.path))}function ba(e,t,n){let i=he(e,t);if(e.vault.adapter.insensitive){let o=se(n),s=Re(n),l;for(;l=ht(e,o,!0),!l;)s=we(Re(o),s),o=se(o);n=we(l.getParentPrefix(),s)}return i.toLowerCase()===n.toLowerCase()?n:Qi(e,n)}async function va(e,t){let n=await Jn(e,he(e,t));return n.files.length===0&&n.folders.length===0}async function Jn(e,t){let n=he(e,t),i={files:[],folders:[]};if((await e.vault.adapter.stat(n))?.type!=="folder")return i;try{return await e.vault.adapter.list(n)}catch(o){if(await e.vault.exists(n))throw o;return i}}async function af(e,t,n,i={}){let s={...{shouldFailOnMissingFile:!0},...i};await br(async()=>{let l=await Ca(e,t);if(l===null)return h();let u=await mr(n,l);if(u===null)return!1;let f=!0;if(!await lf(e,t,async p=>{await e.vault.process(p,w=>w!==l?(console.warn("Content has changed since it was read. Retrying...",{actualContent:w,expectedContent:l,path:p.path}),f=!1,w):u)}))return h();return f;function h(){if(s.shouldFailOnMissingFile){let p=he(e,t);throw new Error(`File '${p}' not found`)}return!0}},s)}async function Ca(e,t){let n=null;return await lf(e,t,async i=>{n=await e.vault.read(i)}),n}async function Ji(e,t,n){let i=Ne(e,t,!1,!0),o=ba(e,t,n);if(i.path.toLowerCase()===o.toLowerCase())return i.path!==n&&await e.vault.rename(i,o),o;let s=dt(o);await Zn(e,s);try{await e.vault.rename(i,o)}catch(l){if(!await e.vault.exists(o)||await e.vault.exists(i.path))throw l}return o}async function lf(e,t,n){let i=he(e,t),o=ce(e,i);if(!o||o.deleted)return!1;try{return await n(o),!0}catch(s){if(o=ce(e,i),!o||o.deleted)return!1;throw s}}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();async function Mr(e,t,n,i={}){await af(e,t,async o=>{let s=await mr(n),l=cn(e,t)?Tk(o):Zi(o);for(let h of s)if(xn(h)){let p=o.slice(h.startIndex,h.endIndex);if(p!==h.oldContent)return console.warn("Content mismatch",{actualContent:p,endIndex:h.endIndex,expectedContent:h.oldContent,path:he(e,t),startIndex:h.startIndex}),null}else if(Ki(h)){let p=Ci(l,h.frontmatterKey);if(p!==h.oldContent)return console.warn("Content mismatch",{actualContent:p,expectedContent:h.oldContent,frontmatterKey:h.frontmatterKey,path:he(e,t)}),null}s.sort((h,p)=>xn(h)&&xn(p)?h.startIndex-p.startIndex:Ki(h)&&Ki(p)?h.frontmatterKey.localeCompare(p.frontmatterKey):xn(h)?-1:1),s=s.filter((h,p)=>h.oldContent===h.newContent?!1:p===0?!0:!Cs(h,s[p-1]));for(let h=1;hp.startIndex)return console.warn("Overlapping changes",{change:p,previousChange:w}),null}let u="",f=0,m=!1;for(let h of s)xn(h)?(u+=o.slice(f,h.startIndex),u+=h.newContent,f=h.endIndex):Ki(h)&&(Eu(l,h.frontmatterKey,h.newContent),m=!0);return cn(e,t)?u=JSON.stringify(l,null," "):(u+=o.slice(f),m&&(u=of(u,l))),u},i)}function xn(e){return e.startIndex!==void 0}function Ki(e){return e.frontmatterKey!==void 0}function Tk(e){let t;try{t=JSON.parse(e)}catch{t=null}return(t===null||typeof t!="object")&&(t={}),t}var cf=require("obsidian");(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();function Xi(e,t){if(Vt(e))return{endIndex:e.position.end.offset,newContent:t,oldContent:e.original,startIndex:e.position.start.offset};if(Ot(e))return{frontmatterKey:e.key,newContent:t,oldContent:e.original};throw new Error("Unknown link type")}function uf(e){return e.sort((t,n)=>Ot(t)&&Ot(n)?t.key.localeCompare(n.key):Vt(t)&&Vt(n)?t.position.start.offset-n.position.start.offset:Ot(t)?1:-1)}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();async function Ak(e){for(let[t,n]of Object.entries(e.metadataCache.fileCache))n.hash&&(e.metadataCache.metadataCache[n.hash]||await mt(e,t))}function vt(e){let t=[];return e.links&&t.push(...e.links),e.embeds&&t.push(...e.embeds),e.frontmatterLinks&&t.push(...e.frontmatterLinks),uf(t),t=t.filter((n,i)=>{if(i===0)return!0;let o=t[i-1];return o?Vt(n)&&Vt(o)?n.position.start.offset!==o.position.start.offset:Ot(n)&&Ot(o)?n.key!==o.key:!0:!0}),t}function eo(e,t){let n=Ne(e,t,!0);return Sa(e,n,()=>e.metadataCache.getBacklinksForFile(n))}async function Jt(e,t,n={}){let i=e.metadataCache.getBacklinksForFile.safe;if(i)return i(t);let o=null;return await br(async()=>{let s=Ne(e,t);await Ak(e),o=eo(e,s);for(let l of o.keys()){let u=ce(e,l);if(!u)return!1;await ff(e,u);let f=await Ca(e,u);if(!f)return!1;let m=Zi(f),h=o.get(l);if(!h)return!1;for(let p of h){let w;if(Vt(p))w=f.slice(p.position.start.offset,p.position.end.offset);else if(Ot(p)){let k=Ci(m,p.key);if(typeof k!="string")return!1;w=k}else return!0;if(w!==p.original)return!1}}return!0},n),o}async function mt(e,t,n={}){let i=Ue("MetadataCache:getCacheSafe"),o=null;return await br(async()=>{let s=ce(e,t);if(!s||s.deleted)return o=null,!0;await ff(e,s);let l=e.metadataCache.getFileInfo(s.path),u=await e.vault.adapter.stat(s.path);return l?u?s.stat.mtime{for(let o of n)delete e.vault.fileMap[o];tt(t)&&e.metadataCache.uniqueFileLookup.remove(t.name.toLowerCase(),t)}}function Sa(e,t,n){let i=Fk(e,t);try{return n()}finally{i()}}async function ff(e,t){if(!ke(e,t))return;let n=he(e,t);for(let i of e.workspace.getLeavesOfType("markdown"))i.view instanceof cf.MarkdownView&&i.view.file?.path===n&&await i.view.save()}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();function df(e){return e.vault.getConfig("newLinkFormat")==="relative"}function hf(e){return!e.vault.getConfig("useMarkdownLinks")}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Pk=/[\\\x00\x08\x0B\x0C\x0E-\x1F ]/g,Mk=/[\\[\]<>_*~=`$]/g,pf="|";function Ik(e){let t=Yt(e.app,e.link,e.oldSourcePathOrFile??e.newSourcePathOrFile);return t?Ea({app:e.app,link:e.link,newSourcePathOrFile:e.newSourcePathOrFile,newTargetPathOrFile:t,oldSourcePathOrFile:e.oldSourcePathOrFile,shouldForceMarkdownLinks:e.shouldForceMarkdownLinks,shouldUpdateFilenameAlias:e.shouldUpdateFilenameAlias}):e.link.original}async function _a(e,t,n,i={}){await Mr(e,t,async()=>{let o=await mt(e,t);if(!o)return[];let s=[];for(let l of vt(o)){let u=await n(l);u!==void 0&&s.push(Xi(l,u))}return s},i)}function Yt(e,t,n){let{linkPath:i}=Kt(t.link);return e.metadataCache.getFirstLinkpathDest(i,he(e,n))}function no(e){let{app:t}=e,i=(t.fileManager.generateMarkdownLink.defaultOptionsFn??(()=>({})))();e={...{isEmptyEmbedAliasAllowed:!0},...i,...e};let s=Ne(t,e.targetPathOrFile,e.isNonExistingFileAllowed);return Sa(t,s,()=>Nk(e))}function Ir(e){let t=Hk(e);if(t)return t;let n="!",i=e.startsWith(n);i&&(e=Dt(e,n));let s=Kc().use(Un).use(rf,{aliasDivider:pf}).parse(e);if(s.children.length!==1)return null;let l=s.children[0];if(l?.type!=="paragraph"||l.children.length!==1)return null;let u=l.children[0];if(u?.position?.start.offset!==0||u.position.end.offset!==e.length)return null;switch(u.type){case"link":return Bk(u,e,i);case"wikiLink":return Uk(u,e,i);default:return null}}function Lk(e){let{app:t,displayText:n,isWikilink:i,newSourcePathOrFile:o,oldSourcePathOrFile:s,oldTargetPath:l,targetPathOrFile:u}=e;if(i===!1)return!1;if(!n)return!0;let f=Ne(t,u,!0),m=he(t,o),h=he(t,s??o),p=se(m),w=se(h),k=new Set;for(let F of[f.path,l]){if(!F)continue;let T=he(t,F);k.add(T),k.add(Re(T)),k.add(In(p,T)),k.add(In(w,T))}for(let F of[h,m])k.add(t.metadataCache.fileToLinktext(f,F,!1));let v=He((0,to.normalizePath)(n.split(" > ")[0]??""),/^\.\//g,"").toLowerCase();for(let F of k){if(F.toLowerCase()===v)return!0;let T=se(F),C=Re(F,et(F));if(we(T,C).toLowerCase()===v)return!0}return!1}function Kt(e){let t=(0,to.parseLinktext)(pr(e));return{linkPath:t.path,subpath:t.subpath}}function Ok(e){return Ir(e)?.hasAngleBrackets??!1}function ro(e){return Ir(e)?.isEmbed??!1}function Dk(e){return Ir(e)?.url.startsWith("./")??!1}function Kn(e){return Ir(e)?.isWikilink??!1}function Ea(e){let{app:t,link:n,newSourcePathOrFile:i,newTargetPathOrFile:o,oldSourcePathOrFile:s,oldTargetPathOrFile:l,shouldForceMarkdownLinks:u,shouldUpdateFilenameAlias:f}=e;if(!o)return n.original;let m=Ne(t,o,!0),h=he(t,l??o),p=Kn(n.original)&&u!==!0,{subpath:w}=Kt(n.link),k=!f;if(cn(t,i))return m.path+w;let v;if(p){let T=Ir(n.original);T?.alias&&(v=T.alias,k=!0)}return v??=Lk({app:t,displayText:n.displayText,isWikilink:p,newSourcePathOrFile:i,oldSourcePathOrFile:s,oldTargetPath:h,targetPathOrFile:m})?void 0:n.displayText,k||(v===Re(h,et(h))?v=m.basename:v===Re(h)&&(v=m.name)),no({alias:v,app:t,isWikilink:u?!1:void 0,originalLink:n.original,sourcePathOrFile:i,subpath:w,targetPathOrFile:m})}async function io(e){let{app:t,newSourcePathOrFile:n,oldSourcePathOrFile:i,shouldForceMarkdownLinks:o,shouldUpdateEmbedOnlyLinks:s,shouldUpdateFilenameAlias:l}=e;cn(t,n)&&!t.internalPlugins.getEnabledPluginById("canvas")||await _a(t,n,u=>{let f=ro(u.original);if(!(s!==void 0&&s!==f))return Ik({app:t,link:u,newSourcePathOrFile:n,oldSourcePathOrFile:i,shouldForceMarkdownLinks:o,shouldUpdateFilenameAlias:l})},e)}function Rk(e,t,n,i,o){let s;return t.path===n&&i?s=i:o.shouldForceRelativePath?s=In(se(n),o.isWikilink?Ul(e,t):t.path)+i:s=e.metadataCache.fileToLinktext(t,n,o.isWikilink)+i,o.shouldForceRelativePath&&o.shouldUseLeadingDot&&!s.startsWith(".")&&!s.startsWith("#")&&(s=`./${s}`),s}function Nk(e){let{app:t}=e,n=Ne(t,e.targetPathOrFile,e.isNonExistingFileAllowed),i=he(t,e.sourcePathOrFile),o=e.subpath??"",s=zk(e,n),l=Rk(t,n,i,o,s);return s.isWikilink?Wk(l,e.alias,s.isEmbed):Yk(l,n,e,s)}function Yk(e,t,n,i){let{app:o}=n,s=i.isEmbed?"!":"",l=i.shouldUseAngleBrackets?`<${e}>`:He(e,Pk,({substring:m})=>encodeURIComponent(m)),u=n.alias??"";!u&&(!i.isEmbed||!n.isEmptyEmbedAliasAllowed)&&(u=!n.shouldIncludeAttachmentExtensionToEmbedAlias||ke(o,t)?t.basename:t.name);let f=He(u,Mk,"\\$&");return`${s}[${f}](${l})`}function Wk(e,t,n){let i=n?"!":"",o=t??"";if(o&&o.toLowerCase()===e.toLowerCase())return`${i}[[${o}]]`;let s=o?`|${o}`:"";return`${i}[[${e}${s}]]`}function zk(e,t){let{app:n}=e;return{isEmbed:e.isEmbed??(e.originalLink?ro(e.originalLink):void 0)??!ke(n,t),isWikilink:e.isWikilink??(e.originalLink?Kn(e.originalLink):void 0)??hf(n),shouldForceRelativePath:e.shouldForceRelativePath??df(n),shouldUseAngleBrackets:e.shouldUseAngleBrackets??(e.originalLink?Ok(e.originalLink):void 0)??!1,shouldUseLeadingDot:e.shouldUseLeadingDot??(e.originalLink?Dk(e.originalLink):void 0)??!1}}function Bk(e,t,n){let i="<",o="](",s=")",l=e.children[0],u=t.slice((l?.position?.end.offset??1)+o.length,(e.position?.end.offset??0)-s.length),f=t.startsWith(i)||u.startsWith(i),m=xa(e.url),h=e.url;if(!m&&!f)try{h=decodeURIComponent(h)}catch(p){console.error(`Failed to decode URL ${h}`,p)}return{alias:l?.value,hasAngleBrackets:f,isEmbed:n,isExternal:m,isWikilink:!1,title:e.title??void 0,url:h}}function Hk(e){return xa(e)?{isEmbed:!1,isExternal:!0,isWikilink:!1,url:e}:null}function Uk(e,t,n){return{alias:t.includes(pf)?e.data.alias:void 0,isEmbed:n,isExternal:!1,isWikilink:!0,url:e.value}}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();async function oo(e,t){let n=ht(e,t);for(;n;){if(!await va(e,n))return;let i=n.parent;await Lr(e,n.path),n=i}}async function Lr(e,t,n,i,o){let s=gr(e,t);if(!s)return!1;let l=tt(s)||(o??!0);if(tt(s)){let u=await Jt(e,s);n&&u.clear(n),u.count()!==0&&(i&&new Notice(`Attachment ${s.path} is still used by other notes. It will not be deleted.`),l=!1)}else if(wr(s)){let u=await Jn(e,s);for(let f of[...u.files,...u.folders])l&&=await Lr(e,f,n,i);l&&=await va(e,s)}if(l)try{await e.fileManager.trashFile(s)}catch(u){await e.vault.exists(s.path)&&(hr(new Error(`Failed to delete ${s.path}`,{cause:u})),l=!1)}return l}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Ta=new Map,Or=new Set,so=new Map;function yf(e,t){let n=ao(e.app),i=e.manifest.id;n.set(i,t),wf(e.app),e.register(()=>{n.delete(i),wf(e.app)});let o=e.app;e.registerEvent(o.vault.on("delete",s=>{qk(e,s)})),e.registerEvent(o.vault.on("rename",(s,l)=>{Kk(e,s,l)})),e.registerEvent(o.metadataCache.on("deleted",(s,l)=>{Qk(e,s,l)}))}async function Vk(e,t,n,i,o){let s=so.get(t);if(s){so.delete(t);for(let l of s)await Aa(e,l.oldPath,n,i,o,l.combinedBacklinksMap)}}async function $k(e,t,n,i,o){if(i.set(t,n),!Rt(e,t))return;let s=Dr(e),l=await Wn(e,t),u=s.shouldRenameAttachmentFolder?await Wn(e,n):l,f=ht(e,l);if(!f||l===u&&!s.shouldRenameAttachmentFiles)return;let m=[];if(await _s(e,t))kf.Vault.recurseChildren(f,w=>{tt(w)&&m.push(w)});else for(let w of o){let k=Yt(e,w,t);k&&k.path.startsWith(l)&&(await Jt(e,k)).keys().length===1&&m.push(k)}let h=Re(t,et(t)),p=Re(n,et(n));for(let w of m){if(Rt(e,w))continue;let k=In(l,w.path),v=we(u,se(k)),F=s.shouldRenameAttachmentFiles?He(w.basename,h,p):w.basename,T=we(v,Rl(F,w.extension));if(w.path!==T){if(s.shouldDeleteConflictingAttachments){let C=ce(e,T);C&&await e.fileManager.trashFile(C)}else T=e.vault.getAvailablePath(we(v,F),w.extension);i.set(w.path,T)}}}function ao(e){return jt(e,"renameDeleteHandlersMap",new Map).value}function Dr(e){let t=ao(e),n=Array.from(t.values()).reverse(),i={};for(let o of n){let s=o();i.shouldDeleteConflictingAttachments||=s.shouldDeleteConflictingAttachments??!1,i.shouldDeleteEmptyFolders||=s.shouldDeleteEmptyFolders??!1,i.shouldHandleDeletions||=s.shouldHandleDeletions??!1,i.shouldHandleRenames||=s.shouldHandleRenames??!1,i.shouldRenameAttachmentFiles||=s.shouldRenameAttachmentFiles??!1,i.shouldRenameAttachmentFolder||=s.shouldRenameAttachmentFolder??!1,i.shouldUpdateFilenameAliases||=s.shouldUpdateFilenameAliases??!1;let l=i.isPathIgnored;i.isPathIgnored=u=>l?.(u)??s.isPathIgnored?.(u)??!1}return i}async function jk(e,t,n,i,o){if(!e.vault.adapter.insensitive||t.toLowerCase()!==n.toLowerCase())return!1;let s=we(se(n),`__temp__${Re(n)}`);return await bf(e,n,s),await Aa(e,t,s,i,o),await e.vault.rename(Ne(e,s),n),!0}async function Gk(e,t){if(Ue("RenameDeleteHandler:handleDelete")(`Handle Delete ${t}`),!Rt(e,t))return;let n=Dr(e);if(!n.shouldHandleDeletions||n.isPathIgnored?.(t))return;let i=Ta.get(t);if(Ta.delete(t),i){let l=vt(i);for(let u of l){let f=Yt(e,u,t);f&&(Rt(e,f)||await Lr(e,f,t,n.shouldDeleteEmptyFolders))}}let o=await Wn(e,t),s=ht(e,o);s&&await _s(e,t)&&await Lr(e,s,t,!1,n.shouldDeleteEmptyFolders)}function qk(e,t){let n=e.app;if(!Fa(e))return;let i=t.path;it(n,()=>Gk(n,i))}function Zk(e,t,n){let i=Dr(e);i.isPathIgnored?.(t.path)||i.shouldHandleDeletions&&ke(e,t)&&n&&Ta.set(t.path,n)}function Qk(e,t,n){Fa(e)&&Zk(e.app,t,n)}function Jk(e,t,n){let i=xf(t,n);if(Ue("RenameDeleteHandler:handleRename")(`Handle Rename ${i}`),Or.has(i)){Or.delete(i);return}let o=Dr(e);if(!o.shouldHandleRenames||o.isPathIgnored?.(t)||o.isPathIgnored?.(n))return;let s=e.metadataCache.getCache(t)??e.metadataCache.getCache(n),l=s?vt(s):[],u=eo(e,t).data;it(e,()=>Aa(e,t,n,u,l))}async function Aa(e,t,n,i,o,s){if(await Vk(e,t,n,i,o),Xk(e,t,n,i,o),await jk(e,t,n,i,o))return;let l=Su(e.fileManager,{updateAllLinks:()=>is});try{let u=new Map;await $k(e,t,n,u,o);let f=new Map;gf(i,u,f,t);for(let p of u.keys()){if(p===t)continue;let w=(await Jt(e,p)).data;gf(w,u,f,p)}let m=new Set;for(let[p,w]of u.entries()){if(p===t)continue;let k=await bf(e,p,w);u.set(p,k),m.add(se(p))}let h=Dr(e);if(h.shouldDeleteEmptyFolders)for(let p of m)await oo(e,p);for(let[p,w]of Array.from(f.entries()).concat(Array.from(s?.entries()??[])))await _a(e,p,k=>{let v=w.get(Si(k));if(!v)return;let F=u.get(v);if(F)return Ea({app:e,link:k,newSourcePathOrFile:p,newTargetPathOrFile:F,oldTargetPathOrFile:v,shouldUpdateFilenameAlias:h.shouldUpdateFilenameAliases})},{shouldFailOnMissingFile:!1});if(Rt(e,n)&&await io({app:e,newSourcePathOrFile:n,oldSourcePathOrFile:t,shouldFailOnMissingFile:!1,shouldUpdateFilenameAlias:h.shouldUpdateFilenameAliases}),!ce(e,n)){let p=so.get(n);p||(p=[],so.set(n,p)),p.push({combinedBacklinksMap:f,oldPath:t})}}finally{l();let u=Array.from(Or);it(e,()=>{for(let f of u)Or.delete(f)})}}function Kk(e,t,n){if(!Fa(e)||!tt(t))return;let i=t.path;Jk(e.app,n,i)}function gf(e,t,n,i){for(let[o,s]of e.entries()){let l=t.get(o)??o,u=n.get(l)??new Map;n.set(l,u);for(let f of s)u.set(Si(f),i)}}function wf(e){let t=ao(e);Ue("RenameDeleteHandler:logRegisteredHandlers")(`Plugins with registered rename/delete handlers: ${JSON.stringify(Array.from(t.keys()))}`)}function xf(e,t){return`${e} -> ${t}`}function Xk(e,t,n,i,o){let s=e.metadataCache.getCache(t)??e.metadataCache.getCache(n),l=s?vt(s):[],u=eo(e,t).data;for(let f of l)o.includes(f)||o.push(f);for(let[f,m]of u.entries()){let h=i.get(f);h||(h=[],i.set(f,h));for(let p of m)h.includes(p)||h.push(p)}}async function bf(e,t,n){if(n=ba(e,t,n),t===n)return n;let i=xf(t,n);return Or.add(i),n=await Ji(e,t,n),n}function Fa(e){let t=e.app,n=e.manifest.id,i=ao(t);return Array.from(i.keys())[0]===n}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Xt=class{getTransformer(t){if(t===this.id)return this;throw new Error(`Transformer with id ${t} not found`)}transformObjectRecursively(t){return this.transformValueRecursively(t,"")}getTransformerId(t,n){return this.canTransform(t,n)?this.id:null}transformValueRecursively(t,n){let i=this.getTransformerId(t,n);if(i){let s=this.transformValue(t,n);return s===void 0?void 0:{__transformerId:i,transformedValue:s}}if(t===null)return null;if(typeof t!="object")return t;if(Array.isArray(t))return t.map((s,l)=>this.transformValueRecursively(s,l.toString()));let o=t;return o.__transformerId?this.getTransformer(o.__transformerId).restoreValue(o.transformedValue,n):Object.fromEntries(Object.entries(t).map(([s,l])=>[s,this.transformValueRecursively(l,s)]))}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Xn=class extends Xt{};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var lo=class extends Xn{get id(){return"date"}canTransform(t){return t instanceof Date}restoreValue(t){return new Date(t)}transformValue(t){return t.toISOString()}};var vf=je(bn(),1);(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var uo=class extends Xn{get id(){return"duration"}canTransform(t){let n=t;return!!n.asHours&&!!n.asMinutes&&!!n.asSeconds&&!!n.asMilliseconds}restoreValue(t){return(0,vf.duration)(t)}transformValue(t){return t.toISOString()}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var co=class extends Xt{constructor(t){super(),this.transformers=t}get id(){return"group"}canTransform(t,n){return this.getFirstTransformerThatCanTransform(t,n)!==null}getTransformer(t){return this.transformers.find(n=>n.id===t)??un(`No transformer with id ${t} found`)}transformValue(t,n){let i=this.getFirstTransformerThatCanTransform(t,n);if(i===null)throw new Error("No transformer can transform the value");return i.transformValue(t,n)}getTransformerId(t,n){let i=this.getFirstTransformerThatCanTransform(t,n);return i===null?null:i.id}restoreValue(){throw new Error("GroupTransformer does not support restoring values")}getFirstTransformerThatCanTransform(t,n){return this.transformers.find(i=>i.canTransform(t,n))??null}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var ey="_",fo=class extends Xt{get id(){return"skip-private-property"}canTransform(t,n){return n.startsWith(ey)}transformValue(){}restoreValue(){throw new Error("SkipPrivatePropertyTransformer does not support restoring values")}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var ty=new co([new fo,new lo,new uo]),ho=class{get shouldSaveAfterLoad(){return this._shouldSaveAfterLoad}_shouldSaveAfterLoad=!1;init(t){if(t!=null){if(typeof t!="object"||Array.isArray(t)){let n=Array.isArray(t)?"Array":typeof t;console.error(`Invalid data type. Expected Object, got: ${n}`);return}this.initFromRecord(t)}}toJSON(){return this.getTransformer().transformObjectRecursively(this)}getTransformer(){return ty}initFromRecord(t){t=this.getTransformer().transformObjectRecursively(t);for(let[n,i]of Object.entries(t)){if(!(n in this)){console.warn(`Unknown property: ${n}`);continue}this[n]=i}}};var Cf=/(?:)/,Sf=/$./,mo=class extends ho{autoCollectAttachments=!1;changeNoteBacklinksAlt=!0;consistencyReportFile="consistency-report.md";deleteAttachmentsWithNote=!1;deleteEmptyFolders=!0;deleteExistFilesWhenMoveNote=!1;moveAttachmentsWithNote=!1;showBackupWarning=!0;updateLinks=!0;get excludePaths(){return this._excludePaths}set excludePaths(t){this._excludePaths=t.filter(Boolean),this._excludePathsRegExp=_f(this._excludePaths,Sf)}get hadDangerousSettingsReverted(){return this._hadDangerousSettingsReverted}get includePaths(){return this._includePaths}set includePaths(t){this._includePaths=t.filter(Boolean),this._includePathsRegExp=_f(this._includePaths,Cf)}_excludePaths=[];_excludePathsRegExp=Sf;_hadDangerousSettingsReverted=!1;_includePaths=[];_includePathsRegExp=Cf;constructor(t){super(),this.excludePaths=["/consistency-report\\.md$/"],this.init(t)}initFromRecord(t){let n=t;if(n.ignoreFiles||n.ignoreFolders){let i=n.excludePaths??[];for(let o of n.ignoreFiles??[])i.push(`/${o}$/`);for(let o of n.ignoreFolders??[])i.push(o);i.length>0&&(n.excludePaths=i),delete n.ignoreFiles,delete n.ignoreFolders}super.initFromRecord(n),this.showBackupWarning&&(this._hadDangerousSettingsReverted=this.deleteAttachmentsWithNote||this.deleteExistFilesWhenMoveNote||this.moveAttachmentsWithNote||this.autoCollectAttachments,this.deleteAttachmentsWithNote=!1,this.deleteExistFilesWhenMoveNote=!1,this.moveAttachmentsWithNote=!1,this.autoCollectAttachments=!1)}isPathIgnored(t){return!this._includePathsRegExp.test(t)||this._excludePathsRegExp.test(t)}toJSON(){return{...super.toJSON(),excludePaths:this.excludePaths,includePaths:this.includePaths}}};function _f(e,t){if(e.length===0)return t;let n=e.map(i=>i.startsWith("/")&&i.endsWith("/")?i.slice(1,-1):`^${ls(i)}`).map(i=>`(${i})`).join("|");return new RegExp(n)}var Of=require("obsidian");(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();function Ma(e,t){e.createEl("strong",{cls:"markdown-rendered code"},n=>{n.createEl("code",{text:t})})}var Tf=require("obsidian");var en=require("obsidian");(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();function Ef(e){let t=e;return t.validatorEl?t:e instanceof en.DropdownComponent?{get validatorEl(){return e.selectEl}}:e instanceof en.SliderComponent?{get validatorEl(){return e.sliderEl}}:e instanceof en.TextAreaComponent?{get validatorEl(){return e.inputEl}}:e instanceof en.TextComponent?{get validatorEl(){return e.inputEl}}:null}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var po=class extends Tf.PluginSettingTab{constructor(t){super(t.app,t),this.plugin=t,this.containerEl.addClass($.LibraryName,rt(),$.PluginSettingsTab)}validatorsMap=new WeakMap;bind(t,n,i){let s={...{componentToPluginSettingsValueConverter:m=>m,onChanged:wt,pluginSettings:void 0,pluginSettingsToComponentValueConverter:m=>m,shouldAutoSave:!0,shouldShowValidationMessage:!0,valueValidator:wt},...i},l=()=>s.pluginSettings??this.plugin.settingsClone,u=Ef(t)?.validatorEl,f=async m=>{m??=t.getValue();let h=await s.valueValidator(m);return u&&(h||(u.setCustomValidity(""),u.checkValidity(),h=u.validationMessage),u.setCustomValidity(h),u.title=h,u.isActiveElement()&&s.shouldShowValidationMessage&&u.reportValidity()),!h};return t.setValue(s.pluginSettingsToComponentValueConverter(l()[n])).onChange(async m=>{if(!await f(m))return;let h=l();h[n]=s.componentToPluginSettingsValueConverter(m),s.shouldAutoSave&&await this.plugin.saveSettings(h),await s.onChanged()}),u?.addEventListener("focus",xs(()=>f())),u?.addEventListener("blur",xs(()=>f())),this.validatorsMap.set(t,()=>f()),xr(()=>f()),t}async revalidate(t){let n=this.validatorsMap.get(t);return n?await n():!0}};var If=require("obsidian");var Ia=je(bn(),1);var go=require("obsidian");(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Ve=class extends go.ValueComponent{inputEl;get validatorEl(){return this.inputEl}textComponent;constructor(t,n,i){super(),this.textComponent=new go.TextComponent(t),this.inputEl=this.textComponent.inputEl,this.inputEl.type=n,t.addClass($.LibraryName,rt(),i)}getValue(){return this.valueFromString(this.inputEl.value)}onChange(t){return this.textComponent.onChange(()=>t(this.getValue())),this}onChanged(){this.textComponent.onChanged()}setDisabled(t){return this.textComponent.setDisabled(t),this.disabled=t,this}setPlaceholder(t){return this.textComponent.setPlaceholder(t),this}setValue(t){return this.inputEl.value=this.valueToString(t),this}valueToString(t){return String(t)}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var $e=class extends Ve{setMax(t){return this.inputEl.max=this.valueToString(t),this}setMin(t){return this.inputEl.min=this.valueToString(t),this}setStep(t){return this.inputEl.step=t.toString(),this}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Af="YYYY-MM-DD",wo=class extends $e{constructor(t){super(t,"date",$.DateComponent)}valueFromString(t){return(0,Ia.default)(t,Af).toDate()}valueToString(t){return(0,Ia.default)(t).format(Af)}};var La=je(bn(),1);(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Ff="YYYY-MM-DDTHH:mm",ko=class extends $e{constructor(t){super(t,"datetime-local",$.DateTimeComponent)}valueFromString(t){return(0,La.default)(t,Ff).toDate()}valueToString(t){return(0,La.default)(t).format(Ff)}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var yo=class extends Ve{constructor(t){super(t,"email",$.EmailComponent)}valueFromString(t){return t}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var xo=class extends Ve{constructor(t){super(t,"file",$.FileComponent)}getValue(){return this.inputEl.files?.[0]??null}valueFromString(){return this.getValue()}valueToString(t){return t?.name??""}};var Oa=je(bn(),1);(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Pf="YYYY-MM",bo=class extends $e{constructor(t){super(t,"month",$.MonthComponent)}valueFromString(t){let n=(0,Oa.default)(t,Pf);if(!n.isValid())throw new Error("Invalid month");return{month:n.month()+1,year:n.year()}}valueToString(t){return(0,Oa.default)().year(t.year).month(t.month-1).format(Pf)}};var Co=require("obsidian");(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var vo=class extends Co.ValueComponent{get validatorEl(){return this.dropdownComponent.selectEl}dropdownComponent;constructor(t){super(),this.dropdownComponent=new Co.DropdownComponent(t),this.dropdownComponent.selectEl.multiple=!0,t.addClass($.LibraryName,rt(),$.MultipleDropdownComponent)}addOption(t,n){return this.dropdownComponent.addOption(t,n),this}addOptions(t){return this.dropdownComponent.addOptions(t),this}getValue(){return Array.from(this.dropdownComponent.selectEl.selectedOptions).map(t=>t.value)}onChange(t){return this.dropdownComponent.onChange(()=>t(this.getValue())),this}setDisabled(t){return this.dropdownComponent.setDisabled(t),this.disabled=t,this}setValue(t){for(let n of Array.from(this.dropdownComponent.selectEl.options))n.selected=t.includes(n.value);return this}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var So=class extends Ve{constructor(t){super(t,"email",$.MultipleEmailComponent),this.inputEl.multiple=!0}valueFromString(t){return t.split(",").map(n=>n.trim())}valueToString(t){return t.join(", ")}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var _o=class extends Ve{constructor(t){super(t,"file",$.MultipleFileComponent),this.inputEl.multiple=!0}getValue(){return Array.from(this.inputEl.files??[])}valueFromString(){return this.getValue()}valueToString(t){return t[0]?.name??""}};var To=require("obsidian");(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Eo=class extends To.ValueComponent{get validatorEl(){return this.textAreaComponent.inputEl}textAreaComponent;constructor(t){super(),this.textAreaComponent=new To.TextAreaComponent(t),t.addClass($.LibraryName,rt(),$.MultipleTextComponent)}getValue(){return this.textAreaComponent.getValue().split(` +`)}onChange(t){return this.textAreaComponent.onChange(()=>t(this.getValue())),this}setDisabled(t){return this.textAreaComponent.setDisabled(t),this.disabled=t,this}setPlaceholder(t){return this.textAreaComponent.setPlaceholder(t),this}setValue(t){return this.textAreaComponent.setValue(t.join(` +`)),this}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Ao=class extends $e{constructor(t){super(t,"number",$.NumberComponent)}valueFromString(t){return parseInt(t,10)}};var Po=je(bn(),1);(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Fo=class extends $e{constructor(t){super(t,"time",$.TimeComponent)}valueFromString(t){return(0,Po.duration)(t)}valueToString(t){let n;return t.milliseconds()>0?n="HH:mm:ss.SSS":t.seconds()>0?n="HH:mm:ss":n="HH:mm",(0,Po.utc)(t.asMilliseconds()).format(n)}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Mo=class extends Ve{constructor(t){super(t,"url",$.UrlComponent)}valueFromString(t){return t}};var Da=je(bn(),1);(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Mf="YYYY-[W]WW",Io=class extends $e{constructor(t){super(t,"week",$.WeekComponent)}valueFromString(t){let n=(0,Da.default)(t,Mf);if(!n.isValid())throw new Error("Invalid week");return{weekNumber:n.isoWeek(),year:n.year()}}valueToString(t){return(0,Da.default)().year(t.year).isoWeek(t.weekNumber).format(Mf)}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Qe=class extends If.Setting{addComponent(t,n){let i=new t(this.controlEl);return this.components.push(i),n(i),this}addDate(t){return this.addComponent(wo,t)}addDateTime(t){return this.addComponent(ko,t)}addEmail(t){return this.addComponent(yo,t)}addFile(t){return this.addComponent(xo,t)}addMonth(t){return this.addComponent(bo,t)}addMultipleDropdown(t){return this.addComponent(vo,t)}addMultipleEmail(t){return this.addComponent(So,t)}addMultipleFile(t){return this.addComponent(_o,t)}addMultipleText(t){return this.addComponent(Eo,t)}addNumber(t){return this.addComponent(Ao,t)}addTime(t){return this.addComponent(Fo,t)}addUrl(t){return this.addComponent(Mo,t)}addWeek(t){return this.addComponent(Io,t)}};var Lo=class extends po{display(){this.containerEl.empty();let t="Move Attachments with Note";new Qe(this.containerEl).setName(t).setDesc("Automatically move attachments when a note is relocated. This includes attachments located in the same folder or any of its subfolders.").addToggle(s=>this.bind(s,"moveAttachmentsWithNote",{onChanged:async()=>{await this.checkDangerousSetting("moveAttachmentsWithNote",t)}}));let n="Delete Unused Attachments with Note";new Qe(this.containerEl).setName(n).setDesc("Automatically remove attachments that are no longer referenced in other notes when the note is deleted.").addToggle(s=>this.bind(s,"deleteAttachmentsWithNote",{onChanged:async()=>{await this.checkDangerousSetting("deleteAttachmentsWithNote",n)}})),new Qe(this.containerEl).setName("Update Links").setDesc("Automatically update links to attachments and other notes when moving notes or attachments.").addToggle(s=>this.bind(s,"updateLinks")),new Qe(this.containerEl).setName("Delete Empty Folders").setDesc("Automatically remove empty folders after moving notes with attachments.").addToggle(s=>this.bind(s,"deleteEmptyFolders"));let i="Delete Duplicate Attachments on Note Move";new Qe(this.containerEl).setName(i).setDesc("Automatically delete attachments when moving a note if a file with the same name exists in the destination folder. If disabled, the file will be renamed and moved.").addToggle(s=>this.bind(s,"deleteExistFilesWhenMoveNote",{onChanged:async()=>{await this.checkDangerousSetting("deleteExistFilesWhenMoveNote",i)}})),new Qe(this.containerEl).setName("Update Backlink Text on Note Rename").setDesc("When a note is renamed, its linked references are automatically updated. If this option is enabled, the text of backlinks to this note will also be modified.").addToggle(s=>this.bind(s,"changeNoteBacklinksAlt")),new Qe(this.containerEl).setName("Consistency Report Filename").setDesc("Specify the name of the file for the consistency report.").addText(s=>this.bind(s,"consistencyReportFile").setPlaceholder("Example: consistency-report.md"));let o="Auto Collect Attachments";new Qe(this.containerEl).setName(o).setDesc("Automatically collect attachments when the note is edited.").addToggle(s=>this.bind(s,"autoCollectAttachments",{onChanged:async()=>{await this.checkDangerousSetting("autoCollectAttachments",o)}})),new Qe(this.containerEl).setName("Include paths").setDesc(createFragment(s=>{s.appendText("Include notes from the following paths"),s.createEl("br"),s.appendText("Insert each path on a new line"),s.createEl("br"),s.appendText("You can use path string or "),Ma(s,"/regular expression/"),s.createEl("br"),s.appendText("If the setting is empty, all notes are included")})).addMultipleText(s=>{this.bind(s,"includePaths",{valueValidator:Lf})}),new Qe(this.containerEl).setName("Exclude paths").setDesc(createFragment(s=>{s.appendText("Exclude notes from the following paths"),s.createEl("br"),s.appendText("Insert each path on a new line"),s.createEl("br"),s.appendText("You can use path string or "),Ma(s,"/regular expression/"),s.createEl("br"),s.appendText("If the setting is empty, no notes are excluded")})).addMultipleText(s=>{this.bind(s,"excludePaths",{valueValidator:Lf})})}async checkDangerousSetting(t,n){this.plugin.settings[t]&&await yi({app:this.app,message:createFragment(i=>{i.createDiv({cls:"community-modal-readme"},o=>{o.appendText("You enabled "),o.createEl("strong",{cls:"markdown-rendered-code",text:n}),o.appendText(" setting. Without proper configuration it might lead to inconvenient attachment rearrangements or even data loss in your vault."),o.createEl("br"),o.appendText("It is "),o.createEl("strong",{text:"STRONGLY"}),o.appendText(" recommended to backup your vault before using the plugin."),o.createEl("br"),o.createEl("a",{href:"https://github.com/dy-sh/obsidian-consistent-attachments-and-links?tab=readme-ov-file",text:"Read more"}),o.appendText(" about how to use the plugin.")})}),title:createFragment(i=>{(0,Of.setIcon)(i.createSpan(),"triangle-alert"),i.appendText(" Consistent Attachments and Links")})})}};function Lf(e){for(let t of e)if(t.startsWith("/")&&t.endsWith("/")){let n=t.slice(1,-1);if(!Ll(n))return`Invalid regular expression ${t}`}}var yA=require("obsidian");var Df=require("obsidian");var vn=class extends Map{constructor(n){super();this.title=n}add(n,i){this.has(n)||this.set(n,[]);let o=this.get(n);o&&o.push(i)}toString(n,i){if(this.size>0){let o=`# ${this.title} (${this.size.toString()} files) +`;for(let s of this.keys()){let l=ce(n,s);if(!l)continue;let u=no({app:n,sourcePathOrFile:i,targetPathOrFile:l});o+=`${u}: +`;for(let f of this.get(s)??[])o+=`- (line ${(f.position.start.line+1).toString()}): \`${f.link}\` +`;o+=` -`}return i}else return`# ${this.title} +`}return o}return`# ${this.title} No problems found -`}},br=class{constructor(t,r=""){this.plugin=t;this.consoleLogPrefix=r}async checkConsistency(t,r,n,i,o){if(this.plugin.settingsCopy.isPathIgnored(t.path))return;let a=await(0,Ne.getCacheSafe)(this.plugin.app,t.path);if(!a)return;let s=a.links??[],l=a.embeds??[];for(let c of s)await this.isValidLink(c,t.path)||r.add(t.path,c),(0,ue.testWikilink)(c.original)&&i.add(t.path,c);for(let c of l)await this.isValidLink(c,t.path)||n.add(t.path,c),(0,ue.testWikilink)(c.original)&&o.add(t.path,c)}async convertAllNoteEmbedsPathsToRelative(t){return this.convertAllNoteRefPathsToRelative(t,!0)}async convertAllNoteLinksPathsToRelative(t){return this.convertAllNoteRefPathsToRelative(t,!1)}async getCachedNotesThatHaveLinkToFile(t){let r=(0,Te.getFileOrNull)(this.plugin.app,t);return r?(await(0,Ne.getBacklinksForFileSafe)(this.plugin.app,r)).keys():[]}getFullPathForLink(t,r){({linkPath:t}=(0,ue.splitSubpath)(t));let n=(0,Re.dirname)(r);return(0,Re.join)(n,t)}async replaceAllNoteWikilinksWithMarkdownLinks(t,r){if(this.plugin.settingsCopy.isPathIgnored(t))return 0;let n=(0,Te.getFileOrNull)(this.plugin.app,t);if(!n)return console.warn(this.consoleLogPrefix+"can't update wikilinks in note, file not found: "+t),0;let i=await(0,Ne.getCacheSafe)(this.plugin.app,n);if(!i)return 0;let a=((r?i.embeds:i.links)??[]).filter(s=>(0,ue.testWikilink)(s.original)).length;return await(0,ue.updateLinksInFile)({app:this.plugin.app,newSourcePathOrFile:n,shouldForceMarkdownLinks:!0,shouldUpdateEmbedOnlyLinks:r}),a}async updateChangedPathsInNote(t,r){if(this.plugin.settingsCopy.isPathIgnored(t))return;let n=(0,Te.getFileOrNull)(this.plugin.app,t);if(!n){console.warn(this.consoleLogPrefix+"can't update links in note, file not found: "+t);return}let i=new Map;for(let o of r)i.set(o.oldPath,o.newPath);await this.updateLinks(n,n.path,i)}async convertAllNoteRefPathsToRelative(t,r){if(this.plugin.settingsCopy.isPathIgnored(t))return[];let n=(0,Te.getFileOrNull)(this.plugin.app,t);if(!n)return[];let i=[];return await(0,Ia.applyFileChanges)(this.plugin.app,n,async()=>{let o=await(0,Ne.getCacheSafe)(this.plugin.app,n);if(!o)return[];let a=(r?o.embeds:o.links)??[],s=[];for(let l of a){let c={endIndex:l.position.end.offset,newContent:this.convertLink({forceRelativePath:!0,link:l,note:n,oldNotePath:t}),oldContent:l.original,startIndex:l.position.start.offset};s.push(c),i.push({newLink:c.newContent,old:l})}return s}),i}convertLink({forceRelativePath:t,link:r,note:n,oldNotePath:i,pathChangeMap:o}){let{linkPath:a,subpath:s}=(0,ue.splitSubpath)(r.link),l=(0,ue.extractLinkFile)(this.plugin.app,r,i)?.path??(0,Re.join)((0,Re.dirname)(i),a),c=o?o.get(l):(0,ue.extractLinkFile)(this.plugin.app,r,n.path)?.path??(0,Re.join)((0,Re.dirname)(n.path),a);if(!c)return r.original;let u=(0,Te.getFileOrNull)(this.plugin.app,l)??(0,Te.getFileOrNull)(this.plugin.app,c);return u?(0,ue.generateMarkdownLink)((0,vh.normalizeOptionalProperties)({alias:r.displayText,app:this.plugin.app,originalLink:r.original,shouldForceRelativePath:t,sourcePathOrFile:n.path,subpath:s,targetPathOrFile:u})):r.original}async isValidLink(t,r){let{linkPath:n,subpath:i}=(0,ue.splitSubpath)(t.link),o;n?n.startsWith("/")?o=(0,yh.normalizePath)(n):o=(0,Re.join)((0,Re.dirname)(r),n):o=r;let a=(0,Te.getFileOrNull)(this.plugin.app,o);if(!a)return!1;if(!i)return!0;let s=a.extension.toLocaleLowerCase();if(s==="pdf")return i.startsWith("#page=");if(s!==Te.MARKDOWN_FILE_EXTENSION)return!1;let l=await(0,Ne.getCacheSafe)(this.plugin.app,a);return l?i.startsWith("#^")?Object.keys(l.blocks??{}).includes(i.slice(2)):(l.headings??[]).map(c=>c.heading.replaceAll("#"," ")).includes(i.slice(1)):!1}async updateLinks(t,r,n){await(0,Ia.applyFileChanges)(this.plugin.app,t,async()=>{let i=await(0,Ne.getCacheSafe)(this.plugin.app,t);return i?(0,Ne.getAllLinks)(i).map(a=>(0,xh.referenceToFileChange)(a,this.convertLink({link:a,note:t,oldNotePath:r,pathChangeMap:n}))):[]})}};var kr=class{constructor(t,r,n=""){this.plugin=t;this.lh=r;this.consoleLogPrefix=n}async collectAttachmentsForCachedNote(t,r,n){if(this.plugin.settingsCopy.isPathIgnored(t))return{movedAttachments:[],renamedFiles:[]};let i={movedAttachments:[],renamedFiles:[]},o=await(0,Mn.getCacheSafe)(this.plugin.app,t);if(!o)return i;for(let a of(0,Mn.getAllLinks)(o)){let{linkPath:s}=(0,Bt.splitSubpath)(a.link);if(!s)continue;let l=this.lh.getFullPathForLink(s,t);if(i.movedAttachments.findIndex(p=>p.oldPath==l)!=-1)continue;let c=(0,Bt.extractLinkFile)(this.plugin.app,a,t);if(!c){let p=(0,Bt.testEmbed)(a.original)?"embed":"link";console.warn(`${this.consoleLogPrefix}${t} has bad ${p} (file does not exist): ${s}`);continue}if(!this.isAttachment(c))continue;let u=await(0,_h.getAttachmentFilePath)(this.plugin.app,c.path,t);if((0,Dn.dirname)(u)===(0,Dn.dirname)(c.path))continue;let f=await this.moveAttachment(c,u,[t],r,n);i.movedAttachments=i.movedAttachments.concat(f.movedAttachments),i.renamedFiles=i.renamedFiles.concat(f.renamedFiles)}return i}async deleteEmptyFolders(t){if(this.plugin.settingsCopy.isPathIgnored(t))return;t.startsWith("./")&&(t=t.slice(2));let r=await(0,ce.listSafe)(this.plugin.app,t);for(let n of r.folders)await this.deleteEmptyFolders(n);if(r=await(0,ce.listSafe)(this.plugin.app,t),r.files.length==0&&r.folders.length==0&&(console.log(this.consoleLogPrefix+`delete empty folder: - `+t),await this.plugin.app.vault.exists(t)))try{await this.plugin.app.vault.adapter.rmdir(t,!1)}catch(n){if(await this.plugin.app.vault.adapter.exists(t))throw n}}async createFolderForAttachmentFromPath(t){await(0,ce.createFolderSafe)(this.plugin.app,(0,Dn.dirname)(t))}async deleteFile(t,r){if(await this.plugin.app.fileManager.trashFile(t),r){let n=t.parent;for(;n&&n.children.length===0;)await this.plugin.app.fileManager.trashFile(n),n=n.parent}}isAttachment(t){return!(0,wr.isNote)(this.plugin.app,t)}async moveAttachment(t,r,n,i,o){let a=t.path,s={movedAttachments:[],renamedFiles:[]};if(this.plugin.settingsCopy.isPathIgnored(a)||!this.isAttachment(t))return s;if(a==r)return console.warn(this.consoleLogPrefix+"Can't move file. Source and destination path the same."),s;await this.createFolderForAttachmentFromPath(r);let l=await this.lh.getCachedNotesThatHaveLinkToFile(a);for(let u of n)l.remove(u);if(a!==t.path)return console.warn(this.consoleLogPrefix+"File was moved already"),await this.moveAttachment(t,r,n,i,o);let c=t.parent;if(l.length==0)if(!(0,wr.getFileOrNull)(this.plugin.app,r))console.log(this.consoleLogPrefix+`move file [from, to]: - `+a+` - `+r),s.movedAttachments.push({newPath:r,oldPath:a}),await(0,ce.renameSafe)(this.plugin.app,t,r);else if(i)console.log(this.consoleLogPrefix+`delete file: - `+a),s.movedAttachments.push({newPath:r,oldPath:a}),await this.deleteFile(t,o);else{let f=(0,ce.getAvailablePath)(this.plugin.app,r);console.log(this.consoleLogPrefix+`copy file with new name [from, to]: - `+a+` - `+f),s.movedAttachments.push({newPath:f,oldPath:a}),await(0,ce.renameSafe)(this.plugin.app,t,f),s.renamedFiles.push({newPath:f,oldPath:r})}else if(!(0,wr.getFileOrNull)(this.plugin.app,r))console.log(this.consoleLogPrefix+`copy file [from, to]: - `+a+` - `+r),s.movedAttachments.push({newPath:r,oldPath:a}),await(0,ce.renameSafe)(this.plugin.app,t,r),await(0,ce.copySafe)(this.plugin.app,t,a);else if(!i){let f=(0,ce.getAvailablePath)(this.plugin.app,r);console.log(this.consoleLogPrefix+`copy file with new name [from, to]: - `+a+` - `+f),s.movedAttachments.push({newPath:f,oldPath:t.path}),await(0,ce.renameSafe)(this.plugin.app,t,f),await(0,ce.copySafe)(this.plugin.app,t,a),s.renamedFiles.push({newPath:f,oldPath:r})}return this.plugin.settingsCopy.deleteEmptyFolders&&await(0,Ch.deleteEmptyFolderHierarchy)(this.plugin.app,c),s}};var n1=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"},jn=class extends Ah.PluginBase{deletedNoteCache=new Map;fh;lh;async saveSettings(t){await super.saveSettings(t),this.lh=new br(this,"Consistent Attachments and Links: "),this.fh=new kr(this,this.lh,"Consistent Attachments and Links: ")}createPluginSettings(t){return new qn(t)}createPluginSettingsTab(){return new Rn(this)}async onLayoutReady(){await this.showBackupWarning()}onloadComplete(){this.registerEvent(this.app.metadataCache.on("deleted",(t,r)=>{r&&this.handleDeletedMetadata(t,r)})),(0,Eh.registerRenameDeleteHandlers)(this,()=>({isPathIgnored:r=>this.settings.isPathIgnored(r),shouldDeleteConflictingAttachments:this.settings.deleteExistFilesWhenMoveNote,shouldDeleteEmptyFolders:this.settings.deleteEmptyFolders,shouldHandleDeletions:this.settings.deleteAttachmentsWithNote,shouldHandleRenames:this.settings.updateLinks,shouldRenameAttachmentFolder:this.settings.moveAttachmentsWithNote,shouldUpdateFilenameAliases:this.settings.changeNoteBacklinksAlt})),this.addCommand({callback:()=>this.collectAllAttachments(),id:"collect-all-attachments",name:"Collect All Attachments"}),this.addCommand({checkCallback:t=>this.collectAttachmentsCurrentFolder(t),id:"collect-attachments-current-folder",name:"Collect Attachments in Current Folder"}),this.addCommand({checkCallback:this.collectAttachmentsCurrentNote.bind(this),id:"collect-attachments-current-note",name:"Collect Attachments in Current Note"}),this.addCommand({callback:()=>this.deleteEmptyFolders(),id:"delete-empty-folders",name:"Delete Empty Folders"}),this.addCommand({callback:()=>this.convertAllLinkPathsToRelative(),id:"convert-all-link-paths-to-relative",name:"Convert All Link Paths to Relative"}),this.addCommand({checkCallback:this.convertAllLinkPathsToRelativeCurrentNote.bind(this),id:"convert-all-link-paths-to-relative-current-note",name:"Convert All Link Paths to Relative in Current Note"}),this.addCommand({callback:()=>this.convertAllEmbedsPathsToRelative(),id:"convert-all-embed-paths-to-relative",name:"Convert All Embed Paths to Relative"}),this.addCommand({checkCallback:this.convertAllEmbedsPathsToRelativeCurrentNote.bind(this),id:"convert-all-embed-paths-to-relative-current-note",name:"Convert All Embed Paths to Relative in Current Note"}),this.addCommand({callback:()=>this.replaceAllWikilinksWithMarkdownLinks(),id:"replace-all-wikilinks-with-markdown-links",name:"Replace All Wiki Links with Markdown Links"}),this.addCommand({checkCallback:this.replaceAllWikilinksWithMarkdownLinksCurrentNote.bind(this),id:"replace-all-wikilinks-with-markdown-links-current-note",name:"Replace All Wiki Links with Markdown Links in Current Note"}),this.addCommand({callback:()=>this.replaceAllWikiEmbedsWithMarkdownEmbeds(),id:"replace-all-wiki-embeds-with-markdown-embeds",name:"Replace All Wiki Embeds with Markdown Embeds"}),this.addCommand({checkCallback:this.replaceAllWikiEmbedsWithMarkdownEmbedsCurrentNote.bind(this),id:"replace-all-wiki-embeds-with-markdown-embeds-current-note",name:"Replace All Wiki Embeds with Markdown Embeds in Current Note"}),this.addCommand({callback:()=>this.reorganizeVault(),id:"reorganize-vault",name:"Reorganize Vault"}),this.addCommand({callback:()=>this.checkConsistency(),id:"check-consistency",name:"Check Vault consistency"}),this.registerEvent(this.app.metadataCache.on("changed",t=>{(0,et.addToQueue)(this.app,()=>this.handleMetadataCacheChanged(t))})),this.registerEvent(this.app.workspace.on("file-menu",(t,r)=>{this.handleFileMenu(t,r)})),this.lh=new br(this,"Consistent Attachments and Links: "),this.fh=new kr(this,this.lh,"Consistent Attachments and Links: ")}async checkConsistency(){await this.saveAllOpenNotes();let t=new yt("Bad links"),r=new yt("Bad embeds"),n=new yt("Wiki links"),i=new yt("Wiki embeds");await(0,vt.loop)({abortSignal:this.abortSignal,buildNoticeMessage:(c,u)=>`Checking note ${u} - ${c.path}`,items:(0,tt.getMarkdownFilesSorted)(this.app),processItem:async c=>{await this.lh.checkConsistency(c,t,r,n,i)},shouldContinueOnError:!0});let o=this.settings.consistencyReportFile,a=t.toString(this.app,o)+r.toString(this.app,o)+n.toString(this.app,o)+i.toString(this.app,o);await(0,tt.createFolderSafe)(this.app,(0,Sh.dirname)(o));let s=await(0,be.getOrCreateFile)(this.app,o);await this.app.vault.modify(s,a);let l=!1;this.app.workspace.iterateAllLeaves(c=>{c.getDisplayText()!=""&&o.startsWith(c.getDisplayText())&&(l=!0)}),l||await this.app.workspace.openLinkText(o,"/",!1)}async collectAllAttachments(){await this.collectAttachmentsInFolder("/")}async collectAttachments(t,r=!0){if(this.settings.isPathIgnored(t.path)){new Z.Notice("Note path is ignored");return}await this.saveAllOpenNotes();let n=await this.fh.collectAttachmentsForCachedNote(t.path,this.settings.deleteExistFilesWhenMoveNote,this.settings.deleteEmptyFolders);n.movedAttachments.length>0&&await this.lh.updateChangedPathsInNote(t.path,n.movedAttachments),n.movedAttachments.length==0?r&&new Z.Notice("No files found that need to be moved"):new Z.Notice(`Moved ${n.movedAttachments.length.toString()} attachment${n.movedAttachments.length>1?"s":""}`)}collectAttachmentsCurrentFolder(t){let r=this.app.workspace.getActiveFile();return!r||!(0,be.isMarkdownFile)(this.app,r)?!1:(t||(0,et.addToQueue)(this.app,()=>this.collectAttachmentsInFolder(r.parent?.path??"/")),!0)}collectAttachmentsCurrentNote(t){let r=this.app.workspace.getActiveFile();return!r||!(0,be.isMarkdownFile)(this.app,r)?!1:(t||(0,et.addToQueue)(this.app,()=>this.collectAttachments(r)),!0)}async collectAttachmentsInFolder(t){let r=0,n=0;await this.saveAllOpenNotes(),await(0,vt.loop)({abortSignal:this.abortSignal,buildNoticeMessage:(i,o)=>`Collecting attachments ${o} - ${i.path}`,items:(0,be.getMarkdownFiles)(this.app,t,!0),processItem:async i=>{if(this.settings.isPathIgnored(i.path))return;let o=await this.fh.collectAttachmentsForCachedNote(i.path,this.settings.deleteExistFilesWhenMoveNote,this.settings.deleteEmptyFolders);o.movedAttachments.length>0&&(await this.lh.updateChangedPathsInNote(i.path,o.movedAttachments),r+=o.movedAttachments.length,n++)},shouldContinueOnError:!0}),r==0?new Z.Notice("No files found that need to be moved"):new Z.Notice(`Moved ${r.toString()} attachment${r>1?"s":""} from ${n.toString()} note${n>1?"s":""}`)}async convertAllEmbedsPathsToRelative(){await this.saveAllOpenNotes();let t=0,r=0;await(0,vt.loop)({abortSignal:this.abortSignal,buildNoticeMessage:(n,i)=>`Converting embed paths to relative ${i} - ${n.path}`,items:(0,tt.getMarkdownFilesSorted)(this.app),processItem:async n=>{if(this.settings.isPathIgnored(n.path))return;let i=await this.lh.convertAllNoteEmbedsPathsToRelative(n.path);i.length>0&&(t+=i.length,r++)},shouldContinueOnError:!0}),t==0?new Z.Notice("No embeds found that need to be converted"):new Z.Notice(`Converted ${t.toString()} embed${t>1?"s":""} from ${r.toString()} note${r>1?"s":""}`)}convertAllEmbedsPathsToRelativeCurrentNote(t){let r=this.app.workspace.getActiveFile();return!r||!(0,be.isMarkdownFile)(this.app,r)?!1:(t||(0,et.addToQueue)(this.app,(0,yr.omitAsyncReturnType)(()=>this.lh.convertAllNoteEmbedsPathsToRelative(r.path))),!0)}async convertAllLinkPathsToRelative(){await this.saveAllOpenNotes();let t=0,r=0;await(0,vt.loop)({abortSignal:this.abortSignal,buildNoticeMessage:(n,i)=>`Converting link paths to relative ${i} - ${n.path}`,items:(0,tt.getMarkdownFilesSorted)(this.app),processItem:async n=>{if(this.settings.isPathIgnored(n.path))return;let i=await this.lh.convertAllNoteLinksPathsToRelative(n.path);i.length>0&&(t+=i.length,r++)},shouldContinueOnError:!0}),t==0?new Z.Notice("No links found that need to be converted"):new Z.Notice(`Converted ${t.toString()} link${t>1?"s":""} from ${r.toString()} note${r>1?"s":""}`)}convertAllLinkPathsToRelativeCurrentNote(t){let r=this.app.workspace.getActiveFile();return!r||!(0,be.isMarkdownFile)(this.app,r)?!1:(t||(0,et.addToQueue)(this.app,(0,yr.omitAsyncReturnType)(()=>this.lh.convertAllNoteLinksPathsToRelative(r.path))),!0)}async deleteEmptyFolders(){await this.fh.deleteEmptyFolders("/")}handleDeletedMetadata(t,r){!this.settings.deleteAttachmentsWithNote||this.settings.isPathIgnored(t.path)||!(0,be.isMarkdownFile)(this.app,t)||this.deletedNoteCache.set(t.path,r)}handleFileMenu(t,r){(0,be.isFolder)(r)&&t.addItem(n=>{n.setTitle("Collect attachments in folder").setIcon("download").onClick(()=>this.collectAttachmentsInFolder(r.path))})}async handleMetadataCacheChanged(t){if(!this.settings.autoCollectAttachments)return;let r=document.querySelector(".suggestion-container");r&&r.style.display!=="none"||await this.collectAttachments(t,!1)}async reorganizeVault(){await this.saveAllOpenNotes(),await this.replaceAllWikilinksWithMarkdownLinks(),await this.replaceAllWikiEmbedsWithMarkdownEmbeds(),await this.convertAllEmbedsPathsToRelative(),await this.convertAllLinkPathsToRelative(),await this.collectAllAttachments(),await this.deleteEmptyFolders(),new Z.Notice("Reorganization of the vault completed")}async replaceAllWikiEmbedsWithMarkdownEmbeds(){await this.saveAllOpenNotes();let t=0,r=0;await(0,vt.loop)({abortSignal:this.abortSignal,buildNoticeMessage:(n,i)=>`Replacing wiki embeds with markdown embeds ${i} - ${n.path}`,items:(0,tt.getMarkdownFilesSorted)(this.app),processItem:async n=>{if(this.settings.isPathIgnored(n.path))return;let i=await this.lh.replaceAllNoteWikilinksWithMarkdownLinks(n.path,!0);t+=i,r++},shouldContinueOnError:!0}),t==0?new Z.Notice("No wiki embeds found that need to be replaced"):new Z.Notice(`Replaced ${t.toString()} wiki embed${t>1?"s":""} from ${r.toString()} note${r>1?"s":""}`)}replaceAllWikiEmbedsWithMarkdownEmbedsCurrentNote(t){let r=this.app.workspace.getActiveFile();return!r||!(0,be.isMarkdownFile)(this.app,r)?!1:(t||(0,et.addToQueue)(this.app,(0,yr.omitAsyncReturnType)(()=>this.lh.replaceAllNoteWikilinksWithMarkdownLinks(r.path,!0))),!0)}async replaceAllWikilinksWithMarkdownLinks(){await this.saveAllOpenNotes();let t=0,r=0;await(0,vt.loop)({abortSignal:this.abortSignal,buildNoticeMessage:(n,i)=>`Replacing wikilinks with markdown links ${i} - ${n.path}`,items:(0,tt.getMarkdownFilesSorted)(this.app),processItem:async n=>{if(this.settings.isPathIgnored(n.path))return;let i=await this.lh.replaceAllNoteWikilinksWithMarkdownLinks(n.path,!1);t+=i,r++},shouldContinueOnError:!0}),t==0?new Z.Notice("No wiki links found that need to be replaced"):new Z.Notice(`Replaced ${t.toString()} wikilink${t>1?"s":""} from ${r.toString()} note${r>1?"s":""}`)}replaceAllWikilinksWithMarkdownLinksCurrentNote(t){let r=this.app.workspace.getActiveFile();return!r||!(0,be.isMarkdownFile)(this.app,r)?!1:(t||(0,et.addToQueue)(this.app,(0,yr.omitAsyncReturnType)(()=>this.lh.replaceAllNoteWikilinksWithMarkdownLinks(r.path,!1))),!0)}async saveAllOpenNotes(){for(let t of this.app.workspace.getLeavesOfType("markdown"))t.view instanceof Z.MarkdownView&&await t.view.save()}async showBackupWarning(){this.settings.showBackupWarning&&(await(0,Ph.alert)({app:this.app,message:createFragment(t=>{t.createDiv({cls:"community-modal-readme"},r=>{r.appendText("Using 'Consistent Attachments and Links' plugin without proper configuration might lead to inconvenient attachment rearrangements or even data loss in your vault."),r.createEl("br"),r.appendText("It is "),r.createEl("strong",{text:"STRONGLY"}),r.appendText(" recommended to backup your vault before using the plugin."),r.createEl("br"),this.settings.hadDangerousSettingsReverted&&(r.appendText("Some of your plugin settings has been changed to their safe values."),r.createEl("br")),r.createEl("a",{href:"https://github.com/dy-sh/obsidian-consistent-attachments-and-links?tab=readme-ov-file",text:"Read more"}),r.appendText(" about how to use the plugin."),r.createEl("br"),r.appendText("This warning will not appear again.")})}),title:createFragment(t=>{(0,Z.setIcon)(t.createSpan(),"triangle-alert"),t.appendText(" Consistent Attachments and Links")})}),this.settings.showBackupWarning=!1,await this.saveSettings(this.settings))}};var iC=jn; +`}},Rr=class{constructor(t){this.plugin=t;}async checkConsistency(t,n,i,o,s){if(this.plugin.settings.isPathIgnored(t.path))return;let l=await mt(this.plugin.app,t.path);if(!l)return;let u=l.links??[],f=l.embeds??[];for(let m of u)await this.isValidLink(m,t.path)||n.add(t.path,m),Kn(m.original)&&o.add(t.path,m);for(let m of f)await this.isValidLink(m,t.path)||i.add(t.path,m),Kn(m.original)&&s.add(t.path,m)}async convertAllNoteEmbedsPathsToRelative(t){return await this.convertAllNoteRefPathsToRelative(t,!0)}async convertAllNoteLinksPathsToRelative(t){return await this.convertAllNoteRefPathsToRelative(t,!1)}async getCachedNotesThatHaveLinkToFile(t){let n=ce(this.plugin.app,t);return n?(await Jt(this.plugin.app,n)).keys():[]}getFullPathForLink(t,n){({linkPath:t}=Kt(t));let i=se(n);return we(i,t)}async replaceAllNoteWikilinksWithMarkdownLinks(t,n){if(this.plugin.settings.isPathIgnored(t))return 0;let i=ce(this.plugin.app,t);if(!i)return console.warn(`can't update wikilinks in note, file not found: ${t}`),0;let o=await mt(this.plugin.app,i);if(!o)return 0;let l=((n?o.embeds:o.links)??[]).filter(u=>Kn(u.original)).length;return await io({app:this.plugin.app,newSourcePathOrFile:i,shouldForceMarkdownLinks:!0,shouldUpdateEmbedOnlyLinks:n}),l}async updateChangedPathsInNote(t,n){if(this.plugin.settings.isPathIgnored(t))return;let i=ce(this.plugin.app,t);if(!i){console.warn(`can't update links in note, file not found: ${t}`);return}let o=new Map;for(let s of n)o.set(s.oldPath,s.newPath);await this.updateLinks(i,i.path,o)}async convertAllNoteRefPathsToRelative(t,n){if(this.plugin.settings.isPathIgnored(t))return[];let i=ce(this.plugin.app,t);if(!i)return[];let o=[];return await Mr(this.plugin.app,i,async()=>{let s=await mt(this.plugin.app,i);if(!s)return[];let l=(n?s.embeds:s.links)??[],u=[];for(let f of l){let m={endIndex:f.position.end.offset,newContent:this.convertLink({forceRelativePath:!0,link:f,note:i,oldNotePath:t}),oldContent:f.original,startIndex:f.position.start.offset};u.push(m),o.push({newLink:m.newContent,old:f})}return u}),o}convertLink({forceRelativePath:t,link:n,note:i,oldNotePath:o,pathChangeMap:s}){let{linkPath:l,subpath:u}=Kt(n.link),f=Yt(this.plugin.app,n,o)?.path??we(se(o),l),m=s?s.get(f):Yt(this.plugin.app,n,i.path)?.path??we(se(i.path),l);if(!m)return n.original;let h=ce(this.plugin.app,m)??ce(this.plugin.app,f);if(!h)return n.original;let p=n.displayText&&we(i.parent?.path??"",n.displayText)===f?void 0:n.displayText;return no({alias:p,app:this.plugin.app,originalLink:n.original,shouldForceRelativePath:t,sourcePathOrFile:i.path,subpath:u,targetPathOrFile:h})}async isValidLink(t,n){let{linkPath:i,subpath:o}=Kt(t.link),s;i?i.startsWith("/")?s=(0,Df.normalizePath)(i):s=we(se(n),i):s=n;let l=ce(this.plugin.app,s);if(!l)return!1;if(!o)return!0;let u=l.extension.toLocaleLowerCase();if(u==="pdf")return o.startsWith("#page=");if(u!==ui)return!1;let f=await mt(this.plugin.app,l);if(!f)return!1;let m="#^";if(o.startsWith(m))return Object.keys(f.blocks??{}).includes(Dt(o,m));let h="#";return(f.headings??[]).map(p=>p.heading.replaceAll(h," ")).includes(Dt(o,h))}async updateLinks(t,n,i){await Mr(this.plugin.app,t,async()=>{let o=await mt(this.plugin.app,t);return o?vt(o).map(l=>Xi(l,this.convertLink({link:l,note:t,oldNotePath:n,pathChangeMap:i}))):[]})}};var Nr=class{constructor(t,n){this.plugin=t;this.lh=n;}async collectAttachmentsForCachedNote(t,n,i){if(this.plugin.settings.isPathIgnored(t))return{movedAttachments:[]};let o={movedAttachments:[]},s=await mt(this.plugin.app,t);if(!s)return o;for(let l of vt(s)){let{linkPath:u}=Kt(l.link);if(!u)continue;let f=this.lh.getFullPathForLink(u,t);if(o.movedAttachments.findIndex(w=>w.oldPath===f)!==-1)continue;let m=Yt(this.plugin.app,l,t);if(!m){let w=ro(l.original)?"embed":"link";console.warn(`${t} has bad ${w} (file does not exist): ${u}`);continue}if(!this.isAttachment(m))continue;let h=await Ss(this.plugin.app,m.path,t);if(se(h)===se(m.path))continue;let p=await this.moveAttachment(m,h,[t],n,i);o.movedAttachments=o.movedAttachments.concat(p.movedAttachments)}return o}async deleteEmptyFolders(t){if(this.plugin.settings.isPathIgnored(t))return;t=Dt(t,"./");let n=await Jn(this.plugin.app,t);for(let i of n.folders)await this.deleteEmptyFolders(i);if(n=await Jn(this.plugin.app,t),n.files.length===0&&n.folders.length===0&&(this.plugin.consoleDebug(`delete empty folder: + ${t}`),await this.plugin.app.vault.exists(t)))try{await this.plugin.app.vault.adapter.rmdir(t,!1)}catch(i){if(await this.plugin.app.vault.adapter.exists(t))throw i}}async createFolderForAttachmentFromPath(t){await Zn(this.plugin.app,se(t))}async deleteFile(t,n){if(await this.plugin.app.fileManager.trashFile(t),n){let i=t.parent;for(;i&&i.children.length===0;)await this.plugin.app.fileManager.trashFile(i),i=i.parent}}isAttachment(t){return!Rt(this.plugin.app,t)}async moveAttachment(t,n,i,o,s){let l=t.path,u={movedAttachments:[]};if(this.plugin.settings.isPathIgnored(l)||!this.isAttachment(t))return u;if(l===n)return console.warn("Can't move file. Source and destination path the same."),u;await this.createFolderForAttachmentFromPath(n);let f=await this.lh.getCachedNotesThatHaveLinkToFile(l);for(let w of i)f.remove(w);if(l!==t.path)return console.warn("File was moved already"),await this.moveAttachment(t,n,i,o,s);let m=t.parent,h=f.length===0,p=ce(this.plugin.app,n);return p&&(o?(this.plugin.consoleDebug(`delete: ${n}`),await this.deleteFile(p,s)):n=Qi(this.plugin.app,n)),this.plugin.consoleDebug(`${h?"move":"copy"} + from: ${l} + to: ${n}`),u.movedAttachments.push({newPath:n,oldPath:l}),h?await Ji(this.plugin.app,t,n):await sf(this.plugin.app,t,n),this.plugin.settings.deleteEmptyFolders&&await oo(this.plugin.app,m),u}};var Oo=class extends bi{deletedNoteCache=new Map;fh;lh;async saveSettings(t){await super.saveSettings(t),this.lh=new Rr(this),this.fh=new Nr(this,this.lh)}createPluginSettings(t){return new mo(t)}createPluginSettingsTab(){return new Lo(this)}async onLayoutReady(){await this.showBackupWarning()}onloadComplete(){this.registerEvent(this.app.metadataCache.on("deleted",(t,n)=>{n&&this.handleDeletedMetadata(t,n)})),yf(this,()=>({isPathIgnored:n=>this.settings.isPathIgnored(n),shouldDeleteConflictingAttachments:this.settings.deleteExistFilesWhenMoveNote,shouldDeleteEmptyFolders:this.settings.deleteEmptyFolders,shouldHandleDeletions:this.settings.deleteAttachmentsWithNote,shouldHandleRenames:this.settings.updateLinks,shouldRenameAttachmentFolder:this.settings.moveAttachmentsWithNote,shouldUpdateFilenameAliases:this.settings.changeNoteBacklinksAlt})),this.addCommand({callback:()=>this.collectAllAttachments(),id:"collect-all-attachments",name:"Collect All Attachments"}),this.addCommand({checkCallback:t=>this.collectAttachmentsCurrentFolder(t),id:"collect-attachments-current-folder",name:"Collect Attachments in Current Folder"}),this.addCommand({checkCallback:this.collectAttachmentsCurrentNote.bind(this),id:"collect-attachments-current-note",name:"Collect Attachments in Current Note"}),this.addCommand({callback:()=>this.deleteEmptyFolders(),id:"delete-empty-folders",name:"Delete Empty Folders"}),this.addCommand({callback:()=>this.convertAllLinkPathsToRelative(),id:"convert-all-link-paths-to-relative",name:"Convert All Link Paths to Relative"}),this.addCommand({checkCallback:this.convertAllLinkPathsToRelativeCurrentNote.bind(this),id:"convert-all-link-paths-to-relative-current-note",name:"Convert All Link Paths to Relative in Current Note"}),this.addCommand({callback:()=>this.convertAllEmbedsPathsToRelative(),id:"convert-all-embed-paths-to-relative",name:"Convert All Embed Paths to Relative"}),this.addCommand({checkCallback:this.convertAllEmbedsPathsToRelativeCurrentNote.bind(this),id:"convert-all-embed-paths-to-relative-current-note",name:"Convert All Embed Paths to Relative in Current Note"}),this.addCommand({callback:()=>this.replaceAllWikilinksWithMarkdownLinks(),id:"replace-all-wikilinks-with-markdown-links",name:"Replace All Wiki Links with Markdown Links"}),this.addCommand({checkCallback:this.replaceAllWikilinksWithMarkdownLinksCurrentNote.bind(this),id:"replace-all-wikilinks-with-markdown-links-current-note",name:"Replace All Wiki Links with Markdown Links in Current Note"}),this.addCommand({callback:()=>this.replaceAllWikiEmbedsWithMarkdownEmbeds(),id:"replace-all-wiki-embeds-with-markdown-embeds",name:"Replace All Wiki Embeds with Markdown Embeds"}),this.addCommand({checkCallback:this.replaceAllWikiEmbedsWithMarkdownEmbedsCurrentNote.bind(this),id:"replace-all-wiki-embeds-with-markdown-embeds-current-note",name:"Replace All Wiki Embeds with Markdown Embeds in Current Note"}),this.addCommand({callback:()=>this.reorganizeVault(),id:"reorganize-vault",name:"Reorganize Vault"}),this.addCommand({callback:()=>this.checkConsistency(),id:"check-consistency",name:"Check Vault consistency"}),this.registerEvent(this.app.metadataCache.on("changed",t=>{it(this.app,()=>this.handleMetadataCacheChanged(t))})),this.registerEvent(this.app.workspace.on("file-menu",(t,n)=>{this.handleFileMenu(t,n)})),this.lh=new Rr(this),this.fh=new Nr(this,this.lh)}async checkConsistency(){await this.saveAllOpenNotes();let t=new vn("Bad links"),n=new vn("Bad embeds"),i=new vn("Wiki links"),o=new vn("Wiki embeds");await dn({abortSignal:this.abortSignal,buildNoticeMessage:(m,h)=>`Checking note ${h} - ${m.path}`,items:Qn(this.app),processItem:async m=>{await this.lh.checkConsistency(m,t,n,i,o)},shouldContinueOnError:!0});let s=this.settings.consistencyReportFile,l=t.toString(this.app,s)+n.toString(this.app,s)+i.toString(this.app,s)+o.toString(this.app,s);await Zn(this.app,se(s));let u=await Bl(this.app,s);await this.app.vault.modify(u,l);let f=!1;this.app.workspace.iterateAllLeaves(m=>{m.getDisplayText()!==""&&s.startsWith(m.getDisplayText())&&(f=!0)}),f||await this.app.workspace.openLinkText(s,"/",!1)}async collectAllAttachments(){await this.collectAttachmentsInFolder("/")}async collectAttachments(t,n=!0){if(this.settings.isPathIgnored(t.path)){new ye.Notice("Note path is ignored");return}await this.saveAllOpenNotes();let i=await this.fh.collectAttachmentsForCachedNote(t.path,this.settings.deleteExistFilesWhenMoveNote,this.settings.deleteEmptyFolders);i.movedAttachments.length>0&&await this.lh.updateChangedPathsInNote(t.path,i.movedAttachments),i.movedAttachments.length===0?n&&new ye.Notice("No files found that need to be moved"):new ye.Notice(`Moved ${i.movedAttachments.length.toString()} attachment${i.movedAttachments.length>1?"s":""}`)}collectAttachmentsCurrentFolder(t){let n=this.app.workspace.getActiveFile();return!n||!ke(this.app,n)?!1:(t||it(this.app,()=>this.collectAttachmentsInFolder(n.parent?.path??"/")),!0)}collectAttachmentsCurrentNote(t){let n=this.app.workspace.getActiveFile();return!n||!ke(this.app,n)?!1:(t||it(this.app,()=>this.collectAttachments(n)),!0)}async collectAttachmentsInFolder(t){let n=0,i=0;await this.saveAllOpenNotes(),await dn({abortSignal:this.abortSignal,buildNoticeMessage:(o,s)=>`Collecting attachments ${s} - ${o.path}`,items:zl(this.app,t,!0),processItem:async o=>{if(this.settings.isPathIgnored(o.path))return;let s=await this.fh.collectAttachmentsForCachedNote(o.path,this.settings.deleteExistFilesWhenMoveNote,this.settings.deleteEmptyFolders);s.movedAttachments.length>0&&(await this.lh.updateChangedPathsInNote(o.path,s.movedAttachments),n+=s.movedAttachments.length,i++)},shouldContinueOnError:!0}),n===0?new ye.Notice("No files found that need to be moved"):new ye.Notice(`Moved ${n.toString()} attachment${n>1?"s":""} from ${i.toString()} note${i>1?"s":""}`)}async convertAllEmbedsPathsToRelative(){await this.saveAllOpenNotes();let t=0,n=0;await dn({abortSignal:this.abortSignal,buildNoticeMessage:(i,o)=>`Converting embed paths to relative ${o} - ${i.path}`,items:Qn(this.app),processItem:async i=>{if(this.settings.isPathIgnored(i.path))return;let o=await this.lh.convertAllNoteEmbedsPathsToRelative(i.path);o.length>0&&(t+=o.length,n++)},shouldContinueOnError:!0}),t===0?new ye.Notice("No embeds found that need to be converted"):new ye.Notice(`Converted ${t.toString()} embed${t>1?"s":""} from ${n.toString()} note${n>1?"s":""}`)}convertAllEmbedsPathsToRelativeCurrentNote(t){let n=this.app.workspace.getActiveFile();return!n||!ke(this.app,n)?!1:(t||it(this.app,fr(()=>this.lh.convertAllNoteEmbedsPathsToRelative(n.path))),!0)}async convertAllLinkPathsToRelative(){await this.saveAllOpenNotes();let t=0,n=0;await dn({abortSignal:this.abortSignal,buildNoticeMessage:(i,o)=>`Converting link paths to relative ${o} - ${i.path}`,items:Qn(this.app),processItem:async i=>{if(this.settings.isPathIgnored(i.path))return;let o=await this.lh.convertAllNoteLinksPathsToRelative(i.path);o.length>0&&(t+=o.length,n++)},shouldContinueOnError:!0}),t===0?new ye.Notice("No links found that need to be converted"):new ye.Notice(`Converted ${t.toString()} link${t>1?"s":""} from ${n.toString()} note${n>1?"s":""}`)}convertAllLinkPathsToRelativeCurrentNote(t){let n=this.app.workspace.getActiveFile();return!n||!ke(this.app,n)?!1:(t||it(this.app,fr(()=>this.lh.convertAllNoteLinksPathsToRelative(n.path))),!0)}async deleteEmptyFolders(){await this.fh.deleteEmptyFolders("/")}handleDeletedMetadata(t,n){!this.settings.deleteAttachmentsWithNote||this.settings.isPathIgnored(t.path)||!ke(this.app,t)||this.deletedNoteCache.set(t.path,n)}handleFileMenu(t,n){wr(n)&&t.addItem(i=>{i.setTitle("Collect attachments in folder").setIcon("download").onClick(()=>this.collectAttachmentsInFolder(n.path))})}async handleMetadataCacheChanged(t){if(!this.settings.autoCollectAttachments)return;let n=document.querySelector(".suggestion-container");n&&n.style.display!=="none"||await this.collectAttachments(t,!1)}async reorganizeVault(){await this.saveAllOpenNotes(),await this.replaceAllWikilinksWithMarkdownLinks(),await this.replaceAllWikiEmbedsWithMarkdownEmbeds(),await this.convertAllEmbedsPathsToRelative(),await this.convertAllLinkPathsToRelative(),await this.collectAllAttachments(),await this.deleteEmptyFolders(),new ye.Notice("Reorganization of the vault completed")}async replaceAllWikiEmbedsWithMarkdownEmbeds(){await this.saveAllOpenNotes();let t=0,n=0;await dn({abortSignal:this.abortSignal,buildNoticeMessage:(i,o)=>`Replacing wiki embeds with markdown embeds ${o} - ${i.path}`,items:Qn(this.app),processItem:async i=>{if(this.settings.isPathIgnored(i.path))return;let o=await this.lh.replaceAllNoteWikilinksWithMarkdownLinks(i.path,!0);t+=o,n++},shouldContinueOnError:!0}),t===0?new ye.Notice("No wiki embeds found that need to be replaced"):new ye.Notice(`Replaced ${t.toString()} wiki embed${t>1?"s":""} from ${n.toString()} note${n>1?"s":""}`)}replaceAllWikiEmbedsWithMarkdownEmbedsCurrentNote(t){let n=this.app.workspace.getActiveFile();return!n||!ke(this.app,n)?!1:(t||it(this.app,fr(()=>this.lh.replaceAllNoteWikilinksWithMarkdownLinks(n.path,!0))),!0)}async replaceAllWikilinksWithMarkdownLinks(){await this.saveAllOpenNotes();let t=0,n=0;await dn({abortSignal:this.abortSignal,buildNoticeMessage:(i,o)=>`Replacing wikilinks with markdown links ${o} - ${i.path}`,items:Qn(this.app),processItem:async i=>{if(this.settings.isPathIgnored(i.path))return;let o=await this.lh.replaceAllNoteWikilinksWithMarkdownLinks(i.path,!1);t+=o,n++},shouldContinueOnError:!0}),t===0?new ye.Notice("No wiki links found that need to be replaced"):new ye.Notice(`Replaced ${t.toString()} wikilink${t>1?"s":""} from ${n.toString()} note${n>1?"s":""}`)}replaceAllWikilinksWithMarkdownLinksCurrentNote(t){let n=this.app.workspace.getActiveFile();return!n||!ke(this.app,n)?!1:(t||it(this.app,fr(()=>this.lh.replaceAllNoteWikilinksWithMarkdownLinks(n.path,!1))),!0)}async saveAllOpenNotes(){for(let t of this.app.workspace.getLeavesOfType("markdown"))t.view instanceof ye.MarkdownView&&await t.view.save()}async showBackupWarning(){if(!this.settings.showBackupWarning)return;await yi({app:this.app,message:createFragment(n=>{n.createDiv({cls:"community-modal-readme"},i=>{i.appendText("Using 'Consistent Attachments and Links' plugin without proper configuration might lead to inconvenient attachment rearrangements or even data loss in your vault."),i.createEl("br"),i.appendText("It is "),i.createEl("strong",{text:"STRONGLY"}),i.appendText(" recommended to backup your vault before using the plugin."),i.createEl("br"),this.settings.hadDangerousSettingsReverted&&(i.appendText("Some of your plugin settings has been changed to their safe values."),i.createEl("br")),i.createEl("a",{href:"https://github.com/dy-sh/obsidian-consistent-attachments-and-links?tab=readme-ov-file",text:"Read more"}),i.appendText(" about how to use the plugin."),i.createEl("br"),i.appendText("This warning will not appear again.")})}),title:createFragment(n=>{(0,ye.setIcon)(n.createSpan(),"triangle-alert"),n.appendText(" Consistent Attachments and Links")})});let t=this.settingsClone;t.showBackupWarning=!1,await this.saveSettings(t)}};var ny=Oo; +/*! Bundled license information: + +moment/moment.js: + (*! moment.js *) + (*! version : 2.30.1 *) + (*! authors : Tim Wood, Iskren Chernev, Moment.js contributors *) + (*! license : MIT *) + (*! momentjs.com *) +*/ /* nosourcemap */ \ No newline at end of file diff --git a/.obsidian/plugins/consistent-attachments-and-links/manifest.json b/.obsidian/plugins/consistent-attachments-and-links/manifest.json index 72228d95..bad62dd2 100644 --- a/.obsidian/plugins/consistent-attachments-and-links/manifest.json +++ b/.obsidian/plugins/consistent-attachments-and-links/manifest.json @@ -1,8 +1,8 @@ { "id": "consistent-attachments-and-links", "name": "Consistent Attachments and Links", - "version": "3.24.1", - "minAppVersion": "1.7.7", + "version": "3.24.13", + "minAppVersion": "1.8.7", "description": "This plugin ensures the consistency of attachments and links", "author": "Dmitry Savosh", "authorUrl": "https://github.com/dy-sh/", diff --git a/SanPinPLM/相关操作/3.PLM/30.项目跟踪.md b/SanPinPLM/相关操作/3.PLM/30.项目跟踪.md index b22eadbb..dd00923a 100644 --- a/SanPinPLM/相关操作/3.PLM/30.项目跟踪.md +++ b/SanPinPLM/相关操作/3.PLM/30.项目跟踪.md @@ -20,3 +20,13 @@ ![image-20240614153619837](../1.EDM/assets/image-20240614153619837.png) +## 扩展 + +项目跟踪页面的新或旧,影响着 [角色设置](../0.SETOUT/42.角色设置.md) 中 **项目跟踪** 权限的子级权限 + +若启用项目跟踪新页面,则角色中可设置项目跟踪的子级权限范围如图 + +![](assets/Pasted%20image%2020250303195504.png) + +若不启用项目跟踪新页面,则在角色中可设置的项目跟踪子级权限仅为 **新增** + diff --git a/SanPinPLM/相关操作/3.PLM/assets/Pasted image 20250303195504.png b/SanPinPLM/相关操作/3.PLM/assets/Pasted image 20250303195504.png new file mode 100644 index 00000000..d7e00565 Binary files /dev/null and b/SanPinPLM/相关操作/3.PLM/assets/Pasted image 20250303195504.png differ