/ *
THIS IS A GENERATED / BUNDLED FILE BY ESBUILD
if you want to view the source , please visit the github repository of this plugin
* /
var c6 = Object . create ; var Y1 = Object . defineProperty ; var a6 = Object . getOwnPropertyDescriptor ; var e6 = Object . getOwnPropertyNames ; var l6 = Object . getPrototypeOf , i6 = Object . prototype . hasOwnProperty ; var p4 = a => Y1 ( a , "__esModule" , { value : ! 0 } ) ; var o6 = ( a , c ) => { p4 ( a ) ; for ( var e in c ) Y1 ( a , e , { get : c [ e ] , enumerable : ! 0 } ) } , r6 = ( a , c , e ) => { if ( c && typeof c == "object" || typeof c == "function" ) for ( let l of e6 ( c ) ) ! i6 . call ( a , l ) && l !== "default" && Y1 ( a , l , { get : ( ) => c [ l ] , enumerable : ! ( e = a6 ( c , l ) ) || e . enumerable } ) ; return a } , a1 = a => r6 ( p4 ( Y1 ( a != null ? c6 ( l6 ( a ) ) : { } , "default" , a && a . _ _esModule && "default" in a ? { get : ( ) => a . default , enumerable : ! 0 } : { value : a , enumerable : ! 0 } ) ) , a ) ; o6 ( exports , { default : ( ) => t4 } ) ; var H = a1 ( require ( "obsidian" ) ) , Y3 = a1 ( require ( "@codemirror/language" ) ) , _ = a1 ( require ( "@codemirror/view" ) ) , _3 = a1 ( require ( "@codemirror/stream-parser" ) ) , d2 = a1 ( require ( "@codemirror/state" ) ) ; var t6 = { prefix : "far" , iconName : "address-book" , icon : [ 448 , 512 , [ ] , "f2b9" , "M436 160c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-20V48c0-26.5-21.5-48-48-48H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h320c26.5 0 48-21.5 48-48v-48h20c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-20v-64h20c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-20v-64h20zm-68 304H48V48h320v416zM208 256c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm-89.6 128h179.2c12.4 0 22.4-8.6 22.4-19.2v-19.2c0-31.8-30.1-57.6-67.2-57.6-10.8 0-18.7 8-44.8 8-26.9 0-33.4-8-44.8-8-37.1 0-67.2 25.8-67.2 57.6v19.2c0 10.6 10 19.2 22.4 19.2z" ] } , n6 = { prefix : "far" , iconName : "address-card" , icon : [ 576 , 512 , [ ] , "f2bb" , "M528 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h480c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm0 400H48V80h480v352zM208 256c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm-89.6 128h179.2c12.4 0 22.4-8.6 22.4-19.2v-19.2c0-31.8-30.1-57.6-67.2-57.6-10.8 0-18.7 8-44.8 8-26.9 0-33.4-8-44.8-8-37.1 0-67.2 25.8-67.2 57.6v19.2c0 10.6 10 19.2 22.4 19.2zM360 320h112c4.4 0 8-3.6 8-8v-16c0-4.4-3.6-8-8-8H360c-4.4 0-8 3.6-8 8v16c0 4.4 3.6 8 8 8zm0-64h112c4.4 0 8-3.6 8-8v-16c0-4.4-3.6-8-8-8H360c-4.4 0-8 3.6-8 8v16c0 4.4 3.6 8 8 8zm0-64h112c4.4 0 8-3.6 8-8v-16c0-4.4-3.6-8-8-8H360c-4.4 0-8 3.6-8 8v16c0 4.4 3.6 8 8 8z" ] } , s6 = { prefix : "far" , iconName : "angry" , icon : [ 496 , 512 , [ ] , "f556" , "M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 448c-110.3 0-200-89.7-200-200S137.7 56 248 56s200 89.7 200 200-89.7 200-200 200zm0-144c-33.6 0-65.2 14.8-86.8 40.6-8.5 10.2-7.1 25.3 3.1 33.8s25.3 7.2 33.8-3c24.8-29.7 75-29.7 99.8 0 8.1 9.7 23.2 11.9 33.8 3 10.2-8.5 11.5-23.6 3.1-33.8-21.6-25.8-53.2-40.6-86.8-40.6zm-48-72c10.3 0 19.9-6.7 23-17.1 3.8-12.7-3.4-26.1-16.1-29.9l-80-24c-12.8-3.9-26.1 3.4-29.9 16.1-3.8 12.7 3.4 26.1 16.1 29.9l28.2 8.5c-3.1 4.9-5.3 10.4-5.3 16.6 0 17.7 14.3 32 32 32s32-14.4 32-32.1zm199-54.9c-3.8-12.7-17.1-19.9-29.9-16.1l-80 24c-12.7 3.8-19.9 17.2-16.1 29.9 3.1 10.4 12.7 17.1 23 17.1 0 17.7 14.3 32 32 32s32-14.3 32-32c0-6.2-2.2-11.7-5.3-16.6l28.2-8.5c12.7-3.7 19.9-17.1 16.1-29.8z" ] } , f6 = { prefix : "far" , iconName : "arrow-alt-circle-down" , icon : [ 512 , 512 , [ ] , "f358" , "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm-32-316v116h-67c-10.7 0-16 12.9-8.5 20.5l99 99c4.7 4.7 12.3 4.7 17 0l99-99c7.6-7.6 2.2-20.5-8.5-20.5h-67V140c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12z" ] } , v6 = { prefix : "far" , iconName : "arrow-alt-circle-left" , icon : [ 512 , 512 , [ ] , "f359" , "M8 256c0 137 111 248 248 248s248-111 248-248S393 8 256 8 8 119 8 256zm448 0c0 110.5-89.5 200-200 200S56 366.5 56 256 145.5 56 256 56s200 89.5 200 200zm-72-20v40c0 6.6-5.4 12-12 12H256v67c0 10.7-12.9 16-20.5 8.5l-99-99c-4.7-4.7-4.7-12.3 0-17l99-99c7.6-7.6 20.5-2.2 20.5 8.5v67h116c6.6 0 12 5.4 12 12z" ] } , m6 = { prefix : "far" , iconName : "arrow-alt-circle-right" , icon : [ 512 , 512 , [ ] , "f35a" , "M504 256C504 119 393 8 256 8S8 119 8 256s111 248 248 248 248-111 248-248zm-448 0c0-110.5 89.5-200 200-200s200 89.5 200 200-89.5 200-200 200S56 366.5 56 256zm72 20v-40c0-6.6 5.4-12 12-12h116v-67c0-10.7 12.9-16 20.5-8.5l99 99c4.7 4.7 4.7 12.3 0 17l-99 99c-7.6 7.6-20.5 2.2-20.5-8.5v-67H140c-6.6 0-12-5.4-12-12z" ] } , h6 =
overflow : visible ;
}
. svg - inline -- fa {
display : inline - block ;
font - size : inherit ;
height : 1 em ;
overflow : visible ;
vertical - align : - 0.125 em ;
}
. svg - inline -- fa . fa - lg {
vertical - align : - 0.225 em ;
}
. svg - inline -- fa . fa - w - 1 {
width : 0.0625 em ;
}
. svg - inline -- fa . fa - w - 2 {
width : 0.125 em ;
}
. svg - inline -- fa . fa - w - 3 {
width : 0.1875 em ;
}
. svg - inline -- fa . fa - w - 4 {
width : 0.25 em ;
}
. svg - inline -- fa . fa - w - 5 {
width : 0.3125 em ;
}
. svg - inline -- fa . fa - w - 6 {
width : 0.375 em ;
}
. svg - inline -- fa . fa - w - 7 {
width : 0.4375 em ;
}
. svg - inline -- fa . fa - w - 8 {
width : 0.5 em ;
}
. svg - inline -- fa . fa - w - 9 {
width : 0.5625 em ;
}
. svg - inline -- fa . fa - w - 10 {
width : 0.625 em ;
}
. svg - inline -- fa . fa - w - 11 {
width : 0.6875 em ;
}
. svg - inline -- fa . fa - w - 12 {
width : 0.75 em ;
}
. svg - inline -- fa . fa - w - 13 {
width : 0.8125 em ;
}
. svg - inline -- fa . fa - w - 14 {
width : 0.875 em ;
}
. svg - inline -- fa . fa - w - 15 {
width : 0.9375 em ;
}
. svg - inline -- fa . fa - w - 16 {
width : 1 em ;
}
. svg - inline -- fa . fa - w - 17 {
width : 1.0625 em ;
}
. svg - inline -- fa . fa - w - 18 {
width : 1.125 em ;
}
. svg - inline -- fa . fa - w - 19 {
width : 1.1875 em ;
}
. svg - inline -- fa . fa - w - 20 {
width : 1.25 em ;
}
. svg - inline -- fa . fa - pull - left {
margin - right : 0.3 em ;
width : auto ;
}
. svg - inline -- fa . fa - pull - right {
margin - left : 0.3 em ;
width : auto ;
}
. svg - inline -- fa . fa - border {
height : 1.5 em ;
}
. svg - inline -- fa . fa - li {
width : 2 em ;
}
. svg - inline -- fa . fa - fw {
width : 1.25 em ;
}
. fa - layers svg . svg - inline -- fa {
bottom : 0 ;
left : 0 ;
margin : auto ;
position : absolute ;
right : 0 ;
top : 0 ;
}
. fa - layers {
display : inline - block ;
height : 1 em ;
position : relative ;
text - align : center ;
vertical - align : - 0.125 em ;
width : 1 em ;
}
. fa - layers svg . svg - inline -- fa {
- webkit - transform - origin : center center ;
transform - origin : center center ;
}
. fa - layers - counter , . fa - layers - text {
display : inline - block ;
position : absolute ;
text - align : center ;
}
. fa - layers - text {
left : 50 % ;
top : 50 % ;
- webkit - transform : translate ( - 50 % , - 50 % ) ;
transform : translate ( - 50 % , - 50 % ) ;
- webkit - transform - origin : center center ;
transform - origin : center center ;
}
. fa - layers - counter {
background - color : # ff253a ;
border - radius : 1 em ;
- webkit - box - sizing : border - box ;
box - sizing : border - box ;
color : # fff ;
height : 1.5 em ;
line - height : 1 ;
max - width : 5 em ;
min - width : 1.5 em ;
overflow : hidden ;
padding : 0.25 em ;
right : 0 ;
text - overflow : ellipsis ;
top : 0 ;
- webkit - transform : scale ( 0.25 ) ;
transform : scale ( 0.25 ) ;
- webkit - transform - origin : top right ;
transform - origin : top right ;
}
. fa - layers - bottom - right {
bottom : 0 ;
right : 0 ;
top : auto ;
- webkit - transform : scale ( 0.25 ) ;
transform : scale ( 0.25 ) ;
- webkit - transform - origin : bottom right ;
transform - origin : bottom right ;
}
. fa - layers - bottom - left {
bottom : 0 ;
left : 0 ;
right : auto ;
top : auto ;
- webkit - transform : scale ( 0.25 ) ;
transform : scale ( 0.25 ) ;
- webkit - transform - origin : bottom left ;
transform - origin : bottom left ;
}
. fa - layers - top - right {
right : 0 ;
top : 0 ;
- webkit - transform : scale ( 0.25 ) ;
transform : scale ( 0.25 ) ;
- webkit - transform - origin : top right ;
transform - origin : top right ;
}
. fa - layers - top - left {
left : 0 ;
right : auto ;
top : 0 ;
- webkit - transform : scale ( 0.25 ) ;
transform : scale ( 0.25 ) ;
- webkit - transform - origin : top left ;
transform - origin : top left ;
}
. fa - lg {
font - size : 1.3333333333 em ;
line - height : 0.75 em ;
vertical - align : - 0.0667 em ;
}
. fa - xs {
font - size : 0.75 em ;
}
. fa - sm {
font - size : 0.875 em ;
}
. fa - 1 x {
font - size : 1 em ;
}
. fa - 2 x {
font - size : 2 em ;
}
. fa - 3 x {
font - size : 3 em ;
}
. fa - 4 x {
font - size : 4 em ;
}
. fa - 5 x {
font - size : 5 em ;
}
. fa - 6 x {
font - size : 6 em ;
}
. fa - 7 x {
font - size : 7 em ;
}
. fa - 8 x {
font - size : 8 em ;
}
. fa - 9 x {
font - size : 9 em ;
}
. fa - 10 x {
font - size : 10 em ;
}
. fa - fw {
text - align : center ;
width : 1.25 em ;
}
. fa - ul {
list - style - type : none ;
margin - left : 2.5 em ;
padding - left : 0 ;
}
. fa - ul > li {
position : relative ;
}
. fa - li {
left : - 2 em ;
position : absolute ;
text - align : center ;
width : 2 em ;
line - height : inherit ;
}
. fa - border {
border : solid 0.08 em # eee ;
border - radius : 0.1 em ;
padding : 0.2 em 0.25 em 0.15 em ;
}
. fa - pull - left {
float : left ;
}
. fa - pull - right {
float : right ;
}
. fa . fa - pull - left ,
. fas . fa - pull - left ,
. far . fa - pull - left ,
. fal . fa - pull - left ,
. fab . fa - pull - left {
margin - right : 0.3 em ;
}
. fa . fa - pull - right ,
. fas . fa - pull - right ,
. far . fa - pull - right ,
. fal . fa - pull - right ,
. fab . fa - pull - right {
margin - left : 0.3 em ;
}
. fa - spin {
- webkit - animation : fa - spin 2 s infinite linear ;
animation : fa - spin 2 s infinite linear ;
}
. fa - pulse {
- webkit - animation : fa - spin 1 s infinite steps ( 8 ) ;
animation : fa - spin 1 s infinite steps ( 8 ) ;
}
@ - webkit - keyframes fa - spin {
0 % {
- webkit - transform : rotate ( 0 deg ) ;
transform : rotate ( 0 deg ) ;
}
100 % {
- webkit - transform : rotate ( 360 deg ) ;
transform : rotate ( 360 deg ) ;
}
}
@ keyframes fa - spin {
0 % {
- webkit - transform : rotate ( 0 deg ) ;
transform : rotate ( 0 deg ) ;
}
100 % {
- webkit - transform : rotate ( 360 deg ) ;
transform : rotate ( 360 deg ) ;
}
}
. fa - rotate - 90 {
- ms - filter : "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)" ;
- webkit - transform : rotate ( 90 deg ) ;
transform : rotate ( 90 deg ) ;
}
. fa - rotate - 180 {
- ms - filter : "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)" ;
- webkit - transform : rotate ( 180 deg ) ;
transform : rotate ( 180 deg ) ;
}
. fa - rotate - 270 {
- ms - filter : "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)" ;
- webkit - transform : rotate ( 270 deg ) ;
transform : rotate ( 270 deg ) ;
}
. fa - flip - horizontal {
- ms - filter : "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)" ;
- webkit - transform : scale ( - 1 , 1 ) ;
transform : scale ( - 1 , 1 ) ;
}
. fa - flip - vertical {
- ms - filter : "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)" ;
- webkit - transform : scale ( 1 , - 1 ) ;
transform : scale ( 1 , - 1 ) ;
}
. fa - flip - both , . fa - flip - horizontal . fa - flip - vertical {
- ms - filter : "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)" ;
- webkit - transform : scale ( - 1 , - 1 ) ;
transform : scale ( - 1 , - 1 ) ;
}
: root . fa - rotate - 90 ,
: root . fa - rotate - 180 ,
: root . fa - rotate - 270 ,
: root . fa - flip - horizontal ,
: root . fa - flip - vertical ,
: root . fa - flip - both {
- webkit - filter : none ;
filter : none ;
}
. fa - stack {
display : inline - block ;
height : 2 em ;
position : relative ;
width : 2.5 em ;
}
. fa - stack - 1 x ,
. fa - stack - 2 x {
bottom : 0 ;
left : 0 ;
margin : auto ;
position : absolute ;
right : 0 ;
top : 0 ;
}
. svg - inline -- fa . fa - stack - 1 x {
height : 1 em ;
width : 1.25 em ;
}
. svg - inline -- fa . fa - stack - 2 x {
height : 2 em ;
width : 2.5 em ;
}
. fa - inverse {
color : # fff ;
}
. sr - only {
border : 0 ;
clip : rect ( 0 , 0 , 0 , 0 ) ;
height : 1 px ;
margin : - 1 px ;
overflow : hidden ;
padding : 0 ;
position : absolute ;
width : 1 px ;
}
. sr - only - focusable : active , . sr - only - focusable : focus {
clip : auto ;
height : auto ;
margin : 0 ;
overflow : visible ;
position : static ;
width : auto ;
}
. svg - inline -- fa . fa - primary {
fill : var ( -- fa - primary - color , currentColor ) ;
opacity : 1 ;
opacity : var ( -- fa - primary - opacity , 1 ) ;
}
. svg - inline -- fa . fa - secondary {
fill : var ( -- fa - secondary - color , currentColor ) ;
opacity : 0.4 ;
opacity : var ( -- fa - secondary - opacity , 0.4 ) ;
}
. svg - inline -- fa . fa - swap - opacity . fa - primary {
opacity : 0.4 ;
opacity : var ( -- fa - secondary - opacity , 0.4 ) ;
}
. svg - inline -- fa . fa - swap - opacity . fa - secondary {
opacity : 1 ;
opacity : var ( -- fa - primary - opacity , 1 ) ;
}
. svg - inline -- fa mask . fa - primary ,
. svg - inline -- fa mask . fa - secondary {
fill : black ;
}
. fad . fa - inverse {
color : # fff ;
} ` ;function EL(){var a=H4,c=L4,e=j.familyPrefix,l=j.replacementClass,i=kL;if(e!==a||l!==c){var o=new RegExp(" \\ .".concat(a," \\ -"),"g"),n=new RegExp(" \\ --".concat(a," \\ -"),"g"),r=new RegExp(" \\ .".concat(c),"g");i=i.replace(o,".".concat(e,"-")).replace(n,"--".concat(e,"-")).replace(r,".".concat(l))}return i}var DL=function(){function a(){cL(this,a),this.definitions={}}return aL(a,[{key:"add",value:function(){for(var e=this,l=arguments.length,i=new Array(l),o=0;o<l;o++)i[o]=arguments[o];var n=i.reduce(this._pullDefinitions,{});Object.keys(n).forEach(function(r){e.definitions[r]=N({},e.definitions[r]||{},n[r]),T4(r,n[r]),G4()})}},{key:"reset",value:function(){this.definitions={}}},{key:"_pullDefinitions",value:function(e,l){var i=l.prefix&&l.iconName&&l.icon?{0:l}:l;return Object.keys(i).map(function(o){var n=i[o],r=n.prefix,t=n.iconName,f=n.icon;e[r]||(e[r]={}),e[r][t]=f}),e}}]),a}();function RL(){j.autoAddCss&&!j4&&(wL(EL()),j4=!0)}function TL(a,c){return Object.defineProperty(a,"abstract",{get:c}),Object.defineProperty(a,"html",{get:function(){return a.abstract.map(function(l){return O4(l)})}}),Object.defineProperty(a,"node",{get:function(){if(!!N2){var l=P.createElement("div");return l.innerHTML=a.html,l.children}}}),a}function X(a){var c=a.prefix,e=c===void 0?"fa":c,l=a.iconName;if(!!l)return P4(E2.definitions,e,l)||P4(e1.styles,e,l)}function ZL(a){return function(c){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=(c||{}).icon?c:X(c||{}),i=e.mask;return i&&(i=(i||{}).icon?i:X(i||{})),a(l,N({},e,{mask:i}))}}var E2=new DL;var j4=!1;var B1=ZL(function(a){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=c.transform,l=e===void 0?y1:e,i=c.symbol,o=i===void 0?!1:i,n=c.mask,r=n===void 0?null:n,t=c.maskId,f=t===void 0?null:t,s=c.title,v=s===void 0?null:s,m=c.titleId,z=m===void 0?null:m,p=c.classes,h=p===void 0?[]:p,g=c.attributes,M=g===void 0?{}:g,C=c.styles,x=C===void 0?{}:C;if(!!a){var d=a.prefix,b=a.iconName,w=a.icon;return TL(N({type:"icon"},a),function(){return RL(),j.autoA11y&&(v?M["aria-labelledby"]="".concat(j.replacementClass,"-title-").concat(z||e2()):(M["aria-hidden"]="true",M.focusable="false")),BL({icons:{main:X4(w),mask:r?X4(r.icon):{found:!1,width:null,height:null,icon:{}}},prefix:d,iconName:b,transform:N({},y1,l),symbol:o,title:v,maskId:f,titleId:z,extra:{attributes:M,styles:x,classes:h}})})}});var D1={acid:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M391.998 391.993c29.992 0 60.009 29.992 119.994 29.992s90.002-29.992 119.994-29.992c90.002 0 29.992 60.009 0 90.002 0 299.997 240.013 450.008 240.013 509.992H152.012c0-60.009 240.013-209.995 240.013-509.992-30.017-29.992-90.027-90.002-.025-90.002zm150.011-29.992c0 16.565-13.427 29.992-29.992 29.992s-29.992-13.427-29.992-29.992 13.427-29.992 29.992-29.992c16.54-.025 29.992 13.427 29.992 29.992zm29.992-270.004c0 33.129-26.855 60.009-60.009 60.009-33.129 0-60.009-26.855-60.009-60.009 0-33.129 26.855-60.009 60.009-60.009 33.155.025 60.009 26.88 60.009 60.009zm-90.002 150.011c0 33.129-26.855 60.009-60.009 60.009s-60.009-26.855-60.009-60.009c0-33.129 26.855-60.009 60.009-60.009s60.009 26.855 60.009 60.009zM601.993 272c0 16.565-13.427 29.992-29.992 29.992S542.009 288.565 542.009 272s13.427-29.992 29.992-29.992 29.992 13.427 29.992 29.992z"/></svg>',acorn:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M731.604 153.246l.047.03c54.711-24.345 118.046-40.713 227.398-14.508-51.275-157.925-189.5-108.798-276.719-14.795l.12.067C478.176 12.449 336.428 60.931 219.28 187.849a996.637 996.637 0 0 1 77.126 14.256c-43.502 22.536-82.541 59.566-114.172 114.29v.007c-84.476 146.153-123.47 396.036-48.968 530.594l128.531 92.68c175.498 37.888 424.987-98.735 520.449-263.906 32.586-56.385 46.417-110.62 45.23-161.393a1562.236 1562.236 0 0 1 48.267 52.072c63.747-160.566 41.082-293.818-144.138-413.202zm81.52 346.551zM697.827 132.651a765.736 765.736 0 0 0-8.113-4.6 648.534 648.534 0 0 1 8.113 4.6zm25.86 15.562l-.613-.383c.202.127.409.254.613.383zm-8.132-5.035c-.875-.533-1
` ).slice(c),i=l.indexOf(l.find(t=>t==e)),o=i+1;for(;o<l.length&&/^(?: {2,4}| \t )+[ \s \S ]*?/.test(l[o]);o++);let n=l.slice(i+1,o).join( `
` ),r=n.split( `
` )[0].match(/^( \s +)/);return n=n.replace(new RegExp( ` ^ $ { r [ 0 ] || "" } ` ,"gm"),""),{start:i+c,end:o+c-1,src:n,type:e.split("-").pop()}}function OL(a,c){for(let e=0;e<c.length;e++)if(a.startsWith(c[e]))return e;return!1}function _4(a,c,e){let l=e.title??a[0].toUpperCase()+a.slice(1).toLowerCase(),i=["title:","collapse:","icon:","color:"],o=["title","collapse","icon","color"],n=c.split( `
` ),r=0,t={};for(let p=0;p<n.length;p++){let h=OL(n[p],i);if(h===!1)break;let g=o[h];if(t[g]!==void 0)break;t[g]=n[p].slice(i[h].length).trim(),++r}let{title:f,collapse:s,icon:v,color:m}=t,z=n.slice(r).join( `
` );return s!==void 0&&s!=="none"&&s!=="open"&&s!=="closed"&&(s="closed"),"title"in t||e.noTitle||(f=l),f&&f.trim()===""&&s!==void 0&&s!=="none"&&(f=l,new Y4.Notice("An admonition must have a title if it is collapsible.")),{title:f,collapse:s,content:z,icon:v,color:m}}var K4='<svg viewBox="0 0 100 100" class="add-admonition-command"><path fill="currentColor" stroke="currentColor" d="M37,16c-4.4,0-8.3,3.3-9.2,7.6l-11.6,52c-0.5,2.2,0,4.3,1.2,5.9c1.2,1.6,3.2,2.6,5.4,2.6H79c4.4,0,8.3-3.3,9.2-7.6 l11.6-52c0.5-2.2,0-4.3-1.2-5.9C97.4,17,95.4,16,93.2,16L37,16z M37,20h56.2c1.1,0,1.8,0.4,2.2,1c0.5,0.6,0.7,1.4,0.4,2.6l-1,4.4 H30.8l0.8-3.6C32.1,22.2,34.8,20,37,20z M29.9,32H94l-9.6,43.6C83.9,77.8,81.2,80,79,80H22.8c-1.1,0-1.8-0.4-2.2-1 c-0.5-0.6-0.7-1.4-0.4-2.6L29.9,32z M0,36v4h19.6l0.9-4L0,36z M36.7,38c-0.8,0.1-1.4,0.7-1.6,1.5l-3.5,14c-0.2,0.6,0,1.2,0.4,1.7 c0.4,0.5,1,0.8,1.6,0.8H81c0.9,0,1.7-0.6,1.9-1.5l3.5-14c0.2-0.6,0-1.3-0.4-1.8c-0.4-0.5-1-0.8-1.6-0.8H37.1c-0.1,0-0.1,0-0.2,0 C36.9,38,36.8,38,36.7,38L36.7,38z M38.7,42h43.2l-2.4,10H36.2L38.7,42z M0,52v4h16l0.9-4H0z M0,68v4h12.4l0.9-4H0z"></path><circle fill="white" transform="translate(50 50) scale(3 3)" cx="8" cy="8" r="8"/><path fill="green" transform="translate(50 50) scale(3 3)" d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.5 4.5a.5.5 0 0 0-1 0v3h-3a.5.5 0 0 0 0 1h3v3a.5.5 0 0 0 1 0v-3h3a.5.5 0 0 0 0-1h-3v-3z"/></svg>',o2=Symbol("add-command"), $ 4='<svg viewBox="0 0 100 100" class="remove-admonition-command"><path fill="currentColor" stroke="currentColor" d="M37,16c-4.4,0-8.3,3.3-9.2,7.6l-11.6,52c-0.5,2.2,0,4.3,1.2,5.9c1.2,1.6,3.2,2.6,5.4,2.6H79c4.4,0,8.3-3.3,9.2-7.6 l11.6-52c0.5-2.2,0-4.3-1.2-5.9C97.4,17,95.4,16,93.2,16L37,16z M37,20h56.2c1.1,0,1.8,0.4,2.2,1c0.5,0.6,0.7,1.4,0.4,2.6l-1,4.4 H30.8l0.8-3.6C32.1,22.2,34.8,20,37,20z M29.9,32H94l-9.6,43.6C83.9,77.8,81.2,80,79,80H22.8c-1.1,0-1.8-0.4-2.2-1 c-0.5-0.6-0.7-1.4-0.4-2.6L29.9,32z M0,36v4h19.6l0.9-4L0,36z M36.7,38c-0.8,0.1-1.4,0.7-1.6,1.5l-3.5,14c-0.2,0.6,0,1.2,0.4,1.7 c0.4,0.5,1,0.8,1.6,0.8H81c0.9,0,1.7-0.6,1.9-1.5l3.5-14c0.2-0.6,0-1.3-0.4-1.8c-0.4-0.5-1-0.8-1.6-0.8H37.1c-0.1,0-0.1,0-0.2,0 C36.9,38,36.8,38,36.7,38L36.7,38z M38.7,42h43.2l-2.4,10H36.2L38.7,42z M0,52v4h16l0.9-4H0z M0,68v4h12.4l0.9-4H0z"></path><circle fill="white" transform="translate(50 50) scale(3 3)" cx="8" cy="8" r="8"/><path fill="#dc3545" transform="translate(50 50) scale(3 3)" d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM4.5 7.5a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1h-7z"/></svg>',r2=Symbol("remove-command"),c3=/^> \[ !( \w +)(?::[ ]?(.+)?)? \] (x| \+ | \- )?/,t2={note:{type:"note",color:"68, 138, 255",icon:{type:"font-awesome",name:"pencil-alt"},command:!1,injectColor:!0,noTitle:!1,copy:!1},seealso:{type:"note",color:"68, 138, 255",icon:{type:"font-awesome",name:"pencil-alt"},command:!1,injectColor:!0,noTitle:!1,copy:!1},abstract:{type:"abstract",color:"0, 176, 255",icon:{type:"font-awesome",name:"book"},command:!1,injectColor:!0,noTitle:!1,copy:!1},summary:{type:"abstract",color:"0, 176, 255",icon:{type:"font-awesome",name:"book"},command:!1,injectColor:!0,noTitle:!1,copy:!1},tldr:{type:"abstract",color:"0, 176, 255",icon:{type:"font-awesome",name:"book"},command:!1,injectColor:!0,noTitle:!1,copy:!1},info:{type:"info",color:"0, 184, 212",icon:{type:"font-awesome",name:"info-circle"},command:!1,injectColor:!0,noTitle:!1,copy:!1},todo:{type:"info",color:"0, 184, 212",icon:{type:"font-awesome",name:"info-circle"},command:!1,injectColor:!0,noTitle:!1,copy:!1},tip:{type:"tip",color:"0, 191, 165",icon:{type:"font-awesome",name:"fire"},command:!1,injectColor:!0,noTitle:!1,copy:!1},hint:{type:"tip",color:"0, 191, 165",icon:{type:"font-awesome",name:"fire"},command:!1,injectColor:!0,noTitle:!1,copy:!1},important:{type:"tip",color:"0, 191, 165",icon:{type:"font-awesome",name:"fire"},command:!1,injectColor:!0,noTitle:!1,copy:!1},success:{type:"success",color:"0, 200, 83",icon:{type:"font-awesome",name:"check-circle"},command:!1,injectColor:!0,noTitle:!1,copy:!1},check:{type:"success",color:"0, 200, 83",icon:{type:"font-awesome",name:"check-circle"},command:!1,injectColor:!0,noTitle:!1,copy
` ),(this.plugin.data.autoCollapse&&this.collapse!=this.plugin.data.defaultCollapseType||!this.plugin.data.autoCollapse&&this.collapse!="none")&&(f= ` collapse : $ { this . collapse }
` ),this.editor.getDoc().replaceSelection( ` \ ` \` \` ad- ${ this . type }
$ { t } $ { f }
$ { this . editor . getDoc ( ) . getSelection ( ) }
\ ` \` \`
` );let s=this.editor.getCursor();this.editor.setCursor(s.line-3)}catch{new Z.Notice("There was an issue inserting the admonition.")}this.close()})).addExtraButton(r=>{r.setIcon("cross").setTooltip("Cancel").onClick(()=>this.close()),r.extraSettingsEl.setAttr("tabindex",0),r.extraSettingsEl.onkeydown=t=>{t.key=="Enter"&&this.close()}})}buildAdmonition(){if(this.admonitionEl.empty(),this.type&&this.plugin.admonitions[this.type]){let c=this.plugin.admonitions[this.type];this.element=this.plugin.getAdmonitionElement(this.type,this.title,c.icon,c.injectColor??this.plugin.data.injectColor?c.color:null,this.collapse),this.element.createDiv({cls:"admonition-content",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla."}),this.admonitionEl.appendChild(this.element)}}};var H3= ` ( function webpackUniversalModuleDefinition ( root , factory ) {
if ( typeof exports === 'object' && typeof module === 'object' )
module . exports = factory ( ) ;
else if ( typeof define === 'function' && define . amd )
define ( [ ] , factory ) ;
else {
var a = factory ( ) ;
for ( var i in a ) ( typeof exports === 'object' ? exports : root ) [ i ] = a [ i ] ;
}
} ) ( self , function ( ) {
return /******/ ( ( ) => { // webpackBootstrap
/******/ "use strict" ;
/******/ // The require scope
/******/ var _ _webpack _require _ _ = { } ;
/******/
/************************************************************************/
/******/ /* webpack/runtime/make namespace object */
/******/ ( ( ) => {
/******/ // define __esModule on exports
/******/ _ _webpack _require _ _ . r = ( exports ) => {
/******/ if ( typeof Symbol !== 'undefined' && Symbol . toStringTag ) {
/******/ Object . defineProperty ( exports , Symbol . toStringTag , { value : 'Module' } ) ;
/******/ }
/******/ Object . defineProperty ( exports , '__esModule' , { value : true } ) ;
/******/ } ;
/******/ } ) ( ) ;
/******/
/************************************************************************/
var _ _webpack _exports _ _ = { } ;
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
function createEl ( tag , t , e ) {
const i = document . createElement ( tag ) ;
"string" == typeof t &&
( t = {
cls : t
} ) ;
const r = t || { } , o = r . cls , s = r . text , a = r . attr , l = r . title , c = r . value , u = r . type , h = e ? e : r . parent , p = r . prepend , d = r . href ;
return ( o &&
( Array . isArray ( o )
? ( i . className = o . join ( " " ) )
: ( i . className = o ) ) ,
s && ( i . textContent = s ) ,
a &&
Object . keys ( a ) . forEach ( ( t ) => {
const n = a [ t ] ;
null !== n && i . setAttribute ( t , String ( n ) ) ;
} ) ,
l && ( i . title = l ) ,
c &&
( i instanceof HTMLInputElement ||
i instanceof HTMLSelectElement ||
i instanceof HTMLOptionElement ) &&
( i . value = c ) ,
/* u && i instanceof HTMLInputElement && (i.type = u), */
u && i instanceof HTMLStyleElement && i . setAttribute ( "type" , u ) ,
d &&
( i instanceof HTMLAnchorElement || i instanceof HTMLLinkElement ) &&
( i . href = d ) ,
h && ( p ? h . insertBefore ( i , h . firstChild ) : h . appendChild ( i ) ) ,
i ) ;
}
//@ts-ignore-line
const createDiv = function ( o , e ) {
return createEl ( "div" , o , e ) ;
} ;
Node . prototype . createDiv = function ( o , cb ) {
return createDiv ( o , this ) ;
} ;
Node . prototype . createEl = function ( tag , o , cb ) {
return createEl ( tag , o , this ) ;
} ;
Element . prototype . addClass = function ( ... args ) {
const e = [ ] ;
for ( let t = 0 ; t < args . length ; t ++ )
e [ t ] = args [ t ] ;
this . addClasses ( e ) ;
} ;
Element . prototype . addClasses = function ( e ) {
for ( let t = 0 ; t < e . length ; t ++ )
this . classList . add ( e [ t ] ) ;
} ;
function getAdmonitionElement ( type , title , icon , color , collapse , id ) {
var _a ;
let admonition , titleEl , attrs = {
style : \ ` --admonition-color: \$ {color}; \`
} ;
if ( collapse && collapse != "none" ) {
if ( collapse === "open" ) {
attrs . open = "open" ;
}
admonition = createEl ( "details" , {
cls : \ ` admonition admonition- \$ {type} admonition-plugin \` ,
attr : attrs
} ) ;
titleEl = admonition . createEl ( "summary" , {
cls : \ ` admonition-title \$ {!(title === null || title === void 0 ? void 0 : title.trim().length) ? "no-title" : ""} \`
} ) ;
}
else {
admonition = createDiv ( {
cls : \ ` admonition admonition- \$ {type} admonition-plugin \` ,
attr : attrs
} ) ;
titleEl = admonition . createDiv ( {
cls : \ ` admonition-title \$ {!(title === null || title === void 0 ? void 0 : title.trim().length) ? "no-title" : ""} \`
} ) ;
}
if ( id ) {
admonition . id = id ;
}
if ( title && title . trim ( ) . length ) {
/ * *
* Title structure
* < div | summary > . admonition - title
* < element > . admonition - title - content - Rendered Markdown top - level element ( e . g . H1 / 2 / 3 etc , p )
* div . admonition - title - icon
* svg
* div . admonition - title - markdown - Container of rendered markdown
* ... rendered markdown children ...
* /
//get markdown
const markdownHolder = createDiv ( ) ;
//MarkdownRenderer.renderMarkdown(title, markdownHolder, "", null);
//admonition-title-content is first child of rendered markdown
const admonitionTitleContent =
/ * m a r k d o w n H o l d e r ? . c h i l d r e n [ 0 ] ? . t a g N a m e = = = " P "
? createDiv ( )
: markdownHolder . children [ 0 ] ? ? * / c r e a t e D i v ( ) ;
//get children of markdown element, then remove them
const markdownElements = Array . from ( ( ( _a = markdownHolder . children [ 0 ] ) === null || _a === void 0 ? void 0 : _a . childNodes ) || [ ] ) ;
admonitionTitleContent . innerHTML = "" ;
admonitionTitleContent . addClass ( "admonition-title-content" ) ;
//build icon element
const iconEl = admonitionTitleContent . createDiv ( "admonition-title-icon" ) ;
if ( icon ) {
iconEl . innerHTML = icon ;
}
//add markdown children back
const admonitionTitleMarkdown = admonitionTitleContent . createDiv ( "admonition-title-markdown" ) ;
admonitionTitleMarkdown . innerText = title ;
/ * f o r ( l e t i = 0 ; i < m a r k d o w n E l e m e n t s . l e n g t h ; i + + ) {
admonitionTitleMarkdown . appendChild ( markdownElements [ i ] ) ;
} * /
titleEl . appendChild ( admonitionTitleContent || createDiv ( ) ) ;
}
//add them to title element
if ( collapse ) {
titleEl . createDiv ( "collapser" ) . createDiv ( "handle" ) ;
}
return admonition ;
}
function startsWithAny ( str , needles ) {
for ( let i = 0 ; i < needles . length ; i ++ ) {
if ( str . startsWith ( needles [ i ] ) ) {
return i ;
}
}
return false ;
}
function getParametersFromSource ( type , src ) {
const keywordTokens = [ "title:" , "collapse:" , "icon:" , "color:" ] ;
const keywords = [ "title" , "collapse" , "icon" , "color" ] ;
let lines = src . split ( "\\n" ) ;
let skipLines = 0 ;
let params = { } ;
for ( let i = 0 ; i < lines . length ; i ++ ) {
let keywordIndex = startsWithAny ( lines [ i ] , keywordTokens ) ;
if ( keywordIndex === false ) {
break ;
}
let foundKeyword = keywords [ keywordIndex ] ;
if ( params [ foundKeyword ] !== undefined ) {
break ;
}
params [ foundKeyword ] = lines [ i ]
. substr ( keywordTokens [ keywordIndex ] . length )
. trim ( ) ;
++ skipLines ;
}
let { title = type [ 0 ] . toUpperCase ( ) + type . slice ( 1 ) . toLowerCase ( ) , collapse , icon , color } = params ;
let content = lines . slice ( skipLines ) . join ( "\\n" ) ;
/ * *
* If the admonition should collapse , but something other than open or closed was provided , set to closed .
* /
if ( collapse !== undefined &&
collapse !== "none" &&
collapse !== "open" &&
collapse !== "closed" ) {
collapse = "closed" ;
}
/ * *
* If the admonition should collapse , but title was blanked , set the default title .
* /
if ( title . trim ( ) === "" && collapse !== undefined && collapse !== "none" ) {
title = type [ 0 ] . toUpperCase ( ) + type . slice ( 1 ) . toLowerCase ( ) ;
return ;
}
return { title , collapse , content , icon , color } ;
}
const blockSet = new Set ( ) ;
const ADMONITION _ICON _MAP = { } ;
if ( document . readyState === "complete" ) {
postprocess ( ) ;
registerToProcess ( ) ;
}
else {
window . onload = ( ) => {
postprocess ( ) ;
registerToProcess ( ) ;
} ;
}
function registerToProcess ( ) {
const sizer = document . querySelector ( ".markdown-preview-sizer" ) ;
const observer = new MutationObserver ( ( mutations ) => {
mutations . forEach ( ( mutation ) => {
if ( mutation . type == "childList" && mutation . addedNodes . length ) {
mutation . addedNodes . forEach ( ( node ) => {
var _a ;
if ( node &&
node instanceof Element &&
node . children . length &&
( ( _a = node . firstElementChild ) === null || _a === void 0 ? void 0 : _a . tagName ) === "PRE" ) {
//postprocess(node);
preObserver . observe ( node . firstChild , {
attributes : true ,
childList : false ,
characterData : false ,
subtree : false
} ) ;
}
} ) ;
}
} ) ;
} ) ;
observer . observe ( sizer , {
attributes : false ,
childList : true ,
subtree : false
} ) ;
const preObserver = new MutationObserver ( ( mutations ) => {
mutations . forEach ( ( mutation ) => {
if ( mutation . target instanceof HTMLPreElement &&
! blockSet . has ( mutation . target ) &&
mutation . type === "attributes" &&
mutation . attributeName === "class" &&
Array . from ( mutation . target . classList ) . some ( ( cls ) => / language - ad - ( \ \ w + ) / . test ( cls ) ) ) {
blockSet . add ( mutation . target ) ;
processAdmonitionBlock ( mutation . target ) ;
}
} ) ;
} ) ;
}
function processAdmonitionBlock ( admonitionBlock ) {
const [ , type ] = admonitionBlock . classList
. toString ( )
. match ( /language-ad-(\\w+)/ ) ;
if ( ! type )
return ;
if ( ! ( type in ADMONITION _ICON _MAP ) )
return ;
let { title = type [ 0 ] . toUpperCase ( ) + type . slice ( 1 ) . toLowerCase ( ) , collapse , content , icon = ADMONITION _ICON _MAP [ type ] . icon , color = ADMONITION _ICON _MAP [ type ] . color } = getParametersFromSource ( type , admonitionBlock . innerText ) ;
let admonition = getAdmonitionElement ( type , title , icon , color , collapse ) ;
const contentHolder = admonition . createDiv ( "admonition-content-holder" ) ;
const admonitionContent = contentHolder . createDiv ( "admonition-content" ) ;
admonitionContent . innerText = content ;
admonitionBlock . replaceWith ( admonition ) ;
}
function postprocess ( ) {
//do work
const admonitions = document . querySelectorAll ( "pre[class*='language-ad']" ) ;
if ( ! admonitions . length )
return ;
for ( let admonitionBlock of Array . from ( admonitions ) ) {
blockSet . add ( admonitionBlock ) ;
const [ , type ] = admonitionBlock . classList
. toString ( )
. match ( /language-ad-(\\w+)/ ) ;
if ( ! type )
continue ;
if ( ! ( type in ADMONITION _ICON _MAP ) )
continue ;
let { title = type [ 0 ] . toUpperCase ( ) + type . slice ( 1 ) . toLowerCase ( ) , collapse , content , icon = ADMONITION _ICON _MAP [ type ] . icon , color = ADMONITION _ICON _MAP [ type ] . color } = getParametersFromSource ( type , admonitionBlock . innerText ) ;
let admonition = getAdmonitionElement ( type , title , icon , color , collapse ) ;
const contentHolder = admonition . createDiv ( "admonition-content-holder" ) ;
const admonitionContent = contentHolder . createDiv ( "admonition-content" ) ;
admonitionContent . innerText = content ;
admonitionBlock . replaceWith ( admonition ) ;
}
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGlzaC5hZG1vbml0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsicHVibGlzaC5hZG1vbml0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sb0JBQW9CLENBQUM7QUFFNUIsU0FBUyxRQUFRLENBQ2IsR0FBTSxFQUNOLENBQTJCLEVBQzNCLENBQWU7SUFFZixNQUFNLENBQUMsR0FBRyxRQUFRLENBQUMsYUFBYSxDQUFDLEdBQUcsQ0FBQyxDQUFDO0lBQ3RDLFFBQVEsSUFBSSxPQUFPLENBQUM7UUFDaEIsQ0FBQyxDQUFDLEdBQUc7WUFDRCxHQUFHLEVBQUUsQ0FBQztTQUNULENBQUMsQ0FBQztJQUNQLE1BQU0sQ0FBQyxHQUFHLENBQUMsSUFBSSxFQUFFLEVBQ2IsQ0FBQyxHQUFHLENBQUMsQ0FBQyxHQUFHLEVBQ1QsQ0FBQyxHQUFHLENBQUMsQ0FBQyxJQUFJLEVBQ1YsQ0FBQyxHQUFHLENBQUMsQ0FBQyxJQUFJLEVBQ1YsQ0FBQyxHQUFHLENBQUMsQ0FBQyxLQUFLLEVBQ1gsQ0FBQyxHQUFHLENBQUMsQ0FBQyxLQUFLLEVBQ1gsQ0FBQyxHQUFHLENBQUMsQ0FBQyxJQUFJLEVBQ1YsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsTUFBTSxFQUNwQixDQUFDLEdBQUcsQ0FBQyxDQUFDLE9BQU8sRUFDYixDQUFDLEdBQUcsQ0FBQyxDQUFDLElBQUksQ0FBQztJQUNmLE9BQU8sQ0FDSCxDQUFDO1FBQ0csQ0FBQyxLQUFLLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQztZQUNiLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxTQUFTLEdBQUcsQ0FBQyxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztZQUM3QixDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsU0FBUyxHQUFHLENBQUMsQ0FBQyxDQUFDO1FBQzVCLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxX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
/******/ return _ _webpack _exports _ _ ;
/******/ } ) ( )
;
} ) ; ` ;var X3=a1(require("obsidian"));var L3={};var V3={};var b3={};var N3={};var i4={"Admonition Settings":"Admonition Settings","Use Obsidian's markdown syntax highlighter in admonition code blocks. This setting is experimental and could cause errors.":"Use Obsidian's markdown syntax highlighter in admonition code blocks. This setting is experimental and could cause errors.","Markdown Syntax Highlighting":"Markdown Syntax Highlighting","Try to sync internal links to the metadata cache to display in graph view. This setting could have unintended consequences. Use at your own risk.":"Try to sync internal links to the metadata cache to display in graph view. This setting could have unintended consequences. Use at your own risk."," Sync Links to Metadata Cache":" Sync Links to Metadata Cache","Allows admonitions to be created using ":"Allows admonitions to be created using "," or ":" or ",", instead of using a code block.":", instead of using a code block."," Enable Non-codeblock Admonitions":" Enable Non-codeblock Admonitions","Collapsible by Default":"Collapsible by Default","All admonitions will be collapsible by default. Use ":"All admonitions will be collapsible by default. Use "," to prevent.":" to prevent.","Default Collapse Type":"Default Collapse Type","Collapsible admonitions will be either opened or closed.":"Collapsible admonitions will be either opened or closed.","Add Copy Button":"Add Copy Button","Add a 'copy content' button to admonitions.":"Add a 'copy content' button to admonitions.","Add New":"Add New","Add a new Admonition type.":"Add a new Admonition type.","Add Additional":"Add Additional","Register Commands":"Register Commands","Unregister Commands":"Unregister Commands",Edit:"Edit",Delete:"Delete","Admonition Type":"Admonition Type","Admonition Title":"Admonition Title","This will be the default title for this admonition type.":"This will be the default title for this admonition type.","Admonition type cannot be empty.":"Admonition type cannot be empty.","Admonition type cannot include spaces.":"Admonition type cannot include spaces.","Types must be a valid CSS selector.":"Types must be a valid CSS selector.","Invalid icon name.":"Invalid icon name.","Icon cannot be empty.":"Icon cannot be empty.","Upload Image":"Upload Image","There was an error parsing the image.":"There was an error parsing the image.","Admonition Icon":"Admonition Icon",Color:"Color",Save:"Save","No Admonition Title by Default":"No Admonition Title by Default","The admonition will have no title unless ":"The admonition will have no title unless "," is explicitly provided.":" is explicitly provided.","Show Copy Button":"Show Copy Button","A copy button will be added to the admonition.":"A copy button will be added to the admonition.","Parse Titles as Markdown":"Parse Titles as Markdown","Admonition Titles will be rendered as markdown.":"Admonition Titles will be rendered as markdown."};var A3={};var y3={};var B3={};var S3={};var F3={};var Q3={};var U3={};var I3={};var k3={};var E3={};var D3={};var R3={};var T3={};var Z3={};var G3={};var P3={};var O3={"Admonition Settings":"Admonition \u 8BBE \u 7F6E","Use Obsidian's markdown syntax highlighter in admonition code blocks. This setting is experimental and could cause errors.":" \u 5728 admonition \u 4EE3 \u 7801 \u 5757 \u 4E2D \u 4F7F \u 7528 Obsidian \u 7684 markdown \u 7CFB \u 7EDF \u 7EA7 \u 9AD8 \u 4EAE \u 3002 \u 8BE5 \u 8BBE \u 7F6E \u 4E3A \u 5B9E \u 9A8C \u 6027 \u FF0C \u 53EF \u 80FD \u 4F1A \u 5F15 \u 53D1 \u 9519 \u 8BEF"," Markdown Syntax Highlighting":" Markdown \u 7CFB \u 7EDF \u 9AD8 \u 4EAE","Try to sync internal links to the metadata cache to display in graph view. This setting could have unintended consequences. Use at your own risk.":"Try to sync internal links to the metadata cache to display in graph view. This setting could have unintended consequences. Use at your own risk."," Sync Links to Metadata Cache":" Sync Links to Metadata Cache","Allows admonitions to be created using ":" \u 5141 \u 8BB8 admonitions \u 521B \u 5EFA \u 4F7F \u 7528"," or ":" \u 6216",", instead of using a code block.":" \u FF0C \u 800C \u 975E \u 4EE3 \u 7801 \u 5757"," E
Please update them to the MSDoc - style syntax . ` ,0),this.data.warnedAboutNC=!0),this.admonitions={...t2,...this.data.userAdmonitions},await this.saveSettings()}async addAdmonition(c){this.data.userAdmonitions={...this.data.userAdmonitions,[c.type]:c},this.admonitions={...t2,...this.data.userAdmonitions},this.data.syntaxHighlight&&this.turnOnSyntaxHighlighting([c.type]),await this.saveSettings();let e=this.registerMarkdownCodeBlockProcessor( ` ad - $ { c . type } ` ,(l,i,o)=>this.postprocessor(c.type,l,i,o));this.postprocessors.set(c.type,e)}async removeAdmonition(c){this.data.userAdmonitions[c.type]&&delete this.data.userAdmonitions[c.type],this.admonitions={...t2,...this.data.userAdmonitions},this.data.syntaxHighlight&&this.turnOffSyntaxHighlighting([c.type]),c.command&&this.unregisterCommandsFor(c),this.postprocessors.has(c.type)&&(H.MarkdownPreviewRenderer.unregisterPostProcessor(this.postprocessors.get(c.type)),H.MarkdownPreviewRenderer.unregisterCodeBlockPostProcessor( ` ad - $ { c . type } ` ),this.postprocessors.delete(c.type)),await this.saveSettings()}async onload(){console.log("Obsidian Admonition loaded"),await this.loadSettings(),Object.keys(this.admonitions).forEach(c=>{let e=this.registerMarkdownCodeBlockProcessor( ` ad - $ { c } ` ,(l,i,o)=>this.postprocessor(c,l,i,o));this.postprocessors.set(c,e),this.admonitions[c].command&&this.registerCommandsFor(this.admonitions[c])}),this.app.workspace.onLayoutReady(async()=>{this.addSettingTab(new g2(this.app,this)),(0,H.addIcon)(o2.toString(),K4),(0,H.addIcon)(r2.toString(), $ 4),this.data.enableMarkdownProcessor&&this.enableMarkdownProcessor(),this.data.syntaxHighlight&&this.turnOnSyntaxHighlighting(),this.addCommand({id:"collapse-admonitions",name:"Collapse Admonitions in Note",checkCallback:c=>{if(c)return!!this.app.workspace.getActiveViewOfType(H.MarkdownView);let e=this.app.workspace.getActiveViewOfType(H.MarkdownView);if(!e||!(e instanceof H.MarkdownView))return;let l=e.contentEl.querySelectorAll("details[open].admonition-plugin");for(let i=0;i<l.length;i++)l[i].removeAttribute("open")}}),this.addCommand({id:"open-admonitions",name:"Open Admonitions in Note",checkCallback:c=>{if(c)return!!this.app.workspace.getActiveViewOfType(H.MarkdownView);let e=this.app.workspace.getActiveViewOfType(H.MarkdownView);if(!e||!(e instanceof H.MarkdownView))return;let l=e.contentEl.querySelectorAll("details:not([open]).admonition-plugin");for(let i=0;i<l.length;i++)l[i].setAttribute("open","open")}}),this.addCommand({id:"insert-admonition",name:"Insert Admonition",editorCallback:(c,e)=>{new l4(this,c).open()}}),this.registerEvent(this.app.metadataCache.on("resolve",c=>{if(!this.data.syncLinks||this.app.workspace.getActiveFile()!=c)return;let e=this.app.workspace.getActiveViewOfType(H.MarkdownView);if(!e||!(e instanceof H.MarkdownView))return;let l=e.contentEl.querySelectorAll(".admonition:not(.admonition-plugin-async) a.internal-link");this.addLinksToCache(l,c.path)})),this.enableMSSyntax()})}getMSParametersFromLine(c){let[,e,l,i]=c.match(c3)??[];if(!e||!this.admonitions[e]&&!Object.keys(this.admonitions).map(n=>n.toLowerCase()).includes(e.toLowerCase())||(e in this.admonitions||(e=Object.keys(this.admonitions).find(n=>n.toLowerCase()==e.toLowerCase())),!e))return;l==null&&!c.match(/^> \[ !( \w +):[ ]?/)&&(l=this.admonitions[e].title?? ` $ { e [ 0 ] . toUpperCase ( ) } $ { e . slice ( 1 ) . toLowerCase ( ) } ` );let o;switch(i){case"+":{o="open";break}case"-":{o="closed";break}case"x":break;default:o=this.data.autoCollapse?this.data.defaultCollapseType:null}return(o=="closed"||o=="open")&&!l&&(l=this.admonitions[e].title?? ` $ { e [ 0 ] . toUpperCase ( ) } $ { e . slice ( 1 ) . toLowerCase ( ) } ` ),{type:e,title:l,collapse:o}}enableMSSyntax(){this.registerMarkdownPostProcessor((r,t)=>{if(!this.data.allowMSSyntax||r?.firstChild?.nodeName!=="BLOCKQUOTE")return;let f=t.getSectionInfo(r);if(!f)return;let s=f.text.split( `
` ),v=s[f.lineStart];if(!/^> \[ !.+ \] /.test(v))return;let m=this.getMSParametersFromLine(v);if(!m?.type)return;let{type:z,title:p,collapse:h}=m,g=this.getAdmonitionElement(z,p,this.admonitions[z].icon,this.admonitions[z].color,h),M=s.slice(f.lineStart+1,f.lineEnd+1).join( `
` ).replace(/> /g,""),C=this.getAdmonitionContentElement(z,g,M);H.MarkdownRenderer.renderMarkdown(M,C,t.sourcePath,null),(!M.length||C.textContent.trim()=="")&&this.data.hideEmpty&&g.addClass("no-content"),r.firstElementChild.replaceWith(g)});let c=d2.StateEffect.define();class e extends _.WidgetType{constructor(t,f,s,v){super();this.type=t;this.title=f;this.collapse=s;this.content=v}eq(t){return this.type==t.type&&this.title==t.title&&this.collapse==t.collapse&&this.content==t.content}toDOM(t){let f=i.getAdmonitionElement(this.type,this.title,i.admonitions[this.type].icon,i.admonitions[this.type].color,this.collapse),s=createDiv( ` cm - embed - block admonition - parent admonition - $ { this . type } - parent ` );s.appendChild(f);let v=s.createDiv({cls:"edit-block-button",attr:{"aria-label":"Edit this block"}});(0,H.setIcon)(v,"code-glyph"),v.onclick=()=>{let p=t.posAtDOM(f);t.dispatch({selection:{head:p,anchor:p}})};let m=this.content.replace(/^> /gm,""),z=i.getAdmonitionContentElement(this.type,f,m);return H.MarkdownRenderer.renderMarkdown(m,z,"",null),(!m.length||z.textContent.trim()=="")&&i.data.hideEmpty&&f.addClass("no-content"),s}}class l{constructor(t){this.cache=Object.create(null);this.editor=t}hash(t){return ` from$ { t . from } to$ { t . to } ` }async compute(t){let f=[];for(let s of t){let v=this.cache[this.hash(s)];v||(v=this.cache[this.hash(s)]=_.Decoration.replace({inclusive:!0,widget:new e(s.type,s.title,s.collapse,s.value),block:!0,from:s.from,to:s.to})),f.push(v.range(s.from,s.to))}return _.Decoration.set(f,!0)}async updateDecos(t){let f=await this.compute(t);(f||this.editor.state.field(n).size)&&this.editor.dispatch({effects:[c.of(f??_.Decoration.none)]})}clearDecos(){this.editor.dispatch({effects:[c.of(_.Decoration.none)]})}}let i=this,o=_.ViewPlugin.fromClass(class{constructor(r){this.source=!1;this.manager=new l(r),this.build(r)}update(r){if(!r.heightChanged&&!!i.data.livePreviewMS){if(!r4(r.view.state)){this.source==!1&&(this.source=!0,this.manager.updateDecos([]));return}(r.docChanged||r.viewportChanged||r.selectionSet||this.source==!0)&&(this.source=!1,this.build(r.view))}}destroy(){}build(r){if(!i.data.allowMSSyntax||!i.data.livePreviewMS)return;let t=[];if(!!r4(r.state)){for(let{from:f,to:s}of r.visibleRanges)(0,Y3.syntaxTree)(r.state).iterate({from:f,to:s,enter:(m,z,p)=>{let h=m.prop(_3.tokenClassNodeProp);if(!new Set(h?.split(" ")).has("quote"))return;let C=r.state.doc.sliceString(z).split( `
` ),x=C[0];if(!/^> \[ !.+ \] /.test(x))return;let d=i.getMSParametersFromLine(x);if(!d?.type)return;let{type:b,title:w,collapse:A}=d,V=C.findIndex(D=>!/^>/.test(D)),B=C.slice(1,V>-1?V:void 0).join( `
` ),y=z+x.length+B.length+1;t.push({from:z,to:y,value:B?.trim(),title:w?.trim(),type:b?.trim(),collapse:A})}});this.manager.updateDecos(t)}}}),n=d2.StateField.define({create(){return _.Decoration.none},update(r,t){return t.effects.reduce((f,s)=>s.is(c)?s.value.update({filter:(v,m,z)=>!q3(t.newSelection.ranges,z.spec.from,z.spec.to)}):f,r.map(t.changes))},provide:r=>_.EditorView.decorations.from(r)});this.registerEditorExtension([o,n])}enableMarkdownProcessor(){if(!this.data.enableMarkdownProcessor)return;let c=new RegExp( ` ( ! { 3 , } | \ \ ? { 3 , } \ \ + ? ) ad - ( $ { this . types . join ( "|" ) } ) ( \ \ s [ \ \ s \ \ S ] + ) ? ` ),e=new RegExp(" \\ -{3,} admonition"),l=!1,i,o=new Map,n=new Map,r=new Map;Object.values(this.admonitions).filter(({command:t})=>t).forEach(t=>{this.registerCommandsFor(t)}),this.registerMarkdownPostProcessor(async(t,f)=>{if(!!this.data.enableMarkdownProcessor){if(e.test(t.textContent)&&l){l=!1;let s=createDiv();if(i&&r.has(i)&&o.has(r.get(i))&&t.children[0].textContent.replace(e,"").length){s.innerHTML=t.children[0].outerHTML.replace(new RegExp( ` ( < br > ) ? \ \ n ? $ { e . source } ` ),"");let v=o.get(r.get(i)).contentEl;v&&v.appendChild(s.children[0])}t.children[0].detach();return}if(!(!c.test(t.textContent)&&!l)){if(!l){if(!(Array.from(t.children).find(v=>c.test(v.textContent))instanceof HTMLParagraphElement))return;l=!0;let s=new H.MarkdownRenderChild(t);i=R2(),r.set(i,s),o.set(s,{contentEl:null,elements:[],loaded:!1}),s.onload=async()=>{let v=t.textContent,[,m,z,p=z[0].toUpperCase()+z.slice(1).toLowerCase()]=v.match(c)??[];if(!z)return;let h;/ \? {3,}/.test(m)&&(h=/ \+ /.test(m)?"open":"closed"),(p.trim()===""||p==='""')&&h!==void 0&&h!=="none"&&(p=z[0].toUpperCase()+z.slice(1).toLowerCase(),new H.Notice("An admonition must have a title if it is collapsible."));let g=this.admonitions[z],M=await this.getAdmonitionElementAsync(z,p.trim(),g.icon,g.injectColor??this.data.injectColor?g.color:null,h),x=M.createDiv("admonition-content-holder").createDiv("admonition-content");s.containerEl.appendChild(M);for(let d of o.get(s)?.elements)x.appendChild(d);o.set(s,{...o.get(s),contentEl:x,loaded:!0})},s.onunload=()=>{r.delete(i),o.delete(s)},f.addChild(s),t.children[0].detach();return}if(i&&r.get(i)){let s=r.get(i);if(o.set(s,{...o.get(s),elements:[...o.get(s).elements,...Array.from(t.children)]}),n.set(t,s),o.get(s)?.loaded)for(let v of o.get(s)?.elements)o.get(s).contentEl.appendChild(v)}}}})}disableMarkdownProcessor(){Object.values(this.admonitions).filter(({command:c})=>c).forEach(c=>{this.registerCommandsFor(c)})}unregisterCommandsFor(c){c.command=!1,this.app.commands.findCommand( ` obsidian - admonition : insert - $ { c . type } ` )&&(delete this.app.commands.editorCommands[ ` obsidian - admonition : insert - $ { c . type } ` ],delete this.app.commands.editorCommands[ ` obsidian - admonition : insert - $ { c . type } - with - title ` ],delete this.app.commands.commands[ ` obsidian - admonition : insert - $ { c . type } ` ],delete this.app.commands.commands[ ` obsidian - admonition : insert - $ { c . type } - with - title ` ])}registerCommandsFor(c){c.command=!0,this.addCommand({id: ` insert - $ { c . type } ` ,name: ` Insert $ { c . type } ` ,editorCheckCallback:(e,l,i)=>{if(e)return c.command;if(c.command)try{l.getDoc().replaceSelection( ` \ ` \` \` ad- ${ c . type }
$ { l . getDoc ( ) . getSelection ( ) }
\ ` \` \`
` );let o=l.getCursor();l.setCursor(o.line-2)}catch{new H.Notice("There was an issue inserting the admonition.")}}}),this.addCommand({id: ` insert - $ { c . type } - with - title ` ,name: ` Insert $ { c . type } With Title ` ,editorCheckCallback:(e,l,i)=>{if(e)return c.command;if(c.command)try{l.getDoc().replaceSelection( ` \ ` \` \` ad- ${ c . type }
title :
$ { l . getDoc ( ) . getSelection ( ) }
\ ` \` \`
` );let o=l.getCursor();l.setCursor(o.line-3)}catch{new H.Notice("There was an issue inserting the admonition.")}}}),this.data.enableMarkdownProcessor&&this.addCommand({id: ` insert - non - $ { c . type } ` ,name: ` Insert Non - codeblock $ { c . type } ` ,editorCheckCallback:(e,l,i)=>{if(e)return c.command&&this.data.enableMarkdownProcessor;if(c.command)try{l.getDoc().replaceSelection( ` ! ! ! ad - $ { c . type }
$ { l . getDoc ( ) . getSelection ( ) }
-- - admonition
` );let o=l.getCursor();l.setCursor(o.line-2)}catch{new H.Notice("There was an issue inserting the admonition.")}}})}turnOnSyntaxHighlighting(c=Object.keys(this.admonitions)){!this.data.syntaxHighlight||(c.forEach(e=>{if(this.data.syntaxHighlight){let[,l]= ` $ { e } ` .match(/^([ \w +#-]*)[^ \n ` ] * $ / ) ; window . CodeMirror . defineMode ( ` ad- ${ l } ` , ( i , o ) => window . CodeMirror . getMode ( { } , "hypermd" ) ) } } ) , this . app . workspace . layoutReady ? this . layoutReady ( ) : this . app . workspace . onLayoutReady ( this . layoutReady . bind ( this ) ) ) } turnOffSyntaxHighlighting ( c = Object . keys ( this . admonitions ) ) { c . forEach ( e => { window . CodeMirror . modes . hasOwnProperty ( ` ad- ${ e } ` ) && delete window . CodeMirror . modes [ ` ad- ${ e } ` ] } ) , this . app . workspace . layoutReady ? this . layoutReady ( ) : this . app . workspace . onLayoutReady ( this . layoutReady . bind ( this ) ) } layoutReady ( ) { this . app . workspace . off ( "layout-ready" , this . layoutReady . bind ( this ) ) , this . refreshLeaves ( ) } refreshLeaves ( ) { this . app . workspace . iterateCodeMirrors ( c => c . setOption ( "mode" , c . getOption ( "mode" ) ) ) } async postprocessor ( c , e , l , i ) { if ( ! ! this . admonitions [ c ] ) try { let o = typeof i == "string" ? i : i ? . sourcePath ? ? this . app . workspace . getActiveFile ( ) ? . path ? ? "" , { title : n , collapse : r , content : t , icon : f , color : s } = _4 ( c , e , this . admonitions [ c ] ) , v = new RegExp ( ` ^!!! ad-( ${ this . types . join ( "|" ) } ) $ ` , "gm" ) , m = t . match ( v ) || [ ] ; if ( m . length ) { let C = [ T2 ( t , 0 , m [ 0 ] ) ] ; for ( let d = 1 ; d < m . length ; d ++ ) C . push ( T2 ( t , C [ d - 1 ] . end , m [ d ] ) ) ; let x = t . split ( `
` );for(let d of C.reverse())x.splice(d.start,d.end-d.start+1, ` \ ` \` \` ad- ${ d . type }
$ { d . src }
\ ` \` \` ` ) ; t = x . join ( `
` )}this.data.autoCollapse&&!r?r=this.data.defaultCollapseType??"open":r&&r.trim()==="none"&&(r="");let z=R2(),p=this.admonitions[c],h=this.getAdmonitionElement(c,n,R1.find(({name:C})=>f===C)??p.icon,s??(p.injectColor??this.data.injectColor?p.color:null),r,z),g=new H.MarkdownRenderChild(h);if(g.containerEl=h,i&&typeof i!="string"&&(g.onload=()=>{},g.onunload=()=>{},i.addChild(g)),t&&t.length){let C=this.getAdmonitionContentElement(c,h,t);if(/^ ` { 3 , } mermaid / m . test ( t ) ) { let b = ! h . hasAttribute ( "open" ) ; h instanceof HTMLDetailsElement && h . setAttribute ( "open" , "open" ) , setImmediate ( ( ) => { H . MarkdownRenderer . renderMarkdown ( t , C , o , g ) , h instanceof HTMLDetailsElement && b && h . removeAttribute ( "open" ) } ) } else H . MarkdownRenderer . renderMarkdown ( t , C , o , g ) ; ( ! t . length || C . textContent . trim ( ) == "" ) && this . data . hideEmpty && h . addClass ( "no-content" ) ; let x = C . querySelectorAll ( ".task-list-item-checkbox" ) ; if ( x ? . length ) { let b = e . split ( `
` ),w=0;x.forEach(A=>{let V=b.slice(w).findIndex(B=>/^ \- \[ . \] /.test(B));V!=-1&&(A.dataset.line= ` $ { V + w + 1 } ` ,w=V+w+1)})}let d=C.querySelectorAll("a.internal-link");this.addLinksToCache(d,o)}let M=l.parentElement;return M&&!M.hasClass("admonition-content")&&M.addClass("admonition-parent", ` admonition - $ { c } - parent ` ),l.replaceWith(h),h}catch(o){console.error(o);let n=createEl("pre");n.createEl("code",{attr:{style:"color: var(--text-error) !important"}}).createSpan({text: ` There was an error rendering the admonition :
` +e}),l.replaceWith(n)}}async onunload(){console.log("Obsidian Admonition unloaded"),this.turnOffSyntaxHighlighting()}addLinksToCache(c,e){if(!!this.data.syncLinks)for(let l=0;l<c.length;l++){let i=c[l];if(i.dataset.href){let o=this.app.metadataCache.getFirstLinkpathDest(i.dataset.href,""),n,r;o&&o instanceof H.TFile?(n=this.app.metadataCache.resolvedLinks,r=o.path):(n=this.app.metadataCache.unresolvedLinks,r=i.dataset.href),n[e]||(n[e]={[r]:0});let t=n[e];t[r]||(t[r]=0),t[r]+=1,n[e]=t}}}getAdmonitionElement(c,e,l,i,o,n){let r,t,f=i?{style: ` -- admonition - color : $ { i } ; ` }:{};if(o&&o!="none"?(o==="open"&&(f.open="open"),r=createEl("details",{cls: ` admonition admonition - $ { c } admonition - plugin ` ,attr:f}),t=r.createEl("summary",{cls: ` admonition - title $ { e ? . trim ( ) . length ? "" : "no-title" } ` })):(r=createDiv({cls: ` admonition admonition - $ { c } admonition - plugin ` ,attr:f}),t=r.createDiv({cls: ` admonition - title $ { e ? . trim ( ) . length ? "" : "no-title" } ` })),n&&(r.id=n),e&&e.trim().length){let s=createDiv();H.MarkdownRenderer.renderMarkdown(e,s,"",null);let v=s.children[0]?.tagName==="P"?createDiv():s.children[0],m=Array.from(s.children[0]?.childNodes||[]);v.innerHTML="",v.addClass("admonition-title-content");let z=v.createDiv("admonition-title-icon");l&&l.name&&l.type&&z.appendChild(t1(l));let p=v.createDiv("admonition-title-markdown");for(let h=0;h<m.length;h++)p.appendChild(m[h]);t.appendChild(v||createDiv())}return o&&t.createDiv("collapser").createDiv("handle"),this.data.dropShadow||r.addClass("no-drop"),r}getAdmonitionContentElement(c,e,l){let i=e.createDiv("admonition-content-holder"),o=i.createDiv("admonition-content");return(this.admonitions[c].copy??this.data.copyButton)&&i.createDiv("admonition-content-copy").appendChild(J4.cloneNode(!0)).addEventListener("click",()=>{navigator.clipboard.writeText(l.trim()).then(async()=>{new H.Notice("Admonition content copied to clipboard.")})}),o}async getAdmonitionElementAsync(c,e,l,i,o,n){let r,t,f=i?{style: ` -- admonition - color : $ { i } ; ` }:{};if(o?(o==="open"&&(f.open="open"),r=createEl("details",{cls: ` admonition admonition - $ { c } admonition - plugin admonition - plugin - async ` ,attr:f}),t=r.createEl("summary",{cls: ` admonition - title $ { e . trim ( ) . length ? "" : "no-title" } ` })):(r=createDiv({cls: ` admonition admonition - $ { c } admonition - plugin ` ,attr:f}),t=r.createDiv({cls: ` admonition - title $ { e . trim ( ) . length ? "" : "no-title" } ` })),n&&(r.id=n),e&&e.trim().length)if(this.data.parseTitles){let s=createDiv();await H.MarkdownRenderer.renderMarkdown(e,s,"",null);let v=s.children[0].tagName==="P"?createDiv():s.children[0],m=Array.from(s.children[0]?.childNodes||[]);v.innerHTML="",v.addClass("admonition-title-content");let z=v.createDiv("admonition-title-icon");l&&l.name&&l.type&&z.appendChild(t1(l));let p=v.createDiv("admonition-title-markdown");for(let h=0;h<m.length;h++)p.appendChild(m[h]);t.appendChild(v||createDiv())}else t.appendChild(createDiv({text:e}));return o&&t.createDiv("collapser").createDiv("handle"),this.data.dropShadow||r.addClass("no-drop"),r}};
/ * !
* Font Awesome Free 5.15 . 3 by @ fontawesome - https : //fontawesome.com
* License - https : //fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
* /
/ * !
* Font Awesome Free 5.15 . 4 by @ fontawesome - https : //fontawesome.com
* License - https : //fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
* /