2023-03-25 16:31:46 +00:00
"use strict" ; var obsidian _module = require ( "obsidian" ) ; var LZString = function ( ) { function o ( o , r ) { if ( ! t [ o ] ) { t [ o ] = { } ; for ( var n = 0 ; n < o . length ; n ++ ) t [ o ] [ o . charAt ( n ) ] = n } return t [ o ] [ r ] } var r = String . fromCharCode , n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" , e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$" , t = { } , i = { compressToBase64 : function ( o ) { if ( null == o ) return "" ; var r = i . _compress ( o , 6 , function ( o ) { return n . charAt ( o ) } ) ; switch ( r . length % 4 ) { default : case 0 : return r ; case 1 : return r + "===" ; case 2 : return r + "==" ; case 3 : return r + "=" } } , decompressFromBase64 : function ( r ) { return null == r ? "" : "" == r ? null : i . _decompress ( r . length , 32 , function ( e ) { return o ( n , r . charAt ( e ) ) } ) } , compressToUTF16 : function ( o ) { return null == o ? "" : i . _compress ( o , 15 , function ( o ) { return r ( o + 32 ) } ) + " " } , decompressFromUTF16 : function ( o ) { return null == o ? "" : "" == o ? null : i . _decompress ( o . length , 16384 , function ( r ) { return o . charCodeAt ( r ) - 32 } ) } , compressToUint8Array : function ( o ) { for ( var r = i . compress ( o ) , n = new Uint8Array ( 2 * r . length ) , e = 0 , t = r . length ; t > e ; e ++ ) { var s = r . charCodeAt ( e ) ; n [ 2 * e ] = s >>> 8 , n [ 2 * e + 1 ] = s % 256 } return n } , decompressFromUint8Array : function ( o ) { if ( null === o || void 0 === o ) return i . decompress ( o ) ; for ( var n = new Array ( o . length / 2 ) , e = 0 , t = n . length ; t > e ; e ++ ) n [ e ] = 256 * o [ 2 * e ] + o [ 2 * e + 1 ] ; var s = [ ] ; return n . forEach ( function ( o ) { s . push ( r ( o ) ) } ) , i . decompress ( s . join ( "" ) ) } , compressToEncodedURIComponent : function ( o ) { return null == o ? "" : i . _compress ( o , 6 , function ( o ) { return e . charAt ( o ) } ) } , decompressFromEncodedURIComponent : function ( r ) { return null == r ? "" : "" == r ? null : ( r = r . replace ( / /g , "+" ) , i . _decompress ( r . length , 32 , function ( n ) { return o ( e , r . charAt ( n ) ) } ) ) } , compress : function ( o ) { return i . _compress ( o , 16 , function ( o ) { return r ( o ) } ) } , _compress : function ( o , r , n ) { if ( null == o ) return "" ; var e , t , i , s = { } , p = { } , u = "" , c = "" , a = "" , l = 2 , f = 3 , h = 2 , d = [ ] , m = 0 , v = 0 ; for ( i = 0 ; i < o . length ; i += 1 ) if ( u = o . charAt ( i ) , Object . prototype . hasOwnProperty . call ( s , u ) || ( s [ u ] = f ++ , p [ u ] = ! 0 ) , c = a + u , Object . prototype . hasOwnProperty . call ( s , c ) ) a = c ; else { if ( Object . prototype . hasOwnProperty . call ( p , a ) ) { if ( a . charCodeAt ( 0 ) < 256 ) { for ( e = 0 ; h > e ; e ++ ) m <<= 1 , v == r - 1 ? ( v = 0 , d . push ( n ( m ) ) , m = 0 ) : v ++ ; for ( t = a . charCodeAt ( 0 ) , e = 0 ; 8 > e ; e ++ ) m = m << 1 | 1 & t , v == r - 1 ? ( v = 0 , d . push ( n ( m ) ) , m = 0 ) : v ++ , t >>= 1 } else { for ( t = 1 , e = 0 ; h > e ; e ++ ) m = m << 1 | t , v == r - 1 ? ( v = 0 , d . push ( n ( m ) ) , m = 0 ) : v ++ , t = 0 ; for ( t = a . charCodeAt ( 0 ) , e = 0 ; 16 > e ; e ++ ) m = m << 1 | 1 & t , v == r - 1 ? ( v = 0 , d . push ( n ( m ) ) , m = 0 ) : v ++ , t >>= 1 } l -- , 0 == l && ( l = Math . pow ( 2 , h ) , h ++ ) , delete p [ a ] } else for ( t = s [ a ] , e = 0 ; h > e ; e ++ ) m = m << 1 | 1 & t , v == r - 1 ? ( v = 0 , d . push ( n ( m ) ) , m = 0 ) : v ++ , t >>= 1 ; l -- , 0 == l && ( l = Math . pow ( 2 , h ) , h ++ ) , s [ c ] = f ++ , a = String ( u ) } if ( "" !== a ) { if ( Object . prototype . hasOwnProperty . call ( p , a ) ) { if ( a . charCodeAt ( 0 ) < 256 ) { for ( e = 0 ; h > e ; e ++ ) m <<= 1 , v == r - 1 ? ( v = 0 , d . push ( n ( m ) ) , m = 0 ) : v ++ ; for ( t = a . charCodeAt ( 0 ) , e = 0 ; 8 > e ; e ++ ) m = m << 1 | 1 & t , v == r - 1 ? ( v = 0 , d . push ( n ( m ) ) , m = 0 ) : v ++ , t >>= 1 } else { for ( t = 1 , e = 0 ; h > e ; e ++ ) m = m << 1 | t , v == r - 1 ? ( v = 0 , d . push ( n ( m ) ) , m = 0 ) : v ++ , t = 0 ; for ( t = a . charCodeAt ( 0 ) , e = 0 ; 16 > e ; e ++ ) m = m << 1 | 1 & t , v == r - 1 ? ( v = 0 , d . push ( n ( m ) ) , m = 0 ) : v ++ , t >>= 1 } l -- , 0 == l && ( l = Math . pow ( 2 , h ) , h ++ ) , delete p [ a ] } else for ( t = s [ a ] , e = 0 ; h > e ; e ++ ) m = m << 1 | 1 & t , v == r - 1 ? ( v = 0 , d . push ( n ( m ) ) , m = 0 ) : v ++ , t >>= 1 ; l -- , 0 == l && ( l = Math . pow ( 2 , h ) , h ++ ) } for ( t = 2 , e = 0 ; h > e ; e ++ ) m = m << 1 | 1 & t , v == r - 1 ? ( v = 0 , d . push ( n ( m ) ) , m = 0 ) : v ++ , t >>= 1 ; for ( ; ; ) { if ( m <<= 1 , v == r - 1 ) { d . push ( n ( m ) ) ; break } v ++ } return d . join ( "" ) } , decompress : function ( o ) { return null == o ? "" : "" == o ? null : i . _decompress ( o . length , 32768 , function ( r ) { return o . charCodeAt ( r ) } ) } , _decompress : function ( o , n , e ) { var t , i , s , p , u , c , a , l , f = [ ] , h = 4 , d = 4 , m = 3 , v = "" , w = [ ] , A = { val : e ( 0 ) , position : n , index : 1 } ; for ( i = 0 ; 3 > i ; i += 1 ) f [ i ] = i ; for ( p = 0 , c = Math . pow ( 2 , 2 ) , a = 1 ; a != c ; ) u = A . val & A . position , A . position >>= 1 , 0 == A . position && ( A . position = n , A . val = e ( A . index ++ ) ) , p |= ( u > 0 ? 1 : 0 ) * a , a <<= 1 ; switch ( t = p ) { case 0 : for ( p = 0 , c = Math . pow ( 2 , 8 ) , a = 1 ; a != c ; ) u = A . val & A . position , A . position >>= 1 , 0 == A . position && ( A . position = n , A . val = e ( A . index ++ ) ) , p |= ( u > 0 ? 1 : 0 ) * a , a <<= 1 ; l = r ( p ) ; break ; case 1 : for ( p = 0 , c = Math . pow ( 2 , 16 ) , a = 1 ; a != c ; ) u = A . val & A . position , A . position >>= 1 , 0 == A . position && ( A . position = n , A . val = e ( A . index ++ ) ) , p |= ( u > 0 ? 1 : 0 ) * a , a <<= 1 ; l = r ( p ) ; break ; case 2 : return "" } for ( f [ 3 ] = l , s = l , w . push ( l ) ; ; ) { if ( A . index > o ) return "" ; for ( p = 0 , c = Math . pow ( 2 , m ) , a = 1 ; a != c ; ) u = A . val & A . position , A . position >>= 1 , 0 == A . position && ( A . position = n , A . val = e ( A . index ++ ) ) , p |= ( u > 0 ? 1 : 0 ) * a , a <<= 1 ; switch ( l = p ) { case
2023-07-11 12:13:51 +00:00
const EXCALIDRAW _PACKAGES = " PQKhCgAIUgBAbAlgYwKYDsDOrICVUCGyALlDAE6EkB0ADuQPYAmAriYg + tQLaJcBWmMmUgBhBrQCe5RAHMAFsUgAKZAEpIAMSKoARgwYBrADSQAkumTVIBdE0iJimGwDMXiJAWKpM1YdEgAFXlEZ0wGFnI0SGRmHFDIJDQsVHsWO1RySGJ5HABZM0DElAxsSBcIuwd0bNyRABkzUQBRADkAZWbyj3ianJxGBiUmREoSBnJJSAYXWoTwyOjiSlQ / aGBwZRd09k5lNQBvAHIWMsxllGIjgG4tneIOdFVjAA9DgCIGXX5UEneAXkBxEktFQM0gqBetAmTgAZLD3ukmKh3OhUu8AIRAkFg2bcZgseCoAD8L2UkOh5CcagAXO9tpYHpwAdjQeDkajUPCOXxVgRuExiTy0coANr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MA7E0NkKEL1DkJsPICYD3RcGIJeFsNMPkPYPLUwFBBSGIMkE8NYLMIcNCnxGINx2CO0IUIcMDlx0kGIKTBMMoPzAdwmGMGPANFCDyEqG8FxRDRv2jHP37HQGTVOVOU0AmDQAAFVdx9xkMY5 + 47 Q8IMByjUBTl8AfFUAm4GiQ1nwYYw9WiyiKiej5ZejvBGjL9mjB5DgiZ2pExWUaBzJMA5B0BjA1xcJrgOx3whghgcQdtMBdQSBxBuBoQ0QZwtidiRwG5AZgdxjh1IN + jG1J4aUQxqxJltYK9HR3jx4C44wsQXQvlMZe9QV5DsBiAJjUBlBqBYTaRshAEfAbAagaVphZh20cB / In9dAiRnB5UwJ9xphlVyhBsOwQh5oFUNFoUUTIUlBwQMSEUZACAcSfA6FfJwBJwCSIIIcRiOixjITHjzQlxo1nwH4
2023-03-25 16:31:46 +00:00
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Copyright ( c ) Microsoft Corporation .
Permission to use , copy , modify , and / or distribute this software for any
purpose with or without fee is hereby granted .
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS . IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL , DIRECT ,
INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE , DATA OR PROFITS , WHETHER IN AN ACTION OF CONTRACT , NEGLIGENCE OR
OTHER TORTIOUS ACTION , ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
2023-07-11 12:13:51 +00:00
var e = function ( t , A ) { return e = Object . setPrototypeOf || { _ _proto _ _ : [ ] } instanceof Array && function ( e , t ) { e . _ _proto _ _ = t } || function ( e , t ) { for ( var A in t ) Object . prototype . hasOwnProperty . call ( t , A ) && ( e [ A ] = t [ A ] ) } , e ( t , A ) } ; function t ( t , A ) { if ( "function" != typeof A && null !== A ) throw new TypeError ( "Class extends value " + String ( A ) + " is not a constructor or null" ) ; function i ( ) { this . constructor = t } e ( t , A ) , t . prototype = null === A ? Object . create ( A ) : ( i . prototype = A . prototype , new i ) } var A = function ( ) { return A = Object . assign || function ( e ) { for ( var t , A = 1 , i = arguments . length ; A < i ; A ++ ) for ( var n in t = arguments [ A ] ) Object . prototype . hasOwnProperty . call ( t , n ) && ( e [ n ] = t [ n ] ) ; return e } , A . apply ( this , arguments ) } ; function i ( e , t , A , i ) { return new ( A || ( A = Promise ) ) ( ( function ( n , a ) { function r ( e ) { try { o ( i . next ( e ) ) } catch ( e ) { a ( e ) } } function s ( e ) { try { o ( i . throw ( e ) ) } catch ( e ) { a ( e ) } } function o ( e ) { var t ; e . done ? n ( e . value ) : ( t = e . value , t instanceof A ? t : new A ( ( function ( e ) { e ( t ) } ) ) ) . then ( r , s ) } o ( ( i = i . apply ( e , t || [ ] ) ) . next ( ) ) } ) ) } function n ( e , t ) { var A , i , n , a , r = { label : 0 , sent : function ( ) { if ( 1 & n [ 0 ] ) throw n [ 1 ] ; return n [ 1 ] } , trys : [ ] , ops : [ ] } ; return a = { next : s ( 0 ) , throw : s ( 1 ) , return : s ( 2 ) } , "function" == typeof Symbol && ( a [ Symbol . iterator ] = function ( ) { return this } ) , a ; function s ( a ) { return function ( s ) { return function ( a ) { if ( A ) throw new TypeError ( "Generator is already executing." ) ; for ( ; r ; ) try { if ( A = 1 , i && ( n = 2 & a [ 0 ] ? i . return : a [ 0 ] ? i . throw || ( ( n = i . return ) && n . call ( i ) , 0 ) : i . next ) && ! ( n = n . call ( i , a [ 1 ] ) ) . done ) return n ; switch ( i = 0 , n && ( a = [ 2 & a [ 0 ] , n . value ] ) , a [ 0 ] ) { case 0 : case 1 : n = a ; break ; case 4 : return r . label ++ , { value : a [ 1 ] , done : ! 1 } ; case 5 : r . label ++ , i = a [ 1 ] , a = [ 0 ] ; continue ; case 7 : a = r . ops . pop ( ) , r . trys . pop ( ) ; continue ; default : if ( ! ( ( n = ( n = r . trys ) . length > 0 && n [ n . length - 1 ] ) || 6 !== a [ 0 ] && 2 !== a [ 0 ] ) ) { r = 0 ; continue } if ( 3 === a [ 0 ] && ( ! n || a [ 1 ] > n [ 0 ] && a [ 1 ] < n [ 3 ] ) ) { r . label = a [ 1 ] ; break } if ( 6 === a [ 0 ] && r . label < n [ 1 ] ) { r . label = n [ 1 ] , n = a ; break } if ( n && r . label < n [ 2 ] ) { r . label = n [ 2 ] , r . ops . push ( a ) ; break } n [ 2 ] && r . ops . pop ( ) , r . trys . pop ( ) ; continue } a = t . call ( e , r ) } catch ( e ) { a = [ 6 , e ] , i = 0 } finally { A = n = 0 } if ( 5 & a [ 0 ] ) throw a [ 1 ] ; return { value : a [ 0 ] ? a [ 1 ] : void 0 , done : ! 0 } } ( [ a , s ] ) } } } function a ( e , t , A ) { if ( A || 2 === arguments . length ) for ( var i , n = 0 , a = t . length ; n < a ; n ++ ) ! i && n in t || ( i || ( i = Array . prototype . slice . call ( t , 0 , n ) ) , i [ n ] = t [ n ] ) ; return e . concat ( i || t ) } for ( var r = function ( ) { function e ( e , t , A , i ) { this . left = e , this . top = t , this . width = A , this . height = i } return e . prototype . add = function ( t , A , i , n ) { return new e ( this . left + t , this . top + A , this . width + i , this . height + n ) } , e . fromClientRect = function ( t , A ) { return new e ( A . left + t . windowBounds . left , A . top + t . windowBounds . top , A . width , A . height ) } , e . fromDOMRectList = function ( t , A ) { var i = Array . from ( A ) . find ( ( function ( e ) { return 0 !== e . width } ) ) ; return i ? new e ( i . left + t . windowBounds . left , i . top + t . windowBounds . top , i . width , i . height ) : e . EMPTY } , e . EMPTY = new e ( 0 , 0 , 0 , 0 ) , e } ( ) , s = function ( e , t ) { return r . fromClientRect ( e , t . getBoundingClientRect ( ) ) } , o = function ( e ) { for ( var t = [ ] , A = 0 , i = e . length ; A < i ; ) { var n = e . charCodeAt ( A ++ ) ; if ( n >= 55296 && n <= 56319 && A < i ) { var a = e . charCodeAt ( A ++ ) ; 56320 == ( 64512 & a ) ? t . push ( ( ( 1023 & n ) << 10 ) + ( 1023 & a ) + 65536 ) : ( t . push ( n ) , A -- ) } else t . push ( n ) } return t } , l = function ( ) { for ( var e = [ ] , t = 0 ; t < arguments . length ; t ++ ) e [ t ] = arguments [ t ] ; if ( String . fromCodePoint ) return String . fromCodePoint . apply ( String , e ) ; var A = e . length ; if ( ! A ) return "" ; for ( var i = [ ] , n = - 1 , a = "" ; ++ n < A ; ) { var r = e [ n ] ; r <= 65535 ? i . push ( r ) : ( r -= 65536 , i . push ( 55296 + ( r >> 10 ) , r % 1024 + 56320 ) ) , ( n + 1 === A || i . length > 16384 ) && ( a += String . fromCharCode . apply ( String , i ) , i . length = 0 ) } return a } , c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" , d = "undefined" == typeof Uint8Array ? [ ] : new Uint8Array ( 256 ) , h = 0 ; h < c . length ; h ++ ) d [ c . charCodeAt ( h ) ] = h ; for ( var u = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" , g = "undefined" == typeof Uint8Array ? [ ] : new Uint8Array ( 256 ) , p = 0 ; p < u . length ; p ++ ) g [ u . charCodeAt ( p ) ] = p ; for ( var m = function ( e , t , A ) { return e . slice ? e . slice ( t , A ) : new Uint16Array ( Array . prototype . slice . call ( e , t , A ) ) } , w = function ( ) { function e ( e , t , A , i , n , a ) { this . initialValue = e , this . errorValue = t , this . highStart = A , this . highValueIndex = i , this . index = n , this . data = a } return e . prototype . get = function ( e ) { var t ; if ( e >= 0 ) { if ( e < 55296 || e > 56319 && e <= 65535 ) return t = ( ( t = this . index [ e >> 5 ] ) << 2 ) + ( 31 & e ) , this . data [ t ] ; if ( e <= 65535 )
2023-03-25 16:31:46 +00:00
//![[link|alias]] [alias](link){num}
2023-07-11 12:13:51 +00:00
EXPR : /(!)?(\[\[([^|\]]+)\|?([^\]]+)?]]|\[([^\]]*)]\(([^)]*)\))(\{(\d+)\})?/g , getResList : e => { const t = e . matchAll ( REGEX _LINK . EXPR ) ; let A ; const i = [ ] ; for ( ; ! ( A = t . next ( ) ) . done ; ) i . push ( A ) ; return i } , getRes : e => e . matchAll ( REGEX _LINK . EXPR ) , isTransclusion : e => ! ! e . value [ 1 ] , getLink : e => e . value [ 3 ] ? e . value [ 3 ] : e . value [ 6 ] , isWikiLink : e => ! ! e . value [ 3 ] , getAliasOrLink : e => REGEX _LINK . isWikiLink ( e ) ? e . value [ 4 ] ? e . value [ 4 ] : e . value [ 3 ] : e . value [ 5 ] ? e . value [ 5 ] : e . value [ 6 ] , getWrapLength : ( e , t ) => { const A = parseInt ( e . value [ 8 ] ) ; return isNaN ( A ) ? t > 0 ? t : null : A } } , DRAWING _REG = /\n# Drawing\n[^`]*(```json\n)([\s\S]*?)```\n/gm , DRAWING _REG _FALLBACK = /\n# Drawing\n(```json\n)?(.*)(```)?(%%)?/gm , DRAWING _COMPRESSED _REG = /(\n# Drawing\n[^`]*(?:```compressed\-json\n))([\s\S]*?)(```\n)/gm , DRAWING _COMPRESSED _REG _FALLBACK = /(\n# Drawing\n(?:```compressed\-json\n)?)(.*)((```)?(%%)?)/gm , REG _LINKINDEX _HYPERLINK = /^\w+:\/\// , isCompressedMD = e => null !== e . match ( /```compressed\-json\n/gm ) , getDecompressedScene = e => { let t , A = e . matchAll ( DRAWING _COMPRESSED _REG ) ; return t = A . next ( ) , t . done && ( A = e . matchAll ( DRAWING _COMPRESSED _REG _FALLBACK ) , t = A . next ( ) ) , t . value && t . value . length > 1 ? [ decompress ( t . value [ 2 ] ) , t ] : [ null , t ] } , changeThemeOfExcalidrawMD = e => { const t = isCompressedMD ( e ) ; let A = t ? getDecompressedScene ( e ) [ 0 ] : e ; return A ? ( isObsidianThemeDark ? 1 === ( A . match ( /"theme"\s*:\s*"light"\s*,/g ) || [ ] ) . length && ( A = A . replace ( /"theme"\s*:\s*"light"\s*,/ , '"theme": "dark",' ) ) : 1 === ( A . match ( /"theme"\s*:\s*"dark"\s*,/g ) || [ ] ) . length && ( A = A . replace ( /"theme"\s*:\s*"dark"\s*,/ , '"theme": "light",' ) ) , t ? e . replace ( DRAWING _COMPRESSED _REG , ` $ 1 ${ compress ( A ) } $ 3 ` ) : A ) : e } ; function getJSON ( e ) { let t , A ; if ( isCompressedMD ( e ) ) { const [ t , A ] = getDecompressedScene ( e ) ; return t ? { scene : t . substring ( 0 , t . lastIndexOf ( "}" ) + 1 ) , pos : A . value . index } : { scene : e , pos : A . value ? A . value . index : 0 } } if ( t = e . matchAll ( DRAWING _REG ) , A = t . next ( ) , A . done && ( t = e . matchAll ( DRAWING _REG _FALLBACK ) , A = t . next ( ) ) , A . value && A . value . length > 1 ) { const e = A . value [ 2 ] ; return { scene : e . substr ( 0 , e . lastIndexOf ( "}" ) + 1 ) , pos : A . value . index } } return { scene : e , pos : A . value ? A . value . index : 0 } } function getMarkdownDrawingSection ( e , t ) { return t ? ` %% \n # Drawing \n \` \` \` compressed-json \n ${ compress ( e ) } \n \` \` \` \n %% ` : ` %% \n # Drawing \n \` \` \` json \n ${ e } \n \` \` \` \n %% ` } const estimateMaxLineLen = ( e , t ) => { if ( ! t || ! e ) return null ; if ( e === t ) return null ; let A = 0 ; const i = e . split ( "\n" ) ; if ( 1 === i . length ) return null ; for ( const e of i ) { const t = e . trim ( ) ; t . length > A && ( A = t . length ) } return A } , wrap = ( e , t ) => t ? wrapTextAtCharLength ( e , t , ! 1 , 0 ) : e ; class ExcalidrawData { constructor ( e ) { this . plugin = e , this . textElements = null , this . elementLinks = null , this . scene = null , this . deletedElements = [ ] , this . file = null , this . iFrameTheme = "auto" , this . autoexportPreference = AutoexportPreference . inherit , this . textMode = TextMode . raw , this . loaded = ! 1 , this . files = null , this . equations = null , this . compatibilityMode = ! 1 , this . selectedElementIds = { } , this . disableCompression = ! 1 , this . app = e . app , this . files = new Map , this . equations = new Map } initializeNonInitializedFields ( ) { var e , t , A ; if ( ! this . scene || ! this . scene . elements ) return ; const i = null !== ( e = this . scene . source . split ( "https://github.com/zsviczian/obsidian-excalidraw-plugin/releases/tag/" ) [ 1 ] ) && void 0 !== e ? e : "1.8.16" , n = this . scene . elements ; for ( const e of n ) { if ( e . boundElements ) { const t = new Map ; e . boundElements . forEach ( ( e => { t . set ( e . id , e . type ) } ) ) ; const A = Array . from ( t , ( ( [ e , t ] ) => ( { id : e , type : t } ) ) ) ; A . length !== e . boundElements . length && ( e . boundElements = A ) } e . boundElementIds && ( e . boundElements || ( e . boundElements = [ ] ) , e . boundElements = e . boundElements . concat ( e . boundElementIds . map ( ( e => ( { type : "arrow" , id : e } ) ) ) ) , delete e . boundElementIds ) , "text" !== e . type || e . containerId || ( e . containerId = null ) , null === e . x && ( e . x = 0 ) , null === e . y && ( e . y = 0 ) , null === ( null === ( t = e . startBinding ) || void 0 === t ? void 0 : t . focus ) && ( e . startBinding . focus = 0 ) , null === ( null === ( A = e . endBinding ) || void 0 === A ? void 0 : A . focus ) && ( e . endBinding . focus = 0 ) , null === e . fontSize && ( e . fontSize = 20 ) } try { n . filter ( ( e => "text" === e . type && e . containerId && n . some ( ( t => t . id === e . containerId && t . boundElements . length > 0 && t . boundElements . some ( ( t => "text" === t . type && t . id !== e . id && t . id . length > 8 ) ) ) ) ) ) . forEach ( ( e => { try { const t = n . filter ( ( t => t . id === e . containerId ) ) [ 0 ] , A = t . boundElements . filter ( ( e => ! ( "text" === e . typ
2023-03-25 16:31:46 +00:00
//!Temporary hack
2023-05-23 05:51:20 +00:00
if ( e . activeExcalidrawView = n , n && ( e . lastActiveExcalidrawFilePath = null === ( A = n . file ) || void 0 === A ? void 0 : A . path ) , app . isMobile && n && ! i ) { const e = document . querySelector ( "body>.app-container>.mobile-navbar" ) ; e && e instanceof HTMLDivElement && ( e . style . position = "relative" ) } if ( app . isMobile && ! n && i ) { const e = document . querySelector ( "body>.app-container>.mobile-navbar" ) ; e && e instanceof HTMLDivElement && ( e . style . position = "" ) } if ( i && i !== n && ( i . leaf !== t && i . semaphores . dirty && ! i . semaphores . viewunload && await i . save ( ! 0 ) , i . file && e . triggerEmbedUpdates ( i . file . path ) ) , n && ( ! i || i . leaf !== t ) ) { const e = n . file ; n . file && setTimeout ( ( ( ) => { var t ; n && n . _loaded && ( null === ( t = n . file ) || void 0 === t ? void 0 : t . path ) === ( null == e ? void 0 : e . path ) && ( n . activeLoader || n . loadSceneFiles ( ) ) } ) , 2e3 ) } if ( n && n . _loaded && n . isLoaded && n . excalidrawAPI && e . ea . onCanvasColorChangeHook && e . ea . onCanvasColorChangeHook ( e . ea , n , n . excalidrawAPI . getAppState ( ) . viewBackgroundColor ) , e . popScope && ( e . popScope ( ) , e . popScope = null ) , n ) { const t = e . app . keymap . getRootScope ( ) , A = t . register ( [ "Mod" ] , "Enter" , ( ( ) => ! 0 ) ) ; t . keys . unshift ( t . keys . pop ( ) ) ; const i = t . register ( [ "Mod" ] , "k" , ( ( ) => ! 0 ) ) ; t . keys . unshift ( t . keys . pop ( ) ) ; const n = t . register ( [ "Mod" ] , "f" , ( ( ) => { const e = this . app . workspace . getActiveViewOfType ( ExcalidrawView ) ; return ! ! e && ( search ( e ) , ! 0 ) } ) ) ; t . keys . unshift ( t . keys . pop ( ) ) ; const a = e . forceSaveCommand && "s" === e . forceSaveCommand . hotkeys [ 0 ] . key && e . forceSaveCommand . hotkeys [ 0 ] . modifiers . includes ( "Ctrl" ) ? t . register ( [ "Ctrl" ] , "s" , ( ( ) => e . forceSaveActiveView ( ! 1 ) ) ) : void 0 ; a && t . keys . unshift ( t . keys . pop ( ) ) , e . popScope = ( ) => { t . unregister ( A ) , t . unregister ( i ) , t . unregister ( n ) , Boolean ( a ) && t . unregister ( a ) } } } ) ) ) , e . addFileSaveTriggerEventHandlers ( ) ; const t = app . metadataCache ; t . getCachedFiles ( ) . forEach ( ( A => { var i ; const n = null === ( i = t . getCache ( A ) ) || void 0 === i ? void 0 : i . frontmatter ; ( n && void 0 !== n [ FRONTMATTER _KEY ] || A . match ( /\.excalidraw$/ ) ) && e . updateFileCache ( app . vault . getAbstractFileByPath ( A ) , n ) } ) ) , this . registerEvent ( t . on ( "changed" , ( ( e , t , A ) => this . updateFileCache ( e , null == A ? void 0 : A . frontmatter ) ) ) ) } ) ) } addFileSaveTriggerEventHandlers ( ) { this . registerEvent ( this . app . workspace . on ( "click" , ( e => { this . activeExcalidrawView && this . activeExcalidrawView . semaphores . dirty && ( ! e . target || "excalidraw__canvas" !== e . target . className && ! getParentOfClass ( e . target , "excalidraw-wrapper" ) ) && this . activeExcalidrawView . save ( ) } ) ) ) , this . registerEvent ( this . app . workspace . on ( "file-menu" , ( ( ) => { this . activeExcalidrawView && this . activeExcalidrawView . semaphores . dirty && this . activeExcalidrawView . save ( ) } ) ) ) , this . modalContainerObserver = new MutationObserver ( ( async e => { 1 === e . length && "childList" === e [ 0 ] . type && 1 === e [ 0 ] . addedNodes . length && this . activeExcalidrawView && this . activeExcalidrawView . semaphores . dirty && this . activeExcalidrawView . save ( ) } ) ) , this . modalContainerObserver . observe ( document . body , { childList : ! 0 } ) ; const e = document . querySelector ( ".workspace-drawer.mod-left" ) , t = document . querySelector ( ".workspace-drawer.mod-right" ) ; if ( e || t ) { const A = async e => { "display: none;" === e [ 0 ] . oldValue && this . activeExcalidrawView && this . activeExcalidrawView . semaphores . dirty && this . activeExcalidrawView . save ( ) } , i = { attributeOldValue : ! 0 , attributeFilter : [ "style" ] } ; e && ( this . workspaceDrawerLeftObserver = new MutationObserver ( A ) , this . workspaceDrawerLeftObserver . observe ( e , i ) ) , t && ( this . workspaceDrawerRightObserver = new MutationObserver ( A ) , this . workspaceDrawerRightObserver . observe ( t , i ) ) } } updateFileCache ( e , t , A = ! 1 ) { t && void 0 !== t [ FRONTMATTER _KEY ] ? this . excalidrawFiles . add ( e ) : A || "excalidraw" !== e . extension ? this . excalidrawFiles . delete ( e ) : this . excalidrawFiles . add ( e ) } onunload ( ) { destroyExcalidrawAutomate ( ) , this . popScope && ( this . popScope ( ) , this . popScope = null ) , this . observer . disconnect ( ) , this . themeObserver . disconnect ( ) , this . modalContainerObserver . disconnect ( ) , this . workspaceDrawerLeftObserver && this . workspaceDrawerLeftObserver . disconnect ( ) , this . workspaceDrawerRightObserver && this . workspaceDrawerRightObserver . disconnect ( ) , this . fileExplorerObserver && this . fileExplorerObserver . disconnect ( ) , this . app . workspace . getLeavesOfType ( "excalidraw" ) . forEach ( ( e => { this . setMarkdownView ( e ) } ) ) , this . mathjaxDiv && document . body . removeChild ( this . mathjaxDiv ) , Object . values ( this . packageMap ) . forEach ( ( e => {