vare=function(A,t){returne=Object.setPrototypeOf||{__proto__:[]}instanceofArray&&function(e,A){e.__proto__=A}||function(e,A){for(vartinA)Object.prototype.hasOwnProperty.call(A,t)&&(e[t]=A[t])},e(A,t)};functionA(A,t){if("function"!=typeoft&&null!==t)thrownewTypeError("Class extends value "+String(t)+" is not a constructor or null");functioni(){this.constructor=A}e(A,t),A.prototype=null===t?Object.create(t):(i.prototype=t.prototype,newi)}vart=function(){returnt=Object.assign||function(e){for(varA,t=1,i=arguments.length;t<i;t++)for(varninA=arguments[t])Object.prototype.hasOwnProperty.call(A,n)&&(e[n]=A[n]);returne},t.apply(this,arguments)};functioni(e,A,t,i){returnnew(t||(t=Promise))((function(n,r){functions(e){try{o(i.next(e))}catch(e){r(e)}}functiona(e){try{o(i.throw(e))}catch(e){r(e)}}functiono(e){varA;e.done?n(e.value):(A=e.value,Ainstanceoft?A:newt((function(e){e(A)}))).then(s,a)}o((i=i.apply(e,A||[])).next())}))}functionn(e,A){vart,i,n,r,s={label:0,sent:function(){if(1&n[0])thrown[1];returnn[1]},trys:[],ops:[]};returnr={next:a(0),throw:a(1),return:a(2)},"function"==typeofSymbol&&(r[Symbol.iterator]=function(){returnthis}),r;functiona(r){returnfunction(a){returnfunction(r){if(t)thrownewTypeError("Generator is already executing.");for(;s;)try{if(t=1,i&&(n=2&r[0]?i.return:r[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,r[1])).done)returnn;switch(i=0,n&&(r=[2&r[0],n.value]),r[0]){case0:case1:n=r;break;case4:returns.label++,{value:r[1],done:!1};case5:s.label++,i=r[1],r=[0];continue;case7:r=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!n||r[1]>n[0]&&r[1]<n[3])){s.label=r[1];break}if(6===r[0]&&s.label<n[1]){s.label=n[1],n=r;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(r);break}n[2]&&s.ops.pop(),s.trys.pop();continue}r=A.call(e,s)}catch(e){r=[6,e],i=0}finally{t=n=0}if(5&r[0])throwr[1];return{value:r[0]?r[1]:void0,done:!0}}([r,a])}}}functionr(e,A,t){if(t||2===arguments.length)for(vari,n=0,r=A.length;n<r;n++)!i&&ninA||(i||(i=Array.prototype.slice.call(A,0,n)),i[n]=A[n]);returne.concat(i||A)}for(vars=function(){functione(e,A,t,i){this.left=e,this.top=A,this.width=t,this.height=i}returne.prototype.add=function(A,t,i,n){returnnewe(this.left+A,this.top+t,this.width+i,this.height+n)},e.fromClientRect=function(A,t){returnnewe(t.left+A.windowBounds.left,t.top+A.windowBounds.top,t.width,t.height)},e.fromDOMRectList=function(A,t){vari=Array.from(t).find((function(e){return0!==e.width}));returni?newe(i.left+A.windowBounds.left,i.top+A.windowBounds.top,i.width,i.height):e.EMPTY},e.EMPTY=newe(0,0,0,0),e}(),a=function(e,A){returns.fromClientRect(e,A.getBoundingClientRect())},o=function(e){for(varA=[],t=0,i=e.length;t<i;){varn=e.charCodeAt(t++);if(n>=55296&&n<=56319&&t<i){varr=e.charCodeAt(t++);56320==(64512&r)?A.push(((1023&n)<<10)+(1023&r)+65536):(A.push(n),t--)}elseA.push(n)}returnA},l=function(){for(vare=[],A=0;A<arguments.length;A++)e[A]=arguments[A];if(String.fromCodePoint)returnString.fromCodePoint.apply(String,e);vart=e.length;if(!t)return"";for(vari=[],n=-1,r="";++n<t;){vars=e[n];s<=65535?i.push(s):(s-=65536,i.push(55296+(s>>10),s%1024+56320)),(n+1===t||i.length>16384)&&(r+=String.fromCharCode.apply(String,i),i.length=0)}returnr},c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g="undefined"==typeofUint8Array?[]:newUint8Array(256),d=0;d<64;d++)g[c.charCodeAt(d)]=d;for(varu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h="undefined"==typeofUint8Array?[]:newUint8Array(256),m=0;m<64;m++)h[u.charCodeAt(m)]=m;for(varp=function(e,A,t){returne.slice?e.slice(A,t):newUint16Array(Array.prototype.slice.call(e,A,t))},w=function(){functione(e,A,t,i,n,r){this.initialValue=e,this.errorValue=A,this.highStart=t,this.highValueIndex=i,this.index=n,this.data=r}returne.prototype.get=function(e){varA;if(e>=0){if(e<55296||e>56319&&e<=65535)returnA=((A=this.index[e>>5])<<2)+(31&e),this.data[A];if(e<=65535)returnA=((A
renderTopRightUI:(e,A)=>this.obsidianMenu.renderButton(e,A),renderEmbeddableMenu:e=>this.embeddableMenu.renderButtons(e),onPaste:(e,A)=>{constt=this.getHookServer();if(e&&t.onPasteHook){consti=t.onPasteHook({ea:t,payload:e,event:A,excalidrawFile:this.file,view:this,pointerPosition:this.currentPosition});if("boolean"==typeofi&&!1===i)return!1}if(!this.modifierKeyDown.ctrlKey&&null!=A&&DEVICE.isLinux)returnconsole.debug("Prevented what is likely middle mouse button paste."),!1;if(e&&e.text&&hyperlinkIsImage(e.text))returnthis.addImageWithURL(e.text),!1;if(e&&e.text&&!this.modifierKeyDown.shiftKey){constA=obsidianPDFQuoteWithRef(e.text);if(A){conste=getEA(this),t=this.excalidrawAPI.getAppState(),i=t.currentItemStrokeColor,n=t.viewBackgroundColor;e.style.strokeColor="transparent"===i?e.getCM("transparent"===n?"white":n).invert().stringHEX({alpha:!1}):i,e.style.fontFamily=t.currentItemFontFamily,e.style.fontSize=t.currentItemFontSize;constr=e.measureText(A.quote),s=r.width+60,a=e.addText(this.currentPosition.x,this.currentPosition.y,A.quote,{box:!0,boxStrokeColor:"transparent",width:Math.min(500,s),height:r.height+60});returne.elementsDict[a].link=`[[${A.link}]]`,e.addElementsToView(!1,!1),!1}}if(e.elements){conste=this;setTimeout((()=>e.save(!1)),300)}return!0},onThemeChange:asynce=>{varA;this.excalidrawData.scene.appState.theme=e,this.loadSceneFiles(),null===(A=null==n?void0:n.current)||void0===A||A.setTheme(e),setTimeout((()=>setDynamicStyle(this.plugin.ea,this,this.previousBackgroundColor,this.plugin.settings.dynamicStyling)))},ownerDocument:this.ownerDocument,ownerWindow:this.ownerWindow,onDrop:e=>{this.draginfoDiv&&(this.ownerDocument.body.removeChild(this.draginfoDiv),deletethis.draginfoDiv);constA=this.excalidrawAPI;if(!A)return!1;constt=A.getAppState();this.currentPosition=viewportCoordsToSceneCoords({clientX:e.clientX,clientY:e.clientY},t);consti=app.dragManager.draggable,n=internalDragModifierType(e),r=externalDragModifierType(e),s=localFileDragModifierType(e),a=(A,t,n)=>{if(!this.getHookServer().onDropHook)return!1;try{returnthis.getHookServer().onDropHook({ea:this.getHookServer(),event:e,draggable:i,type:A,payload:{files:t,text:n},excalidrawFile:this.file,view:this,pointerPosition:this.currentPosition})}catch(e){returnnewobsidian_module.Notice("on drop hook error. See console log for details"),errorlog({where:"ExcalidrawView.onDrop",error:e}),!1}};switch(null==i?void0:i.type){case"file":if(!a("file",[i.file],null)){conste=i.file;if(e.path.match(REG_LINKINDEX_INVALIDCHARS))returnnewobsidian_module.Notice(t$d("FILENAME_INVALID_CHARS"),4e3),!1;if(["image","image-fullsize"].contains(n)&&(IMAGE_TYPES.contains(e.extension)||"md"===e.extension||"pdf"===e.extension.toLowerCase()))return"pdf"===e.extension.toLowerCase()?newInsertPDFModal(this.plugin,this).open(e):(async()=>{constA=getEA(this);A.selectElementsInView([awaitinsertImageToView(A,this.currentPosition,e,!("image-fullsize"===n))])})(),!1;if("embeddable"===n)return(async()=>{constA=getEA(this);A.selectElementsInView([awaitinsertEmbeddableToView(A,this.currentPosition,e)])})(),!1;this.addText(`[[${app.metadataCache.fileToLinktext(i.file,this.file.path,!0)}]]`)}return!1;case"files":returna("file",i.files,null)||(async()=>{if(["image","image-fullsize"].contains(n)){conste=getEA(this);e.canvas.theme=A.getAppState().theme;lett=0;constr=[];for(constAofi.files)(IMAGE_TYPES.contains(A.extension)||"md"===A.extension)&&(r.push(awaite.addImage(this.currentPosition.x+50*t,this.currentPosition.y+50*t,A,!("image-fullsize"===n))),t++,awaite.addElementsToView(!1,!1,!0),e.selectElementsInView(r)),"pdf"===A.extension.toLowerCase()&&newInsertPDFModal(this.plugin,this).open(A)}else{if("embeddable"===n){conste=getEA(this);letA=0,t=0;constn=[];for(constrofi.files)n.push(awaitinsertEmbeddableToView(e,{x:this.currentPosition.x+500*A,y:this.currentPosition.y+550*t},r)),A=(A+1)%3,0===A&&t++;return!1}for(consteofi.files)awaitthis.addText(`[[${app.metadataCache.fileToLinktext(e,this.file.path,!0)}]]`,void0,!1),this.currentPosition.y+=2*t.c