digital-garden/.obsidian/plugins/obsidian-hover-editor/main.js

19 lines
175 KiB
JavaScript
Raw Normal View History

2024-06-13 21:01:37 +03:00
/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
var Oa=Object.create;var $t=Object.defineProperty;var _a=Object.getOwnPropertyDescriptor;var Ca=Object.getOwnPropertyNames;var La=Object.getPrototypeOf,Ia=Object.prototype.hasOwnProperty;var Tr=g=>$t(g,"__esModule",{value:!0});var Mr=(g,a)=>()=>(a||g((a={exports:{}}).exports,a),a.exports),Aa=(g,a)=>{Tr(g);for(var u in a)$t(g,u,{get:a[u],enumerable:!0})},Da=(g,a,u)=>{if(a&&typeof a=="object"||typeof a=="function")for(let h of Ca(a))!Ia.call(g,h)&&h!=="default"&&$t(g,h,{get:()=>a[h],enumerable:!(u=_a(a,h))||u.enumerable});return g},be=g=>Da(Tr($t(g!=null?Oa(La(g)):{},"default",g&&g.__esModule&&"default"in g?{get:()=>g.default,enumerable:!0}:{value:g,enumerable:!0})),g);var _r=Mr((Ua,Or)=>{Or.exports=function(a,u){u||(u=[0,""]),a=String(a);var h=parseFloat(a,10);return u[0]=h,u[1]=a.match(/[\d.\-\+]*\s*(.*)/)[1]||"",u}});var Gr=Mr(($r,Qn)=>{(function(g){typeof $r=="object"&&typeof Qn!="undefined"?Qn.exports=g():typeof define=="function"&&define.amd?define([],g):(typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:this).interact=g()})(function(){var g={};Object.defineProperty(g,"__esModule",{value:!0}),g.default=void 0,g.default=function(e){return!(!e||!e.Window)&&e instanceof e.Window};var a={};Object.defineProperty(a,"__esModule",{value:!0}),a.init=v,a.getWindow=function(e){return(0,g.default)(e)?e:(e.ownerDocument||e).defaultView||h.window},a.window=a.realWindow=void 0;var u=void 0;a.realWindow=u;var h=void 0;function v(e){a.realWindow=u=e;var t=e.document.createTextNode("");t.ownerDocument!==e.document&&typeof e.wrap=="function"&&e.wrap(t)===t&&(e=e.wrap(e)),a.window=h=e}a.window=h,typeof window!="undefined"&&window&&v(window);var d={};function E(e){return(E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}Object.defineProperty(d,"__esModule",{value:!0}),d.default=void 0;var k=function(e){return!!e&&E(e)==="object"},S=function(e){return typeof e=="function"},T={window:function(e){return e===a.window||(0,g.default)(e)},docFrag:function(e){return k(e)&&e.nodeType===11},object:k,func:S,number:function(e){return typeof e=="number"},bool:function(e){return typeof e=="boolean"},string:function(e){return typeof e=="string"},element:function(e){if(!e||E(e)!=="object")return!1;var t=a.getWindow(e)||a.window;return/object|function/.test(E(t.Element))?e instanceof t.Element:e.nodeType===1&&typeof e.nodeName=="string"},plainObject:function(e){return k(e)&&!!e.constructor&&/function Object\b/.test(e.constructor.toString())},array:function(e){return k(e)&&e.length!==void 0&&S(e.splice)}};d.default=T;var _={};function M(e){var t=e.interaction;if(t.prepared.name==="drag"){var o=t.prepared.axis;o==="x"?(t.coords.cur.page.y=t.coords.start.page.y,t.coords.cur.client.y=t.coords.start.client.y,t.coords.velocity.client.y=0,t.coords.velocity.page.y=0):o==="y"&&(t.coords.cur.page.x=t.coords.start.page.x,t.coords.cur.client.x=t.coords.start.client.x,t.coords.velocity.client.x=0,t.coords.velocity.page.x=0)}}function B(e){var t=e.iEvent,o=e.interaction;if(o.prepared.name==="drag"){var n=o.prepared.axis;if(n==="x"||n==="y"){var r=n==="x"?"y":"x";t.page[r]=o.coords.start.page[r],t.client[r]=o.coords.start.client[r],t.delta[r]=0}}}Object.defineProperty(_,"__esModule",{value:!0}),_.default=void 0;var R={id:"actions/drag",install:function(e){var t=e.actions,o=e.Interactable,n=e.defaults;o.prototype.draggable=R.draggable,t.map.drag=R,t.methodDict.drag="draggable",n.actions.drag=R.defaults},listeners:{"interactions:before-action-move":M,"interactions:action-resume":M,"interactions:action-move":B,"auto-start:check":function(e){var t=e.interaction,o=e.interactable,n=e.buttons,r=o.options.drag;if(r&&r.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||(n&o.options.drag.mouseButtons)!=0))return e.action={name:"drag",axis:r.lockAxis==="start"?r.startAxis:r.lockAxis},!1}},draggable:function(e){return d.default.object(e)?(this.options.drag.enable
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}())),d.default.element(i)&&(i=(0,A.getElementRect)(i)),i},G.rectToXY=function(e){return e&&{x:"x"in e?e.x:e.left,y:"y"in e?e.y:e.top}},G.xywhToTlbr=function(e){return!e||"left"in e&&"top"in e||((e=(0,I.default)({},e)).left=e.x||0,e.top=e.y||0,e.right=e.right||e.left+e.width,e.bottom=e.bottom||e.top+e.height),e},G.tlbrToXywh=function(e){return!e||"x"in e&&"y"in e||((e=(0,I.default)({},e)).x=e.left||0,e.y=e.top||0,e.width=e.width||(e.right||0)-e.x,e.height=e.height||(e.bottom||0)-e.y),e},G.addEdges=function(e,t,o){e.left&&(t.left+=o.x),e.right&&(t.right+=o.x),e.top&&(t.top+=o.y),e.bottom&&(t.bottom+=o.y),t.width=t.right-t.left,t.height=t.bottom-t.top};var ke={};Object.defineProperty(ke,"__esModule",{value:!0}),ke.default=function(e,t,o){var n=e.options[o],r=n&&n.origin||e.options.origin,i=(0,G.resolveRectLike)(r,e,t,[e&&t]);return(0,G.rectToXY)(i)||{x:0,y:0}};var De={};function ro(e){return e.trim().split(/ +/)}Object.defineProperty(De,"__esModule",{value:!0}),De.default=function e(t,o,n){if(n=n||{},d.default.string(t)&&t.search(" ")!==-1&&(t=ro(t)),d.default.array(t))return t.reduce(function(l,p){return(0,I.default)(l,e(p,o,n))},n);if(d.default.object(t)&&(o=t,t=""),d.default.func(o))n[t]=n[t]||[],n[t].push(o);else if(d.default.array(o))for(var r=0;r<o.length;r++){var i;i=o[r],e(t,i,n)}else if(d.default.object(o))for(var c in o){var s=ro(c).map(function(l){return"".concat(t).concat(l)});e(s,o[c],n)}return n};var we={};Object.defineProperty(we,"__esModule",{value:!0}),we.default=void 0,we.default=function(e,t){return Math.sqrt(e*e+t*t)};var Ze={};function ln(e,t){for(var o in t){var n=ln.prefixedPropREs,r=!1;for(var i in n)if(o.indexOf(i)===0&&n[i].test(o)){r=!0;break}r||typeof t[o]=="function"||(e[o]=t[o])}return e}Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.default=void 0,ln.prefixedPropREs={webkit:/(Movement[XY]|Radius[XY]|RotationAngle|Force)$/,moz:/(Pressure)$/};var Qr=ln;Ze.default=Qr;var L={};function cn(e){return e instanceof D.default.Event||e instanceof D.default.Touch}function Qe(e,t,o){return e=e||"page",(o=o||{}).x=t[e+"X"],o.y=t[e+"Y"],o}function io(e,t){return t=t||{x:0,y:0},$.default.isOperaMobile&&cn(e)?(Qe("screen",e,t),t.x+=window.scrollX,t.y+=window.scrollY):Qe("page",e,t),t}function ao(e,t){return t=t||{},$.default.isOperaMobile&&cn(e)?Qe("screen",e,t):Qe("client",e,t),t}function gt(e){var t=[];return d.default.array(e)?(t[0]=e[0],t[1]=e[1]):e.type==="touchend"?e.touches.length===1?(t[0]=e.touches[0],t[1]=e.changedTouches[0]):e.touches.length===0&&(t[0]=e.changedTouches[0],t[1]=e.changedTouches[1]):(t[0]=e.touches[0],t[1]=e.touches[1]),t}function so(e){for(var t={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},o=0;o<e.length;o++){var n=e[o];for(var r in t)t[r]+=n[r]}for(var i in t)t[i]/=e.length;return t}Object.defineProperty(L,"__esModule",{value:!0}),L.copyCoords=function(e,t){e.page=e.page||{},e.page.x=t.page.x,e.page.y=t.page.y,e.client=e.client||{},e.client.x=t.client.x,e.client.y=t.client.y,e.timeStamp=t.timeStamp},L.setCoordDeltas=function(e,t,o){e.page.x=o.page.x-t.page.x,e.page.y=o.page.y-t.page.y,e.client.x=o.client.x-t.client.x,e.client.y=o.client.y-t.client.y,e.timeStamp=o.timeStamp-t.timeStamp},L.setCoordVelocity=function(e,t){var o=Math.max(t.timeStamp/1e3,.001);e.page.x=t.page.x/o,e.page.y=t.page.y/o,e.client.x=t.client.x/o,e.client.y=t.client.y/o,e.timeStamp=o},L.setZeroCoords=function(e){e.page.x=0,e.page.y=0,e.client.x=0,e.client.y=0},L.isNativePointer=cn,L.getXY=Qe,L.getPageXY=io,L.getClientXY=ao,L.getPointerId=function(e){return d.default.number(e.pointerId)?e.pointerId:e.identifier},L.setCoords=function(e,t,o){var n=t.length>1?so(t):t[0];io(n,e.page),ao(n,e.client),e.timeStamp=o},L.getTouchPair=gt,L.pointerAverage=so,L.touchBBox=function(e){if(!e.length)return null;var t=gt(e),o=Math.min(t[0].pageX,t[1].pageX),n=Math.min(t[0].pageY,t[1].pageY),r=Math.max(t[0].pageX,t[1].pageX),i=Math.max(t[0].pageY,t[1].pageY);return{x:o,y:n,left:o,top:n,right:r,bottom:i,width:r-o,height:i-n}},L.
`},{name:ze.boxSizing,perform:function(e){var t=e.element;return e.prepared.name==="resize"&&t instanceof D.default.HTMLElement&&!Mo(t,"boxSizing",/border-box/)},text:'Consider adding CSS "box-sizing: border-box" to this resizable element',getInfo:function(e){return[e.element,bn.boxSizing]}},{name:ze.noListeners,perform:function(e){var t=e.prepared.name;return!(e.interactable.events.types["".concat(t,"move")]||[]).length},getInfo:function(e){return[e.prepared.name,e.interactable]},text:"There are no listeners set for this action"}];function Mo(e,t,o){var n=e.style[t]||a.window.getComputedStyle(e)[t];return o.test((n||"").toString())}var Ei={id:"dev-tools",install:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=t.logger,n=e.Interactable,r=e.defaults;e.logger=o||console,r.base.devTools={ignore:{}},n.prototype.devTools=function(i){return i?((0,I.default)(this.options.devTools,i),this):this.options.devTools},e.usePlugin(Mt.default)},listeners:{"interactions:action-start":function(e,t){for(var o=e.interaction,n=0;n<wn.length;n++){var r,i=wn[n],c=o.interactable&&o.interactable.options;c&&c.devTools&&c.devTools.ignore[i.name]||!i.perform(o)||(r=t.logger).warn.apply(r,[To+i.text].concat(function(l){if(Array.isArray(l))return yn(l)}(s=i.getInfo(o))||function(l){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(l))return Array.from(l)}(s)||function(l,p){if(l){if(typeof l=="string")return yn(l,p);var f=Object.prototype.toString.call(l).slice(8,-1);return f==="Object"&&l.constructor&&(f=l.constructor.name),f==="Map"||f==="Set"?Array.from(l):f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?yn(l,p):void 0}}(s)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()))}var s}},checks:wn,CheckName:ze,links:bn,prefix:To};Ot.default=Ei;var Me={};Object.defineProperty(Me,"__esModule",{value:!0}),Me.default=function e(t){var o={};for(var n in t){var r=t[n];d.default.plainObject(r)?o[n]=e(r):d.default.array(r)?o[n]=K.from(r):o[n]=r}return o};var Oe={};function Oo(e,t){return function(o){if(Array.isArray(o))return o}(e)||function(o,n){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(o)){var r=[],i=!0,c=!1,s=void 0;try{for(var l,p=o[Symbol.iterator]();!(i=(l=p.next()).done)&&(r.push(l.value),!n||r.length!==n);i=!0);}catch(f){c=!0,s=f}finally{try{i||p.return==null||p.return()}finally{if(c)throw s}}return r}}(e,t)||function(o,n){if(o){if(typeof o=="string")return _o(o,n);var r=Object.prototype.toString.call(o).slice(8,-1);return r==="Object"&&o.constructor&&(r=o.constructor.name),r==="Map"||r==="Set"?Array.from(o):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_o(o,n):void 0}}(e,t)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function _o(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}function xi(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.getRectOffset=Co,Oe.default=void 0;var Si=function(){function e(n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,e),this.states=[],this.startOffset={left:0,right:0,top:0,bottom:0},this.startDelta=void 0,this.result=void 0,this.endResult=void 0,this.edges=void 0,this.interaction=void 0,this.interaction=n,this.result=_t()}var t,o;return t=e,(o=[{key:"start",value:function(n,r){var i=n.phase,c=this.interaction,s=function(p){var f=p.interactable.options[p.prepared.name],m=f.modifiers;return m&&m.length?m:["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map(function(b){var w=f[b];return w&&w.enabled&&{options:w,methods:w._methods}}).filter(function(b){return!!b})}(c);this.prepareStates(s),this.edges=(0,I.default)({},c.edges),this.startOffset=Co(c.rect,r),this.startDelta={x:0,y:0};var l=this.fillArg({phase:i,pageCoords:r,preEnd:!1});return this.result=_t(),this.startAll(l),this.result=this.setAll(l)}},{key:"fillArg",value:function(n){var r=this.interaction;return n.interaction=r,n.interactable=r.interactable,n.element=r.element,n.rect=n.rect||r.rect,n.edges=this.edges,n.startOffset=this.startOffset,n}},{key:"startAll",value:function(n){for(var r=0;r<this.states.length;r++){var i=this.states[r];i.methods.start&&(n.state=i,i.methods.start(n))}}},{key:"setAll",value:function(n){var r=n.phase,i=n.preEnd,c=n.skipModifiers,s=n.rect;n.coords=(0,I.default)({},n.pageCoords),n.rect=(0,I.default)({},s);for(var l=c?this.states.slice(c):this.states,p=_t(n.coords,n.rect),f=0;f<l.length;f++){var m,b=l[f],w=b.options,y=(0,I.default)({},n.coords),P=null;(m=b.methods)!=null&&m.set&&this.shouldDo(w,i,r)&&(n.state=b,P=b.methods.set(n),G.addEdges(this.interaction.edges,n.rect,{x:n.coords.x-y.x,y:n.coords.y-y.y})),p.eventProps.push(P)}p.delta.x=n.coords.x-n.pageCoords.x,p.delta.y=n.coords.y-n.pageCoords.y,p.rectDelta.left=n.rect.left-s.left,p.rectDelta.right=n.rect.right-s.right,p.rectDelta.top=n.rect.top-s.top,p.rectDelta.bottom=n.rect.bottom-s.bottom;var O=this.result.coords,x=this.result.rect;if(O&&x){var C=p.rect.left!==x.left||p.rect.right!==x.right||p.rect.top!==x.top||p.rect.bottom!==x.bottom;p.changed=C||O.x!==p.coords.x||O.y!==p.coords.y}return p}},{key:"applyToInteraction",value:function(n){var r=this.interaction,i=n.phase,c=r.coords.cur,s=r.coords.start,l=this.result,p=this.startDelta,f=l.delta;i==="start"&&(0,I.default)(this.startDelta,l.delta);for(var m=[[s,p],[c,f]],b=0;b<m.length;b++){var w=Oo(m[b],2),y=w[0],P=w[1];y.page.x+=P.x,y.page.y+=P.y,y.client.x+=P.x,y.client.y+=P.y}var O=this.result.rectDelta,x=n.rect||r.rect;x.left+=O.left,x.right+=O.right,x.top+=O.top,x.bottom+=O.bottom,x.width=x.right-x.left,x.height=x.bottom-x.top}},{key:"setAndApply",value:function(n){var r=this.interaction,i=n.phase,c=n.preEnd,s=n.skipModifiers,l=this.setAll(this.fillArg({preEnd:c,phase:i,pageCoords:n.modifiedCoords||r.coords.cur.page}));if(this.result=l,!l.changed&&(!s||s<this.states.length)&&r.interacting())return!1;if(n.modifiedCoords){var p=r.coords.cur.page,f={x:n.modifiedCoords.x-p.x,y:n.modifiedCoords.y-p.y};l.coords.x+=f.x,l.coords.y+=f.y,l.delta.x+=f.x,l.delta.y+=f.y}this.applyToInteraction(n)}},{key:"beforeEnd",value:function(n){var r=n.interaction,i=n.event,c=this.states;if(c&&c.length){for(var s=!1,l=0;l<c.length;l++){var p=c[l];n.state=p;var f=p.options,m=p.methods,b=m.beforeEnd&&m.beforeEnd(n);if(b)return this.endResult=b,!1;s=s||!s&&this.shouldDo(f,!0,n.phase,!0)}s&&r.move({event:i,preEnd:!0})}}},{key:"stop",value:function(n){var r=n.interaction;if(this.states&&this.states.length){var i=(0,I.default)({states:this.states,interactable:r.interactable,element:
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Bo(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.default=void 0;var Vi=function(){function e(n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,e),this.currentTarget=void 0,this.originalEvent=void 0,this.type=void 0,this.originalEvent=n,(0,Ze.default)(this,n)}var t,o;return t=e,(o=[{key:"preventOriginalDefault",value:function(){this.originalEvent.preventDefault()}},{key:"stopPropagation",value:function(){this.originalEvent.stopPropagation()}},{key:"stopImmediatePropagation",value:function(){this.originalEvent.stopImmediatePropagation()}}])&&Fi(t.prototype,o),e}();function it(e){if(!d.default.object(e))return{capture:!!e,passive:!1};var t=(0,I.default)({},e);return t.capture=!!e.capture,t.passive=!!e.passive,t}var Bi={id:"events",install:function(e){var t,o=[],n={},r=[],i={add:c,remove:s,addDelegate:function(f,m,b,w,y){var P=it(y);if(!n[b]){n[b]=[];for(var O=0;O<r.length;O++){var x=r[O];c(x,b,l),c(x,b,p,!0)}}var C=n[b],j=K.find(C,function(F){return F.selector===f&&F.context===m});j||(j={selector:f,context:m,listeners:[]},C.push(j)),j.listeners.push([w,P])},removeDelegate:function(f,m,b,w,y){var P,O=it(y),x=n[b],C=!1;if(x)for(P=x.length-1;P>=0;P--){var j=x[P];if(j.selector===f&&j.context===m){for(var F=j.listeners,X=F.length-1;X>=0;X--){var Z=kn(F[X],2),N=Z[0],Y=Z[1],ue=Y.capture,ye=Y.passive;if(N===w&&ue===O.capture&&ye===O.passive){F.splice(X,1),F.length||(x.splice(P,1),s(m,b,l),s(m,b,p,!0)),C=!0;break}}if(C)break}}},delegateListener:l,delegateUseCapture:p,delegatedEvents:n,documents:r,targets:o,supportsOptions:!1,supportsPassive:!1};function c(f,m,b,w){var y=it(w),P=K.find(o,function(O){return O.eventTarget===f});P||(P={eventTarget:f,events:{}},o.push(P)),P.events[m]||(P.events[m]=[]),f.addEventListener&&!K.contains(P.events[m],b)&&(f.addEventListener(m,b,i.supportsOptions?y:y.capture),P.events[m].push(b))}function s(f,m,b,w){var y=it(w),P=K.findIndex(o,function(X){return X.eventTarget===f}),O=o[P];if(O&&O.events)if(m!=="all"){var x=!1,C=O.events[m];if(C){if(b==="all"){for(var j=C.length-1;j>=0;j--)s(f,m,C[j],y);return}for(var F=0;F<C.length;F++)if(C[F]===b){f.removeEventListener(m,b,i.supportsOptions?y:y.capture),C.splice(F,1),C.length===0&&(delete O.events[m],x=!0);break}}x&&!Object.keys(O.events).length&&o.splice(P,1)}else for(m in O.events)O.events.hasOwnProperty(m)&&s(f,m,"all")}function l(f,m){for(var b=it(m),w=new Vi(f),y=n[f.type],P=kn(L.getEventTargets(f),1)[0],O=P;d.default.element(O);){for(var x=0;x<y.length;x++){var C=y[x],j=C.selector,F=C.context;if(A.matchesSelector(O,j)&&A.nodeContains(F,P)&&A.nodeContains(F,O)){var X=C.listeners;w.currentTarget=O;for(var Z=0;Z<X.length;Z++){var N=kn(X[Z],2),Y=N[0],ue=N[1],ye=ue.capture,Wn=ue.passive;ye===b.capture&&Wn===b.passive&&Y(w)}}}O=A.parentNode(O)}}function p(f){return l(f,!0)}return(t=e.document)==null||t.createElement("div").addEventListener("test",null,{get capture(){return i.supportsOptions=!0},get passive(){return i.supportsPassive=!0}}),e.events=i,i}};Ht.default=Bi;var Rt={};Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.default=void 0;var zt={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search:function(e){for(var t=0;t<zt.methodOrder.length;t++){var o;o=zt.methodOrder[t];var n=zt[o](e);if(n)return n}return null},simulationResume:function(e){var t=e.pointerType,o=e.eventType,n=e.eventTarget,r=e.scope;if(!/down|start/i.test(o))return null;for(var i=0;i<r.interactions.list.length;i++){var c=r.interactions.list[i],s=n;if(c.simulation&&c.simulation.allowResume&&c.pointerType===t)for(;s;){if(s===c.element)return c;s=A.parentNode(s)}}return null},mouseOrPen:function(e){var t,o=e.pointerId,n=e.pointerType,r=e.eventType,i=e.scope;if(n!=="mouse"&&n!=="pen")return null;for(var c=0;c<i.interactions.list.length;c++){var s=i.interactions.list[c];if(s.pointerType===n){if(s.simulation&&!No(s,o))continu
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Yo(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}function qi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xi(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Uo(e,t){return(Uo=Object.setPrototypeOf||function(o,n){return o.__proto__=n,o})(e,t)}function Yi(e,t){return!t||qo(t)!=="object"&&typeof t!="function"?function(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}(e):t}function Tn(e){return(Tn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(e)}Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.default=void 0;var Mn=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function Ko(e,t){return function(o){var n=t.interactions.list,r=L.getPointerType(o),i=Xo(L.getEventTargets(o),2),c=i[0],s=i[1],l=[];if(/^touch/.test(o.type)){t.prevTouchTime=t.now();for(var p=0;p<o.changedTouches.length;p++){var f=o.changedTouches[p],m={pointer:f,pointerId:L.getPointerId(f),pointerType:r,eventType:o.type,eventTarget:c,curEventTarget:s,scope:t},b=$o(m);l.push([m.pointer,m.eventTarget,m.curEventTarget,b])}}else{var w=!1;if(!$.default.supportsPointerEvent&&/mouse/.test(o.type)){for(var y=0;y<n.length&&!w;y++)w=n[y].pointerType!=="mouse"&&n[y].pointerIsDown;w=w||t.now()-t.prevTouchTime<500||o.timeStamp===0}if(!w){var P={pointer:o,pointerId:L.getPointerId(o),pointerType:r,eventType:o.type,curEventTarget:s,eventTarget:c,scope:t},O=$o(P);l.push([P.pointer,P.eventTarget,P.curEventTarget,O])}}for(var x=0;x<l.length;x++){var C=Xo(l[x],4),j=C[0],F=C[1],X=C[2];C[3][e](j,o,F,X)}}}function $o(e){var t=e.pointerType,o=e.scope,n={interaction:Rt.default.search(e),searchDetails:e};return o.fire("interactions:find",n),n.interaction||o.interactions.new({pointerType:t})}function On(e,t){var o=e.doc,n=e.scope,r=e.options,i=n.interactions.docEvents,c=n.events,s=c[t];for(var l in n.browser.isIOS&&!r.events&&(r.events={passive:!1}),c.delegatedEvents)s(o,l,c.delegateListener),s(o,l,c.delegateUseCapture,!0);for(var p=r&&r.events,f=0;f<i.length;f++){var m=i[f];s(o,m.type,m.listener,p)}}var Ui={id:"core/interactions",install:function(e){for(var t={},o=0;o<Mn.length;o++){var n=Mn[o];t[n]=Ko(n,e)}var r,i=$.default.pEventTypes;function c(){for(var s=0;s<e.interactions.list.length;s++){var l=e.interactions.list[s];if(l.pointerIsDown&&l.pointerType==="touch"&&!l._interacting)for(var p=function(){var m=l.pointers[f];e.documents.some(function(b){var w=b.doc;return(0,A.nodeContains)(w,m.downTarget)})||l.removePointer(m.pointer,m.event)},f=0;f<l.pointers.length;f++)p()}}(r=D.default.PointerEvent?[{type:i.down,listener:c},{type:i.down,listener:t.pointerDown},{type:i.move,listener:t.pointerMove},{type:i.up,listener:t.pointerUp},{type:i.cancel,listener:t.pointerUp}]:[{type:"mousedown",listener:t.pointerDown},{type:"mousemove",listener:t.pointerMove},{type:"mouseup",listener:t.pointerUp},{type:"touchstart",listener:c},{type:"touchstart",listener:t.pointerDown},{type:"touchmove",listener:t.pointerMove},{type:"touchend",listener:t.pointerUp},{type:"touchcancel",listener:t.pointerUp}]).push({type:"blur",listener:function(s){for(var l=0;l<e.interactions.list.length;l++)e.interactions.list[l].documentBlur(s)}}),e.prevTouchTime=0,e.Interaction=function(s){(function(y,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function");y.prototype=Object.create(P&&P.prototype,{constructor:{value:y,writable:!0,configurable:!0}}),P&&Uo(y,P)})(w,s);var l,p,f,m,b=(f=w,m=function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(y){retur
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ir(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.default=void 0,Bt.default=function(e){var t=[["x","y"],["left","top"],["right","bottom"],["width","height"]].filter(function(n){var r=rr(n,2),i=r[0],c=r[1];return i in e||c in e}),o=function(n,r){for(var i=e.range,c=e.limits,s=c===void 0?{left:-1/0,right:1/0,top:-1/0,bottom:1/0}:c,l=e.offset,p=l===void 0?{x:0,y:0}:l,f={range:i,grid:e,x:null,y:null},m=0;m<t.length;m++){var b=rr(t[m],2),w=b[0],y=b[1],P=Math.round((n-p.x)/e[w]),O=Math.round((r-p.y)/e[y]);f[w]=Math.max(s.left,Math.min(s.right,P*e[w]+p.x)),f[y]=Math.max(s.top,Math.min(s.bottom,O*e[y]+p.y))}return f};return o.grid=e,o.coordFields=t,o};var st={};Object.defineProperty(st,"__esModule",{value:!0}),Object.defineProperty(st,"edgeTarget",{enumerable:!0,get:function(){return Ft.default}}),Object.defineProperty(st,"elements",{enumerable:!0,get:function(){return Vt.default}}),Object.defineProperty(st,"grid",{enumerable:!0,get:function(){return Bt.default}});var Nt={};Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.default=void 0;var Qi={id:"snappers",install:function(e){var t=e.interactStatic;t.snappers=(0,I.default)(t.snappers||{},st),t.createSnapGrid=t.snappers.grid}};Nt.default=Qi;var Ve={};function ar(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),o.push.apply(o,n)}return o}function Cn(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?ar(Object(o),!0).forEach(function(n){Ji(e,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ar(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}function Ji(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.aspectRatio=Ve.default=void 0;var sr={start:function(e){if(!e.state.options.enabled)return!1;var t=e.state,o=e.rect,n=e.edges,r=e.pageCoords,i=t.options.ratio,c=t.options,s=c.equalDelta,l=c.modifiers;i==="preserve"&&(i=o.width/o.height),t.startCoords=(0,I.default)({},r),t.startRect=(0,I.default)({},o),t.ratio=i,t.equalDelta=s;var p=t.linkedEdges={top:n.top||n.left&&!n.bottom,left:n.left||n.top&&!n.right,bottom:n.bottom||n.right&&!n.top,right:n.right||n.bottom&&!n.left};if(t.xIsPrimaryAxis=!(!n.left&&!n.right),t.equalDelta)t.edgeSign=(p.left?1:-1)*(p.top?1:-1);else{var f=t.xIsPrimaryAxis?p.top:p.left;t.edgeSign=f?-1:1}if((0,I.default)(e.edges,p),l&&l.length){var m=new Oe.default(e.interaction);m.copyFrom(e.interaction.modification),m.prepareStates(l),t.subModification=m,m.startAll(Cn({},e))}},set:function(e){if(e.state.options.enabled===!1)return!1;var t=e.state,o=e.rect,n=e.coords,r=(0,I.default)({},n),i=t.equalDelta?ea:ta;if(i(t,t.xIsPrimaryAxis,n,o),!t.subModification)return null;var c=(0,I.default)({},o);(0,G.addEdges)(t.linkedEdges,c,{x:n.x-r.x,y:n.y-r.y});var s=t.subModification.setAll(Cn(Cn({},e),{},{rect:c,edges:t.linkedEdges,pageCoords:n,prevCoords:n,prevRect:c})),l=s.delta;return s.changed&&(i(t,Math.abs(l.x)>Math.abs(l.y),s.coords,s.rect),(0,I.default)(n,s.coords)),s.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function ea(e,t,o){var n=e.startCoords,r=e.edgeSign;t?o.y=n.y+(o.x-n.x)*r:o.x=n.x+(o.y-n.y)*r}function ta(e,t,o,n){var r=e.startRect,i=e.startCoords,c=e.ratio,s=e.edgeSign;if(t){var l=n.width/c;o.y=i.y+(l-r.height)*s}else{var p=n.height*c;o.x=i.x+(p-r.width)*s}}Ve.aspectRatio=sr;var na=(0,ee.makeModifier)(sr,"aspectRatio");Ve.default=na;var Ce={};Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.default=void 0;var lr=function(){};lr._defaults={};var oa=lr;Ce.default=oa;var Ln={};Object.defineProperty(Ln,"__esModule",{value:!0}),Object.defineProperty
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()),y=w[0],P=w[1];if(y in m||P in m){m.x=m[y],m.y=m[P];break}}r.options.targets.push(m)}}var O=xe.snap.set(e);return r.options=c,O},defaults:{range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1}};me.snapSize=yr;var da=(0,ee.makeModifier)(yr,"snapSize");me.default=da;var qe={};Object.defineProperty(qe,"__esModule",{value:!0}),qe.snapEdges=qe.default=void 0;var br={start:function(e){var t=e.edges;return t?(e.state.targetFields=e.state.targetFields||[[t.left?"left":"right",t.top?"top":"bottom"]],me.snapSize.start(e)):null},set:me.snapSize.set,defaults:(0,I.default)((0,Me.default)(me.snapSize.defaults),{targets:null,range:null,offset:{x:0,y:0}})};qe.snapEdges=br;var fa=(0,ee.makeModifier)(br,"snapEdges");qe.default=fa;var Dn={};Object.defineProperty(Dn,"__esModule",{value:!0}),Object.defineProperty(Dn,"default",{enumerable:!0,get:function(){return Ce.default}});var jn={};Object.defineProperty(jn,"__esModule",{value:!0}),Object.defineProperty(jn,"default",{enumerable:!0,get:function(){return Ce.default}});var Xe={};Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.default=void 0;var ha={aspectRatio:Ve.default,restrictEdges:fe.default,restrict:ne.default,restrictRect:Be.default,restrictSize:Ne.default,snapEdges:qe.default,snap:xe.default,snapSize:me.default,spring:Dn.default,avoid:Ln.default,transform:jn.default,rubberband:An.default};Xe.default=ha;var qt={};Object.defineProperty(qt,"__esModule",{value:!0}),qt.default=void 0;var va={id:"modifiers",install:function(e){var t=e.interactStatic;for(var o in e.usePlugin(ee.default),e.usePlugin(Nt.default),t.modifiers=Xe.default,Xe.default){var n=Xe.default[o],r=n._defaults,i=n._methods;r._methods=i,e.defaults.perAction[o]=r}}};qt.default=va;var Le={};function wr(e){return(wr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function ga(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Er(e,t){return(Er=Object.setPrototypeOf||function(o,n){return o.__proto__=n,o})(e,t)}function ma(e,t){return!t||wr(t)!=="object"&&typeof t!="function"?Hn(e):t}function Hn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rn(e){return(Rn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(e)}Object.defineProperty(Le,"__esModule",{value:!0}),Le.PointerEvent=Le.default=void 0;var ya=function(e){(function(s,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(l&&l.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),l&&Er(s,l)})(c,e);var t,o,n,r,i=(n=c,r=function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}(),function(){var s,l=Rn(n);if(r){var p=Rn(this).constructor;s=Reflect.construct(l,arguments,p)}else s=l.apply(this,arguments);return ma(this,s)});function c(s,l,p,f,m,b){var w;if(function(O,x){if(!(O instanceof x))throw new TypeError("Cannot call a class as a function")}(this,c),(w=i.call(this,m)).type=void 0,w.originalEvent=void 0,w.pointerId=void 0,w.pointerType=void 0,w.double=void 0,w.pageX=void 0,w.pageY=void 0,w.clientX=void 0,w.clientY=void 0,w.dt=void 0,w.eventable=void 0,L.pointerExtend(Hn(w),p),p!==l&&L.pointerExtend(Hn(w),l),w.timeStamp=b,w.originalEvent=p,w.type=s,w.pointerId=L.getPointerId(l),w.pointerType=L.getPointerType(l),w.target=f,w.currentTarget=null,s==="tap"){var y=m.getPointerIndex(l);w.dt=w.timeStamp-m.pointers[y].downTime;var P=w.timeStamp-m.tapTime;w.double=!!(m.prevTap&&m.prevTap.type!=="doubletap"&&m.prevTap.target===w.targ
will maximize the popover vertically. The top edge will maximize the popover to fill the entire
screen. Dragging the popovers away from the edges will restore the popver to its original size.`).addToggle(u=>u.setValue(this.plugin.settings.snapToEdges).onChange(h=>{this.plugin.settings.snapToEdges=h,this.plugin.saveSettings()})),new re.Setting(a).setName("Show view header by default").setDesc(`Show the view header by default when triggering a hover editor.
When disabled, view headers will only show if you click the view header icon to the left of the minimize button.`).addToggle(u=>u.setValue(this.plugin.settings.showViewHeader).onChange(h=>{this.plugin.settings.showViewHeader=h,this.plugin.saveSettings()})),new re.Setting(a).setName("Click to zoom image").setDesc(`Click and hold an image within a hover editor to temporarily maximize the popover and image to fill the entire viewport.
On mouse up, the hover editor will restore to its original size.`).addToggle(u=>u.setValue(this.plugin.settings.imageZoom).onChange(h=>{this.plugin.settings.imageZoom=h,this.plugin.saveSettings()})),new re.Setting(a).setName("Initial popover width").setDesc("Enter any valid CSS unit").addText(u=>{u.setPlaceholder(this.plugin.settings.initialWidth),u.inputEl.type="text",u.setValue(this.plugin.settings.initialWidth),u.onChange(async h=>{h=Fn(h),h||(h=nn.initialWidth),this.plugin.settings.initialWidth=h,this.plugin.saveSettings()})}),new re.Setting(a).setName("Initial popover height").setDesc("Enter any valid CSS unit").addText(u=>{u.setPlaceholder(String(this.plugin.settings.initialHeight)),u.inputEl.type="text",u.setValue(String(this.plugin.settings.initialHeight)),u.onChange(async h=>{h=Fn(h),h||(h=nn.initialHeight),this.plugin.settings.initialHeight=h,this.plugin.saveSettings()})}),new re.Setting(a).setName("Hover Trigger Delay (ms)").setDesc("How long to wait before showing a Hover Editor when hovering over a link").addText(u=>{u.setPlaceholder(String(this.plugin.settings.triggerDelay)),u.inputEl.type="number",u.setValue(String(this.plugin.settings.triggerDelay)),u.onChange(async h=>{this.plugin.settings.triggerDelay=Number(h),this.plugin.saveSettings()})}),new re.Setting(a).setName("Hover Close Delay (ms)").setDesc("How long to wait before closing a Hover Editor once the mouse leaves").addText(u=>{u.setPlaceholder(String(this.plugin.settings.closeDelay)),u.inputEl.type="number",u.setValue(String(this.plugin.settings.closeDelay)),u.onChange(async h=>{this.plugin.settings.closeDelay=Number(h),this.plugin.saveSettings()})})}};var Jn=be(Gr());var Zr=class extends Gn{constructor(){super(...arguments);this.interact=this.createInteractor();this.plugin=this.use(on)}createInteractor(){if(this.win===window)return Jn.default;let a=Jn.default.scope,h=new a.constructor().init(this.win).interactStatic;for(let v of a._plugins.list)h.use(v);return h}onload(){this.win.addEventListener("resize",this.plugin.debouncedPopoverReflow)}onunload(){this.win.removeEventListener("resize",this.plugin.debouncedPopoverReflow);try{this.interact.removeDocument(this.win.document)}catch(a){console.error(a)}}},on=class extends V.Plugin{constructor(){super(...arguments);this.use=se.plugin(this);this.interact=this.use(Zr);this.debouncedPopoverReflow=(0,V.debounce)(()=>{U.activePopovers().forEach(a=>{var u;(u=a.interact)==null||u.reflow({name:"drag",axis:"xy"})})},100,!0)}async onload(){this.registerActivePopoverHandler(),this.registerFileRenameHandler(),this.registerContextMenuHandler(),this.registerCommands(),this.patchUnresolvedGraphNodeHover(),this.patchWorkspace(),this.patchQuickSwitcher(),this.patchWorkspaceLeaf(),this.patchItemView(),this.patchMarkdownPreviewRenderer(),this.patchMarkdownPreviewView(),await this.loadSettings(),this.registerSettingsTab(),this.app.workspace.onLayoutReady(()=>{this.patchSlidingPanes(),this.patchLinkHover(),setTimeout(()=>{this.app.workspace.trigger("css-change")},2e3)})}get activePopovers(){return U.activePopovers()}patchWorkspaceLeaf(){this.register(oe(V.WorkspaceLeaf.prototype,{getRoot(a){return function(){let u=a.call(this);return u.getRoot===this.getRoot?u:u.getRoot()}},onResize(a){return function(){var u;(u=this.view)==null||u.onResize()}},setViewState(a){return async function(u,h){var d,E,k;let v=await a.call(this,u,h);try{let S=U.forLeaf(this);if(S){u.type&&S.hoverEl.setAttribute("data-active-view-type",u.type);let T=S.hoverEl.querySelector(".popover-title");T&&(T.textContent=(d=this.view)==null?void 0:d.getDisplayText(),((k=(E=this.view)==null?void 0:E.file)==null?void 0:k.path)?T.setAttribute("data-path",this.view.file.path):T.removeAttribute("data-path"))}}catch(S){}return v}},setEphemeralState(a){return function(u){var h;a.call(this,u),u.focus&&((h=this.view)==null?void 0:h.getViewType())==="empty"&&(this.view.contentEl.tabIndex=-1,this.view.contentEl.focus())}}})),this.register(oe(V.WorkspaceItem.prototype,{getContainer(a){return function(){if(!!a)return!this.parentSplit||this instanceof V.Workspace