varae=Object.defineProperty;varTe=Object.getOwnPropertyDescriptor;varCe=Object.getOwnPropertyNames;varxe=Object.prototype.hasOwnProperty;varFe=(y,t)=>{for(vareint)ae(y,e,{get:t[e],enumerable:!0})},Se=(y,t,e,n)=>{if(t&&typeoft=="object"||typeoft=="function")for(letiofCe(t))!xe.call(y,i)&&i!==e&&ae(y,i,{get:()=>t[i],enumerable:!(n=Te(t,i))||n.enumerable});returny};varIe=y=>Se(ae({},"__esModule",{value:!0}),y);varLe={};Fe(Le,{default:()=>re});module.exports=Ie(Le);varoe=require("obsidian");vark=require("obsidian");varJ=class{constructor(){this.values=newMap}put(t,e){this.values.set(t,e)}get(t,e){varn;return(n=this.values.get(t))!=null?n:e}getFirst(t,e){for(letn=0;n<t.length;n++){leti=t[n];if(this.containsKey(i))returnthis.get(i,e)}returne}containsKey(t){returnthis.values.has(t)}getKeys(){returnArray.from(this.values.keys())}removeKey(t){returnthis.values.delete(t)}clear(){this.values.clear()}};varle=require("obsidian"),R=class{staticgetFilePathWithNewExtension(t,e){return(0,le.normalizePath)(t.parent.path+"/"+t.basename+"."+e)}staticgetFilePathExcludingExtension(t){return(0,le.normalizePath)(t.parent.path+"/"+t.basename)}};varp=class{staticsetActive(t){p.isActive=t,p.isActive||this.clear()}staticsetAutoExpire(t){p.baseMinutesToExpire=t!=null?t:0,p.updateExpiryTime()}staticsetLevel(t){p.level!=t&&(p.allLevels.contains(t)&&(p.level=t),p.level=p.LevelFilename,this.clear())}staticupdateExpiryTime(){p.baseMinutesToExpire==0||p.baseMinutesToExpire==null?p.expiryTime=null:p.expiryTime=Date.now()+p.baseMinutesToExpire*1e3*60}staticputByFile(t,e){if(!p.isActive)return;letn=p.getFileCacheKey(e);this.cache.put(n,t),p.updateExpiryTime()}staticgetByFile(t){if(!p.isActive)returnp.blankPasswordAndHint;this.clearIfExpired(),p.updateExpiryTime();lete=p.getFileCacheKey(t);returnthis.cache.get(e,p.blankPasswordAndHint)}staticputByPath(t,e){if(!p.isActive)return;letn=p.getPathCacheKey(e);this.cache.put(n,t),p.updateExpiryTime()}staticgetByPath(t){if(!p.isActive)returnp.blankPasswordAndHint;this.clearIfExpired(),p.updateExpiryTime();lete=p.getPathCacheKey(t);returnthis.cache.get(e,p.blankPasswordAndHint)}staticgetPathCacheKey(t){lete=t.split("/").slice(0,-1).join("/");switch(p.level){casep.LevelVault:return"$vault";casep.LevelParentPath:returne;default:returnt}}staticgetFileCacheKey(t){switch(p.level){casep.LevelVault:return"$vault";casep.LevelParentPath:returnt.parent.path;default:returnR.getFilePathExcludingExtension(t)}}staticclearIfExpired(){p.expiryTime!=null&&(Date.now()<p.expiryTime||this.clear())}staticclearForFile(t){lete=p.getFileCacheKey(t);this.cache.removeKey(e)}staticclearForPath(t){lete=p.getPathCacheKey(t);this.cache.removeKey(e)}staticclear(){lett=this.cache.getKeys().length;returnthis.cache.clear(),t}},g=p;g.isActive=!0,g.blankPasswordAndHint={password:"",hint:""},g.cache=newJ,g.baseMinutesToExpire=0,g.expiryTime=null,g.LevelFilename="filename",g.LevelParentPath="parentPath",g.LevelVault="vault",g.allLevels=[p.LevelFilename,p.LevelParentPath,p.LevelVault],g.level=p.LevelVault;var_=classextendsk.PluginSettingTab{constructor(e,n,i,r){super(e,n);this.plugin=n,this.settings=i,this.features=r}display(){let{containerEl:e}=this;e.empty(),newk.Setting(e).setName("Confirm password?").setDesc("Confirm password when encrypting. (Recommended)").addToggle(s=>{s.setValue(this.settings.confirmPassword).onChange(asynco=>{this.settings.confirmPassword=o,awaitthis.plugin.saveSettings()})});letn=()=>{if(!this.settings.rememberPassword){i.settingEl.hide(),r.settingEl.hide();return}i.settingEl.show(),r.settingEl.show();lets=this.settings.rememberPasswordTimeout,o=`For ${s} minutes`;s==0&&(o="Until Obsidian is closed"),i.setName(`Remember Password (${o})`)};newk.Setting(e).setName("Remember password?").setDesc("Remember the last used passwords when encrypting or decrypting. Passwords are remembered until they timeout or Obsidian is closed").addToggle(s=>{s.setValue(this.settings.rememberPassword).onChange(asynco=>{this.settings.rememberPassword=o,awaitthis.plugin.saveS