(()=>{var i={152:function(e,t,i){var r=this&&this.__createBinding||(Object.create?function(e,t,i,r){void 0===r&&(r=i);var a=Object.getOwnPropertyDescriptor(t,i);a&&("get"in a?t.__esModule:!a.writable&&!a.configurable)||(a={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,r,a)}:function(e,t,i,r){e[r=void 0===r?i:r]=t[i]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(t,e,i);return a(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.SettingsTab=void 0;let s=n(i(117)),o=i(795);class d extends o.PluginSettingTab{__i18n=this.__getI18n();__plugin;constructor(e,t){super(e,t),this.__plugin=t}display(){var e=this.containerEl;e.empty(),new o.Setting(e).setName(this.__i18n.settings.hideRootNode.name).setDesc(this.__i18n.settings.hideRootNode.desc).addToggle(e=>{e.setValue(this.__plugin.settings.hideRootNode).onChange(e=>{this.__plugin.settings.hideRootNode=e,this.__plugin.saveSettings(),this.__plugin.refreshGraphLeaves()})})}__getI18n(){return"fr"!==window.localStorage.getItem("language")?s.enUS:s.frFR}}t.SettingsTab=d},786:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.enUS=void 0,t.enUS={settings:{hideRootNode:{name:"Hide root node",desc:"Either hide or show the root folder node ('/') in the graph view. (displayed by default)"}}}},177:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.frFR=void 0,t.frFR={settings:{hideRootNode:{name:"Cacher le nœu racine",desc:"Cacher ou non le nœu du dossier racine ('/') dans la vue graphique. (affiché par défaut)"}}}},117:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.frFR=t.enUS=void 0;var r=i(786),a=(Object.defineProperty(t,"enUS",{enumerable:!0,get:function(){return r.enUS}}),i(177));Object.defineProperty(t,"frFR",{enumerable:!0,get:function(){return a.frFR}})},795:e=>{e.exports=require("obsidian")}},r={};function n(e){var t=r[e];return void 0!==t||(t=r[e]={exports:{}},i[e].call(t.exports,t,t.exports,n)),t.exports}var t={};{var s=t,o=(Object.defineProperty(s,"__esModule",{value:!0}),n(795));let e=n(152),a="tag";class d extends o.Plugin{settings={hideRootNode:!1};async onload(){await this.__loadSettings(),this.addSettingTab(new e.SettingsTab(this.app,this)),this.refreshGraphLeaves(),this.registerEvent(this.app.workspace.on("active-leaf-change",e=>{this.refreshGraphLeaves([e])})),this.registerEvent(this.app.workspace.on("layout-change",()=>{this.refreshGraphLeaves()}))}onunload(){this.__getLeavesOfTypeGraph().forEach(e=>{e.view.renderer.originalSetData&&(e.view.renderer.setData=e.view.renderer.originalSetData,delete e.view.renderer.originalSetData,e.view.unload(),e.view.load())})}refreshGraphLeaves(e=this.__getLeavesOfTypeGraph()){e.forEach(e=>{"graph"===e.view.getViewType()&&(this.__injectDataInLeaf(e),e.view.unload(),e.view.load())})}__injectDataInLeaf(e){let t=e.view.renderer;null==t.originalSetData&&(t.originalSetData=t.setData),t.setData=i=>{let r=new Set("/");if(Object.entries(i.nodes).forEach(([e,t])=>{e=this.__getNodeParentFolders(e);t.folderNode||t.type==a||null==e||e.forEach(r.add,r)}),r.forEach(e=>{i.nodes[e]={type:a,links:{},folderNode:!0}}),Object.entries(i.nodes).forEach(([e,t])=>{t.type==a&&!t.folderNode||(t=this.__getNodeParentFolder(e),i.nodes[t].links[e]=!0)}),t.originalSetData)return this.settings.hideRootNode&&i.nodes["/"]&&delete i.nodes["/"],t.originalSetData(i);throw new Error("originalSetData is undefined.")}}__getLeavesOfTypeGraph(){return this.app.workspace.getLeavesOfType("graph")}__getNodeParentFolders(e){let t=["/"];e=e.split("/"),e=e.slice(0,e.length-1);let i="";return e.forEach(e=>{i+="/"+e,t.push(i)}),t}__getNodeParentFolder(e){e=e.split("/");return"/"+e.slice(0,e.length-1).filter(e=>""!=e).join("/")}async __loadSettings(){this.settings=Object.assign({},this.settings,await this.loadData())}async saveSettings(){await this.saveData(this.settings)}}s.default=d}var e,a=exports;for(e in t)a[e]=t[e];t.__esModule&&Object.defineProperty(a,"__esModule",{value:!0})})();
/* nosourcemap */