varae=Object.defineProperty;varTe=Object.getOwnPropertyDescriptor;varFe=Object.getOwnPropertyNames;varxe=Object.prototype.hasOwnProperty;varSe=(w,t)=>{for(vareint)ae(w,e,{get:t[e],enumerable:!0})},Ie=(w,t,e,n)=>{if(t&&typeoft=="object"||typeoft=="function")for(letiofFe(t))!xe.call(w,i)&&i!==e&&ae(w,i,{get:()=>t[i],enumerable:!(n=Te(t,i))||n.enumerable});returnw};varDe=w=>Ie(ae({},"__esModule",{value:!0}),w);varVe={};Se(Ve,{default:()=>oe});module.exports=De(Ve);varCe=require("obsidian");vark=require("obsidian");varee=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()}};varce=require("obsidian"),B=class{staticgetFilePathWithNewExtension(t,e){return(0,ce.normalizePath)(t.parent.path+"/"+t.basename+"."+e)}staticgetFilePathExcludingExtension(t){return(0,ce.normalizePath)(t.parent.path+"/"+t.basename)}};varu=class{staticsetActive(t){u.isActive=t,u.isActive||this.clear()}staticsetAutoExpire(t){u.baseMinutesToExpire=t!=null?t:0,u.updateExpiryTime()}staticsetLevel(t){u.level!=t&&(u.allLevels.contains(t)&&(u.level=t),u.level=u.LevelFilename,this.clear())}staticupdateExpiryTime(){u.baseMinutesToExpire==0||u.baseMinutesToExpire==null?u.expiryTime=null:u.expiryTime=Date.now()+u.baseMinutesToExpire*1e3*60}staticputByFile(t,e){if(!u.isActive)return;letn=u.getFileCacheKey(e);this.cache.put(n,t),u.updateExpiryTime()}staticgetByFile(t){if(!u.isActive)returnu.blankPasswordAndHint;this.clearIfExpired(),u.updateExpiryTime();lete=u.getFileCacheKey(t);returnthis.cache.get(e,u.blankPasswordAndHint)}staticputByPath(t,e){if(!u.isActive)return;letn=u.getPathCacheKey(e);this.cache.put(n,t),u.updateExpiryTime()}staticgetByPath(t){if(!u.isActive)returnu.blankPasswordAndHint;this.clearIfExpired(),u.updateExpiryTime();lete=u.getPathCacheKey(t);returnthis.cache.get(e,u.blankPasswordAndHint)}staticgetPathCacheKey(t){lete=t.split("/").slice(0,-1).join("/");switch(u.level){caseu.LevelParentPath:returne;default:returnt}}staticgetFileCacheKey(t){switch(u.level){caseu.LevelParentPath:returnt.parent.path;default:returnB.getFilePathExcludingExtension(t)}}staticclearIfExpired(){u.expiryTime!=null&&(Date.now()<u.expiryTime||this.clear())}staticclearForFile(t){lete=u.getFileCacheKey(t);this.cache.removeKey(e)}staticclearForPath(t){lete=u.getPathCacheKey(t);this.cache.removeKey(e)}staticclear(){this.cache.clear()}},g=u;g.isActive=!0,g.blankPasswordAndHint={password:"",hint:""},g.cache=newee,g.baseMinutesToExpire=0,g.expiryTime=null,g.LevelFilename="filename",g.LevelParentPath="parentPath",g.allLevels=[u.LevelFilename,u.LevelParentPath],g.level=u.LevelFilename;varW=classextendsk.PluginSettingTab{constructor(e,n,i,s){super(e,n);this.plugin=n,this.settings=i,this.features=s}display(){let{containerEl:e}=this;e.empty(),e.createEl("h1",{text:"Settings for Meld Encrypt"}),newk.Setting(e).setHeading().setName("Common Settings"),newk.Setting(e).setName("Confirm password?").setDesc("Confirm password when encrypting. (Recommended)").addToggle(r=>{r.setValue(this.settings.confirmPassword).onChange(asynco=>{this.settings.confirmPassword=o,awaitthis.plugin.saveSettings()})});letn=()=>{if(!this.settings.rememberPassword){i.settingEl.hide(),s.settingEl.hide();return}i.settingEl.show(),s.settingEl.show();letr=this.settings.rememberPasswordTimeout,o=`For ${r} minutes`;r==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(r=>{r.setValue(this.settings.rememberPassword).onChange(asynco=>{this.settings.rememberPassword=o,awaitthis.plugin.saveSettings(),g.setActive(this.se