/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source visit the plugins github repository (https://github.com/Vinzent03/obsidian-advanced-uri)
*/
var ze=Object.create;var Z=Object.defineProperty;var De=Object.getOwnPropertyDescriptor;var He=Object.getOwnPropertyNames;var Ne=Object.getPrototypeOf,We=Object.prototype.hasOwnProperty;var Be=(s,n)=>()=>(n||s((n={exports:{}}).exports,n),n.exports),$e=(s,n)=>{for(var e in n)Z(s,e,{get:n[e],enumerable:!0})},ge=(s,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of He(n))!We.call(s,i)&&i!==e&&Z(s,i,{get:()=>n[i],enumerable:!(t=De(n,i))||t.enumerable});return s};var Ke=(s,n,e)=>(e=s!=null?ze(Ne(s)):{},ge(n||!s||!s.__esModule?Z(e,"default",{value:s,enumerable:!0}):e,s)),Ge=s=>ge(Z({},"__esModule",{value:!0}),s);var xe=Be((N,se)=>{(function(n,e){typeof N=="object"&&typeof se=="object"?se.exports=e():typeof define=="function"&&define.amd?define([],e):typeof N=="object"?N.feather=e():n.feather=e()})(typeof self!="undefined"?self:N,function(){return function(s){var n={};function e(t){if(n[t])return n[t].exports;var i=n[t]={i:t,l:!1,exports:{}};return s[t].call(i.exports,i,i.exports,e),i.l=!0,i.exports}return e.m=s,e.c=n,e.d=function(t,i,o){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:o})},e.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},e.p="",e(e.s=0)}({"./dist/icons.json":function(s){s.exports={activity:'',airplay:'',"alert-circle":'',"alert-octagon":'',"alert-triangle":'',"align-center":'',"align-justify":'',"align-left":'',"align-right":'',anchor:'',aperture:'',archive:'',"arrow-down-circle":'',"arrow-down-left":'',"arrow-down-right":'',"arrow-down":'',"arrow-left-circle":'',"arrow-left":'',"arrow-right-circle":'',"arrow-right":'',"arrow-up-circle":'',"arrow-up-left":'',"arrow-up-right":'',"arrow-up":'',"at-sign":'',award:'',"bar-chart-2":'',"bar-chart":'',"battery-charging":'',battery:'',"bell-off":'',bell:'',bluetooth:'',bold:'',"book-open":'',book:'',bookmark:'',box:'',briefcase:'',calendar:'',"camera-off":'',camera:'',cast:'',"check-circle":'',"check-square":'',check:'',"chevron-down":'',"chevron-left":'',"chevron-right":'',"chevron-up":'',"chevrons-down":'',"chevrons-left":'',"chevrons-right":'',"chevrons-up":'',chrome:'',circle:'',clipboard:'',clock:'',"cloud-drizzle":'',"cloud-lightning":'',"cloud-off":'',"cloud-rain":'',"cloud-snow":'',cloud:'',code:'',codepen:'',codesandbox:'',coffee:'',columns:'',command:'',compass:'',copy:'',"corner-down-left":'',"corner-down-right":'',"corner-left-down":'',"corner-left-up":'',"corner-right-down":'',"corner-right-up":'',"corner-up-left":'',"corner-up-right":'',cpu:'',"credit-card":'',crop:'',crosshair:'',database:'',delete:'',disc:'',"divide-circle":'',"divide-square":'',divide:'',"dollar-sign":'',"download-cloud":'',download:'',dribbble:'',droplet:'',"edit-2":'',"edit-3":'',edit:'',"external-link":'',"eye-off":'',eye:'',facebook:'',"fast-forward":'',feather:'',figma:'',"file-minus":'',"file-plus":'',"file-text":'',file:'',film:'',filter:'',flag:'',"folder-minus":'',"folder-plus":'',folder:'',framer:'',frown:'',gift:'',"git-branch":'',"git-commit":'',"git-merge":'',"git-pull-request":'',github:'',gitlab:'',globe:'',grid:'',"hard-drive":'',hash:'',headphones:'',heart:'',"help-circle":'',hexagon:'',home:'',image:'',inbox:'',info:'',instagram:'',italic:'',key:'',layers:'',layout:'',"life-buoy":'',"link-2":'',link:'',linkedin:'',list:'',loader:'',lock:'',"log-in":'',"log-out":'',mail:'',"map-pin":'',map:'',"maximize-2":'',maximize:'',meh:'',menu:'',"message-circle":'',"message-square":'',"mic-off":'',mic:'',"minimize-2":'',minimize:'',"minus-circle":'',"minus-square":'',minus:'',monitor:'',moon:'',"more-horizontal":'',"more-vertical":'',"mouse-pointer":'',move:'',music:'',"navigation-2":'',navigation:'',octagon:'',package:'',paperclip:'',"pause-circle":'',pause:'',"pen-tool":'',percent:'',"phone-call":'',"phone-forwarded":'',"phone-incoming":'',"phone-missed":'',"phone-off":'',"phone-outgoing":'',phone:'',"pie-chart":'',"play-circle":'',play:'',"plus-circle":'',"plus-square":'',plus:'',pocket:'',power:'',printer:'',radio:'',"refresh-ccw":'',"refresh-cw":'',repeat:'',rewind:'',"rotate-ccw":'',"rotate-cw":'',rss:'',save:'',scissors:'',search:'',send:'',server:'',settings:'',"share-2":'',share:'',"shield-off":'',shield:'',"shopping-bag":'',"shopping-cart":'',shuffle:'',sidebar:'',"skip-back":'',"skip-forward":'',slack:'',slash:'',sliders:'',smartphone:'',smile:'',speaker:'',square:'',star:'',"stop-circle":'',sun:'',sunrise:'',sunset:'',table:'',tablet:'',tag:'',target:'',terminal:'',thermometer:'',"thumbs-down":'',"thumbs-up":'',"toggle-left":'',"toggle-right":'',tool:'',"trash-2":'',trash:'',trello:'',"trending-down":'',"trending-up":'',triangle:'',truck:'',tv:'',twitch:'',twitter:'',type:'',umbrella:'',underline:'',unlock:'',"upload-cloud":'',upload:'',"user-check":'',"user-minus":'',"user-plus":'',"user-x":'',user:'',users:'',"video-off":'',video:'',voicemail:'',"volume-1":'',"volume-2":'',"volume-x":'',volume:'',watch:'',"wifi-off":'',wifi:'',wind:'',"x-circle":'',"x-octagon":'',"x-square":'',x:'',youtube:'',"zap-off":'',zap:'',"zoom-in":'',"zoom-out":''}},"./node_modules/classnames/dedupe.js":function(s,n,e){var t,i;(function(){"use strict";var o=function(){function a(){}a.prototype=Object.create(null);function l(y,f){for(var x=f.length,m=0;m1?arguments[1]:void 0,f=y!==void 0,x=0,m=c(h),M,j,b,I;if(f&&(y=t(y,g>2?arguments[2]:void 0,2)),m!=null&&!(u==Array&&a(m)))for(I=m.call(h),j=new u;!(b=I.next()).done;x++)r(j,x,f?o(I,y,[b.value,x],!0):b.value);else for(M=l(h.length),j=new u(M);M>x;x++)r(j,x,f?y(h[x],x):h[x]);return j.length=x,j}},"./node_modules/core-js/internals/array-includes.js":function(s,n,e){var t=e("./node_modules/core-js/internals/to-indexed-object.js"),i=e("./node_modules/core-js/internals/to-length.js"),o=e("./node_modules/core-js/internals/to-absolute-index.js");s.exports=function(a){return function(l,r,c){var d=t(l),p=i(d.length),h=o(c,p),u;if(a&&r!=r){for(;p>h;)if(u=d[h++],u!=u)return!0}else for(;p>h;h++)if((a||h in d)&&d[h]===r)return a||h||0;return!a&&-1}}},"./node_modules/core-js/internals/bind-context.js":function(s,n,e){var t=e("./node_modules/core-js/internals/a-function.js");s.exports=function(i,o,a){if(t(i),o===void 0)return i;switch(a){case 0:return function(){return i.call(o)};case 1:return function(l){return i.call(o,l)};case 2:return function(l,r){return i.call(o,l,r)};case 3:return function(l,r,c){return i.call(o,l,r,c)}}return function(){return i.apply(o,arguments)}}},"./node_modules/core-js/internals/call-with-safe-iteration-closing.js":function(s,n,e){var t=e("./node_modules/core-js/internals/an-object.js");s.exports=function(i,o,a,l){try{return l?o(t(a)[0],a[1]):o(a)}catch(c){var r=i.return;throw r!==void 0&&t(r.call(i)),c}}},"./node_modules/core-js/internals/check-correctness-of-iteration.js":function(s,n,e){var t=e("./node_modules/core-js/internals/well-known-symbol.js"),i=t("iterator"),o=!1;try{var a=0,l={next:function(){return{done:!!a++}},return:function(){o=!0}};l[i]=function(){return this},Array.from(l,function(){throw 2})}catch(r){}s.exports=function(r,c){if(!c&&!o)return!1;var d=!1;try{var p={};p[i]=function(){return{next:function(){return{done:d=!0}}}},r(p)}catch(h){}return d}},"./node_modules/core-js/internals/classof-raw.js":function(s,n){var e={}.toString;s.exports=function(t){return e.call(t).slice(8,-1)}},"./node_modules/core-js/internals/classof.js":function(s,n,e){var t=e("./node_modules/core-js/internals/classof-raw.js"),i=e("./node_modules/core-js/internals/well-known-symbol.js"),o=i("toStringTag"),a=t(function(){return arguments}())=="Arguments",l=function(r,c){try{return r[c]}catch(d){}};s.exports=function(r){var c,d,p;return r===void 0?"Undefined":r===null?"Null":typeof(d=l(c=Object(r),o))=="string"?d:a?t(c):(p=t(c))=="Object"&&typeof c.callee=="function"?"Arguments":p}},"./node_modules/core-js/internals/copy-constructor-properties.js":function(s,n,e){var t=e("./node_modules/core-js/internals/has.js"),i=e("./node_modules/core-js/internals/own-keys.js"),o=e("./node_modules/core-js/internals/object-get-own-property-descriptor.js"),a=e("./node_modules/core-js/internals/object-define-property.js");s.exports=function(l,r){for(var c=i(r),d=a.f,p=o.f,h=0;h",M="java"+x+":",j;for(g.style.display="none",l.appendChild(g),g.src=String(M),j=g.contentWindow.document,j.open(),j.write(f+x+m+"document.F=Object"+f+"/"+x+m),j.close(),u=j.F;y--;)delete u[p][o[y]];return u()};s.exports=Object.create||function(y,f){var x;return y!==null?(h[p]=t(y),x=new h,h[p]=null,x[d]=y):x=u(),f===void 0?x:i(x,f)},a[d]=!0},"./node_modules/core-js/internals/object-define-properties.js":function(s,n,e){var t=e("./node_modules/core-js/internals/descriptors.js"),i=e("./node_modules/core-js/internals/object-define-property.js"),o=e("./node_modules/core-js/internals/an-object.js"),a=e("./node_modules/core-js/internals/object-keys.js");s.exports=t?Object.defineProperties:function(r,c){o(r);for(var d=a(c),p=d.length,h=0,u;p>h;)i.f(r,u=d[h++],c[u]);return r}},"./node_modules/core-js/internals/object-define-property.js":function(s,n,e){var t=e("./node_modules/core-js/internals/descriptors.js"),i=e("./node_modules/core-js/internals/ie8-dom-define.js"),o=e("./node_modules/core-js/internals/an-object.js"),a=e("./node_modules/core-js/internals/to-primitive.js"),l=Object.defineProperty;n.f=t?l:function(c,d,p){if(o(c),d=a(d,!0),o(p),i)try{return l(c,d,p)}catch(h){}if("get"in p||"set"in p)throw TypeError("Accessors not supported");return"value"in p&&(c[d]=p.value),c}},"./node_modules/core-js/internals/object-get-own-property-descriptor.js":function(s,n,e){var t=e("./node_modules/core-js/internals/descriptors.js"),i=e("./node_modules/core-js/internals/object-property-is-enumerable.js"),o=e("./node_modules/core-js/internals/create-property-descriptor.js"),a=e("./node_modules/core-js/internals/to-indexed-object.js"),l=e("./node_modules/core-js/internals/to-primitive.js"),r=e("./node_modules/core-js/internals/has.js"),c=e("./node_modules/core-js/internals/ie8-dom-define.js"),d=Object.getOwnPropertyDescriptor;n.f=t?d:function(h,u){if(h=a(h),u=l(u,!0),c)try{return d(h,u)}catch(g){}if(r(h,u))return o(!i.f.call(h,u),h[u])}},"./node_modules/core-js/internals/object-get-own-property-names.js":function(s,n,e){var t=e("./node_modules/core-js/internals/object-keys-internal.js"),i=e("./node_modules/core-js/internals/enum-bug-keys.js"),o=i.concat("length","prototype");n.f=Object.getOwnPropertyNames||function(l){return t(l,o)}},"./node_modules/core-js/internals/object-get-own-property-symbols.js":function(s,n){n.f=Object.getOwnPropertySymbols},"./node_modules/core-js/internals/object-get-prototype-of.js":function(s,n,e){var t=e("./node_modules/core-js/internals/has.js"),i=e("./node_modules/core-js/internals/to-object.js"),o=e("./node_modules/core-js/internals/shared-key.js"),a=e("./node_modules/core-js/internals/correct-prototype-getter.js"),l=o("IE_PROTO"),r=Object.prototype;s.exports=a?Object.getPrototypeOf:function(c){return c=i(c),t(c,l)?c[l]:typeof c.constructor=="function"&&c instanceof c.constructor?c.constructor.prototype:c instanceof Object?r:null}},"./node_modules/core-js/internals/object-keys-internal.js":function(s,n,e){var t=e("./node_modules/core-js/internals/has.js"),i=e("./node_modules/core-js/internals/to-indexed-object.js"),o=e("./node_modules/core-js/internals/array-includes.js"),a=e("./node_modules/core-js/internals/hidden-keys.js"),l=o(!1);s.exports=function(r,c){var d=i(r),p=0,h=[],u;for(u in d)!t(a,u)&&t(d,u)&&h.push(u);for(;c.length>p;)t(d,u=c[p++])&&(~l(h,u)||h.push(u));return h}},"./node_modules/core-js/internals/object-keys.js":function(s,n,e){var t=e("./node_modules/core-js/internals/object-keys-internal.js"),i=e("./node_modules/core-js/internals/enum-bug-keys.js");s.exports=Object.keys||function(a){return t(a,i)}},"./node_modules/core-js/internals/object-property-is-enumerable.js":function(s,n,e){"use strict";var t={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!t.call({1:2},1);n.f=o?function(l){var r=i(this,l);return!!r&&r.enumerable}:t},"./node_modules/core-js/internals/object-set-prototype-of.js":function(s,n,e){var t=e("./node_modules/core-js/internals/validate-set-prototype-of-arguments.js");s.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var i=!1,o={},a;try{a=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,a.call(o,[]),i=o instanceof Array}catch(l){}return function(r,c){return t(r,c),i?a.call(r,c):r.__proto__=c,r}}():void 0)},"./node_modules/core-js/internals/own-keys.js":function(s,n,e){var t=e("./node_modules/core-js/internals/global.js"),i=e("./node_modules/core-js/internals/object-get-own-property-names.js"),o=e("./node_modules/core-js/internals/object-get-own-property-symbols.js"),a=e("./node_modules/core-js/internals/an-object.js"),l=t.Reflect;s.exports=l&&l.ownKeys||function(c){var d=i.f(a(c)),p=o.f;return p?d.concat(p(c)):d}},"./node_modules/core-js/internals/path.js":function(s,n,e){s.exports=e("./node_modules/core-js/internals/global.js")},"./node_modules/core-js/internals/redefine.js":function(s,n,e){var t=e("./node_modules/core-js/internals/global.js"),i=e("./node_modules/core-js/internals/shared.js"),o=e("./node_modules/core-js/internals/hide.js"),a=e("./node_modules/core-js/internals/has.js"),l=e("./node_modules/core-js/internals/set-global.js"),r=e("./node_modules/core-js/internals/function-to-string.js"),c=e("./node_modules/core-js/internals/internal-state.js"),d=c.get,p=c.enforce,h=String(r).split("toString");i("inspectSource",function(u){return r.call(u)}),(s.exports=function(u,g,y,f){var x=f?!!f.unsafe:!1,m=f?!!f.enumerable:!1,M=f?!!f.noTargetGet:!1;if(typeof y=="function"&&(typeof g=="string"&&!a(y,"name")&&o(y,"name",g),p(y).source=h.join(typeof g=="string"?g:"")),u===t){m?u[g]=y:l(g,y);return}else x?!M&&u[g]&&(m=!0):delete u[g];m?u[g]=y:o(u,g,y)})(Function.prototype,"toString",function(){return typeof this=="function"&&d(this).source||r.call(this)})},"./node_modules/core-js/internals/require-object-coercible.js":function(s,n){s.exports=function(e){if(e==null)throw TypeError("Can't call method on "+e);return e}},"./node_modules/core-js/internals/set-global.js":function(s,n,e){var t=e("./node_modules/core-js/internals/global.js"),i=e("./node_modules/core-js/internals/hide.js");s.exports=function(o,a){try{i(t,o,a)}catch(l){t[o]=a}return a}},"./node_modules/core-js/internals/set-to-string-tag.js":function(s,n,e){var t=e("./node_modules/core-js/internals/object-define-property.js").f,i=e("./node_modules/core-js/internals/has.js"),o=e("./node_modules/core-js/internals/well-known-symbol.js"),a=o("toStringTag");s.exports=function(l,r,c){l&&!i(l=c?l:l.prototype,a)&&t(l,a,{configurable:!0,value:r})}},"./node_modules/core-js/internals/shared-key.js":function(s,n,e){var t=e("./node_modules/core-js/internals/shared.js"),i=e("./node_modules/core-js/internals/uid.js"),o=t("keys");s.exports=function(a){return o[a]||(o[a]=i(a))}},"./node_modules/core-js/internals/shared.js":function(s,n,e){var t=e("./node_modules/core-js/internals/global.js"),i=e("./node_modules/core-js/internals/set-global.js"),o=e("./node_modules/core-js/internals/is-pure.js"),a="__core-js_shared__",l=t[a]||i(a,{});(s.exports=function(r,c){return l[r]||(l[r]=c!==void 0?c:{})})("versions",[]).push({version:"3.1.3",mode:o?"pure":"global",copyright:"\xA9 2019 Denis Pushkarev (zloirock.ru)"})},"./node_modules/core-js/internals/string-at.js":function(s,n,e){var t=e("./node_modules/core-js/internals/to-integer.js"),i=e("./node_modules/core-js/internals/require-object-coercible.js");s.exports=function(o,a,l){var r=String(i(o)),c=t(a),d=r.length,p,h;return c<0||c>=d?l?"":void 0:(p=r.charCodeAt(c),p<55296||p>56319||c+1===d||(h=r.charCodeAt(c+1))<56320||h>57343?l?r.charAt(c):p:l?r.slice(c,c+2):(p-55296<<10)+(h-56320)+65536)}},"./node_modules/core-js/internals/to-absolute-index.js":function(s,n,e){var t=e("./node_modules/core-js/internals/to-integer.js"),i=Math.max,o=Math.min;s.exports=function(a,l){var r=t(a);return r<0?i(r+l,0):o(r,l)}},"./node_modules/core-js/internals/to-indexed-object.js":function(s,n,e){var t=e("./node_modules/core-js/internals/indexed-object.js"),i=e("./node_modules/core-js/internals/require-object-coercible.js");s.exports=function(o){return t(i(o))}},"./node_modules/core-js/internals/to-integer.js":function(s,n){var e=Math.ceil,t=Math.floor;s.exports=function(i){return isNaN(i=+i)?0:(i>0?t:e)(i)}},"./node_modules/core-js/internals/to-length.js":function(s,n,e){var t=e("./node_modules/core-js/internals/to-integer.js"),i=Math.min;s.exports=function(o){return o>0?i(t(o),9007199254740991):0}},"./node_modules/core-js/internals/to-object.js":function(s,n,e){var t=e("./node_modules/core-js/internals/require-object-coercible.js");s.exports=function(i){return Object(t(i))}},"./node_modules/core-js/internals/to-primitive.js":function(s,n,e){var t=e("./node_modules/core-js/internals/is-object.js");s.exports=function(i,o){if(!t(i))return i;var a,l;if(o&&typeof(a=i.toString)=="function"&&!t(l=a.call(i))||typeof(a=i.valueOf)=="function"&&!t(l=a.call(i))||!o&&typeof(a=i.toString)=="function"&&!t(l=a.call(i)))return l;throw TypeError("Can't convert object to primitive value")}},"./node_modules/core-js/internals/uid.js":function(s,n){var e=0,t=Math.random();s.exports=function(i){return"Symbol(".concat(i===void 0?"":i,")_",(++e+t).toString(36))}},"./node_modules/core-js/internals/validate-set-prototype-of-arguments.js":function(s,n,e){var t=e("./node_modules/core-js/internals/is-object.js"),i=e("./node_modules/core-js/internals/an-object.js");s.exports=function(o,a){if(i(o),!t(a)&&a!==null)throw TypeError("Can't set "+String(a)+" as a prototype")}},"./node_modules/core-js/internals/well-known-symbol.js":function(s,n,e){var t=e("./node_modules/core-js/internals/global.js"),i=e("./node_modules/core-js/internals/shared.js"),o=e("./node_modules/core-js/internals/uid.js"),a=e("./node_modules/core-js/internals/native-symbol.js"),l=t.Symbol,r=i("wks");s.exports=function(c){return r[c]||(r[c]=a&&l[c]||(a?l:o)("Symbol."+c))}},"./node_modules/core-js/modules/es.array.from.js":function(s,n,e){var t=e("./node_modules/core-js/internals/export.js"),i=e("./node_modules/core-js/internals/array-from.js"),o=e("./node_modules/core-js/internals/check-correctness-of-iteration.js"),a=!o(function(l){Array.from(l)});t({target:"Array",stat:!0,forced:a},{from:i})},"./node_modules/core-js/modules/es.string.iterator.js":function(s,n,e){"use strict";var t=e("./node_modules/core-js/internals/string-at.js"),i=e("./node_modules/core-js/internals/internal-state.js"),o=e("./node_modules/core-js/internals/define-iterator.js"),a="String Iterator",l=i.set,r=i.getterFor(a);o(String,"String",function(c){l(this,{type:a,string:String(c),index:0})},function(){var d=r(this),p=d.string,h=d.index,u;return h>=p.length?{value:void 0,done:!0}:(u=t(p,h,!0),d.index+=u.length,{value:u,done:!1})})},"./node_modules/webpack/buildin/global.js":function(s,n){var e;e=function(){return this}();try{e=e||Function("return this")()||(0,eval)("this")}catch(t){typeof window=="object"&&(e=window)}s.exports=e},"./src/default-attrs.json":function(s){s.exports={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"}},"./src/icon.js":function(s,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=Object.assign||function(u){for(var g=1;g2&&arguments[2]!==void 0?arguments[2]:[];d(this,u),this.name=g,this.contents=y,this.tags=f,this.attrs=t({},r.default,{class:"feather feather-"+g})}return i(u,[{key:"toSvg",value:function(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},f=t({},this.attrs,y,{class:(0,a.default)(this.attrs.class,y.class)});return""}},{key:"toString",value:function(){return this.contents}}]),u}();function h(u){return Object.keys(u).map(function(g){return g+'="'+u[g]+'"'}).join(" ")}n.default=p},"./src/icons.js":function(s,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=e("./src/icon.js"),i=c(t),o=e("./dist/icons.json"),a=c(o),l=e("./src/tags.json"),r=c(l);function c(d){return d&&d.__esModule?d:{default:d}}n.default=Object.keys(a.default).map(function(d){return new i.default(d,a.default[d],r.default[d])}).reduce(function(d,p){return d[p.name]=p,d},{})},"./src/index.js":function(s,n,e){"use strict";var t=e("./src/icons.js"),i=c(t),o=e("./src/to-svg.js"),a=c(o),l=e("./src/replace.js"),r=c(l);function c(d){return d&&d.__esModule?d:{default:d}}s.exports={icons:i.default,toSvg:a.default,replace:r.default}},"./src/replace.js":function(s,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=Object.assign||function(h){for(var u=1;u0&&arguments[0]!==void 0?arguments[0]:{};if(typeof document=="undefined")throw new Error("`feather.replace()` only works in a browser environment.");var u=document.querySelectorAll("[data-feather]");Array.from(u).forEach(function(g){return d(g,h)})}function d(h){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=p(h),y=g["data-feather"];if(delete g["data-feather"],l.default[y]===void 0){console.warn("feather: '"+y+"' is not a valid icon");return}var f=l.default[y].toSvg(t({},u,g,{class:(0,o.default)(u.class,g.class)})),x=new DOMParser().parseFromString(f,"image/svg+xml"),m=x.querySelector("svg");h.parentNode.replaceChild(m,h)}function p(h){return Array.from(h.attributes).reduce(function(u,g){return u[g.name]=g.value,u},{})}n.default=c},"./src/tags.json":function(s){s.exports={activity:["pulse","health","action","motion"],airplay:["stream","cast","mirroring"],"alert-circle":["warning","alert","danger"],"alert-octagon":["warning","alert","danger"],"alert-triangle":["warning","alert","danger"],"align-center":["text alignment","center"],"align-justify":["text alignment","justified"],"align-left":["text alignment","left"],"align-right":["text alignment","right"],anchor:[],archive:["index","box"],"at-sign":["mention","at","email","message"],award:["achievement","badge"],aperture:["camera","photo"],"bar-chart":["statistics","diagram","graph"],"bar-chart-2":["statistics","diagram","graph"],battery:["power","electricity"],"battery-charging":["power","electricity"],bell:["alarm","notification","sound"],"bell-off":["alarm","notification","silent"],bluetooth:["wireless"],"book-open":["read","library"],book:["read","dictionary","booklet","magazine","library"],bookmark:["read","clip","marker","tag"],box:["cube"],briefcase:["work","bag","baggage","folder"],calendar:["date"],camera:["photo"],cast:["chromecast","airplay"],"chevron-down":["expand"],"chevron-up":["collapse"],circle:["off","zero","record"],clipboard:["copy"],clock:["time","watch","alarm"],"cloud-drizzle":["weather","shower"],"cloud-lightning":["weather","bolt"],"cloud-rain":["weather"],"cloud-snow":["weather","blizzard"],cloud:["weather"],codepen:["logo"],codesandbox:["logo"],code:["source","programming"],coffee:["drink","cup","mug","tea","cafe","hot","beverage"],columns:["layout"],command:["keyboard","cmd","terminal","prompt"],compass:["navigation","safari","travel","direction"],copy:["clone","duplicate"],"corner-down-left":["arrow","return"],"corner-down-right":["arrow"],"corner-left-down":["arrow"],"corner-left-up":["arrow"],"corner-right-down":["arrow"],"corner-right-up":["arrow"],"corner-up-left":["arrow"],"corner-up-right":["arrow"],cpu:["processor","technology"],"credit-card":["purchase","payment","cc"],crop:["photo","image"],crosshair:["aim","target"],database:["storage","memory"],delete:["remove"],disc:["album","cd","dvd","music"],"dollar-sign":["currency","money","payment"],droplet:["water"],edit:["pencil","change"],"edit-2":["pencil","change"],"edit-3":["pencil","change"],eye:["view","watch"],"eye-off":["view","watch","hide","hidden"],"external-link":["outbound"],facebook:["logo","social"],"fast-forward":["music"],figma:["logo","design","tool"],"file-minus":["delete","remove","erase"],"file-plus":["add","create","new"],"file-text":["data","txt","pdf"],film:["movie","video"],filter:["funnel","hopper"],flag:["report"],"folder-minus":["directory"],"folder-plus":["directory"],folder:["directory"],framer:["logo","design","tool"],frown:["emoji","face","bad","sad","emotion"],gift:["present","box","birthday","party"],"git-branch":["code","version control"],"git-commit":["code","version control"],"git-merge":["code","version control"],"git-pull-request":["code","version control"],github:["logo","version control"],gitlab:["logo","version control"],globe:["world","browser","language","translate"],"hard-drive":["computer","server","memory","data"],hash:["hashtag","number","pound"],headphones:["music","audio","sound"],heart:["like","love","emotion"],"help-circle":["question mark"],hexagon:["shape","node.js","logo"],home:["house","living"],image:["picture"],inbox:["email"],instagram:["logo","camera"],key:["password","login","authentication","secure"],layers:["stack"],layout:["window","webpage"],"life-buoy":["help","life ring","support"],link:["chain","url"],"link-2":["chain","url"],linkedin:["logo","social media"],list:["options"],lock:["security","password","secure"],"log-in":["sign in","arrow","enter"],"log-out":["sign out","arrow","exit"],mail:["email","message"],"map-pin":["location","navigation","travel","marker"],map:["location","navigation","travel"],maximize:["fullscreen"],"maximize-2":["fullscreen","arrows","expand"],meh:["emoji","face","neutral","emotion"],menu:["bars","navigation","hamburger"],"message-circle":["comment","chat"],"message-square":["comment","chat"],"mic-off":["record","sound","mute"],mic:["record","sound","listen"],minimize:["exit fullscreen","close"],"minimize-2":["exit fullscreen","arrows","close"],minus:["subtract"],monitor:["tv","screen","display"],moon:["dark","night"],"more-horizontal":["ellipsis"],"more-vertical":["ellipsis"],"mouse-pointer":["arrow","cursor"],move:["arrows"],music:["note"],navigation:["location","travel"],"navigation-2":["location","travel"],octagon:["stop"],package:["box","container"],paperclip:["attachment"],pause:["music","stop"],"pause-circle":["music","audio","stop"],"pen-tool":["vector","drawing"],percent:["discount"],"phone-call":["ring"],"phone-forwarded":["call"],"phone-incoming":["call"],"phone-missed":["call"],"phone-off":["call","mute"],"phone-outgoing":["call"],phone:["call"],play:["music","start"],"pie-chart":["statistics","diagram"],"play-circle":["music","start"],plus:["add","new"],"plus-circle":["add","new"],"plus-square":["add","new"],pocket:["logo","save"],power:["on","off"],printer:["fax","office","device"],radio:["signal"],"refresh-cw":["synchronise","arrows"],"refresh-ccw":["arrows"],repeat:["loop","arrows"],rewind:["music"],"rotate-ccw":["arrow"],"rotate-cw":["arrow"],rss:["feed","subscribe"],save:["floppy disk"],scissors:["cut"],search:["find","magnifier","magnifying glass"],send:["message","mail","email","paper airplane","paper aeroplane"],settings:["cog","edit","gear","preferences"],"share-2":["network","connections"],shield:["security","secure"],"shield-off":["security","insecure"],"shopping-bag":["ecommerce","cart","purchase","store"],"shopping-cart":["ecommerce","cart","purchase","store"],shuffle:["music"],"skip-back":["music"],"skip-forward":["music"],slack:["logo"],slash:["ban","no"],sliders:["settings","controls"],smartphone:["cellphone","device"],smile:["emoji","face","happy","good","emotion"],speaker:["audio","music"],star:["bookmark","favorite","like"],"stop-circle":["media","music"],sun:["brightness","weather","light"],sunrise:["weather","time","morning","day"],sunset:["weather","time","evening","night"],tablet:["device"],tag:["label"],target:["logo","bullseye"],terminal:["code","command line","prompt"],thermometer:["temperature","celsius","fahrenheit","weather"],"thumbs-down":["dislike","bad","emotion"],"thumbs-up":["like","good","emotion"],"toggle-left":["on","off","switch"],"toggle-right":["on","off","switch"],tool:["settings","spanner"],trash:["garbage","delete","remove","bin"],"trash-2":["garbage","delete","remove","bin"],triangle:["delta"],truck:["delivery","van","shipping","transport","lorry"],tv:["television","stream"],twitch:["logo"],twitter:["logo","social"],type:["text"],umbrella:["rain","weather"],unlock:["security"],"user-check":["followed","subscribed"],"user-minus":["delete","remove","unfollow","unsubscribe"],"user-plus":["new","add","create","follow","subscribe"],"user-x":["delete","remove","unfollow","unsubscribe","unavailable"],user:["person","account"],users:["group"],"video-off":["camera","movie","film"],video:["camera","movie","film"],voicemail:["phone"],volume:["music","sound","mute"],"volume-1":["music","sound"],"volume-2":["music","sound"],"volume-x":["music","sound","mute"],watch:["clock","time"],"wifi-off":["disabled"],wifi:["connection","signal","wireless"],wind:["weather","air"],"x-circle":["cancel","close","delete","remove","times","clear"],"x-octagon":["delete","stop","alert","warning","times","clear"],"x-square":["cancel","close","delete","remove","times","clear"],x:["cancel","close","delete","remove","times","clear"],youtube:["logo","video","play"],"zap-off":["flash","camera","lightning"],zap:["flash","camera","lightning"],"zoom-in":["magnifying glass"],"zoom-out":["magnifying glass"]}},"./src/to-svg.js":function(s,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=e("./src/icons.js"),i=o(t);function o(l){return l&&l.__esModule?l:{default:l}}function a(l){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(console.warn("feather.toSvg() is deprecated. Please use feather.icons[name].toSvg() instead."),!l)throw new Error("The required `key` (icon name) parameter is missing.");if(!i.default[l])throw new Error("No icon matching '"+l+"'. See the complete list of icons at https://feathericons.com");return i.default[l].toSvg(r)}n.default=a},0:function(s,n,e){e("./node_modules/core-js/es/array/from.js"),s.exports=e("./src/index.js")}})})});var et={};$e(et,{default:()=>ae});module.exports=Ge(et);var w=require("obsidian");var Ye=Ke(xe()),O=require("obsidian");var W=s=>s.match(/\.MD$|\.md$/m)?s.split(/\.MD$|\.md$/m).slice(0,-1).join(".md"):s;var me=require("obsidian"),B=class s{static getBlock(n,e,t){var c,d;let i=e.getCursor("to"),o=n.metadataCache.getFileCache(t),a=o==null?void 0:o.sections;if(!a||a.length===0){console.log("error reading FileCache (empty file?)");return}let l=a.findIndex(p=>p.position.start.line>i.line),r=l>0?a[l-1]:a[a.length-1];return(r==null?void 0:r.type)=="list"&&(r=(d=(c=o.listItems)==null?void 0:c.find(p=>p.position.start.line<=i.line&&p.position.end.line>=i.line))!=null?d:r),r}static getIdOfBlock(n,e){let t=e.id;if(t)return t;let i=e.position.end,o={ch:i.col,line:i.line},a=Math.random().toString(36).substring(2,8),l=s.shouldInsertAfter(e)?`
`:" ";return n.replaceRange(`${l}^${a}`,o),a}static shouldInsertAfter(n){if(n.type)return["blockquote","code","table","heading","comment","footnoteDefinition"].includes(n.type)}static getBlockId(n){let e=n.workspace.getActiveViewOfType(me.MarkdownView);if(e){let t=e.editor,i=e.file,o=this.getBlock(n,t,i);if(o)return this.getIdOfBlock(t,o)}}};var ve={openFileOnWrite:!0,openDailyInNewPane:!1,openFileOnWriteInNewPane:!1,openFileWithoutWriteInNewPane:!1,idField:"id",useUID:!1,addFilepathWhenUsingUID:!1,allowEval:!1,includeVaultName:!0,vaultParam:"name",linkFormats:[{name:"Markdown",format:"[{{name}}]({{uri}})"}]};var we=require("obsidian");function je(s){let n=s.internalPlugins.plugins["daily-notes"];if(n&&n.enabled)return!0}function Ze(...s){let n=[];for(let t=0,i=s.length;t{this.file?this.plugin.tools.copyURI({filepath:this.file,data:e,mode:i},this.withFormat,this.app.vault.getFileByPath(this.file)):this.plugin.tools.copyURI({daily:"true",data:e,mode:i},this.withFormat,void 0)}})}return t}renderSuggestion(e,t){t.innerText=e.display}onChooseSuggestion(e,t){e.func()}};var Ie=require("obsidian"),R=class extends Ie.FuzzySuggestModal{constructor(e,t,i=!0){super(e.app);this.placeHolder=t;this.allowNoFile=i;this.plugin=e,this.setPlaceholder(this.placeHolder)}getItems(){let e=[];this.allowNoFile&&e.push({display:"",source:void 0});let t=this.app.workspace.getActiveFile();return t&&e.push({display:"",source:t.path}),[...e,...this.app.vault.getFiles().map(i=>({display:i.path,source:i.path}))]}getItemText(e){return e.display}onChooseItem(e,t){}};var Ae=require("obsidian");function re(s){return s.viewmode?{state:{mode:s.viewmode,source:s.viewmode=="source"}}:void 0}function D(s){return navigator.clipboard.writeText(s)}function J(s,n){var o;let e=(o=n.parent)==null?void 0:o.path,t=e==="/"?"":e,i=n.name;for(let a=1;a<100;a++){let l=W(i),r=t+(t==""?"":"/")+l+` ${a}.md`;if(!(s.vault.getAbstractFileByPath(r)!==null))return r}}function Fe(s,n){let e=new URL(s.vault.getResourcePath(n));return e.host="localhosthostlocal",e.protocol="file",e.search="",e.pathname=decodeURIComponent(e.pathname),e.toString().replace("/localhosthostlocal/","/")}function ce(s,n,e){var a,l;let t=s.metadataCache.getFileCache(n),i=t.sections,o=(a=t.headings)==null?void 0:a.find(r=>r.heading===e);if(o){let r=i.findIndex(u=>u.type==="heading"&&u.position.start.line===o.position.start.line),c=i.slice(r+1),d=c==null?void 0:c.findIndex(u=>u.type==="heading");return{lastLine:((l=c[(d!==-1?d:c.length)-1])!=null?l:i[r]).position.end.line+1,firstLine:i[r].position.end.line+1}}else new Ae.Notice("Can't find heading")}var z=class extends Error{constructor(e,t,i){super(e);this.name="KeyPathError",this.errKey=t,i&&(this.cause=i)}};function Pe(s){let{originalObject:n,key:e,data:t}=s;if(e.startsWith("[")&&e.endsWith("]")){let i=e.substring(1,e.length-1).split(","),o=n;for(let a=0;ap==l)),r===void 0)throw new z(`Failed to resolve or convert "${l}" to a valid array index.`,l);r=Math.min(r,o.length),r=Math.max(r,-1)}if(a==i.length-1){o instanceof Array?r===-1?o.unshift(t):o[r]=t:o[l]=t;return}let d=!Number.isNaN(parseInt(i[a+1]))?[]:{};try{o instanceof Array?r>=o.length?(o.push(d),o=d):r===-1?(o.unshift(d),o=d):o=o[Math.max(r,0)]:o[l]===void 0?(o[l]=d,o=d):o=o[l]}catch(p){throw new z(`Failed to resolve "${l}" as a valid object key`,l,p)}}}else n[e]=t}function Ce(s){let{obj:n,key:e}=s;if(e.startsWith("[")&&e.endsWith("]")){let t=e.substring(1,e.length-1).split(","),i=n;for(let o of t)if(i instanceof Array){let a=parseInt(o);Number.isNaN(a)?i=i.find(l=>l==o):i=i[a]}else if(i&&typeof i=="object")i=i[o];else return;return i}else return n?n[e]:void 0}var $=class{constructor(n){this.plugin=n;this.app=this.plugin.app}get tools(){return this.plugin.tools}handlePluginManagement(n){if(n["enable-plugin"]){let e=n["enable-plugin"];e in this.app.plugins.manifests&&!this.app.plugins.getPlugin(e)?(this.app.plugins.enablePluginAndSave(e),new v.Notice(`Enabled ${e}`)):this.app.internalPlugins.plugins[e]&&(this.app.internalPlugins.plugins[e].enable(!0),new v.Notice(`Enabled ${e}`))}else if(n["disable-plugin"]){let e=n["disable-plugin"];this.app.plugins.getPlugin(e)?(this.app.plugins.disablePluginAndSave(e),new v.Notice(`Disabled ${e}`)):this.app.internalPlugins.plugins[e]&&(this.app.internalPlugins.plugins[e].disable(!0),new v.Notice(`Disabled ${e}`))}}handleFrontmatterKey(n){var o;let e=n.frontmatterkey,t=this.app.vault.getAbstractFileByPath((o=n.filepath)!=null?o:this.app.workspace.getActiveFile().path);if(!(t instanceof v.TFile))return;let i=this.app.metadataCache.getFileCache(t).frontmatter;if(n.data){let a=n.data;try{a=JSON.parse(a)}catch(l){try{a=`"${a}"`,a=JSON.parse(a)}catch(r){new v.Notice("Failed to parse data, check console for more details"),console.error(r);return}}this.app.fileManager.processFrontMatter(t,l=>{try{Pe({originalObject:l,key:e,data:a})}catch(r){console.error(r),r instanceof z?new v.Notice(`Invalid key in path.
${r.message}`):new v.Notice("Failed to update frontmatter, check console for more details")}});return}D(Ce({obj:i,key:e}))}handleWorkspace(n){let e=this.app.internalPlugins.getEnabledPluginById("workspaces");if(!e)new v.Notice("Workspaces plugin is not enabled"),this.plugin.failure(n);else{if(n.saveworkspace=="true"){let t=e.activeWorkspace;e.saveWorkspace(t),new v.Notice(`Saved current workspace to ${t}`)}n.clipboard&&n.clipboard!="false"?this.tools.copyURI({workspace:e.activeWorkspace}):n.workspace!=null&&e.loadWorkspace(n.workspace),this.plugin.success(n)}}async handleCommand(n){if(n.filepath)if(n.mode){if(n.mode=="new"){let t=this.app.metadataCache.getFirstLinkpathDest(n.filepath,"/");t instanceof v.TFile&&(n.filepath=J(this.app,t))}await this.plugin.open({file:n.filepath,mode:"source",parameters:n});let e=this.app.workspace.getActiveViewOfType(v.MarkdownView);if(e){let t=e.editor,i=t.getValue();if(n.mode==="append"){t.setValue(i+`
`);let o=t.lineCount();t.setCursor({ch:0,line:o})}else n.mode==="prepend"?(t.setValue(`
`+i),t.setCursor({ch:0,line:0})):n.mode==="overwrite"&&t.setValue("")}}else n.line!=null||n.column!=null||n.offset!=null?(await this.plugin.open({file:n.filepath,mode:"source",parameters:n}),await this.plugin.setCursorInLine(n)):await this.plugin.open({file:n.filepath,setting:this.plugin.settings.openFileWithoutWriteInNewPane,parameters:n});else(n.openmode||n.viewmode)&&await this.plugin.open({parameters:n});if(n.commandid)this.app.commands.executeCommandById(n.commandid);else if(n.commandname){let e=this.app.commands.commands;for(let t in e)if(e[t].name===n.commandname){e[t].callback?await e[t].callback():e[t].checkCallback(!1);break}}if(n.confirm&&n.confirm!="false"){await new Promise(t=>setTimeout(t,750));let e=document.querySelector(".mod-cta:not([style*='display: none'])");e.click instanceof Function&&e.click()}this.plugin.success(n),await new Promise(e=>setTimeout(e,4e3))}async handleEval(n){if(n.filepath)if(n.mode){if(n.mode=="new"){let t=this.app.metadataCache.getFirstLinkpathDest(n.filepath,"/");t instanceof v.TFile&&(n.filepath=J(this.app,t))}await this.plugin.open({file:n.filepath,mode:"source",parameters:n});let e=this.app.workspace.getActiveViewOfType(v.MarkdownView);if(e){let t=e.editor,i=t.getValue();if(n.mode==="append"){t.setValue(i+`
`);let o=t.lineCount();t.setCursor({ch:0,line:o})}else n.mode==="prepend"?(t.setValue(`
`+i),t.setCursor({ch:0,line:0})):n.mode==="overwrite"&&t.setValue("")}}else n.line!=null||n.column!=null||n.offset!=null?(await this.plugin.open({file:n.filepath,mode:"source",parameters:n}),await this.plugin.setCursorInLine(n)):await this.plugin.open({file:n.filepath,setting:this.plugin.settings.openFileWithoutWriteInNewPane,parameters:n});this.plugin.settings.allowEval?((0,eval)(n.eval),this.plugin.success(n)):(new v.Notice("Eval is not allowed. Please enable it in the settings."),this.plugin.failure(n))}async handleDoesFileExist(n){let e=await this.app.vault.adapter.exists(n.filepath);D((e?1:0).toString()),this.plugin.success(n)}async handleSearchAndReplace(n){let e;if(n.filepath){let t=this.app.vault.getAbstractFileByPath(n.filepath);t instanceof v.TFile&&(e=t)}else e=this.app.workspace.getActiveFile();if(e){let t=await this.app.vault.read(e);if(n.searchregex)try{let[,,i,o]=n.searchregex.match(/(\/?)(.+)\1([a-z]*)/i),a=new RegExp(i,o);t=t.replace(a,n.replace),this.plugin.success(n)}catch(i){new v.Notice(`Can't parse ${n.searchregex} as RegEx`),this.plugin.failure(n)}else t=t.replaceAll(n.search,n.replace),this.plugin.success(n);await this.plugin.writeAndOpenFile(e.path,t,n)}else new v.Notice("Cannot find file"),this.plugin.failure(n)}async handleSearch(n){n.filepath&&await this.plugin.open({file:n.filepath,parameters:n});let e=this.app.workspace.getActiveViewOfType(v.FileView);e.currentMode.showSearch();let t=e.currentMode.search;t.searchInputEl.value=n.search,t.searchInputEl.dispatchEvent(new Event("input"))}async handleWrite(n,e=!1){var i;let t;if(n.filepath?t=this.app.vault.getAbstractFileByPath(n.filepath):t=this.app.workspace.getActiveFile(),n.filepath||t){let o,a=(i=n.filepath)!=null?i:t.path;n.mode==="overwrite"?(o=await this.plugin.writeAndOpenFile(a,n.data,n),this.plugin.success(n)):n.mode==="prepend"?(t instanceof v.TFile?o=await this.plugin.prepend(t,n):o=await this.plugin.prepend(a,n),this.plugin.success(n)):n.mode==="append"?(t instanceof v.TFile?o=await this.plugin.append(t,n):o=await this.plugin.append(a,n),this.plugin.success(n)):n.mode==="new"?t instanceof v.TFile?(o=await this.plugin.writeAndOpenFile(J(this.app,t),n.data,n),this.plugin.hookSuccess(n,o)):(o=await this.plugin.writeAndOpenFile(a,n.data,n),this.plugin.hookSuccess(n,o)):!e&&t instanceof v.TFile?(new v.Notice("File already exists"),this.plugin.openExistingFileAndSetCursor(t.path,n),this.plugin.failure(n)):(o=await this.plugin.writeAndOpenFile(a,n.data,n),this.plugin.success(n)),n.uid&&this.tools.writeUIDToFile(o,n.uid)}else new v.Notice("Cannot find file"),this.plugin.failure(n)}async handleOpen(n){if(n.heading!=null){await this.plugin.open({file:n.filepath+"#"+n.heading,setting:this.plugin.settings.openFileWithoutWriteInNewPane,parameters:n});let e=this.app.workspace.getActiveViewOfType(v.MarkdownView);if(!e)return;let i=this.app.metadataCache.getFileCache(e.file).headings.find(o=>o.heading===n.heading);e.editor.focus(),e.editor.setCursor({line:i.position.start.line+1,ch:0})}else if(n.block!=null){await this.plugin.open({file:n.filepath+"#^"+n.block,setting:this.plugin.settings.openFileWithoutWriteInNewPane,parameters:n});let e=this.app.workspace.getActiveViewOfType(v.MarkdownView);if(!e)return;let i=this.app.metadataCache.getFileCache(e.file).blocks[n.block.toLowerCase()];e.editor.focus(),i&&e.editor.setCursor({line:i.position.start.line,ch:0})}else await this.plugin.open({file:n.filepath,setting:this.plugin.settings.openFileWithoutWriteInNewPane,parameters:n}),(n.line!=null||n.column!=null||n.offset!=null)&&await this.plugin.setCursorInLine(n);if(n.mode!=null&&await this.plugin.setCursor(n),n.uid){let e=this.app.workspace.getActiveViewOfType(v.MarkdownView);this.tools.writeUIDToFile(e.file,n.uid)}this.plugin.success(n)}async handleOpenBlock(n){let e=this.tools.getFileFromBlockID(n.block);e&&await this.plugin.chooseHandler({...n,filepath:e.path},!1)}handleCopyFileURI(n,e,t){let i=this.app.workspace.getActiveViewOfType(v.FileView);if(!(!i&&!t)){if(t=t!=null?t:i.file,i instanceof v.MarkdownView){let o=i.editor.getCursor(),a=this.app.metadataCache.getFileCache(i.file);if(a.headings){for(let l of a.headings)if(l.position.start.line<=o.line&&l.position.end.line>=o.line){this.tools.copyURI({filepath:i.file.path,heading:l.heading},e,t);return}}if(a.blocks)for(let l of Object.keys(a.blocks)){let r=a.blocks[l];if(r.position.start.line<=o.line&&r.position.end.line>=o.line){this.tools.copyURI({filepath:i.file.path,block:r.id},e,t);return}}}if(n){let o=t!=null?t:this.app.workspace.getActiveFile();if(!o){new v.Notice("No file opened");return}this.tools.copyURI({filepath:o.path},e,t)}else{let o=new R(this.plugin,"Choose a file",!1);o.open(),o.onChooseItem=(a,l)=>{new U(this.plugin,e,a.source).open()}}}}handleOpenSettings(n){if(this.app.setting.containerEl.parentElement===null&&this.app.setting.open(),n.settingid=="plugin-browser"?(this.app.setting.openTabById("community-plugins"),this.app.setting.activeTab.containerEl.find(".mod-cta").click()):n.settingid=="theme-browser"?(this.app.setting.openTabById("appearance"),this.app.setting.activeTab.containerEl.find(".mod-cta").click()):this.app.setting.openTabById(n.settingid),n.settingsection){let e=this.app.setting.tabContentContainer.querySelectorAll("*"),t=Array.prototype.find.call(e,i=>i.textContent==n.settingsection);t&&t.scrollIntoView()}this.plugin.success(n)}async handleUpdatePlugins(n){new v.Notice("Checking for updates\u2026"),await this.app.plugins.checkForUpdates(),Object.keys(this.app.plugins.updates).length>0&&(n.settingid="community-plugins",this.handleOpenSettings(n),this.app.setting.activeTab.containerEl.findAll(".mod-cta").last().click()),this.plugin.success(n)}async handleBookmarks(n){let e=this.app.internalPlugins.getEnabledPluginById("bookmarks"),i=e.getBookmarks().find(a=>a.title==n.bookmark),o;n.openmode=="true"||n.openmode=="false"?o=n.openmode=="true":o=n.openmode,e.openBookmark(i,o)}async handleCanvas(n){n.filepath&&await this.plugin.open({file:n.filepath,setting:this.plugin.settings.openFileWithoutWriteInNewPane,parameters:n});let e=this.app.workspace.activeLeaf.view;if(e.getViewType()!="canvas"){new v.Notice("Active view is not a canvas");return}let t=e;if(n.canvasnodes){let i=n.canvasnodes.split(","),o=t.canvas.nodes,a=i.map(r=>o.get(r)),l=t.canvas.selection;t.canvas.updateSelection(()=>{for(let r of a)l.add(r)}),t.canvas.zoomToSelection()}if(n.canvasviewport){let[i,o,a]=n.canvasviewport.split(",");if(i!="-")if(i.startsWith("--")||i.startsWith("++")){let l=t.canvas.tx+Number(i.substring(1));t.canvas.tx=l}else t.canvas.tx=Number(i);if(o!="-")if(o.startsWith("--")||o.startsWith("++")){let l=t.canvas.ty+Number(o.substring(1));t.canvas.ty=l}else t.canvas.ty=Number(o);if(a!="-")if(a.startsWith("--")||a.startsWith("++")){let l=t.canvas.tZoom+Number(a.substring(1));t.canvas.tZoom=l}else t.canvas.tZoom=Number(a);t.canvas.markViewportChanged()}}};var Se=require("obsidian"),Q=class extends Se.FuzzySuggestModal{constructor(e,t){super(e.app);this.plugin=e,this.file=t}getItems(){let e=this.app.commands.commands;return Object.keys(e).map(i=>({id:e[i].id,name:e[i].name}))}getItemText(e){return e.name}onChooseItem(e,t){this.plugin.tools.copyURI({filepath:this.file,commandid:e.id})}};var ke=require("obsidian"),X=class extends ke.SuggestModal{constructor(e,t,i){super(e.app);this.search=t;this.filepath=i;this.emptyText="Empty text (replace with nothing)";this.plugin=e,this.setPlaceholder("Replacement text")}getSuggestions(e){return e===""&&(e=this.emptyText),[e]}renderSuggestion(e,t){t.innerText=e}onChooseSuggestion(e,t){this.search.isRegEx?this.plugin.tools.copyURI({filepath:this.filepath,searchregex:this.search.source,replace:e==this.emptyText?"":e}):this.plugin.tools.copyURI({filepath:this.filepath,search:this.search.source,replace:e==this.emptyText?"":e})}};var Oe=require("obsidian"),q=class extends Oe.SuggestModal{constructor(e){super(e.app);this.plugin=e,this.setPlaceholder("Searched text. RegEx is supported")}getSuggestions(e){e===""&&(e="...");let t;try{t=new RegExp(e)}catch(i){}return[{source:e,isRegEx:!1,display:e},{source:e,display:t?`As RegEx: ${e}`:"Can't parse RegEx",isRegEx:!0}]}renderSuggestion(e,t){t.innerText=e.display}onChooseSuggestion(e,t){}};var A=require("obsidian"),_=class extends A.PluginSettingTab{constructor(e,t){super(e,t);this.plugin=t}display(){let{containerEl:e}=this;e.empty(),e.createEl("h2",{text:this.plugin.manifest.name}),new A.Setting(e).setName("Open file on write").addToggle(o=>o.setValue(this.plugin.settings.openFileOnWrite).onChange(a=>{this.plugin.settings.openFileOnWrite=a,this.plugin.saveSettings()})),new A.Setting(e).setName("Open file on write in a new pane").setDisabled(this.plugin.settings.openFileOnWrite).addToggle(o=>o.setValue(this.plugin.settings.openFileOnWriteInNewPane).onChange(a=>{this.plugin.settings.openFileOnWriteInNewPane=a,this.plugin.saveSettings()})),new A.Setting(e).setName("Open daily note in a new pane").addToggle(o=>o.setValue(this.plugin.settings.openDailyInNewPane).onChange(a=>{this.plugin.settings.openDailyInNewPane=a,this.plugin.saveSettings()})),new A.Setting(e).setName("Open file without write in new pane").addToggle(o=>o.setValue(this.plugin.settings.openFileWithoutWriteInNewPane).onChange(a=>{this.plugin.settings.openFileWithoutWriteInNewPane=a,this.plugin.saveSettings()})),new A.Setting(e).setName("Use UID instead of file paths").addToggle(o=>o.setValue(this.plugin.settings.useUID).onChange(a=>{this.plugin.settings.useUID=a,this.plugin.saveSettings(),this.display()})),new A.Setting(e).setName("Include vault name/ID parameter").addToggle(o=>o.setValue(this.plugin.settings.includeVaultName).onChange(a=>{this.plugin.settings.includeVaultName=a,this.plugin.saveSettings(),this.display()})),this.plugin.settings.includeVaultName&&new A.Setting(e).setName("Vault identifying parameter").setDesc("Choose whether to use the vault Name or its internal ID as the identifying parameter.").addDropdown(o=>o.addOption("name","Name").addOption("id","ID").setValue(this.plugin.settings.vaultParam).onChange(a=>{this.plugin.settings.vaultParam=a,this.plugin.saveSettings()})),this.plugin.settings.useUID&&new A.Setting(e).setName("Add filepath parameter").setDesc("When using UID instead of file paths, you can still add the filepath parameter to know what this URI is about. It's NOT actually used.").addToggle(o=>o.setValue(this.plugin.settings.addFilepathWhenUsingUID).onChange(a=>{this.plugin.settings.addFilepathWhenUsingUID=a,this.plugin.saveSettings()})),new A.Setting(e).setName("UID field in frontmatter").addText(o=>o.setValue(this.plugin.settings.idField).onChange(a=>{this.plugin.settings.idField=a,this.plugin.saveSettings()})),new A.Setting(e).setName("Allow executing arbitrary code via eval").setDesc("\u26A0\uFE0F This can be dangerous as it allows executing arbitrary code. Only enable this if you trust the source of the URIs you are using and know what you are doing. \u26A0\uFE0F").addToggle(o=>o.setValue(this.plugin.settings.allowEval).onChange(a=>{this.plugin.settings.allowEval=a,this.plugin.saveSettings()}));let t=new A.Setting(e).setName("Link formats").setDesc("Define custom link formats to use when using 'Copy formatted URI for ...' commands. Specify a name to identify and the format template. Available variables:").setHeading();t.descEl.createEl("p").setText("{{uri}} - The Advanced URI"),t.descEl.createEl("p").setText("{{path}} - The file path"),t.descEl.createEl("p").setText("{{name}} - The file name"),t.descEl.createEl("p").setText("{{folder}} - The path of the file folder"),t.descEl.createEl("p").setText("{{vaultName}} - The vault name"),t.descEl.createEl("p").setText("{{vaultId}} - The vault id"),t.descEl.createEl("p").setText("{{uid}} - The file's UID, defaults to file name if not available"),t.descEl.createEl("p").setText("{{alias}} - The file's first alias, defaults to file name if not available"),new A.Setting(e).setName("Add link format").addButton(o=>o.setButtonText("Add format").onClick(()=>{this.plugin.settings.linkFormats.push({name:"",format:""}),this.plugin.saveSettings(),this.display()}));let i=this.plugin.settings.linkFormats;for(let o=0;ol.setPlaceholder("Name").setValue(i[o].name).onChange(r=>{i[o].name=r,this.plugin.saveSettings()})),a.addText(l=>l.setPlaceholder("[{{path}}]({{uri}})").setValue(i[o].format).onChange(r=>{i[o].format=r,this.plugin.saveSettings()})),a.addExtraButton(l=>l.setIcon("trash").onClick(()=>{i.splice(o,1),this.plugin.saveSettings(),this.display()}))}new A.Setting(e).setName("Support").setHeading(),new A.Setting(e).setName("Donate").setDesc("If you like this Plugin, consider donating to support continued development.").addButton(o=>{o.buttonEl.outerHTML="
"})}};var P=require("obsidian");var ee,Je=new Uint8Array(16);function de(){if(!ee&&(ee=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!ee))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ee(Je)}var Te=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Qe(s){return typeof s=="string"&&Te.test(s)}var Ee=Qe;var F=[];for(te=0;te<256;++te)F.push((te+256).toString(16).substr(1));var te;function Xe(s){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=(F[s[n+0]]+F[s[n+1]]+F[s[n+2]]+F[s[n+3]]+"-"+F[s[n+4]]+F[s[n+5]]+"-"+F[s[n+6]]+F[s[n+7]]+"-"+F[s[n+8]]+F[s[n+9]]+"-"+F[s[n+10]]+F[s[n+11]]+F[s[n+12]]+F[s[n+13]]+F[s[n+14]]+F[s[n+15]]).toLowerCase();if(!Ee(e))throw TypeError("Stringified UUID is invalid");return e}var Re=Xe;function qe(s,n,e){s=s||{};var t=s.random||(s.rng||de)();if(t[6]=t[6]&15|64,t[8]=t[8]&63|128,n){e=e||0;for(var i=0;i<16;++i)n[e+i]=t[i];return n}return Re(t)}var pe=qe;var Ve=require("obsidian"),_e={options:[],placeholder:"",allowEmpty:!1,onlySelection:!1,initialValue:void 0},ne=class extends Ve.SuggestModal{constructor(e,t){super(e.app);this.config={..._e,...t},this.setPlaceholder(this.config.placeholder)}openAndGetResult(){return new Promise(e=>{this.resolve=e,this.open(),this.config.initialValue!=null&&(this.inputEl.value=this.config.initialValue,this.inputEl.dispatchEvent(new Event("input")))})}onClose(){new Promise(e=>setTimeout(e,10)).then(()=>{this.resolve&&this.resolve(void 0)})}getSuggestions(e){return this.config.onlySelection?this.config.options:this.config.allowEmpty?[e.length>0?e:" ",...this.config.options]:[e.length>0?e:"...",...this.config.options]}renderSuggestion(e,t){t.setText(e)}onChooseSuggestion(e,t){if(this.resolve){let i;this.config.allowEmpty&&e===" "?i="":e==="..."?i=void 0:i=e,this.resolve(i)}}};var K=class{constructor(n){this.plugin=n;this.app=this.plugin.app}get settings(){return this.plugin.settings}async writeUIDToFile(n,e){var c;let t=(c=this.app.metadataCache.getFileCache(n))==null?void 0:c.frontmatter,i=await this.app.vault.read(n),o=(!t||t.length===0)&&!i.match(/^-{3}\s*\n*\r*-{3}/),a=i.split(`
`),l=`${this.plugin.settings.idField}:`;if(o)a.unshift("---"),a.unshift(`${l} ${e}`),a.unshift("---");else{let d=a.findIndex(p=>p.startsWith(l));d!=-1?a[d]=`${l} ${e}`:a.splice(1,0,`${l} ${e}`)}let r=a.join(`
`);return await this.app.vault.modify(n,r),e}async getUIDFromFile(n){var i;let e=(i=this.app.metadataCache.getFileCache(n))!=null?i:await new Promise(o=>{let a=this.app.metadataCache.on("changed",l=>{if(l.path==n.path){let r=this.app.metadataCache.getFileCache(n);this.app.metadataCache.offref(a),o(r)}})}),t=(0,P.parseFrontMatterEntry)(e.frontmatter,this.plugin.settings.idField);if(t!=null)return t instanceof Array?t[0]:t}async generateURI(n){var a;let e="obsidian://adv-uri",t="",i=this.app.vault.getAbstractFileByPath(n.filepath);this.settings.includeVaultName&&(t+="?vault=",this.settings.vaultParam=="id"&&this.app.appId?t+=encodeURIComponent(this.app.appId):t+=encodeURIComponent(this.app.vault.getName())),this.settings.useUID&&i instanceof P.TFile&&i.extension=="md"&&(this.settings.addFilepathWhenUsingUID||(n.filepath=void 0),n.uid=(a=await this.getUIDFromFile(i))!=null?a:await this.writeUIDToFile(i,pe()));let o=Object.keys(n).filter(l=>n[l]).sort((l,r)=>{let c=["filepath","filename","uid","daily"],d=["data","eval"];return c.includes(l)?-1:c.includes(r)||d.includes(l)?1:d.includes(r)?-1:0});for(let l of o)n[l]!=null&&(t+=t?"&":"?",t+=`${l}=${encodeURIComponent(n[l])}`);return t.endsWith("%20")&&(t+="&"),e+t}async copyURI(n,e=!1,t=void 0){var o,a;let i=await this.generateURI(n);if(e){let l=this.settings.linkFormats;if(l.length==0){new P.Notice("No link formats defined in the settings");return}let r;if(l.length==1)r=l[0];else{let d=l.map(h=>h.name),p=await new ne(this.plugin,{options:d,onlySelection:!0,placeholder:"Select link format"}).openAndGetResult();if(!p){new P.Notice("No link format selected");return}r=l.find(h=>h.name==p)}let c=r.format.replace(/\{\{uri\}\}/g,i).replace(/\{\{path\}\}/g,t==null?void 0:t.path).replace(/\{\{folder\}\}/g,(o=t==null?void 0:t.parent)==null?void 0:o.path).replace(/\{\{name\}\}/g,t==null?void 0:t.basename).replace(/\{\{vaultName\}\}/g,this.app.vault.getName()).replace(/\{\{vaultId\}\}/g,this.app.appId);if(t&&c.match(/\{\{uid\}\}/g)){let d=(a=await this.getUIDFromFile(t))!=null?a:t.basename;c=c.replace(/\{\{uid\}\}/g,d)}if(t&&c.match(/\{\{alias\}\}/g)){let d=(0,P.parseFrontMatterAliases)(this.app.metadataCache.getFileCache(t).frontmatter),p=d?d[0]:t==null?void 0:t.basename;c=c.replace(/\{\{alias\}\}/g,p)}await D(c),new P.Notice(`Advanced URI in format "${r.name}" copied to your clipboard`);return}await D(i),new P.Notice("Advanced URI copied to your clipboard")}getFileFromUID(n){var i;let e=this.app.vault.getMarkdownFiles(),t=this.settings.idField;for(let o of e){let a=(0,P.parseFrontMatterEntry)((i=this.app.metadataCache.getFileCache(o))==null?void 0:i.frontmatter,t);if(a instanceof Array){if(a.contains(n))return o}else if(a==n)return o}}getFileFromBlockID(n){var t,i;let e=this.app.vault.getMarkdownFiles();n=n.toLowerCase();for(let o of e)if(((i=(t=this.app.metadataCache.getFileCache(o))==null?void 0:t.blocks)==null?void 0:i[n])!=null)return o}};var oe=require("obsidian"),ie=class extends oe.FuzzySuggestModal{constructor(e){super(e.app);this.plugin=e,this.setPlaceholder("Choose a workspace")}getItems(){let e=this.app.internalPlugins.getEnabledPluginById("workspaces");if(!e)new oe.Notice("Workspaces plugin is not enabled");else return Object.keys(e.workspaces)}getItemText(e){return e}onChooseItem(e,t){this.plugin.tools.copyURI({workspace:e})}};var ae=class extends w.Plugin{constructor(){super(...arguments);this.handlers=new $(this);this.tools=new K(this)}async onload(){await this.loadSettings(),this.addSettingTab(new _(this.app,this)),this.addCommand({id:"copy-uri-current-file",name:"Copy URI for file with options",callback:()=>this.handlers.handleCopyFileURI(!1,!1)}),this.addCommand({id:"copy-uri-current-file-simple",name:"Copy URI for current file",callback:()=>this.handlers.handleCopyFileURI(!0,!1)}),this.addCommand({id:"copy-uri-current-file-with-format",name:"Copy formatted URI for file with options ",callback:()=>this.handlers.handleCopyFileURI(!1,!0)}),this.addCommand({id:"copy-uri-current-file-simple-with-format",name:"Copy formatted URI for current file",callback:()=>this.handlers.handleCopyFileURI(!0,!0)}),this.addCommand({id:"copy-uri-daily",name:"Copy URI for daily note",callback:()=>new U(this,!1).open()}),this.addCommand({id:"copy-uri-search-and-replace",name:"Copy URI for search and replace",callback:()=>{let e=new R(this,"Used file for search and replace");e.open(),e.onChooseItem=t=>{let i=new q(this);i.open(),i.onChooseSuggestion=o=>{new X(this,o,t==null?void 0:t.source).open()}}}}),this.addCommand({id:"copy-uri-command",name:"Copy URI for command",callback:()=>{let e=new R(this,"Select a file to be opened before executing the command");e.open(),e.onChooseItem=t=>{new Q(this,t==null?void 0:t.source).open()}}}),this.addCommand({id:"copy-uri-block",name:"Copy URI for current block",checkCallback:e=>{let t=this.app.workspace.getActiveViewOfType(w.MarkdownView);if(e)return t!=null;let i=B.getBlockId(this.app);i&&this.tools.copyURI({filepath:t.file.path,block:i},!1,t.file)}}),this.addCommand({id:"copy-uri-block-with-format",name:"Copy formatted URI for current block",checkCallback:e=>{let t=this.app.workspace.getActiveViewOfType(w.MarkdownView);if(e)return t!=null;let i=B.getBlockId(this.app);i&&this.tools.copyURI({filepath:t.file.path,block:i},!0,t.file)}}),this.addCommand({id:"copy-uri-workspace",name:"Copy URI for workspace",callback:()=>{new ie(this).open()}}),this.addCommand({id:"copy-uri-canvas-node",name:"Copy URI for selected canvas nodes",checkCallback:e=>{let t=this.app.workspace.activeLeaf.view;if(e)return t.getViewType()==="canvas"&&t.canvas.selection.size>0;if(t.getViewType()!=="canvas")return!1;let i=t,o=[];i.canvas.selection.forEach(a=>{o.push(a.id)}),this.tools.copyURI({canvasnodes:o.join(","),filepath:t.file.path},!1,t.file)}}),this.addCommand({id:"copy-uri-canvas-viewport",name:"Copy URI for current canvas viewport",checkCallback:e=>{let t=this.app.workspace.activeLeaf.view;if(e)return t.getViewType()==="canvas";if(t.getViewType()!=="canvas")return!1;let o=t.canvas,a=o.tx.toFixed(0),l=o.ty.toFixed(0),r=o.tZoom.toFixed(3);this.tools.copyURI({filepath:t.file.path,canvasviewport:`${a},${l},${r}`},!1,t.file)}}),this.registerObsidianProtocolHandler("advanced-uri",async e=>{let t=e;for(let i in t)t[i]=decodeURIComponent(t[i]);this.onUriCall(t)}),this.registerObsidianProtocolHandler("adv-uri",async e=>{let t=e;this.onUriCall(t)}),this.registerObsidianProtocolHandler("hook-get-advanced-uri",async e=>{let t=e;for(let o in t)t[o]=decodeURIComponent(t[o]);let i=this.app.workspace.getActiveFile();i?this.hookSuccess(t,i):this.failure(t,{errorMessage:"No file opened"})}),this.registerEvent(this.app.workspace.on("file-menu",(e,t,i)=>{(i==="more-options"||i==="tab-header"||i=="file-explorer-context-menu")&&t instanceof w.TFile&&(e.addItem(o=>{o.setTitle("Copy Advanced URI").setIcon("link").setSection("info").onClick(a=>this.handlers.handleCopyFileURI(!0,!1,t))}),e.addItem(o=>{o.setTitle("Copy formatted Advanced URI").setIcon("link").setSection("info").onClick(a=>this.handlers.handleCopyFileURI(!0,!0,t))}))}))}async onUriCall(e){var i,o,a;let t=!1;if(this.lastParameters={...e},e.uid){let l=(i=this.tools.getFileFromUID(e.uid))==null?void 0:i.path;l!=null&&(e.filepath=l,e.uid=void 0)}else if(e.filename){let l=this.app.metadataCache.getFirstLinkpathDest(e.filename,"");l||(l=this.app.vault.getMarkdownFiles().find(d=>{var p;return(p=(0,w.parseFrontMatterAliases)(this.app.metadataCache.getFileCache(d).frontmatter))==null?void 0:p.includes(e.filename)}));let r=this.app.fileManager.getNewFileParent((o=this.app.workspace.getActiveFile())==null?void 0:o.path),c=r.isRoot()?"":r.path+"/";e.filepath=(a=l==null?void 0:l.path)!=null?a:c+(0,w.normalizePath)(e.filename)}if(e.filepath){e.filepath=(0,w.normalizePath)(e.filepath);let l=e.filepath.lastIndexOf(".");e.filepath.substring(l<0?e.filepath.length:l)===""&&(e.filepath=e.filepath+".md")}else if(e.daily==="true"){if(!je(this.app)){new w.Notice("Daily notes plugin is not loaded");return}let l=window.moment(Date.now()),r=await be(l,this.app),c=this.app.vault.getAbstractFileByPath(r);c||(e.exists==="true"?e.filepath=r:(c=await this.app.internalPlugins.getEnabledPluginById("daily-notes").getDailyNote(),t=!0)),c&&(e.filepath=c.path)}e.clipboard==="true"&&(e.data=await navigator.clipboard.readText()),this.chooseHandler(e,t)}async chooseHandler(e,t){e["enable-plugin"]||e["disable-plugin"]?this.handlers.handlePluginManagement(e):e.workspace||e.saveworkspace=="true"?this.handlers.handleWorkspace(e):e.commandname||e.commandid?(await this.handlers.handleCommand(e),e.filepath=void 0,e.commandid=void 0,e.commandname=void 0,await this.chooseHandler(e,t)):e.frontmatterkey?this.handlers.handleFrontmatterKey(e):e.bookmark?this.handlers.handleBookmarks(e):e.eval?this.handlers.handleEval(e):e.filepath&&e.exists==="true"?this.handlers.handleDoesFileExist(e):e.canvasnodes||e.canvasviewport?this.handlers.handleCanvas(e):e.data?this.handlers.handleWrite(e,t):e.filepath&&e.heading?(await this.handlers.handleOpen(e),e.filepath=void 0,e.heading=void 0,this.chooseHandler(e,t)):e.filepath&&e.block?(await this.handlers.handleOpen(e),e.filepath=void 0,e.block=void 0,this.chooseHandler(e,t)):(e.search||e.searchregex)&&e.replace!=null?this.handlers.handleSearchAndReplace(e):e.search?this.handlers.handleSearch(e):e.filepath?this.handlers.handleOpen(e):e.block?this.handlers.handleOpenBlock(e):e.settingid?this.handlers.handleOpenSettings(e):e.updateplugins&&this.handlers.handleUpdatePlugins(e)}async hookSuccess(e,t){if(!e["x-success"])return;let i={title:W(t.name),advanceduri:await this.tools.generateURI({filepath:t.path}),urlkey:"advanceduri",fileuri:Fe(this.app,t)};this.success(e,i)}success(e,t){if(e["x-success"]){let i=new URL(e["x-success"]);for(let o in t)i.searchParams.set(o,t[o]);window.open(i.toString())}}failure(e,t){if(e["x-error"]){let i=new URL(e["x-error"]);for(let o in t)i.searchParams.set(o,t[o]);window.open(i.toString())}}async append(e,t){var a,l;let i,o;if(e instanceof w.TFile){i=e.path;let c=(await this.app.vault.read(e)).split(`
`),d;if(t.heading){let p=ce(this.app,e,t.heading);if(d=p==null?void 0:p.lastLine,d===void 0)return;p.firstLine==p.lastLine&&t.separator&&(t.separator=`
`+t.separator)}else t.line?d=Number(t.line):d=c.length;d=Math.max(1,d),c[d-1]=((a=c[d-1])!=null?a:"")+((l=t.separator)!=null?l:`
`)+t.data,o=c.join(`
`)}else i=e,o=t.data;return this.writeAndOpenFile(i,o,t)}async prepend(e,t){var a,l,r;let i,o;if(e instanceof w.TFile){i=e.path;let c=await this.app.vault.read(e),d=this.app.metadataCache.getFileCache(e),p=c.split(`
`),h;if(t.heading){if(h=(a=ce(this.app,e,t.heading))==null?void 0:a.firstLine,h===void 0)return;h+=1}else t.line?h=Number(t.line):d.frontmatterPosition?h=d.frontmatterPosition.end.line+2:h=1;h=Math.max(1,h),p[h-1]=`${t.data}${(l=t.separator)!=null?l:`
`}${(r=p[h-1])!=null?r:""}`,o=p.join(`
`)}else i=e,o=t.data;return this.writeAndOpenFile(i,o,t)}async writeAndOpenFile(e,t,i){let o=this.app.vault.getAbstractFileByPath(e);if(o instanceof w.TFile)await this.app.vault.modify(o,t);else{let a=e.split("/"),l=a.slice(0,a.length-1).join("/");a.length>1&&!(this.app.vault.getAbstractFileByPath(l)instanceof w.TFolder)&&await this.app.vault.createFolder(l),/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/.test(t)?await this.app.vault.createBinary(e,(0,w.base64ToArrayBuffer)(t)):await this.app.vault.create(e,t)}return this.openExistingFileAndSetCursor(e,i),this.app.vault.getAbstractFileByPath(e)}async openExistingFileAndSetCursor(e,t){t.openmode!="silent"&&this.settings.openFileOnWrite&&(await this.open({file:e,setting:this.settings.openFileOnWriteInNewPane,parameters:t}),t.line!=null||t.column!=null||t.offset!=null?await this.setCursorInLine(t):t.mode!=null&&await this.setCursor(t))}async open({file:e,setting:t,parameters:i,supportPopover:o,mode:a}){var r;let l;if(i.openmode=="popover"&&(o==null||o)){let c=this.app.plugins.plugins["obsidian-hover-editor"];c||(new w.Notice("Cannot find Hover Editor plugin. Please file an issue."),this.failure(i)),await new Promise(d=>{l=c.spawnPopover(void 0,()=>{this.app.workspace.setActiveLeaf(l,{focus:!0}),d()})})}else{let c=t;if(i.newpane!==void 0&&(c=i.newpane=="true"),i.openmode!==void 0&&(i.openmode=="true"||i.openmode=="false"?c=i.openmode=="true":i.openmode=="popover"?c=!1:w.Platform.isMobile&&i.openmode=="window"||(c=i.openmode)),c=="silent")return;if(w.Platform.isMobileApp&&c=="window"&&(c=!0),e!=null){let d=!1;isBoolean(c)&&this.app.workspace.iterateAllLeaves(p=>{var h;if(((h=p.view.file)==null?void 0:h.path)===i.filepath){if(d&&p.width==0)return;d=!0,this.app.workspace.setActiveLeaf(p,{focus:!0}),l=p}})}l||(l=this.app.workspace.getLeaf(c),this.app.workspace.setActiveLeaf(l,{focus:!0}))}if(e instanceof w.TFile?await l.openFile(e):e!=null&&await this.app.workspace.openLinkText(e,"/",!1,a!=null?{state:{mode:a}}:re(i)),l.view instanceof w.MarkdownView){let c=l.getViewState();a!=null?c.state.mode=a:c.state={...c.state,...(r=re(i))==null?void 0:r.state},await l.setViewState(c)}return l}async setCursor(e){let t=this.app.workspace.getActiveViewOfType(w.MarkdownView);if(!t)return;let i=e.mode,o=t.editor,a=t.leaf.getViewState();if(a.state.mode="source",i==="append"){let l=o.lastLine(),r=o.getLine(l).length;await t.leaf.setViewState(a,{focus:!0}),o.setCursor({ch:r,line:l}),t.editor.scrollIntoView({from:{line:l,ch:r},to:{line:l,ch:r}},!0)}else i==="prepend"&&(await t.leaf.setViewState(a,{focus:!0}),o.setCursor({ch:0,line:0}),t.editor.scrollIntoView({from:{line:0,ch:0},to:{line:0,ch:0}},!0));await new Promise(l=>setTimeout(l,10)),e.viewmode=="preview"&&(a.state.mode="preview",await t.leaf.setViewState(a))}async setCursorInLine(e){let t=this.app.workspace.getActiveViewOfType(w.MarkdownView);if(!t)return;let i=t.leaf.getViewState(),o=e.line!=null?Number(e.line):void 0,a=e.column?Number(e.column):void 0;i.state.mode="source",await t.leaf.setViewState(i);let l,r;if(e.offset!=null){let c=t.editor.offsetToPos(Number(e.offset));l=c.line,r=c.ch}else{l=o!=null?Math.min(o-1,t.editor.lineCount()-1):t.editor.getCursor().line;let c=t.editor.getLine(l).length-1;r=Math.min(a-1,c)}t.editor.focus(),t.editor.setCursor({line:l,ch:r}),t.editor.scrollIntoView({from:{line:l,ch:r},to:{line:l,ch:r}},!0),await new Promise(c=>setTimeout(c,10)),e.viewmode=="preview"&&(i.state.mode="preview",await t.leaf.setViewState(i))}async loadSettings(){this.settings=Object.assign(ve,await this.loadData())}async saveSettings(){await this.saveData(this.settings)}};
//! All of these methods are taken from https://www.npmjs.com/package/obsidian-daily-notes-interface.
/*! Bundled license information:
feather-icons/dist/feather.js:
(*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*)
*/
/* nosourcemap */