You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
229 KiB

var Ve=Object.create;var _=Object.defineProperty;var je=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,We=Object.prototype.hasOwnProperty;var Qe=(s,t)=>()=>(t||s((t={exports:{}}).exports,t),t.exports),Ge=(s,t)=>{for(var e in t)_(s,e,{get:t[e],enumerable:!0})},ge=(s,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of qe(t))!We.call(s,i)&&i!==e&&_(s,i,{get:()=>t[i],enumerable:!(n=je(t,i))||n.enumerable});return s};var Ke=(s,t,e)=>(e=s!=null?Ve(Je(s)):{},ge(t||!s||!s.__esModule?_(e,"default",{value:s,enumerable:!0}):e,s)),Ze=s=>ge(_({},"__esModule",{value:!0}),s);var a=(s,t,e)=>new Promise((n,i)=>{var o=c=>{try{l(e.next(c))}catch(g){i(g)}},r=c=>{try{l(e.throw(c))}catch(g){i(g)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(o,r);l((e=e.apply(s,t)).next())});var ze=Qe(u=>{"use strict";Object.defineProperty(u,"__esModule",{value:!0});var p=require("obsidian"),ie="YYYY-MM-DD",se="gggg-[W]ww",Ae="YYYY-MM",Ee="YYYY-[Q]Q",Ie="YYYY";function D(s){var e,n;let t=window.app.plugins.getPlugin("periodic-notes");return t&&((n=(e=t.settings)==null?void 0:e[s])==null?void 0:n.enabled)}function R(){var s,t,e,n;try{let{internalPlugins:i,plugins:o}=window.app;if(D("daily")){let{format:g,folder:h,template:d}=((t=(s=o.getPlugin("periodic-notes"))==null?void 0:s.settings)==null?void 0:t.daily)||{};return{format:g||ie,folder:(h==null?void 0:h.trim())||"",template:(d==null?void 0:d.trim())||""}}let{folder:r,format:l,template:c}=((n=(e=i.getPluginById("daily-notes"))==null?void 0:e.instance)==null?void 0:n.options)||{};return{format:l||ie,folder:(r==null?void 0:r.trim())||"",template:(c==null?void 0:c.trim())||""}}catch(i){console.info("No custom daily note settings found!",i)}}function k(){var s,t,e,n,i,o,r;try{let l=window.app.plugins,c=(s=l.getPlugin("calendar"))==null?void 0:s.options,g=(e=(t=l.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:e.weekly;if(D("weekly"))return{format:g.format||se,folder:((n=g.folder)==null?void 0:n.trim())||"",template:((i=g.template)==null?void 0:i.trim())||""};let h=c||{};return{format:h.weeklyNoteFormat||se,folder:((o=h.weeklyNoteFolder)==null?void 0:o.trim())||"",template:((r=h.weeklyNoteTemplate)==null?void 0:r.trim())||""}}catch(l){console.info("No custom weekly note settings found!",l)}}function M(){var t,e,n,i;let s=window.app.plugins;try{let o=D("monthly")&&((e=(t=s.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:e.monthly)||{};return{format:o.format||Ae,folder:((n=o.folder)==null?void 0:n.trim())||"",template:((i=o.template)==null?void 0:i.trim())||""}}catch(o){console.info("No custom monthly note settings found!",o)}}function x(){var t,e,n,i;let s=window.app.plugins;try{let o=D("quarterly")&&((e=(t=s.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:e.quarterly)||{};return{format:o.format||Ee,folder:((n=o.folder)==null?void 0:n.trim())||"",template:((i=o.template)==null?void 0:i.trim())||""}}catch(o){console.info("No custom quarterly note settings found!",o)}}function O(){var t,e,n,i;let s=window.app.plugins;try{let o=D("yearly")&&((e=(t=s.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:e.yearly)||{};return{format:o.format||Ie,folder:((n=o.folder)==null?void 0:n.trim())||"",template:((i=o.template)==null?void 0:i.trim())||""}}catch(o){console.info("No custom yearly note settings found!",o)}}function Le(...s){let t=[];for(let n=0,i=s.length;n<i;n++)t=t.concat(s[n].split("/"));let e=[];for(let n=0,i=t.length;n<i;n++){let o=t[n];!o||o==="."||e.push(o)}return t[0]===""&&e.unshift(""),e.join("/")}function nt(s){let t=s.substring(s.lastIndexOf("/")+1);return t.lastIndexOf(".")!=-1&&(t=t.substring(0,t.lastIndexOf("."))),t}function it(s){return a(this,null,function*(){let t=s.replace(/\\/g,"/").split("/");if(t.pop(),t.length){let e=Le(...t);window.app.vault.getAbstractFileByPath(e)||(yield window.app.vault.createFolder(e))}})}function $(s,t){return a(this,null,function*(){t.endsWith(".md")||(t+=".md");let e=p.normalizePath(Le(s,t));return yield it(e),e})}function A(s){return a(this,null,function*(){let{metadataCache:t,vault:e}=window.app,n=p.normalizePath(s);if(n==="/")return Promise.resolve(["",null]);try{let i=t.getFirstLinkpathDest(n,""),o=yield e.cachedRead(i),r=window.app.foldManager.load(i);return[o,r]}catch(i){return console.error(`Failed to read the daily note template '${n}'`,i),new p.Notice("Failed to read the daily note template"),["",null]}})}function N(s,t="day"){let e=s.clone().startOf(t).format();return`${t}-${e}`}function Be(s){return s.replace(/\[[^\]]*\]/g,"")}function st(s,t){if(t==="week"){let e=Be(s);return/w{1,2}/i.test(e)&&(/M{1,4}/.test(e)||/D{1,4}/.test(e))}return!1}function E(s,t){return De(s.basename,t)}function ot(s,t){return De(nt(s),t)}function De(s,t){let n={day:R,week:k,month:M,quarter:x,year:O}[t]().format.split("/").pop(),i=window.moment(s,n,!0);if(!i.isValid())return null;if(st(n,t)&&t==="week"){let o=Be(n);if(/w{1,2}/i.test(o))return window.moment(s,n.replace(/M{1,4}/g,"").replace(/D{1,4}/g,""),!1)}return i}var oe=class extends Error{};function Re(s){return a(this,null,function*(){let t=window.app,{vault:e}=t,n=window.moment,{template:i,format:o,folder:r}=R(),[l,c]=yield A(i),g=s.format(o),h=yield $(r,g);try{let d=yield e.create(h,l.replace(/{{\s*date\s*}}/gi,g).replace(/{{\s*time\s*}}/gi,n().format("HH:mm")).replace(/{{\s*title\s*}}/gi,g).replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(b,y,T,f,P,w)=>{let X=n(),ee=s.clone().set({hour:X.get("hour"),minute:X.get("minute"),second:X.get("second")});return T&&ee.add(parseInt(f,10),P),w?ee.format(w.substring(1).trim()):ee.format(o)}).replace(/{{\s*yesterday\s*}}/gi,s.clone().subtract(1,"day").format(o)).replace(/{{\s*tomorrow\s*}}/gi,s.clone().add(1,"d").format(o)));return t.foldManager.save(d,c),d}catch(d){console.error(`Failed to create file: '${h}'`,d),new p.Notice("Unable to create new file.")}})}function at(s,t){var e;return(e=t[N(s,"day")])!=null?e:null}function rt(){let{vault:s}=window.app,{folder:t}=R(),e=s.getAbstractFileByPath(p.normalizePath(t));if(!e)throw new oe("Failed to find daily notes folder");let n={};return p.Vault.recurseChildren(e,i=>{if(i instanceof p.TFile){let o=E(i,"day");if(o){let r=N(o,"day");n[r]=i}}}),n}var ae=class extends Error{};function lt(){let{moment:s}=window,t=s.localeData()._week.dow,e=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;t;)e.push(e.shift()),t--;return e}function ut(s){return lt().indexOf(s.toLowerCase())}function ke(s){return a(this,null,function*(){let{vault:t}=window.app,{template:e,format:n,folder:i}=k(),[o,r]=yield A(e),l=s.format(n),c=yield $(i,l);try{let g=yield t.create(c,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(h,d,b,y,T,f)=>{let P=window.moment(),w=s.clone().set({hour:P.get("hour"),minute:P.get("minute"),second:P.get("second")});return b&&w.add(parseInt(y,10),T),f?w.format(f.substring(1).trim()):w.format(n)}).replace(/{{\s*title\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(h,d,b)=>{let y=ut(d);return s.weekday(y).format(b.trim())}));return window.app.foldManager.save(g,r),g}catch(g){console.error(`Failed to create file: '${c}'`,g),new p.Notice("Unable to create new file.")}})}function gt(s,t){var e;return(e=t[N(s,"week")])!=null?e:null}function ct(){let s={};if(!xe())return s;let{vault:t}=window.app,{folder:e}=k(),n=t.getAbstractFileByPath(p.normalizePath(e));if(!n)throw new ae("Failed to find weekly notes folder");return p.Vault.recurseChildren(n,i=>{if(i instanceof p.TFile){let o=E(i,"week");if(o){let r=N(o,"week");s[r]=i}}}),s}var re=class extends Error{};function Me(s){return a(this,null,function*(){let{vault:t}=window.app,{template:e,format:n,folder:i}=M(),[o,r]=yield A(e),l=s.format(n),c=yield $(i,l);try{let g=yield t.create(c,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(h,d,b,y,T,f)=>{let P=window.moment(),w=s.clone().set({hour:P.get("hour"),minute:P.get("minute"),second:P.get("second")});return b&&w.add(parseInt(y,10),T),f?w.format(f.substring(1).trim()):w.format(n)}).replace(/{{\s*date\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,l));return window.app.foldManager.save(g,r),g}catch(g){console.error(`Failed to create file: '${c}'`,g),new p.Notice("Unable to create new file.")}})}function dt(s,t){var e;return(e=t[N(s,"month")])!=null?e:null}function mt(){let s={};if(!Oe())return s;let{vault:t}=window.app,{folder:e}=M(),n=t.getAbstractFileByPath(p.normalizePath(e));if(!n)throw new re("Failed to find monthly notes folder");return p.Vault.recurseChildren(n,i=>{if(i instanceof p.TFile){let o=E(i,"month");if(o){let r=N(o,"month");s[r]=i}}}),s}var le=class extends Error{};function pt(s){return a(this,null,function*(){let{vault:t}=window.app,{template:e,format:n,folder:i}=x(),[o,r]=yield A(e),l=s.format(n),c=yield $(i,l);try{let g=yield t.create(c,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(h,d,b,y,T,f)=>{let P=window.moment(),w=s.clone().set({hour:P.get("hour"),minute:P.get("minute"),second:P.get("second")});return b&&w.add(parseInt(y,10),T),f?w.format(f.substring(1).trim()):w.format(n)}).replace(/{{\s*date\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,l));return window.app.foldManager.save(g,r),g}catch(g){console.error(`Failed to create file: '${c}'`,g),new p.Notice("Unable to create new file.")}})}function ft(s,t){var e;return(e=t[N(s,"quarter")])!=null?e:null}function ht(){let s={};if(!$e())return s;let{vault:t}=window.app,{folder:e}=x(),n=t.getAbstractFileByPath(p.normalizePath(e));if(!n)throw new le("Failed to find quarterly notes folder");return p.Vault.recurseChildren(n,i=>{if(i instanceof p.TFile){let o=E(i,"quarter");if(o){let r=N(o,"quarter");s[r]=i}}}),s}var ue=class extends Error{};function bt(s){return a(this,null,function*(){let{vault:t}=window.app,{template:e,format:n,folder:i}=O(),[o,r]=yield A(e),l=s.format(n),c=yield $(i,l);try{let g=yield t.create(c,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(h,d,b,y,T,f)=>{let P=window.moment(),w=s.clone().set({hour:P.get("hour"),minute:P.get("minute"),second:P.get("second")});return b&&w.add(parseInt(y,10),T),f?w.format(f.substring(1).trim()):w.format(n)}).replace(/{{\s*date\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,l));return window.app.foldManager.save(g,r),g}catch(g){console.error(`Failed to create file: '${c}'`,g),new p.Notice("Unable to create new file.")}})}function wt(s,t){var e;return(e=t[N(s,"year")])!=null?e:null}function yt(){let s={};if(!Ue())return s;let{vault:t}=window.app,{folder:e}=O(),n=t.getAbstractFileByPath(p.normalizePath(e));if(!n)throw new ue("Failed to find yearly notes folder");return p.Vault.recurseChildren(n,i=>{if(i instanceof p.TFile){let o=E(i,"year");if(o){let r=N(o,"year");s[r]=i}}}),s}function Tt(){var n,i;let{app:s}=window,t=s.internalPlugins.plugins["daily-notes"];if(t&&t.enabled)return!0;let e=s.plugins.getPlugin("periodic-notes");return e&&((i=(n=e.settings)==null?void 0:n.daily)==null?void 0:i.enabled)}function xe(){var e,n;let{app:s}=window;if(s.plugins.getPlugin("calendar"))return!0;let t=s.plugins.getPlugin("periodic-notes");return t&&((n=(e=t.settings)==null?void 0:e.weekly)==null?void 0:n.enabled)}function Oe(){var e,n;let{app:s}=window,t=s.plugins.getPlugin("periodic-notes");return t&&((n=(e=t.settings)==null?void 0:e.monthly)==null?void 0:n.enabled)}function $e(){var e,n;let{app:s}=window,t=s.plugins.getPlugin("periodic-notes");return t&&((n=(e=t.settings)==null?void 0:e.quarterly)==null?void 0:n.enabled)}function Ue(){var e,n;let{app:s}=window,t=s.plugins.getPlugin("periodic-notes");return t&&((n=(e=t.settings)==null?void 0:e.yearly)==null?void 0:n.enabled)}function Pt(s){return{day:R,week:k,month:M,quarter:x,year:O}[s]()}function vt(s,t){return{day:Re,month:Me,week:ke}[s](t)}u.DEFAULT_DAILY_NOTE_FORMAT=ie;u.DEFAULT_MONTHLY_NOTE_FORMAT=Ae;u.DEFAULT_QUARTERLY_NOTE_FORMAT=Ee;u.DEFAULT_WEEKLY_NOTE_FORMAT=se;u.DEFAULT_YEARLY_NOTE_FORMAT=Ie;u.appHasDailyNotesPluginLoaded=Tt;u.appHasMonthlyNotesPluginLoaded=Oe;u.appHasQuarterlyNotesPluginLoaded=$e;u.appHasWeeklyNotesPluginLoaded=xe;u.appHasYearlyNotesPluginLoaded=Ue;u.createDailyNote=Re;u.createMonthlyNote=Me;u.createPeriodicNote=vt;u.createQuarterlyNote=pt;u.createWeeklyNote=ke;u.createYearlyNote=bt;u.getAllDailyNotes=rt;u.getAllMonthlyNotes=mt;u.getAllQuarterlyNotes=ht;u.getAllWeeklyNotes=ct;u.getAllYearlyNotes=yt;u.getDailyNote=at;u.getDailyNoteSettings=R;u.getDateFromFile=E;u.getDateFromPath=ot;u.getDateUID=N;u.getMonthlyNote=dt;u.getMonthlyNoteSettings=M;u.getPeriodicNoteSettings=Pt;u.getQuarterlyNote=ft;u.getQuarterlyNoteSettings=x;u.getTemplateInfo=A;u.getWeeklyNote=gt;u.getWeeklyNoteSettings=k;u.getYearlyNote=wt;u.getYearlyNoteSettings=O});var St={};Ge(St,{default:()=>Z});module.exports=Ze(St);var Ye=require("obsidian");var v=require("obsidian");var q=require("obsidian");var ce=require("obsidian"),S=class extends ce.FuzzySuggestModal{constructor(e){super(e.app);this.scope.register(["Shift"],"Enter",n=>this.enterTrigger(n)),this.scope.register(["Ctrl"],"Enter",n=>this.enterTrigger(n))}setSuggesterData(e){this.data=e}display(e){return a(this,null,function*(){this.callbackFunction=e,this.open()})}getItems(){return this.data}getItemText(e){return e.display}onChooseItem(){}renderSuggestion(e,n){n.createEl("div",{text:e.item.display})}enterTrigger(e){let n=document.querySelector(".suggestion-item.is-selected div").textContent,i=this.data.find(o=>o.display===n);i&&(this.invokeCallback(i,e),this.close())}onChooseSuggestion(e,n){this.invokeCallback(e.item,n)}invokeCallback(e,n){this.callbackFunction(e,n)}};var F=require("obsidian"),Xe="https://raw.githubusercontent.com/",H=(s,t,e)=>a(void 0,null,function*(){let n=`https://github.com/${s}/releases/download/${t}/${e}`;try{let i=yield(0,F.request)({url:n});return i==="Not Found"||i==='{"error":"Not Found"}'?null:i}catch(i){console.log("error in grabReleaseFileFromRepository",n,i)}}),de=(s,t=!0)=>a(void 0,null,function*(){let e=Xe+s+(t===!0?"/HEAD/manifest.json":"/HEAD/manifest-beta.json");try{let n=yield(0,F.request)({url:e});return n==="404: Not Found"?null:yield JSON.parse(n)}catch(n){console.log(`error in grabManifestJsonFromRepository for ${e}`,n)}}),me=()=>a(void 0,null,function*(){let s="https://raw.githubusercontent.com/obsidianmd/obsidian-releases/HEAD/community-plugins.json";try{let t=yield(0,F.request)({url:s});return t==="404: Not Found"?null:yield JSON.parse(t)}catch(t){console.log("error in grabCommmunityPluginList",t)}}),Y=()=>a(void 0,null,function*(){let s="https://raw.githubusercontent.com/obsidianmd/obsidian-releases/HEAD/community-css-themes.json";try{let t=yield(0,F.request)({url:s});return t==="404: Not Found"?null:yield JSON.parse(t)}catch(t){console.log("error in grabCommmunityThemesList",t)}}),te=s=>a(void 0,null,function*(){let t=`https://raw.githubusercontent.com/${s}/HEAD/obsidian.css`;try{let e=yield(0,F.request)({url:t});return e==="404: Not Found"?null:e}catch(e){console.log("error in grabCommmunityThemesList",e)}}),et=(s,t)=>a(void 0,null,function*(){let e=`https://api.github.com/repos/${s}/commits?path=${t}&page=1&per_page=1`;try{let n=yield(0,F.request)({url:e});return n==="404: Not Found"?null:JSON.parse(n)}catch(n){console.log("error in grabCommmunityThemesList",n)}}),V=(s,t)=>a(void 0,null,function*(){let e=yield et(s,t);return e[0].commit.committer.date?e[0].commit.committer.date:""});var pe={pluginList:[],pluginSubListFrozenVersion:[],themesList:[],updateAtStartup:!1,updateThemesAtStartup:!1,ribbonIconEnabled:!0,loggingEnabled:!1,loggingPath:"BRAT-log",loggingVerboseEnabled:!1,debuggingMode:!0,notificationsEnabled:!0};function fe(s,t,e=""){return a(this,null,function*(){let n=!1;s.settings.pluginList.contains(t)||(s.settings.pluginList.unshift(t),n=!0),e!==""&&s.settings.pluginSubListFrozenVersion.filter(i=>i.repo===t).length===0&&(s.settings.pluginSubListFrozenVersion.unshift({repo:t,version:e}),n=!0),n&&s.saveSettings()})}function he(s,t){return a(this,null,function*(){return s.settings.pluginList.contains(t)})}function be(s,t){return a(this,null,function*(){let e={repo:t,lastUpdate:yield V(t,"obsidian.css")};s.settings.themesList.unshift(e),s.saveSettings()})}function we(s,t){return a(this,null,function*(){return!!s.settings.themesList.find(n=>n.repo===t)})}function ye(s,t,e){s.settings.themesList.forEach(n=>{n.repo===t&&(n.lastUpdate=e,s.saveSettings())})}var Te=require("obsidian");function m(s,t,e=10,n=null){if(s.settings.notificationsEnabled===!1)return;let i=n?"(click=dismiss, right-click=Info)":"",o=new Te.Notice(`BRAT
${t}
${i}`,e*1e3);n&&(o.noticeEl.oncontextmenu=()=>a(this,null,function*(){n()}))}function j(){return a(this,null,function*(){try{let s=yield fetch("https://obsidian.md/?"+Math.random());return s.status>=200&&s.status<300}catch(s){return!1}})}var Pe=s=>(0,q.normalizePath)(s.app.vault.configDir+"/themes")+"/",ne=(s,t,e="")=>a(void 0,null,function*(){let n=yield te(t);if(!n)return m(s,"There is no obsidian.css file in the root path of this repository, so there is no theme to install."),!1;yield ve(s,e,n);let i=`${e} theme installed from ${t}. `;return s.log(i+`[Theme Info](https://github.com/${t})`,!1),m(s,`${i}`,10,()=>a(void 0,null,function*(){window.open(`https://github.com/${t}`)})),setTimeout(()=>{s.app.customCss.setTheme(e)},500),!0}),ve=(s,t,e)=>a(void 0,null,function*(){let n=Pe(s),i=s.app.vault.adapter;(yield i.exists(n))===!1&&(yield i.mkdir(n)),yield i.write(n+t+".css",e)}),Se=s=>a(void 0,null,function*(){let t=yield Y(),e=Object.values(t).map(i=>({display:`Theme: ${i.name} (${i.repo})`,info:i})),n=new S(s);n.setSuggesterData(e),yield n.display(i=>a(void 0,null,function*(){yield ne(s,i.info.repo,i.info.name)}))}),J=s=>("BRAT-"+s.replace("/","----")).substr(0,100),Ne=(s,t)=>a(void 0,null,function*(){s.settings.themesList=s.settings.themesList.filter(n=>n.repo!=t),s.saveSettings(),yield s.app.vault.adapter.remove(Pe(s)+J(t)+".css");let e=`Removed ${t} from BRAT themes list and deleted from vault`;s.log(e,!0),m(s,`${e}`)}),W=(s,t)=>a(void 0,null,function*(){if((yield j())===!1){console.log("BRAT: No internet detected.");return}let e,n="Checking for beta theme updates STARTED";s.log(n,!0),t&&s.settings.notificationsEnabled&&(e=new q.Notice(`BRAT
${n}`,3e4));for(let o of s.settings.themesList){let r=yield V(o.repo,"obsidian.css");r!==o.lastUpdate&&(yield tt(s,o.repo,o.lastUpdate,r))}let i="Checking for beta theme updates COMPLETED";s.log(i,!0),t&&(s.settings.notificationsEnabled&&e.hide(),m(s,i))}),tt=(s,t,e="",n="")=>a(void 0,null,function*(){let i=yield te(t);if(!i)return m(s,"There is no obsidian.css file in the root path of the ${cssGithubRepository} repository, so this theme cannot be updated."),!1;let o=J(t);yield ve(s,o,i),ye(s,t,n);let r=`${o} theme updated from ${t}. From date: ${e} to ${n} `;return s.log(r+`[Theme Info](https://github.com/${t})`,!1),m(s,`${r}`,20,()=>a(void 0,null,function*(){window.open(`https://github.com/${t}`)})),!0});var Q=require("obsidian");var C=class extends Q.Modal{constructor(e,n=!1){super(e.app);this.plugin=e,this.address="",this.openSettingsTabAfterwards=n}submitForm(){return a(this,null,function*(){if(this.address==="")return;let e=this.address.replace("https://github.com/","");if(yield we(this.plugin,e)){m(this.plugin,"This plugin is already in the list for beta testing",10);return}(yield ne(this.plugin,e,J(e)))&&(yield be(this.plugin,e),this.close())})}onOpen(){this.contentEl.createEl("h4",{text:"Github repository for beta theme:"}),this.contentEl.createEl("form",{},e=>{new Q.Setting(e).addText(n=>{n.setPlaceholder("Repository (example: GitubUserName/repository-name"),n.onChange(i=>{this.address=i.trim()}),n.inputEl.addEventListener("keydown",i=>a(this,null,function*(){i.key==="Enter"&&this.address!==" "&&(i.preventDefault(),yield this.submitForm())})),n.inputEl.style.width="100%",window.setTimeout(()=>{let i=document.querySelector(".setting-item-info");i&&i.remove(),n.inputEl.focus()},10)}),e.createDiv("modal-button-container",n=>{n.createEl("button",{attr:{type:"button"},text:"Never mind"}).addEventListener("click",()=>this.close()),n.createEl("button",{attr:{type:"submit"},cls:"mod-cta",text:"Add Theme"})}),e.addEventListener("submit",n=>a(this,null,function*(){n.preventDefault(),this.address!==""&&(yield this.submitForm())}))})}onClose(){return a(this,null,function*(){this.openSettingsTabAfterwards&&(yield this.plugin.app.setting.open(),yield this.plugin.app.setting.openTabById("obsidian42-brat"))})}};var G=class extends v.PluginSettingTab{constructor(e,n){super(e,n);this.plugin=n}display(){let{containerEl:e}=this;e.empty(),e.createEl("h2",{text:this.plugin.appName}),new v.Setting(e).setName("Auto-update plugins at startup").setDesc("If enabled all beta plugins will be checked for updates each time Obsidian starts. Note: this does not update frozen version plugins.").addToggle(i=>{i.setValue(this.plugin.settings.updateAtStartup),i.onChange(o=>a(this,null,function*(){this.plugin.settings.updateAtStartup=o,yield this.plugin.saveSettings()}))}),new v.Setting(e).setName("Auto-update themes at startup").setDesc("If enabled all beta themes will be checked for updates each time Obsidian starts.").addToggle(i=>{i.setValue(this.plugin.settings.updateThemesAtStartup),i.onChange(o=>a(this,null,function*(){this.plugin.settings.updateThemesAtStartup=o,yield this.plugin.saveSettings()}))}),new v.Setting(e).setName("Ribbon Button").setDesc("Toggle ribbon button off and on.").addToggle(i=>{i.setValue(this.plugin.settings.ribbonIconEnabled),i.onChange(o=>a(this,null,function*(){this.plugin.settings.ribbonIconEnabled=o,this.plugin.settings.ribbonIconEnabled===!1?this.plugin.ribbonIcon.remove():this.plugin.showRibbonButton(),yield this.plugin.saveSettings()}))}),e.createEl("hr"),e.createEl("h2",{text:"Beta Plugin List"}),e.createEl("div",{text:'The following is a list of beta plugins added via the command palette "Add a beta plugin for testing" or "Add a beta plugin with frozen version for testing". A frozen version is a specific release of a plugin based on its releease tag. '}),e.createEl("p"),e.createEl("div",{text:"Click the x button next to a plugin to remove it from the list."}),e.createEl("p"),e.createEl("span").createEl("b",{text:"Note: "}),e.createSpan({text:"This does not delete the plugin, this should be done from the Community Plugins tab in Settings."}),new v.Setting(e).addButton(i=>{i.setButtonText("Add Beta plugin"),i.onClick(()=>a(this,null,function*(){this.plugin.app.setting.close(),yield this.plugin.betaPlugins.displayAddNewPluginModal(!0,!1)}))});let n=new Set(this.plugin.settings.pluginSubListFrozenVersion.map(i=>i.repo));for(let i of this.plugin.settings.pluginList)n.has(i)||new v.Setting(e).setName(i).addButton(o=>{o.setIcon("cross"),o.setTooltip("Delete this beta plugin"),o.onClick(()=>a(this,null,function*(){o.buttonEl.textContent===""?o.setButtonText("Click once more to confirm removal"):(o.buttonEl.parentElement.parentElement.remove(),yield this.plugin.betaPlugins.deletePlugin(i))}))});new v.Setting(e).addButton(i=>{i.setButtonText("Add Beta plugin with frozen version"),i.onClick(()=>a(this,null,function*(){this.plugin.app.setting.close(),yield this.plugin.betaPlugins.displayAddNewPluginModal(!0,!0)}))});for(let i of this.plugin.settings.pluginSubListFrozenVersion)new v.Setting(e).setName(`${i.repo} (version ${i.version})`).addButton(o=>{o.setIcon("cross"),o.setTooltip("Delete this beta plugin"),o.onClick(()=>a(this,null,function*(){o.buttonEl.textContent===""?o.setButtonText("Click once more to confirm removal"):(o.buttonEl.parentElement.parentElement.remove(),yield this.plugin.betaPlugins.deletePlugin(i.repo))}))});e.createEl("hr"),e.createEl("h2",{text:"Beta Themes List"}),new v.Setting(e).addButton(i=>{i.setButtonText("Add Beta Theme"),i.onClick(()=>a(this,null,function*(){this.plugin.app.setting.close(),new C(this.plugin).open()}))});for(let i of this.plugin.settings.themesList)new v.Setting(e).setName(i.repo).addButton(o=>{o.setIcon("cross"),o.setTooltip("Delete this beta theme"),o.onClick(()=>a(this,null,function*(){o.buttonEl.textContent===""?o.setButtonText("Click once more to confirm removal"):(o.buttonEl.parentElement.parentElement.remove(),yield Ne(this.plugin,i.repo))}))});e.createEl("hr"),e.createEl("h2",{text:"Monitoring"}),new v.Setting(e).setName("Enable Notifications").setDesc("BRAT will provide popup notifications for its various activities. Turn this off means no notifications from BRAT.").addToggle(i=>{i.setValue(this.plugin.settings.notificationsEnabled),i.onChange(o=>a(this,null,function*(){this.plugin.settings.notificationsEnabled=o,yield this.plugin.saveSettings()}))}),new v.Setting(e).setName("Enable Logging").setDesc("Plugin updates will be logged to a file in the log file.").addToggle(i=>{i.setValue(this.plugin.settings.loggingEnabled),i.onChange(o=>a(this,null,function*(){this.plugin.settings.loggingEnabled=o,yield this.plugin.saveSettings()}))}),new v.Setting(this.containerEl).setName("BRAT Log File Location").setDesc("Logs will be saved to this file. Don't add .md to the file name.").addSearch(i=>{i.setPlaceholder("Example: BRAT-log").setValue(this.plugin.settings.loggingPath).onChange(o=>a(this,null,function*(){this.plugin.settings.loggingPath=o,yield this.plugin.saveSettings()}))}),new v.Setting(e).setName("Enable Verbose Logging").setDesc("Get a lot more information in the log.").addToggle(i=>{i.setValue(this.plugin.settings.loggingVerboseEnabled),i.onChange(o=>a(this,null,function*(){this.plugin.settings.loggingVerboseEnabled=o,yield this.plugin.saveSettings()}))}),new v.Setting(e).setName("Debugging Mode").setDesc("Atomic Bomb level console logging. Can be used for troubleshoting and development.").addToggle(i=>{i.setValue(this.plugin.settings.debuggingMode),i.onChange(o=>a(this,null,function*(){this.plugin.settings.debuggingMode=o,yield this.plugin.saveSettings()}))})}};var I=require("obsidian");var L=class extends I.Modal{constructor(e,n,i=!1,o=!1){super(e.app);this.plugin=e,this.betaPlugins=n,this.address="",this.openSettingsTabAfterwards=i,this.useFrozenVersion=o,this.version=""}submitForm(){return a(this,null,function*(){if(this.address==="")return;let e=this.address.replace("https://github.com/","");if(yield he(this.plugin,e)){m(this.plugin,"This plugin is already in the list for beta testing",10);return}(yield this.betaPlugins.addPlugin(e,!1,!1,!1,this.version))&&this.close()})}onOpen(){this.contentEl.createEl("h4",{text:"Github repository for beta plugin:"}),this.contentEl.createEl("form",{},e=>{new I.Setting(e).addText(n=>{n.setPlaceholder("Repository (example: TfTHacker/obsidian-brat)"),n.onChange(i=>{this.address=i.trim()}),n.inputEl.addEventListener("keydown",i=>a(this,null,function*(){i.key==="Enter"&&this.address!==" "&&(this.useFrozenVersion&&this.version!==""||!this.useFrozenVersion)&&(i.preventDefault(),yield this.submitForm())})),n.inputEl.style.width="100%",window.setTimeout(()=>{let i=document.querySelector(".setting-item-info");i&&i.remove(),n.inputEl.focus()},10)}),this.useFrozenVersion&&new I.Setting(e).addText(n=>{n.setPlaceholder("Specify the release version tag (example: 1.0.0)"),n.onChange(i=>{this.version=i.trim()}),n.inputEl.style.width="100%",window.setTimeout(()=>{let i=document.querySelector(".setting-item-info");i&&i.remove()},10)}),e.createDiv("modal-button-container",n=>{n.createEl("button",{attr:{type:"button"},text:"Never mind"}).addEventListener("click",()=>this.close()),n.createEl("button",{attr:{type:"submit"},cls:"mod-cta",text:"Add Plugin"})}),e.addEventListener("submit",n=>a(this,null,function*(){n.preventDefault(),this.address!==""&&(this.useFrozenVersion&&this.version!==""||!this.useFrozenVersion)&&(yield this.submitForm())}))})}onClose(){return a(this,null,function*(){this.openSettingsTabAfterwards&&(yield this.plugin.app.setting.open(),yield this.plugin.app.setting.openTabById("obsidian42-brat"))})}};var K=require("obsidian");var B=class{constructor(t){this.plugin=t}displayAddNewPluginModal(t=!1,e=!1){return a(this,null,function*(){new L(this.plugin,this,t,e).open()})}validateRepository(t,e=!1,n=!1){return a(this,null,function*(){let o=yield de(t,!e);return o?"id"in o?"version"in o?o:(n&&m(this.plugin,`${t}
The version attribute for the release is missing from the manifest file`,15),null):(n&&m(this.plugin,`${t}
The plugin id attribute for the release is missing from the manifest file`,15),null):(n&&m(this.plugin,`${t}
This does not seem to be an obsidian plugin, as there is no manifest.json file.`,15),null)})}getAllReleaseFiles(t,e,n,i=""){return a(this,null,function*(){let o=i===""?e.version:i,r=n||i!=="";return{mainJs:yield H(t,o,"main.js"),manifest:r?yield H(t,o,"manifest.json"):null,styles:yield H(t,o,"styles.css")}})}writeReleaseFilesToPluginFolder(t,e){return a(this,null,function*(){let n=(0,K.normalizePath)(this.plugin.app.vault.configDir+"/plugins/"+t)+"/",i=this.plugin.app.vault.adapter;((yield i.exists(n))===!1||!(yield i.exists(n+"manifest.json")))&&(yield i.mkdir(n)),yield i.write(n+"main.js",e.mainJs),yield i.write(n+"manifest.json",e.manifest),e.styles&&(yield i.write(n+"styles.css",e.styles))})}addPlugin(t,e=!1,n=!1,i=!1,o=""){return a(this,null,function*(){var h;let l=yield this.validateRepository(t,!0,!1),c=!!l;if(c===!1&&(l=yield this.validateRepository(t,!1,!0)),l===null){let d=`${t}
A manifest.json or manifest-beta.json file does not exist in the root directory of the repository. This plugin cannot be installed.`;return this.plugin.log(d,!0),m(this.plugin,`${d}`,10),!1}if(!l.hasOwnProperty("version")){let d=`${t}
The manifest${c?"-beta":""}.json file in the root directory of the repository does not have a version number in the file. This plugin cannot be installed.`;return this.plugin.log(d,!0),m(this.plugin,`${d}`,10),!1}let g=()=>a(this,null,function*(){let d=yield this.getAllReleaseFiles(t,l,c,o);if((c||d.manifest===null)&&(d.manifest=JSON.stringify(l)),d.mainJs===null){let b=`${t}
The release is not complete and cannot be download. main.js is missing from the Release`;return this.plugin.log(b,!0),m(this.plugin,`${b}`,10),null}return d});if(e===!1){let d=yield g();if(d===null)return;yield this.writeReleaseFilesToPluginFolder(l.id,d),yield fe(this.plugin,t,o),yield this.plugin.app.plugins.loadManifests();let b=o===""?"":` (version: ${o})`,y=`${t}${b}
The plugin has been registered with BRAT. You may still need to enable it the Community Plugin List.`;this.plugin.log(y,!0),m(this.plugin,y,10)}else{let d=this.plugin.app.vault.configDir+"/plugins/"+l.id+"/",b=null;try{b=yield this.plugin.app.vault.adapter.read(d+"manifest.json")}catch(T){if(T.errno===-4058)return yield this.addPlugin(t,!1,c,!1,o),!0;console.log("BRAT - Local Manifest Load",l.id,JSON.stringify(T,null,2))}if(o!==""||this.plugin.settings.pluginSubListFrozenVersion.map(T=>T.repo).includes(t))return m(this.plugin,`The version of ${t} is frozen, not updating.`,3),!1;let y=yield JSON.parse(b);if(y.version!==l.version){let T=yield g();if(T===null)return;if(n){let f=`There is an update available for ${l.id} from version ${y.version} to ${l.version}. `;this.plugin.log(f+`[Release Info](https://github.com/${t}/releases/tag/${l.version})`,!1),m(this.plugin,f,30,()=>a(this,null,function*(){window.open(`https://github.com/${t}/releases/tag/${l.version}`)}))}else{yield this.writeReleaseFilesToPluginFolder(l.id,T),yield this.plugin.app.plugins.loadManifests(),(h=this.plugin.app.plugins.plugins[l.id])!=null&&h.manifest&&(yield this.reloadPlugin(l.id));let f=`${l.id}
Plugin has been updated from version ${y.version} to ${l.version}. `;this.plugin.log(f+`[Release Info](https://github.com/${t}/releases/tag/${l.version})`,!1),m(this.plugin,f,30,()=>a(this,null,function*(){window.open(`https://github.com/${t}/releases/tag/${l.version}`)}))}}else i&&m(this.plugin,`No update available for ${t}`,3)}return!0})}reloadPlugin(t){return a(this,null,function*(){let e=this.plugin.app.plugins;try{yield e.disablePlugin(t),yield e.enablePlugin(t)}catch(n){console.log("reload plugin",n)}})}updatePlugin(t,e=!1,n=!1){return a(this,null,function*(){let i=yield this.addPlugin(t,!0,e,n);return i===!1&&e===!1&&m(this.plugin,`${t}
Update of plugin failed.`),i})}checkForUpdatesAndInstallUpdates(t=!1,e=!1){return a(this,null,function*(){if((yield j())===!1){console.log("BRAT: No internet detected.");return}let n,i="Checking for plugin updates STARTED";this.plugin.log(i,!0),t&&this.plugin.settings.notificationsEnabled&&(n=new K.Notice(`BRAT
${i}`,3e4));let o=new Set(this.plugin.settings.pluginSubListFrozenVersion.map(l=>l.repo));for(let l of this.plugin.settings.pluginList)o.has(l)||(yield this.updatePlugin(l,e));let r="Checking for plugin updates COMPLETED";this.plugin.log(r,!0),t&&(n.hide(),m(this.plugin,r,10))})}deletePlugin(t){return a(this,null,function*(){let e=`Removed ${t} from BRAT plugin list`;this.plugin.log(e,!0),this.plugin.settings.pluginList=this.plugin.settings.pluginList.filter(n=>n!=t),this.plugin.settings.pluginSubListFrozenVersion=this.plugin.settings.pluginSubListFrozenVersion.filter(n=>n.repo!=t),this.plugin.saveSettings()})}getEnabledDisabledPlugins(t){let e=this.plugin.app.plugins,n=Object.values(e.manifests),i=Object.values(e.plugins).map(o=>o.manifest);return t?n.filter(o=>i.find(r=>o.id===r.id)):n.filter(o=>!i.find(r=>o.id===r.id))}};var Fe=require("obsidian");function Ce(){(0,Fe.addIcon)("BratIcon",'<path fill="currentColor" stroke="currentColor" d="M 41.667969 41.667969 C 41.667969 39.367188 39.800781 37.5 37.5 37.5 C 35.199219 37.5 33.332031 39.367188 33.332031 41.667969 C 33.332031 43.96875 35.199219 45.832031 37.5 45.832031 C 39.800781 45.832031 41.667969 43.96875 41.667969 41.667969 Z M 60.417969 58.582031 C 59.460938 58.023438 58.320312 57.867188 57.25 58.148438 C 56.179688 58.429688 55.265625 59.125 54.707031 60.082031 C 53.746094 61.777344 51.949219 62.820312 50 62.820312 C 48.050781 62.820312 46.253906 61.777344 45.292969 60.082031 C 44.734375 59.125 43.820312 58.429688 42.75 58.148438 C 41.679688 57.867188 40.539062 58.023438 39.582031 58.582031 C 37.597656 59.726562 36.910156 62.257812 38.042969 64.25 C 40.5 68.53125 45.0625 71.171875 50 71.171875 C 54.9375 71.171875 59.5 68.53125 61.957031 64.25 C 63.089844 62.257812 62.402344 59.726562 60.417969 58.582031 Z M 62.5 37.5 C 60.199219 37.5 58.332031 39.367188 58.332031 41.667969 C 58.332031 43.96875 60.199219 45.832031 62.5 45.832031 C 64.800781 45.832031 66.667969 43.96875 66.667969 41.667969 C 66.667969 39.367188 64.800781 37.5 62.5 37.5 Z M 50 8.332031 C 26.988281 8.332031 8.332031 26.988281 8.332031 50 C 8.332031 73.011719 26.988281 91.667969 50 91.667969 C 73.011719 91.667969 91.667969 73.011719 91.667969 50 C 91.667969 26.988281 73.011719 8.332031 50 8.332031 Z M 50 83.332031 C 33.988281 83.402344 20.191406 72.078125 17.136719 56.363281 C 14.078125 40.644531 22.628906 24.976562 37.5 19.042969 C 37.457031 19.636719 37.457031 20.238281 37.5 20.832031 C 37.5 27.738281 43.097656 33.332031 50 33.332031 C 52.300781 33.332031 54.167969 31.46875 54.167969 29.167969 C 54.167969 26.867188 52.300781 25 50 25 C 47.699219 25 45.832031 23.132812 45.832031 20.832031 C 45.832031 18.53125 47.699219 16.667969 50 16.667969 C 68.410156 16.667969 83.332031 31.589844 83.332031 50 C 83.332031 68.410156 68.410156 83.332031 50 83.332031 Z M 50 83.332031 " />')}var U=require("obsidian"),_e=Ke(ze());function He(s,t,e=!1){if(s.settings.debuggingMode&&console.log("BRAT: "+t),s.settings.loggingEnabled){if(s.settings.loggingVerboseEnabled===!1&&e===!0)return;{let n=s.settings.loggingPath+".md",i="[["+(0,U.moment)().format((0,_e.getDailyNoteSettings)().format).toString()+"]] "+(0,U.moment)().format("HH:mm"),o=U.Platform.isDesktop?window.require("os").hostname():"MOBILE",r=i+" "+o+" "+t.replace(`
`," ")+`
`;setTimeout(()=>a(this,null,function*(){if((yield s.app.vault.adapter.exists(n))===!0){let l=yield s.app.vault.adapter.read(n);r=r+l;let c=s.app.vault.getAbstractFileByPath(n);yield s.app.vault.modify(c,r)}else yield s.app.vault.create(n,r)}),10)}}}var z=class{constructor(t){this.bratCommands=[{id:"BRAT-AddBetaPlugin",icon:"BratIcon",name:"Plugins: Add a beta plugin for testing",showInRibbon:!0,callback:()=>a(this,null,function*(){yield this.plugin.betaPlugins.displayAddNewPluginModal(!1,!1)})},{id:"BRAT-AddBetaPluginWithFrozenVersion",icon:"BratIcon",name:"Plugins: Add a beta plugin with frozen version based on a release tag",showInRibbon:!0,callback:()=>a(this,null,function*(){yield this.plugin.betaPlugins.displayAddNewPluginModal(!1,!0)})},{id:"BRAT-checkForUpdatesAndUpdate",icon:"BratIcon",name:"Plugins: Check for updates to all beta plugins and UPDATE",showInRibbon:!0,callback:()=>a(this,null,function*(){yield this.plugin.betaPlugins.checkForUpdatesAndInstallUpdates(!0,!1)})},{id:"BRAT-checkForUpdatesAndDontUpdate",icon:"BratIcon",name:"Plugins: Only check for updates to beta plugins, but don't Update",showInRibbon:!0,callback:()=>a(this,null,function*(){yield this.plugin.betaPlugins.checkForUpdatesAndInstallUpdates(!0,!0)})},{id:"BRAT-updateOnePlugin",icon:"BratIcon",name:"Plugins: Choose a single plugin version to update",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=new Set(this.plugin.settings.pluginSubListFrozenVersion.map(i=>i.repo)),e=Object.values(this.plugin.settings.pluginList).filter(i=>!t.has(i)).map(i=>({display:i,info:i})),n=new S(this.plugin);n.setSuggesterData(e),yield n.display(i=>a(this,null,function*(){let o=`Checking for updates for ${i.info}`;this.plugin.log(o,!0),m(this.plugin,`
${o}`,3),yield this.plugin.betaPlugins.updatePlugin(i.info,!1,!0)}))})},{id:"BRAT-restartPlugin",icon:"BratIcon",name:"Plugins: Restart a plugin that is already installed",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=Object.values(this.plugin.app.plugins.manifests).map(n=>({display:n.id,info:n.id})),e=new S(this.plugin);e.setSuggesterData(t),yield e.display(n=>a(this,null,function*(){m(this.plugin,`${n.info}
Plugin reloading .....`,5),yield this.plugin.betaPlugins.reloadPlugin(n.info)}))})},{id:"BRAT-disablePlugin",icon:"BratIcon",name:"Plugins: Disable a plugin - toggle it off",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=this.plugin.betaPlugins.getEnabledDisabledPlugins(!0).map(n=>({display:`${n.name} (${n.id})`,info:n.id})),e=new S(this.plugin);e.setSuggesterData(t),yield e.display(n=>a(this,null,function*(){this.plugin.log(`${n.display} plugin disabled`,!1),yield this.plugin.app.plugins.disablePlugin(n.info)}))})},{id:"BRAT-enablePlugin",icon:"BratIcon",name:"Plugins: Enable a plugin - toggle it on",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=this.plugin.betaPlugins.getEnabledDisabledPlugins(!1).map(n=>({display:`${n.name} (${n.id})`,info:n.id})),e=new S(this.plugin);e.setSuggesterData(t),yield e.display(n=>a(this,null,function*(){this.plugin.log(`${n.display} plugin enabled`,!1),yield this.plugin.app.plugins.enablePlugin(n.info)}))})},{id:"BRAT-openGitHubZRepository",icon:"BratIcon",name:"Plugins: Open the GitHub repository for a plugin",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=yield me(),e=Object.values(t).map(o=>({display:`Plugin: ${o.name} (${o.repo})`,info:o.repo})),n=Object.values(this.plugin.settings.pluginList).map(o=>({display:"BRAT: "+o,info:o}));e.forEach(o=>n.push(o));let i=new S(this.plugin);i.setSuggesterData(n),yield i.display(o=>a(this,null,function*(){o.info&&window.open(`https://github.com/${o.info}`)}))})},{id:"BRAT-openGitHubRepoTheme",icon:"BratIcon",name:"Themes: Open the GitHub repository for a theme (appearance)",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=yield Y(),e=Object.values(t).map(i=>({display:`Theme: ${i.name} (${i.repo})`,info:i.repo})),n=new S(this.plugin);n.setSuggesterData(e),yield n.display(i=>a(this,null,function*(){i.info&&window.open(`https://github.com/${i.info}`)}))})},{id:"BRAT-opentPluginSettings",icon:"BratIcon",name:"Plugins: Open Plugin Settings Tab",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=this.plugin.app.setting,e=Object.values(t.pluginTabs).map(o=>({display:"Plugin: "+o.name,info:o.id})),n=new S(this.plugin),i=Object.values(t.settingTabs).map(o=>({display:"Core: "+o.name,info:o.id}));e.forEach(o=>i.push(o)),n.setSuggesterData(i),yield n.display(o=>a(this,null,function*(){t.open(),t.openTabById(o.info)}))})},{id:"BRAT-GrabCommunityTheme",icon:"BratIcon",name:"Themes: Grab a community theme",showInRibbon:!0,callback:()=>a(this,null,function*(){return yield Se(this.plugin)})},{id:"BRAT-GrabBetaTheme",icon:"BratIcon",name:"Themes: Grab a beta theme for testing from a Github repository",showInRibbon:!0,callback:()=>a(this,null,function*(){new C(this.plugin).open()})},{id:"BRAT-updateBetaThemes",icon:"BratIcon",name:"Themes: Update beta themes",showInRibbon:!0,callback:()=>a(this,null,function*(){return yield W(this.plugin,!0)})},{id:"BRAT-switchTheme",icon:"BratIcon",name:"Themes: Switch Active Theme ",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=Object.values(this.plugin.app.customCss.themes).map(n=>({display:n,info:n}));t.unshift({display:"Obsidian Default Theme",info:""});let e=new S(this.plugin);e.setSuggesterData(t),yield e.display(n=>a(this,null,function*(){this.plugin.log(`Switched to theme ${n.display}`,!1),this.plugin.app.customCss.setTheme(n.info)}))})},{id:"BRAT-allCommands",icon:"BratIcon",name:"All Commands list",showInRibbon:!1,callback:()=>a(this,null,function*(){return this.ribbonDisplayCommands()})}];this.plugin=t,this.bratCommands.forEach(e=>a(this,null,function*(){this.plugin.addCommand({id:e.id,name:e.name,icon:e.icon,callback:()=>a(this,null,function*(){yield e.callback()})})}))}ribbonDisplayCommands(){return a(this,null,function*(){let t=[];this.bratCommands.forEach(r=>{r.showInRibbon&&t.push({display:r.name,info:r.callback})});let e=new S(this.plugin),n=this.plugin.app.setting,i=Object.values(n.settingTabs).map(r=>({display:"Core: "+r.name,info:()=>a(this,null,function*(){n.open(),n.openTabById(r.id)})})),o=Object.values(n.pluginTabs).map(r=>({display:"Plugin: "+r.name,info:()=>a(this,null,function*(){n.open(),n.openTabById(r.id)})}));t.push({display:"---- Core Plugin Settings ----",info:()=>a(this,null,function*(){yield this.ribbonDisplayCommands()})}),i.forEach(r=>t.push(r)),t.push({display:"---- Plugin Settings ----",info:()=>a(this,null,function*(){yield this.ribbonDisplayCommands()})}),o.forEach(r=>t.push(r)),e.setSuggesterData(t),yield e.display(r=>a(this,null,function*(){return yield r.info()}))})}};var Z=class extends Ye.Plugin{constructor(){super(...arguments);this.appName="Obsidian42 - Beta Reviewer's Auto-update Tool (BRAT)";this.appID="obsidian42-brat"}onload(){return a(this,null,function*(){console.log("loading Obsidian42 - BRAT"),yield this.loadSettings(),this.addSettingTab(new G(this.app,this)),this.betaPlugins=new B(this),this.commands=new z(this),Ce(),this.settings.ribbonIconEnabled&&this.showRibbonButton(),this.app.workspace.onLayoutReady(()=>{this.settings.updateAtStartup&&setTimeout(()=>a(this,null,function*(){yield this.betaPlugins.checkForUpdatesAndInstallUpdates(!1)}),6e4),this.settings.updateThemesAtStartup&&setTimeout(()=>a(this,null,function*(){yield W(this,!1)}),12e4)})})}showRibbonButton(){this.ribbonIcon=this.addRibbonIcon("BratIcon","BRAT",()=>a(this,null,function*(){return this.commands.ribbonDisplayCommands()}))}log(e,n=!1){He(this,e,n)}onunload(){console.log("unloading "+this.appName)}loadSettings(){return a(this,null,function*(){this.settings=Object.assign({},pe,yield this.loadData())})}saveSettings(){return a(this,null,function*(){yield this.saveData(this.settings)})}};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vbm9kZV9tb2R1bGVzL29ic2lkaWFuLWRhaWx5LW5vdGVzLWludGVyZmFjZS9kaXN0L21haW4uanMiLCAiLi4vc3Jj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AgICBjb25zdCBub3cgPSBtb21lbnQoKTtcbiAgICAgICAgICAgIGNvbnN0IGN1cnJlbnREYXRlID0gZGF0ZS5jbG9uZSgpLnNldCh7XG4gICAgICAgICAgICAgICAgaG91cjogbm93LmdldChcImhvdXJcIiksXG4gICAgICAgICAgICAgICAgbWludXRlOiBub3cuZ2V0KFwibWludXRlXCIpLFxuICAgICAgICAgICAgICAgIHNlY29uZDogbm93LmdldChcInNlY29uZFwiKSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgaWYgKGNhbGMpIHtcbiAgICAgICAgICAgICAgICBjdXJyZW50RGF0ZS5hZGQocGFyc2VJbnQodGltZURlbHRhLCAxMCksIHVuaXQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1vbWVudEZvcm1hdCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBjdXJyZW50RGF0ZS5mb3JtYXQobW9tZW50Rm9ybWF0LnN1YnN0cmluZygxKS50cmltKCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGN1cnJlbnREYXRlLmZvcm1hdChmb3JtYXQpO1xuICAgICAgICB9KVxuICAgICAgICAgICAgLnJlcGxhY2UoL3t7XFxzKnllc3RlcmRheVxccyp9fS9naSwgZGF0ZS5jbG9uZSgpLnN1YnRyYWN0KDEsIFwiZGF5XCIpLmZvcm1hdChmb3JtYXQpKVxuICAgICAgICAgICAgLnJlcGxhY2UoL3t7XFxzKnRvbW9ycm93XFxzKn19L2dpLCBkYXRlLmNsb25lKCkuYWRkKDEsIFwiZFwiKS5mb3JtYXQoZm9ybWF0KSkpO1xuICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLWV4cGxpY2l0LWFueVxuICAgICAgICBhcHAuZm9sZE1hbmFnZXIuc2F2ZShjcmVhdGVkRmlsZSwgSUZvbGRJbmZvKTtcbiAgICAgICAgcmV0dXJuIGNyZWF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AgICAgICAgIG1pbnV0ZTogbm93LmdldChcIm1pbnV0ZVwiKSxcbiAgICAgICAgICAgICAgICBzZWNvbmQ6IG5vdy5nZXQoXCJzZWNvbmRcIiksXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGlmIChjYWxjKSB7XG4gICAgICAgICAgICAgICAgY3VycmVudERhdGUuYWRkKHBhcnNlSW50KHRpbWVEZWx0YSwgMTApLCB1bml0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtb21lbnRGb3JtYXQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY3VycmVudERhdGUuZm9ybWF0KG1vbWVudEZvcm1hdC5zdWJzdHJpbmcoMSkudHJpbSgpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBjdXJyZW50RGF0ZS5mb3JtYXQoZm9ybWF0KTtcbiAgICAgICAgfSlcbiAgICAgICAgICAgIC5yZXBsYWNlKC97e1xccyp0aXRsZVxccyp9fS9naSwgZmlsZW5hbWUpXG4gICAgICAgICAgICAucmVwbGFjZSgve3tcXHMqdGltZVxccyp9fS9naSwgd2luZG93Lm1vbWVudCgpLmZvcm1hdChcIkhIOm1tXCIpKVxuICAgICAgICAgICAgLnJlcGxhY2UoL3t7XFxzKihzdW5kYXl8bW9uZGF5fHR1ZXNkYXl8d2VkbmVzZGF5fHRodXJzZGF5fGZyaWRheXxzYXR1cmRheSlcXHMqOiguKj8pfX0vZ2ksIChfLCBkYXlPZldlZWssIG1vbWVudEZvcm1hdCkgPT4ge1xuICAgICAgICAgICAgY29uc3QgZGF5ID0gZ2V0RGF5T2ZXZWVrTnVtZXJpY2FsVmFsdWUoZGF5T2ZXZWVrKTtcbiAgICAgICAgICAgIHJldHVybiBkYXRlLndlZWtkYXkoZGF5KS5mb3JtYXQobW9tZW50Rm9ybWF0LnRyaW0oKSk7XG4gICAgICAgIH0pKTtcbiAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lI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MsIHRpbWVEZWx0YSwgdW5pdCwgbW9tZW50Rm9ybWF0KSA9PiB7XG4gICAgICAgICAgICBjb25zdCBub3cgPSB3aW5kb3cubW9tZW50KCk7XG4gICAgICAgICAgICBjb25zdCBjdXJyZW50RGF0ZSA9IGRhdGUuY2xvbmUoKS5zZXQoe1xuICAgICAgICAgICAgICAgIGhvdXI6IG5vdy5nZXQoXCJob3VyXCIpLFxuICAgICAgICAgICAgICAgIG1pbnV0ZTogbm93LmdldChcIm1pbnV0ZVwiKSxcbiAgICAgICAgICAgICAgICBzZWNvbmQ6IG5vdy5nZXQoXCJzZWNvbmRcIiksXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGlmIChjYWxjKSB7XG4gICAgICAgICAgICAgICAgY3VycmVudERhdGUuYWRkKHBhcnNlSW50KHRpbWVEZWx0YSwgMTApLCB1bml0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtb21lbnRGb3JtYXQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY3VycmVudERhdGUuZm9ybWF0KG1vbWVudEZvcm1hdC5zdWJzdHJpbmcoMSkudHJpbSgpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBjdXJyZW50RGF0ZS5mb3JtYXQoZm9ybWF0KTtcbiAgICAgICAgfSlcbiAgICAgICAgICAgIC5yZXBsYWNlKC97e1xccypkYXRlXFxzKn19L2dpLCBmaWxlbmFtZSlcbiAgICAgICAgICAgIC5yZXBsYWNlKC97e1xccyp0aW1lXFxzKn19L2dpLCB3aW5kb3cubW9tZW50KCkuZm9ybWF0KFwiSEg6bW1cIikpXG4gICAgICAgICAgICAucmVwbGFjZSgve3tcXHMqdGl0bGVcXHMqfX0vZ2ksIGZpbGVuYW1lKSk7XG4gICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55XG4gICAgICAgIHdpbmRv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5ncygpO1xuICAgIGNvbnN0IFt0ZW1wbGF0ZUNvbnRlbnRzLCBJRm9sZEluZm9dID0gYXdhaXQgZ2V0VGVtcGxhdGVJbmZvKHRlbXBsYXRlKTtcbiAgICBjb25zdCBmaWxlbmFtZSA9IGRhdGUuZm9ybWF0KGZvcm1hdCk7XG4gICAgY29uc3Qgbm9ybWFsaXplZFBhdGggPSBhd2FpdCBnZXROb3RlUGF0aChmb2xkZXIsIGZpbGVuYW1lKTtcbiAgICB0cnkge1xuICAgICAgICBjb25zdCBjcmVhdGVkRmlsZSA9IGF3YWl0IHZhdWx0LmNyZWF0ZShub3JtYWxpemVkUGF0aCwgdGVtcGxhdGVDb250ZW50c1xuICAgICAgICAgICAgLnJlcGxhY2UoL3t7XFxzKihkYXRlfHRpbWUpXFxzKigoWystXVxcZCspKFt5cW13ZGhzXSkpP1xccyooOi4rPyk/fX0vZ2ksIChfLCBfdGltZU9yRGF0ZSwgY2FsYywgdGltZURlbHRhLCB1bml0LCBtb21lbnRGb3JtYXQpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IG5vdyA9IHdpbmRvdy5tb21lbnQoKTtcbiAgICAgICAgICAgIGNvbnN0IGN1cnJlbnREYXRlID0gZGF0ZS5jbG9uZSgpLnNldCh7XG4gICAgICAgICAgICAgICAgaG91cjogbm93LmdldChcImhvdXJcIiksXG4gICAgICAgICAgICAgICAgbWludXRlOiBub3cuZ2V0KFwibWludXRlXCIpLFxuICAgICAgICAgICAgICAgIHNlY29uZDogbm93LmdldChcInNlY29uZFwiKSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgaWYgKGNhbGMpIHtcbiAgICAgICAgICAgICAgICBjdXJyZW50RGF0ZS5hZGQocGFyc2VJbnQodGltZURlbHRhLCAxMCksIHVuaXQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1vbWVudEZvcm1hdCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBjdXJyZW50RGF0ZS5mb3JtYX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HtcclxuICAgICAgICAgICAgICAgICAgICB0ZXh0RWwuc2V0UGxhY2Vob2xkZXIoJ1JlcG9zaXRvcnkgKGV4YW1wbGU6IEdpdHViVXNlck5hbWUvcmVwb3NpdG9yeS1uYW1lJyk7XHJcbiAgICAgICAgICAgICAgICAgICAgdGV4dEVsLm9uQ2hhbmdlKCh2YWx1ZSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmFkZHJlc3MgPSB2YWx1ZS50cmltKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgdGV4dEVsLmlucHV0RWwuYWRkRXZlbnRMaXN0ZW5lcigna2V5ZG93bicsIGFzeW5jIChlOiBLZXlib2FyZEV2ZW50KSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLmtleSA9PT0gJ0VudGVyJyAmJiB0aGlzLmFkZHJlc3MgIT09ICcgJykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5zdWJtaXRGb3JtKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICB0ZXh0RWwuaW5wdXRFbC5zdHlsZS53aWR0aCA9IFwiMTAwJVwiO1xyXG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5zZXRUaW1lb3V0KCgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdGl0bGUgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKFwiLnNldHRpbmctaXRlbS1pbmZvXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodGl0bGUpIHRpdGxlLnJlbW92ZSgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0RWwuaW5wdXRFbC5mb2N1cygpXHJcbiAgICAgICAgICAgICAgICAgICAgfSwgMTApO1xyXG4gICAgICAgICAgICAgICAgfSk7XHJcblxyXG4gICAgICAgICAgICBmb3JtRWwuY3JlYXRlRGl2KCdtb2RhbC1idXR0b24tY29udGFpbmVyJywgKGJ1dHRvbkNvbnRhaW5lckVsKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBidXR0b25Db250YWluZXJFbFxyXG4gICAgICAgICAgICAgICAgICAgIC5jcmVhdGVFbCgnYnV0dG9uJywgeyBhdHRyOiB7IHR5cGU6ICdidXR0b24nIH0sIHRleHQ6ICdOZXZlciBtaW5kJyB9KVxyXG4gICAgICAgICAgICAgICAgICAgIC5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsICgpID0+IHRoaXMuY2xvc2UoKSk7XHJcbiAgICAgICAgICAgICAgICBidXR0b25Db250YWluZXJFbC5jcmVhdGVFbCgnYnV0dG9uJywge1xyXG4gICAgICAgICAgICAgICAgICAgIGF0dHI6IHsgdHlwZTogJ3N1Ym1pdCcgfSxcclxuICAgICAgICAgICAgICAgICAgICBjbHM6ICdtb2QtY3RhJyxcclxuICAgICAgICAgICAgICAgICAgICB0ZXh0OiAnQWRkIFRoZW1lJyxcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgICAgIC8vIGludm9rZWQgd2hlbiBidXR0b24gaXMgY2xpY2tlZC4gXHJcbiAgICAgICAgICAgIGZvcm1FbC5hZGRFdmVudExpc3RlbmVyKCdzdWJtaXQnLCBhc3luYyAoZTogRXZlbnQpID0+IHtcclxuICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLmFkZHJlc3MgIT09ICcnKSBhd2FpdCB0aGlzLnN1Ym1pdEZvcm0oKTtcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcblxyXG4gICAg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ICAgICBpZiAoZS5rZXkgPT09ICdFbnRlcicgJiYgdGhpcy5hZGRyZXNzICE9PSAnICcpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodGhpcy51c2VGcm96ZW5WZXJzaW9uICYmIHRoaXMudmVyc2lvbiAhPT0gXCJcIikgXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKCF0aGlzLnVzZUZyb3plblZlcnNpb24pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5zdWJtaXRGb3JtKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICB0ZXh0RWwuaW5wdXRFbC5zdHlsZS53aWR0aCA9IFwiMTAwJVwiO1xyXG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5zZXRUaW1lb3V0KCgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdGl0bGUgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKFwiLnNldHRpbmctaXRlbS1pbmZvXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodGl0bGUpIHRpdGxlLnJlbW92ZSgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0RWwuaW5wdXRFbC5mb2N1cygpXHJcbiAgICAgICAgICAgICAgICAgICAgfSwgMTApO1xyXG4gICAgICAgICAgICAgICAgfSk7XHJcblxyXG4gICAgICAgICAgICBpZiAodGhpcy51c2VGcm96ZW5WZXJzaW9uKSB7XHJcbiAgICAgICAgICAgICAgICBuZXcgU2V0dGluZyhmb3JtRWwpXHJcbiAgICAgICAgICAgICAgICAgICAgLmFkZFRleHQoKHRleHRFbCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0RWwuc2V0UGxhY2Vob2xkZXIoJ1NwZWNpZnkgdGhlIHJlbGVhc2UgdmVyc2lvbiB0YWcgKGV4YW1wbGU6IDEuMC4wKScpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0RWwub25DaGFuZ2UoKHZhbHVlKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnZlcnNpb24gPSB2YWx1ZS50cmltKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0RWwuaW5wdXRFbC5zdHlsZS53aWR0aCA9IFwiMTAwJVwiO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cuc2V0VGltZW91dCgoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0aXRsZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoXCIuc2V0dGluZy1pdGVtLWluZm9cIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGl0bGUpIHRpdGxlLnJlbW92ZSgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCAxMCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIGZvcm1FbC5jcmVhdGVEaXYoJ21vZGFsLWJ1dHRvbi1jb250YWluZXInLCAoYnV0dG9uQ29udGFpbmVyRWwpID0+IHtcclxuICAgICAgICAgICAgICAgIGJ1dHRvbkNvbnRhaW5lckVsXHJcbiAgICAgICAgICAgICAgICAgICAgLmNyZWF0ZUVsKCdidXR0b24nLCB7IGF0dHI6IHsgdHlwZTogJ2J1dHRvbicgfSwgdGV4dDogJ05ldmVyIG1pbmQnIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJywgKCkgPT4gdGhpcy5jbG9zZSgpKTtcclxuICAgICAgICAgICAgICAgIGJ1dHRvbkNvbnRhaW5lckVsLmNyZWF0ZUVsKCdidXR0b24nLCB7XHJcbiAgICAgICAgICAgICAgICAgICAgYXR0cjogeyB0eXBlOiAnc3VibWl0JyB9LFxyXG4gICAgICAgICAgICAgICAgICAgIGNsczogJ21vZC1jdGEnLFxyXG4gICAgICAgICAgICAgICAgICAgIHRleHQ6ICdBZGQgUGx1Z2luJyxcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgICAgIC8vIGludm9rZWQgd2hlbiBidXR0b24gaXMgY2xpY2tlZC4gXHJcbiAgICAgICAgICAgIGZvcm1FbC5hZGRFdmVudExpc3RlbmVyKCdzdWJtaXQnLCBhc3luYyAoZTogRXZlbnQpID0+IHtcclxuICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLmFkZHJlc3MgIT09ICcnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAodGhpcy51c2VGcm96ZW5WZXJzaW9uICYmIHRoaXMudmVyc2lvbiAhPT0gXCJcIikgXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHx8ICghdGhpcy51c2VGcm96ZW5WZXJzaW9uKVxyXG4gICAgICAgICAgICAgICAgICAgICkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLnN1Ym1pdEZvcm0oKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgXHJ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pbmZvfWA7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wbHVnaW4ubG9nKG1zZyx0cnVlKTtcclxuICAgICAgICAgICAgICAgICAgICBUb2FzdE1lc3NhZ2UodGhpcy5wbHVnaW4sIGBcXG4ke21zZ31gLCAzKTtcclxuICAgICAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLnBsdWdpbi5iZXRhUGx1Z2lucy51cGRhdGVQbHVnaW4ocmVzdWx0cy5pbmZvLCBmYWxzZSwgdHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0sXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBpZDogXCJCUkFULXJlc3RhcnRQbHVnaW5cIixcclxuICAgICAgICAgICAgaWNvbjogXCJCcmF0SWNvblwiLFxyXG4gICAgICAgICAgICBuYW1lOiBcIlBsdWdpbnM6IFJlc3RhcnQgYSBwbHVnaW4gdGhhdCBpcyBhbHJlYWR5IGluc3RhbGxlZFwiLFxyXG4gICAgICAgICAgICBzaG93SW5SaWJib246IHRydWUsXHJcbiAgICAgICAgICAgIGNhbGxiYWNrOiBhc3luYyAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAvLyBAdHMtaWdub3JlXHJcbiAgICAgICAgICAgICAgICBjb25zdCBwbHVnaW5MaXN0OiBTdWdnZXN0ZXJJdGVtW10gPSBPYmplY3QudmFsdWVzKHRoaXMucGx1Z2luLmFwcC5wbHVnaW5zLm1hbmlmZXN0cykubWFwKChtKSA9PiB7IHJldHVybiB7IGRpc3BsYXk6IG0uaWQsIGluZm86IG0uaWQgfSB9KTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGdmcyA9IG5ldyBHZW5lcmljRnV6enlTdWdnZXN0ZXIodGhpcy5wbHVnaW4pO1xyXG4gICAgICAgICAgICAgICAgZ2ZzLnNldFN1Z2dlc3RlckRhdGEocGx1Z2luTGlzdCk7XHJcbiAgICAgICAgICAgICAgICBh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ICAgICAgICAgICAgICAgIGF3YWl0IGdmcy5kaXNwbGF5KGFzeW5jIChyZXN1bHRzKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wbHVnaW4ubG9nKGAke3Jlc3VsdHMuZGlzcGxheX0gcGx1Z2luIGVuYWJsZWRgLCBmYWxzZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gQHRzLWlnbm9yZVxyXG4gICAgICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMucGx1Z2luLmFwcC5wbHVnaW5zLmVuYWJsZVBsdWdpbihyZXN1bHRzLmluZm8pO1xyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9LFxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgaWQ6IFwiQlJBVC1vcGVuR2l0SHViWlJlcG9zaXRvcnlcIixcclxuICAgICAgICAgICAgaWNvbjogXCJCcmF0SWNvblwiLFxyXG4gICAgICAgICAgICBuYW1lOiBcIlBsdWdpbnM6IE9wZW4gdGhlIEdpdEh1YiByZXBvc2l0b3J5IGZvciBhIHBsdWdpblwiLFxyXG4gICAgICAgICAgICBzaG93SW5SaWJib246IHRydWUsXHJcbiAgICAgICAgICAgIGNhbGxiYWNrOiBhc3luYyAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBjb21tdW5pdHlQbHVnaW5zID0gYXdhaXQgZ3JhYkNvbW1tdW5pdHlQbHVnaW5MaXN0KCk7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBjb21tdW5pdHlQbHVnaW5MaXN0OiBTdWdnZXN0ZXJJdGVtW10gPSBPYmplY3QudmFsdWVzKGNvbW11bml0eVBsdWdpbnMpLm1hcCgocCkgPT4geyByZXR1cm4geyBkaXNwbGF5OiBgUGx1Z2luOiAke3AubmFtZX0gICgke3AucmVwb30pYCwgaW5mbzogcC5yZXBvIH0gfSk7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBicmF0TGlzdDog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hlbWVzTGlzdCgpO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgY29tbXVuaXR5VGhlbWVMaXN0OiBTdWdnZXN0ZXJJdGVtW10gPSBPYmplY3QudmFsdWVzKGNvbW11bml0eVRoZW1lKS5tYXAoKHApID0+IHsgcmV0dXJuIHsgZGlzcGxheTogYFRoZW1lOiAke3AubmFtZX0gICgke3AucmVwb30pYCwgaW5mbzogcC5yZXBvIH0gfSk7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBnZnMgPSBuZXcgR2VuZXJpY0Z1enp5U3VnZ2VzdGVyKHRoaXMucGx1Z2luKTtcclxuICAgICAgICAgICAgICAgIGdmcy5zZXRTdWdnZXN0ZXJEYXRhKGNvbW11bml0eVRoZW1lTGlzdCk7XHJcbiAgICAgICAgICAgICAgICBhd2FpdCBnZnMuZGlzcGxheShhc3luYyAocmVzdWx0cykgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHRzLmluZm8pIHdpbmRvdy5vcGVuKGBodHRwczovL2dpdGh1Yi5jb20vJHtyZXN1bHRzLmluZm99YClcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSxcclxuICAgICAgICB7XHJcbiAgICAgICAgICAgIGlkOiBcIkJSQVQtb3BlbnRQbHVnaW5TZXR0aW5nc1wiLFxyXG4gICAgICAgICAgICBpY29uOiBcIkJyYXRJY29uXCIsXHJcbiAgICAgICAgICAgIG5hbWU6IFwiUGx1Z2luczogT3BlbiBQbHVnaW4gU2V0dGluZ3MgVGFiXCIsXHJcbiAgICAgICAgICAgIHNob3dJblJpYmJvbjogdHJ1ZSxcclxuICAgICAgICAgICAgY2FsbGJhY2s6IGFzeW5jICgpID0+IHtcclxuICAgICAgICAgICAgICAgIC8vIEB0cy1pZ25vcmVcclxuICAgICAgICAgICAgICAgIGNvbnN0IHNldHRpbmdzID0gdGhpcy5wbHVnaW4uYXBwLnNldHRpbmc7XHJcbiAgIC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4gICAgICAgIH0sXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBpZDogXCJCUkFULUdyYWJDb21tdW5pdHlUaGVtZVwiLFxyXG4gICAgICAgICAgICBpY29uOiBcIkJyYXRJY29uXCIsXHJcbiAgICAgICAgICAgIG5hbWU6IFwiVGhlbWVzOiBHcmFiIGEgY29tbXVuaXR5IHRoZW1lXCIsXHJcbiAgICAgICAgICAgIHNob3dJblJpYmJvbjogdHJ1ZSxcclxuICAgICAgICAgICAgY2FsbGJhY2s6IGFzeW5jICgpID0+IGF3YWl0IHRoZW1lc0luc3RhbGxGcm9tQ29tbXVuaXR5TGlzdCh0aGlzLnBsdWdpbilcclxuICAgICAgICB9LFxyXG4gICAgICAgIHtcclxuICAgICAgICAgICAgaWQ6IFwiQlJBVC1HcmFiQmV0YVRoZW1lXCIsXHJcbiAgICAgICAgICAgIGljb246IFwiQnJhdEljb25cIixcclxuICAgICAgICAgICAgbmFtZTogXCJUaGVtZXM6IEdyYWIgYSBiZXRhIHRoZW1lIGZvciB0ZXN0aW5nIGZyb20gYSBHaXRodWIgcmVwb3NpdG9yeVwiLFxyXG4gICAgICAgICAgICBzaG93SW5SaWJib246IHRydWUsXHJcbiAgICAgICAgICAgIGNhbGxiYWNrOiBhc3luYyAoKSA9PiB7IChuZXcgQWRkTmV3VGhlbWUodGhpcy5wbHVnaW4pKS5vcGVuKCkgfVxyXG4gICAgICAgIH0sXHJcbiAgICAgICAge1xyXG4gICAgICAgICAgICBpZDogXCJCUkFULXVwZGF0ZUJldGFUaGVtZXNcIixcclxuICAgICAgICAgICAgaWNvbjogXCJCcmF0SWNvblwiLFxyXG4gICAgICAgICAgICBuYW1lOiBcIlRoZW1lczogVXBkYXRlIGJldGEgdGhlbWVzXCIsXHJcbiAgICAgICAgICAgIHNob3dJblJpYmJvbjogdHJ1ZSxcclxuICAgICAgICAgICAgY2FsbGJhY2s6IGFzeW5jICgpID0+IGF3YWl0IHRoZW1lc2VDaGVja0FuZFVwZGF0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NvbnN0IGxpc3RPZkNvcmVTZXR0aW5nc1RhYnM6IFN1Z2dlc3Rlckl0ZW1bXSA9IE9iamVjdC52YWx1ZXMoc2V0dGluZ3Muc2V0dGluZ1RhYnMpLm1hcCgodDogYW55KSA9PiB7XHJcbiAgICAgICAgICAgIHJldHVybiB7XHJcbiAgICAgICAgICAgICAgICBkaXNwbGF5OiBcIkNvcmU6IFwiICsgdC5uYW1lLFxyXG4gICAgICAgICAgICAgICAgaW5mbzogYXN5bmMgKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIHNldHRpbmdzLm9wZW4oKTtcclxuICAgICAgICAgICAgICAgICAgICBzZXR0aW5ncy5vcGVuVGFiQnlJZCh0LmlkKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIC8vIEB0cy1pZ25vcmVcclxuICAgICAgICBjb25zdCBsaXN0T2ZQbHVnaW5TZXR0aW5nc1RhYnM6IFN1Z2dlc3Rlckl0ZW1bXSA9IE9iamVjdC52YWx1ZXMoc2V0dGluZ3MucGx1Z2luVGFicykubWFwKCh0OiBhbnkpID0+IHtcclxuICAgICAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgICAgIGRpc3BsYXk6IFwiUGx1Z2luOiBcIiArIHQubmFtZSxcclxuICAgICAgICAgICAgICAgIGluZm86IGFzeW5jICgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICBzZXR0aW5ncy5vcGVuKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgc2V0dGluZ3Mub3BlblRhYkJ5SWQodC5pZCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgYnJhdENvbW1hbmRMaXN0LnB1c2goeyBkaXNwbGF5OiBcIi0tLS0gQ29yZSBQbHVnaW4gU2V0dGluZ3MgLS0tLVwiLCBpbmZvOiBhc3luYyAoKSA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