@@ -5,30 +5,30 @@
< meta charset = "UTF-8" / >
< meta name = "viewport" content = "width=device-width, initial-scale=1, viewport-fit=cover" / >
< title > Docwell editor< / title >
< script type = "module" crossorigin > ( f u n c t i o n ( ) { l e t e = d o c u m e n t . c r e a t e E l e m e n t ( ` l i n k ` ) . r e l L i s t ; i f ( e & & e . s u p p o r t s & & e . s u p p o r t s ( ` m o d u l e p r e l o a d ` ) ) r e t u r n ; f o r ( l e t e o f d o c u m e n t . q u e r y S e l e c t o r A l l ( ` l i n k [ r e l = " m o d u l e p r e l o a d " ] ` ) ) n ( e ) ; n e w M u t a t i o n O b s e r v e r ( e = > { f o r ( l e t t o f e ) i f ( t . t y p e = = = ` c h i l d L i s t ` ) f o r ( l e t e o f t . a d d e d N o d e s ) e . t a g N a m e = = = ` L I N K ` & & e . r e l = = = ` m o d u l e p r e l o a d ` & & n ( e ) } ) . o b s e r v e ( d o c u m e n t , { c h i l d L i s t : ! 0 , s u b t r e e : ! 0 } ) ; f u n c t i o n t ( e ) { l e t t = { } ; r e t u r n e . i n t e g r i t y & & ( t . i n t e g r i t y = e . i n t e g r i t y ) , e . r e f e r r e r P o l i c y & & ( t . r e f e r r e r P o l i c y = e . r e f e r r e r P o l i c y ) , t . c r e d e n t i a l s = e . c r o s s O r i g i n = = = ` u s e - c r e d e n t i a l s ` ? ` i n c l u d e ` : e . c r o s s O r i g i n = = = ` a n o n y m o u s ` ? ` o m i t ` : ` s a m e - o r i g i n ` , t } f u n c t i o n n ( e ) { i f ( e . e p ) r e t u r n ; e . e p = ! 0 ; l e t n = t ( e ) ; f e t c h ( e . h r e f , n ) } } ) ( ) ; v a r e = O b j e c t . d e f i n e P r o p e r t y , t = ( t , n ) = > { l e t r = { } ; f o r ( v a r i i n t ) e ( r , i , { g e t : t [ i ] , e n u m e r a b l e : ! 0 } ) ; r e t u r n n | | e ( r , S y m b o l . t o S t r i n g T a g , { v a l u e : ` M o d u l e ` } ) , r } ; f u n c t i o n n ( e ) { t h i s . c o n t e n t = e } n . p r o t o t y p e = { c o n s t r u c t o r : n , f i n d : f u n c t i o n ( e ) { f o r ( v a r t = 0 ; t < t h i s . c o n t e n t . l e n g t h ; t + = 2 ) i f ( t h i s . c o n t e n t [ t ] = = = e ) r e t u r n t ; r e t u r n - 1 } , g e t : f u n c t i o n ( e ) { v a r t = t h i s . f i n d ( e ) ; r e t u r n t = = - 1 ? v o i d 0 : t h i s . c o n t e n t [ t + 1 ] } , u p d a t e : f u n c t i o n ( e , t , r ) { v a r i = r & & r ! = e ? t h i s . r e m o v e ( r ) : t h i s , a = i . f i n d ( e ) , o = i . c o n t e n t . s l i c e ( ) ; r e t u r n a = = - 1 ? o . p u s h ( r | | e , t ) : ( o [ a + 1 ] = t , r & & ( o [ a ] = r ) ) , n e w n ( o ) } , r e m o v e : f u n c t i o n ( e ) { v a r t = t h i s . f i n d ( e ) ; i f ( t = = - 1 ) r e t u r n t h i s ; v a r r = t h i s . c o n t e n t . s l i c e ( ) ; r e t u r n r . s p l i c e ( t , 2 ) , n e w n ( r ) } , a d d T o S t a r t : f u n c t i o n ( e , t ) { r e t u r n n e w n ( [ e , t ] . c o n c a t ( t h i s . r e m o v e ( e ) . c o n t e n t ) ) } , a d d T o E n d : f u n c t i o n ( e , t ) { v a r r = t h i s . r e m o v e ( e ) . c o n t e n t . s l i c e ( ) ; r e t u r n r . p u s h ( e , t ) , n e w n ( r ) } , a d d B e f o r e : f u n c t i o n ( e , t , r ) { v a r i = t h i s . r e m o v e ( t ) , a = i . c o n t e n t . s l i c e ( ) , o = i . f i n d ( e ) ; r e t u r n a . s p l i c e ( o = = - 1 ? a . l e n g t h : o , 0 , t , r ) , n e w n ( a ) } , f o r E a c h : f u n c t i o n ( e ) { f o r ( v a r t = 0 ; t < t h i s . c o n t e n t . l e n g t h ; t + = 2 ) e ( t h i s . c o n t e n t [ t ] , t h i s . c o n t e n t [ t + 1 ] ) } , p r e p e n d : f u n c t i o n ( e ) { r e t u r n e = n . f r o m ( e ) , e . s i z e ? n e w n ( e . c o n t e n t . c o n c a t ( t h i s . s u b t r a c t ( e ) . c o n t e n t ) ) : t h i s } , a p p e n d : f u n c t i o n ( e ) { r e t u r n e = n . f r o m ( e ) , e . s i z e ? n e w n ( t h i s . s u b t r a c t ( e ) . c o n t e n t . c o n c a t ( e . c o n t e n t ) ) : t h i s } , s u b t r a c t : f u n c t i o n ( e ) { v a r t = t h i s ; e = n . f r o m ( e ) ; f o r ( v a r r = 0 ; r < e . c o n t e n t . l e n g t h ; r + = 2 ) t = t . r e m o v e ( e . c o n t e n t [ r ] ) ; r e t u r n t } , t o O b j e c t : f u n c t i o n ( ) { v a r e = { } ; r e t u r n t h i s . f o r E a c h ( f u n c t i o n ( t , n ) { e [ t ] = n } ) , e } , g e t s i z e ( ) { r e t u r n t h i s . c o n t e n t . l e n g t h > > 1 } } , n . f r o m = f u n c t i o n ( e ) { i f ( e i n s t a n c e o f n ) r e t u r n e ; v a r t = [ ] ; i f ( e ) f o r ( v a r r i n e ) t . p u s h ( r , e [ r ] ) ; r e t u r n n e w n ( t ) } ; f u n c t i o n r ( e , t , n ) { f o r ( l e t i = 0 ; ; i + + ) { i f ( i = = e . c h i l d C o u n t | | i = = t . c h i l d C o u n t ) r e t u r n e . c h i l d C o u n t = = t . c h i l d C o u n t ? n u l l : n ; l e t s = e . c h i l d ( i ) , c = t . c h i l d ( i ) ; i f ( s = = c ) n + = s . n o d e S i z e ; e l s e { i f ( ! s . s a m e M a r k u p ( c ) ) r e t u r n n ; i f ( s . i s T e x t & & s . t e x t ! = c . t e x t ) { l e t e = s . t e x t , t = c . t e x t , r = 0 ; f o r ( ; e [ r ] = = t [ r ] ; r + + ) n + + ; r e t u r n r & & r < e . l e n g t h & & r < t . l e n g t h & & o ( e . c h a r C o d e A t ( r - 1 ) ) & & a ( e . c h a r C o d e A t ( r ) ) & & n - - , n } i f ( s . c o n t e n t . s i z e | | c . c o n t e n t . s i z e ) { l e t e = r ( s . c o n t e n t , c . c o n t e n t , n + 1 ) ; i f ( e ! = n u l l ) r e t u r n e } n + = s . n o d e S i z e } } } f u n c t i o n i ( e , t , n , r ) { f o r ( l e t s = e . c h i l d C o u n t , c = t . c h i l d C o u n t ; ; ) { i f ( s = = 0 | | c = = 0 ) r e t u r n s = = c ? n u l l : { a : n , b : r } ; l e t l = e . c h i l d ( - - s ) , u = t . c h i l d ( - - c ) , d = l . n o d e S i z e ; i f ( l = = u ) n - = d , r - = d ; e l s e { i f ( ! l . s a m e M a r k u p ( u ) ) r e t u r n { a : n , b : r } ; i f ( l . i s T e x t & & l . t e x t ! = u . t e x t ) { l e t e = l . t e x t , t = u . t e x t , i = e . l e n g t h , s = t . l e n g t h ; f o r ( ; i > 0 & & s > 0 & & e [ i - 1 ] = = t [ s - 1 ] ; ) i - - , s - - , n - - , r - - ; r e t u r n i & & s & & i < e . l e n g t h & & o ( e . c h a r C o d e A t ( i - 1 ) ) & & a ( e . c h a r C o d e A t ( i ) ) & & ( n + + , r + + ) , { a : n , b : r } } i f ( l . c o n t e n t . s i z e | | u . c o n t e n t . s i z e ) { l e t e = i ( l . c o n t e n t , u . c o n t e n t , n - 1 , r - 1 ) ; i f ( e ) r e t u r n e } n - = d , r - = d } } } f u n c t i o n a ( e ) { r e t u r n e > = 5 6 3 2 0 & & e < 5 7 3 4 4 } f u n c t i o n o ( e ) { r e t u r n e > = 5 5 2 9 6 & & e < 5 6 3 2 0 } v a r s = c l a s s e { c o n s t r u c t o r ( e , t ) { i f ( t h i s . c o n t e n t = e , t h i s . s i z e = t | | 0 , t = = n u l l ) f o r ( l e t t = 0 ; t < e . l e n g t h ; t + + ) t h i s . s i z e + = e [ t ] . n o d e S i z e } n o d e s B e t w e e n ( e , t , n , r = 0 , i ) { f o r ( l e t a = 0 , o = 0 ; o < t ; a + + ) { l e t s = t h i s . c o n t e n t [ a ] , c = o + s . n o d e S i z e ; i f ( c > e & & n ( s , r + o , i | | n u l l , a ) ! = = ! 1 & & s . c o n t e n t . s i z e ) { l e t i = o + 1 ; s . n o d e s B e t w e e n ( M a t h . m a x ( 0 , e - i ) , M a t h . m i n ( s . c o n t e n t . s i z e , t - i ) , n , r + i ) } o = c } } d e s c e n d a n t s ( e ) { t h i s . n o d e s B e t w e e n ( 0 , t h i s . s i z e , e ) } t e x t B e t w e e n ( e , t , n , r ) { l e t i = ` ` , a = ! 0 ; r e t u r n t h i s . n o d e s B e t w e e n ( e , t , ( o , s ) = > { l e t c = o . i s T e x t ? o . t e x t . s l i c e ( M a t h . m a x ( e , s ) - s , t - s ) : o . i s L e a f ? r ? t y p e o f r = = ` f u n c t i o n ` ? r ( o ) : r : o . t y p e . s p e c . l e a f T e x t ? o . t y p e . s p e c . l e a f T e x t ( o ) : ` ` : ` ` ; o . i s B l o c k & & ( o . i s L e a f & & c | | o . i s T e x t b l o c k ) & & n & & ( a ? a = ! 1 : i + = n ) , i + = c } , 0 ) , i } a p p e n d ( t ) { i f ( ! t . s i z e ) r e t u r n t h i s ; i f ( ! t h i s . s i z e ) r e t u r n t ; l e t n = t h i s . l a s t C h i l d , r = t . f i r s t C h i l d , i = t h i s . c o n t e n t . s l i c e ( ) , a = 0 ; f o r ( n . i s T e x t & & n . s a m e M a r k u p ( r ) & & ( i [ i . l e n g t h - 1 ] = n . w i t h T e x t ( n . t e x t + r . t e x t ) , a = 1 ) ; a < t . c o n t e n t . l e n g t h ; a + + ) i . p u s h ( t . c o n t e n t [ a ] ) ; r e t u r n n e w e ( i , t h i s . s i z e + t . s i z e ) } c u t ( t , n = t h i s . s i z e ) { i f ( t = = 0 & & n = = t h i s . s i z e ) r e t u r n t h i s ; l e t r = [ ] , i = 0 ; i f ( n > t ) f o r ( l e t e = 0 , a = 0 ; a < n ; e + + ) { l e t o = t h i s . c o n t e n t [ e ] , s = a + o . n o d e S i z e ; s > t & & ( ( a < t | | s > n ) & & ( o = o . i s T e x t ? o . c u t ( M a t h . m a x ( 0 , t - a ) , M a t h . m i n ( o . t e x t . l e n g t h , n - a ) ) : o . c u t ( M a t h . m a x ( 0 , t - a - 1 ) , M a t h . m i n ( o . c o n t e n t . s i z e , n - a - 1 ) ) ) , r . p u s h ( o ) , i + = o . n o d e S i z e ) , a = s } r e t u r n n e w e ( r , i ) } c u t B y I n d e x ( t , n ) { r e t u r n t = = n ? e . e m p t y : t = = 0 & & n = = t h i s . c o n t e n t . l e n g t h ? t h i s : n e w e ( t h i s . c o n t e n t . s l i c e ( t , n ) ) } r e p l a c e C h i l d ( t , n ) { l e t r = t h i s . c o n t e n t [ t ] ; i f ( r = = n ) r e t u r n t h i s ; l e t i = t h i s . c o n t e n t . s l i c e ( ) , a = t h i s . s i z e + n . n o d e S i z e - r . n o d e S i z e ; r e t u r n i [ t ] = n , n e w e ( i , a ) } a d d T o S t a r t ( t ) { r e t u r n n e w e ( [ t ] . c o n c a t ( t h i s . c o n t e n t ) , t h i s . s i z e + t . n o d e S i z e ) } a d d T o E n d ( t ) { r e t u r n n e w e ( t h i s . c o n t e n t . c o n c a t ( t ) , t h i s . s i z e + t . n o d e S i z e ) } e q ( Line truncated
`)}};he.empty=new he(!0);var ge=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``& & this.tokens.pop(),this.tokens[0]==``& & this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e& & (this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function _e(e){let t=[];do t.push(ve(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function ve(e){let t=[];do t.push(ye(e));while(e.next&&e.next!=`)`&&e.next!=`|`); return t.length==1?t[0]:{type:`seq`,exprs:t}}function ye(e){let t=Ce(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=xe(e,t);else break;return t}function be(e){/\D/.test(e.next)& & e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function xe(e,t){let n=be(e),r=n;return e.eat(`,`)& & (r=e.next==`}`?-1:be(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function Se(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)& & i.push(r)}return i.length==0& & e.err(`No node type or group '`+t+`' found`),i}function Ce(e){if(e.eat(`(`)){let t=_e(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=Se(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline& & e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function we(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t< e.min ; t + + ) { let t = n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for ( let t = e.min;t<e.max;t++){let t = n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if ( e . type = =`name`)return[r(t,void 0 , e . value ) ] ; else throw Error ( ` Unknown expr type ` ) } } function Te ( e , t ) { return t-e } function Ee ( e , t ) { let n = [];return r ( t ) , n . sort ( Te ) ; function r ( t ) { let i = e[t];if(i.length==1&&!i[0].term)return r ( i [ 0 ] . to ) ; n . push ( t ) ; for ( let e = 0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function De ( e ) { let t = Object.create(null);return n ( Ee ( e , 0 ) ) ; function n ( r ) { let i = [];r.forEach(t= > {e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e< i.length ; e + + ) i [ e ] [ 0 ] = = t & & ( r = i[e][1]);Ee(e,n).forEach(e= > {r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})}); let a=t[r.join(`,`)]=new he(r.indexOf(e.length-1)>-1);for(let e=0;e< i.length ; e + + ) { let r = i[e][1].sort(Te);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a } } function Oe ( e , t ) { for ( let n = 0,r=[e];n<r.length;n++){let e = r[n],i=!e.validEnd,a=[];for(let t = 0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes ( ` + a . join ( ` , ` ) + ` ) in a required position ( see https: / / prosemirror . net / docs / guide / # generatable ) ` ) } } function ke ( e ) { let t = Object.create(null);for(let n in e ) { let r = e[n];if(!r.hasDefault)return null ; t [ n ] = r . default } return t } function Ae ( e , t ) { let n = Object.create(null);for(let r in e ) { let i = e[r],a=t&&t[r];if(a===void 0 ) { if ( i . hasDefault ) a = i.default;else throw RangeError ( ` No value supplied for attribute ` + r ) } else i . validate & & i . validate ( a ) ; n [ r ] = a } return n } function je ( e , t ) { let n = Object.create(null);if(t)for(let r in t ) n [ r ] = new Pe ( e , r , t [ r ] ) ; return n } var Me = class e { constructor ( e , t , n ) { this . name = e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` ` ) : [ ] , this . attrs = je(e,n.attrs),this.defaultAttrs=ke(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline ( ) { return ! this . isBlock } get isTextblock ( ) { return this . isBlock & & this . inlineContent } get isLeaf ( ) { return this . contentMatch = =he.empty}get isAtom ( ) { return this . isLeaf | | ! ! this . spec . atom } isInGroup ( e ) { return this . groups . indexOf ( e ) > -1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e& & this.defaultAttrs?this.defaultAttrs:Ae(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new de(this,this.coLine truncated
`);else if(a.linebreakReplacement& & /[\r\n]/.test(n)& & this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n< e.length ; n + + ) n & & this . insertNode ( a . linebreakReplacement . create ( ) , t , ! 0 ) , e [ n ] & & this . insertNode ( a . text ( e [ n ] ) , t , ! / \ S / . test ( e [ n ] ) ) ; n = ``}else n = n.replace(/\r?\n|\r/g,` ` ) ; n & & this . insertNode ( a . text ( n ) , t , ! / \ S / . test ( n ) ) , this . findInText ( e ) } else this . findInside ( e ) } addElement ( e , t , n ) { let r = this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a = e.nodeName.toLowerCase(),o;U e.hasOwnProperty(a)&&this.parser.normalizeLists&&X e(e);let s = this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:H e.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if ( ! s | | s . skip | | s . closeParent ) { s & & s . closeParent ? this . open = Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n , r = this.needsBlock;if(V e.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if ( ! e . firstChild ) { this . leafFallback ( e , t ) ; break out } let o = s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n = this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0 ) } this . localPreserveWS = r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
`),t)}ignoreFallback(e,t){e.nodeName!=`BR`||this.top.type& & this.top.type.inlineContent||this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n& & n.length)for(let e=0;e< this.parser.matchedStyles.length ; e + + ) { let r = this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e ; ; ) { let n = this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null ; if ( t = n.clearMark?t.filter(e= > !n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node){if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e& & (i=!0,n=e)}}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e); else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement& & (r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i& & this.sync(o)& & this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break; if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e< r.length ; e + + ) t = this.enterInner(r[e],null,t,!1);return t } insertNode ( e , t , n ) { if ( e . isInline & & this . needsBlock & & ! this . top . type ) { let e = this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r = this.findPlace(e,t,n);if(r){this.closeExtra();let t = this.top;t.match&&=t.match.matchType(e.type);let n = d.none;for(let i of r . concat ( e . marks ) ) ( t . type ? t . type . allowsMarkType ( i . type ) : $ e ( i . type , e . type ) ) & & ( n = i.addToSet(n));return t . content . push ( e . mark ( n ) ) , ! 0 } return ! 1 } enter ( e , t , n , r ) { let i = this.findPlace(e.create(t),n,!1);return i & & = this . enterInner ( e , t , n , ! 0 , r ) , i } enterInner ( e , t , n , r = !1,i){this.closeExtra();let a = this.top;a.match=a.match&&a.match.matchType(e);let o = qe(e,i,a.options);a.options&Ke&&a.content.length==0&&(o|=Ke);let s = d.none;return n = n.filter(t= > !(a.type?a.type.allowsMarkType(t.type):$e(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new Je(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=We); return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t& & e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n< this.find.length ; n + + ) this . find [ n ] . node = =e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t = 0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r = 0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t = 0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`) > -1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen& & (!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null; if(!e||e.name!=s&&!e.isInGroup(s))return!1; o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n& & n.isTextblock& & n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock& & t.defaultAttrs)return t}}};function Xe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e& & Ue.hasOwnProperty(e)& & n?(n.appendChild(t),t=n):e==`li`?n=t:e& & (n=null)}}function Ze(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatcheLine truncated
`))}})}function Gt(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Kt(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new kt(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new p(s.from(o),0,0),1,!0))}function qt(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent; if(a< 0 | | i . parent . type . spec . isolating | | ! i . parent . canReplace ( i . index ( ) , i . parent . childCount ) | | ! o . type . validContent ( i . parent . content . cutByIndex ( i . index ( ) , i . parent . childCount ) ) ) return ! 1 ; for ( let e = i.depth-1,t=n-2;e > a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1]; s&&(o=o.replaceChild(0,s.type.create(s.attrs))); let c=r&&r[t]||n; if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0]; return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function Jt(e,t,n=1,r){let i=e.doc.resolve(t),a=s.empty,o=s.empty;for(let e=i.depth,t=i.depth-n,c=n-1;e>t;e--,c--){a=s.from(i.node(e).copy(a));let t=r&&r[c]; o=s.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new Ot(t,t,new p(a.append(o),n,n),!0))}function Yt(e,t){let n=e.resolve(t),r=n.index();return Zt(n.nodeBefore,n.nodeAfter)& & n.parent.canReplace(r,r+1)}function Xt(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i< t.childCount ; i + + ) { let a = t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n . validEnd } function Zt ( e , t ) { return ! ! ( e & & t & & ! e . isLeaf & & Xt ( e , t ) ) } function Qt ( e , t , n = -1){let r = e.resolve(t);for(let e = r.depth;;e--){let i , a , o = r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n > 0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i& & !i.isTextblock& & Zt(i,a)& & r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n< 0 ? r . before ( e ) :r . after ( e ) } } function $ t ( e , t , n ) { let r = null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e = o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s = e.steps.length;if(r===!1){let r = e.doc.resolve(t+n);Wt(e,r.node(),r.before(),s)}o.inlineContent&&Nt(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c = e.mapping.slice(s),l=c.map(t-n);if(e.step(new Ot ( l , c . map ( t + n , -1 ) , p . empty , ! 0 ) ) , r = ==!0){let t = e.doc.resolve(l);Ut(e,t.node(),t.before(),e.steps.length)}return e } function en ( e , t , n ) { let r = e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t ; if ( r . parentOffset = =0)for(let e = r.depth-1;e > =0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t< r.node ( e ) . childCount ) return null } return null } function tn ( e , t , n ) { let r = e.resolve(t);if(!n.content.size)return t ; let i = n.content;for(let e = 0;e<n.openStart;e++)i=i.firstChild.content;for(let e = 1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t = r.depth;t > =0;t--){let n=t==r.depth?0:r.pos< =(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e& & o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n< 0 ? r . before ( t + 1 ) :r . after ( t + 1 ) } return null } function nn ( e , t , n = t,r=p.empty){if(t==n&&!r.size)return null ; let i = e.resolve(t),a=e.resolve(n);return rn ( i , a , r ) ? new Ot ( t , n , r ) :new an ( i , a , r ) . fit ( ) } function rn ( e , t , n ) { return ! n . openStart & & ! n . openEnd & & e . start ( ) = = t . start ( ) & & e . parent . canReplace ( e . index ( ) , t . index ( ) , n . content ) } var an = class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=s.empty;for(let t = 0;t<=e.depth;t++){let n = e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t = e.depth;t > 0;t--)this.placed=s.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e< 0 ? this . $ to:n . doc . resolve ( e ) ) ; if ( ! r ) return null ; let i = this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s = new p ( i , a , o ) ; return e > -1?new kt(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new Ot(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n< e ; n + + ) { let i = t.firstChild;if(t.childCount > 1&&(r=0),i.type.spec.isolating&&r<=n){e=n; break}t=i.content}for(let t=1;t< =2;t++)for(let n=t=Line truncated
`).scrollIntoView()),!0)};function cr(e){for(let t=0;t< e.edgeCount ; t + + ) { let { type:n } = e . edge ( t ) ; if ( n . isTextblock & & ! n . hasRequiredAttrs ( ) ) return n } return null } var lr = (e,t)= > {let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=cr(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(S.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},ur=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof kn||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=cr(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill()); o.setSelection(C.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},dr=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1& & n.after()!=n.end(-1)){let r=n.before();if(qt(e.doc,r))return t& & t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Ft(r); return i!=null&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)}; function fr(e){return(t,n)=>{if(t.selection instanceof w&&t.selection.node.isBlock){let{$from:e}=t.selection; return!e.parentOffset||!qt(t.doc,e.pos)?!1:(n&&n(t.tr.split(e.pos).scrollIntoView()),!0)}if(!t.selection.$from.depth)return!1; let r=t.tr;!t.selection.empty& & (t.selection instanceof C||t.selection instanceof kn)&&r.deleteSelection(); let{$from:i}=r.selection,a=r.steps.length,o=[],s,c,l=!1,u=!1;for(let t=i.depth;;t--)if(i.node(t).isBlock){l=i.end(t)==i.pos+(i.depth-t),u=i.start(t)==i.pos-(i.depth-t),c=cr(i.node(t-1).contentMatchAt(i.indexAfter(t-1)));let n=e&&e(i.parent,l,i); o.unshift(n||(l&&c?{type:c}:null)),s=t; break}else{if(t==1)return!1;o.unshift(null)}let d=i.pos,f=qt(r.doc,d,o.length,o);if(f||=(o[0]=c?{type:c}:null,qt(r.doc,d,o.length,o)),!f)return!1;if(r.split(d,o.length,o),!l& & u& & i.node(s).type!=c){let e=r.mapping.slice(a),t=e.map(i.before(s)),n=r.doc.resolve(t);c& & i.node(s-1).canReplaceWith(n.index(),n.index()+1,c)& & r.setNodeMarkup(e.map(i.before(s)),c)}return n& & n(r.scrollIntoView()),!0}}var pr=fr(),mr=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a!=0& & (i=n.before(a),t& & t(e.tr.setSelection(w.create(e.doc,i))),!0)},hr=(e,t)=>(t& & t(e.tr.setSelection(new kn(e.doc))),!0);function gr(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size& & t.parent.canReplace(a-1,a)?(n& & n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||Yt(e.doc,t.pos))?!1:(n& & n(e.tr.join(t.pos).scrollIntoView()),!0)}function _r(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,c,l=i.type.spec.isolating||a.type.spec.isolating;if(!l&&gr(e,t,n))return!0; let u=!l&&t.parent.canReplace(t.index(),t.index()+1); if(u& & (o=(c=i.contentMatchAt(i.childCount)).findWrapping(a.type))& & c.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,c=s.empty;for(let e=o.length-1;e>=0;e--)c=s.from(o[e].create(null,c));c=s.from(i.copy(c));let l=e.tr.step(new kt(t.pos-1,r,t.pos,r,new p(c,1,0),o.length,!0)),u=l.doc.resolve(r+2*o.length);u.nodeAfter& & u.nodeAfter.type==i.type& & Yt(l.doc,u.pos)& & l.join(u.pos),n(l.scrollIntoView())}return!0}let d=a.type.spec.isolating||r>0&&l?null:S.findFrom(t,1),f=d&&d.$from.blockRange(d.$to),m=f&&Ft(f); if(m!=null& & m>=t.depth)return n&&n(e.tr.lift(f,m).scrollIntoView()),!0; if(u& & Zn(a,`start`,!0)& & Zn(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let c=a,l=1;for(;!c.isTextblock;c=c.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,c.content)){if(n){let r=s.empty;for(let e=o.length-1;e>=0;e--)r=s.from(o[e].copy(r));n(e.tr.step(new kt(t.pos-o.length,t.pos+a.nodeSize,t.pos+l,t.pos+a.nodeSize-l,new p(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function vr(e){return function(t,n){let r=t.selection,i=e< 0 ? r . $ from:r . $ to , a = i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i . node ( a ) . isTextblock ? ( n & & n ( t . tr . setSelection ( C . create ( t . doc , e < 0 ? i . start ( a ) :i . end ( a ) ) ) ) , ! 0 ) : ! 1 } } var yr = vr(-1),br=vr(1);function xr ( e , t = null){return function ( n , r ) { let { $ from:i , $ to:a } = n . selection , o = i.blockRange(a),s=o&&Lt(o,e,t);return s ? ( r & & r ( n . tr . wrap ( o , s ) . scrollIntoView ( ) ) , ! 0 ) : ! 1 } } function Sr ( e , t = null){return function ( n , r ) { let i = !1;for(let r = 0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)= > {if(i)return!1;if(r.isTextblock&&!r.hasMarkup(e,t)){if(r.type==e)i=!0; else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r< n.selection.ranges.length ; r + + ) { let { $ from: { pos:a } , $ to: { pos:o } } = n . selection . ranges [ r ] ; i . setBlockType ( a , o , e , t ) } r ( i . scrollIntoView ( ) ) } return ! 0 } } function Cr ( . . . e ) { return function ( t , n , r ) { for ( let i = 0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var wr = Cr(Gn,qn,Qn),Tr=Cr(Gn,tr,nr),Er={Enter:Cr(sr,ur Line truncated
`),u& & t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:Ir(n)+1}); break}let e=t.pmViewDesc;if(e& & e.node& & e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n& & (n.nodeName==`BR`||n.contentEditable==`false`)}}if(ci& & l.focusNode& & l.focusNode!=s.node& & D(l.focusNode)){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&fi)&&Vr(o.node,o.offset,l.anchorNode,l.anchorOffset)&&Vr(s.node,s.offset,l.focusNode,l.focusOffset))return; let d=!1;if((c.extend||e==t)&&!(u&&ci)){c.collapse(o.node,o.offset); try{e!=t& & c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM& & e.type!=`selection`}get contentLost(){return this.contentDOM& & this.contentDOM!=this.dom& & !this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r< this.children.length ; r + + ) { let i = this.children[r],a=n+i.size;if(n==a?e<=a&&t > =n:e< a & & t > n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?$i:Qi,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=ea:i.markDirty(e-r,t-r); return}i.dirty=i.dom==i.contentDOM& & i.dom.parentNode==this.contentDOM& & !i.children.length?$i:ea}n=a}this.dirty=$i}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?$i:Qi;t.dirty< n & & ( t . dirty = n)}}get domAtom ( ) { return ! 1 } get ignoreForCoords ( ) { return ! 1 } get ignoreForSelection ( ) { return ! 1 } isText ( e ) { return ! 1 } } , na = class extends ta { constructor ( e , t , n , r ) { let i , a = t.type.toDOM;if(typeof a = =`function`&&(a=a(n,()= > {if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){let e=D(a)?a:document.createElement(`span`);e!=a& & (e.appendChild(a),a=e),e.hasAttribute(`contenteditable`)||(e.contentEditable=`false`),e.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==Zi& & e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},ra=class extends ta{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`& & e.target.nodeValue==e.oldValue}},ia=class e extends ta{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r); return o& & o.dom||(o=et.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty& ea||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=ea& & this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Zi){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty< this.dirty & & ( e . dirty = this.dirty),this.dirty=Zi}}slice(t,n,r){let i = e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=Ta(a,n,o,r)),t > 0&&(a=Ta(a,0,t,r)); for(let e=0;e< a.length ; e + + ) a [ e ] . parent = i;return i . children = a,i}ignoreMutation(e){return this . spec . ignoreMutation ? this . spec . ignoreMutation ( e ) :super . ignoreMutation ( e ) } destroy ( ) { this . spec . destroy & & this . spec . destroy ( ) , super . destroy ( ) } } , aa = class e extends ta { constructor ( e , t , n , r , i , a , o ) { super ( e , [ ] , i , a ) , this . node = t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create ( t , n , r , i , a , o ) { let s = a.nodeViews[n.type.name],c,l=s&&s(n,a,()= > {if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM; if(n.isText){if(!u)u=document.createTextNode(n.text);else if(!O(u))throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=et.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0)); let f=u;return u=ga(u,r,n),l?c=new la(t,n,r,i,u,d||null,f,l):n.isText?new sa(t,n,r,i,u,f):new e(t,n,r,i,u,d||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(t.preserveWhitespace=`full`),!this.contentDOM)t.getContent=()=>this.node.content; else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;bLine truncated
< script type = "module" crossorigin > ( f u n c t i o n ( ) { l e t e = d o c u m e n t . c r e a t e E l e m e n t ( ` l i n k ` ) . r e l L i s t ; i f ( e & & e . s u p p o r t s & & e . s u p p o r t s ( ` m o d u l e p r e l o a d ` ) ) r e t u r n ; f o r ( l e t e o f d o c u m e n t . q u e r y S e l e c t o r A l l ( ` l i n k [ r e l = " m o d u l e p r e l o a d " ] ` ) ) n ( e ) ; n e w M u t a t i o n O b s e r v e r ( e = > { f o r ( l e t t o f e ) i f ( t . t y p e = = = ` c h i l d L i s t ` ) f o r ( l e t e o f t . a d d e d N o d e s ) e . t a g N a m e = = = ` L I N K ` & & e . r e l = = = ` m o d u l e p r e l o a d ` & & n ( e ) } ) . o b s e r v e ( d o c u m e n t , { c h i l d L i s t : ! 0 , s u b t r e e : ! 0 } ) ; f u n c t i o n t ( e ) { l e t t = { } ; r e t u r n e . i n t e g r i t y & & ( t . i n t e g r i t y = e . i n t e g r i t y ) , e . r e f e r r e r P o l i c y & & ( t . r e f e r r e r P o l i c y = e . r e f e r r e r P o l i c y ) , t . c r e d e n t i a l s = e . c r o s s O r i g i n = = = ` u s e - c r e d e n t i a l s ` ? ` i n c l u d e ` : e . c r o s s O r i g i n = = = ` a n o n y m o u s ` ? ` o m i t ` : ` s a m e - o r i g i n ` , t } f u n c t i o n n ( e ) { i f ( e . e p ) r e t u r n ; e . e p = ! 0 ; l e t n = t ( e ) ; f e t c h ( e . h r e f , n ) } } ) ( ) ; v a r e = O b j e c t . d e f i n e P r o p e r t y , t = ( t , n ) = > { l e t r = { } ; f o r ( v a r i i n t ) e ( r , i , { g e t : t [ i ] , e n u m e r a b l e : ! 0 } ) ; r e t u r n n | | e ( r , S y m b o l . t o S t r i n g T a g , { v a l u e : ` M o d u l e ` } ) , r } ; f u n c t i o n n ( e ) { t h i s . c o n t e n t = e } n . p r o t o t y p e = { c o n s t r u c t o r : n , f i n d : f u n c t i o n ( e ) { f o r ( v a r t = 0 ; t < t h i s . c o n t e n t . l e n g t h ; t + = 2 ) i f ( t h i s . c o n t e n t [ t ] = = = e ) r e t u r n t ; r e t u r n - 1 } , g e t : f u n c t i o n ( e ) { v a r t = t h i s . f i n d ( e ) ; r e t u r n t = = - 1 ? v o i d 0 : t h i s . c o n t e n t [ t + 1 ] } , u p d a t e : f u n c t i o n ( e , t , r ) { v a r i = r & & r ! = e ? t h i s . r e m o v e ( r ) : t h i s , a = i . f i n d ( e ) , o = i . c o n t e n t . s l i c e ( ) ; r e t u r n a = = - 1 ? o . p u s h ( r | | e , t ) : ( o [ a + 1 ] = t , r & & ( o [ a ] = r ) ) , n e w n ( o ) } , r e m o v e : f u n c t i o n ( e ) { v a r t = t h i s . f i n d ( e ) ; i f ( t = = - 1 ) r e t u r n t h i s ; v a r r = t h i s . c o n t e n t . s l i c e ( ) ; r e t u r n r . s p l i c e ( t , 2 ) , n e w n ( r ) } , a d d T o S t a r t : f u n c t i o n ( e , t ) { r e t u r n n e w n ( [ e , t ] . c o n c a t ( t h i s . r e m o v e ( e ) . c o n t e n t ) ) } , a d d T o E n d : f u n c t i o n ( e , t ) { v a r r = t h i s . r e m o v e ( e ) . c o n t e n t . s l i c e ( ) ; r e t u r n r . p u s h ( e , t ) , n e w n ( r ) } , a d d B e f o r e : f u n c t i o n ( e , t , r ) { v a r i = t h i s . r e m o v e ( t ) , a = i . c o n t e n t . s l i c e ( ) , o = i . f i n d ( e ) ; r e t u r n a . s p l i c e ( o = = - 1 ? a . l e n g t h : o , 0 , t , r ) , n e w n ( a ) } , f o r E a c h : f u n c t i o n ( e ) { f o r ( v a r t = 0 ; t < t h i s . c o n t e n t . l e n g t h ; t + = 2 ) e ( t h i s . c o n t e n t [ t ] , t h i s . c o n t e n t [ t + 1 ] ) } , p r e p e n d : f u n c t i o n ( e ) { r e t u r n e = n . f r o m ( e ) , e . s i z e ? n e w n ( e . c o n t e n t . c o n c a t ( t h i s . s u b t r a c t ( e ) . c o n t e n t ) ) : t h i s } , a p p e n d : f u n c t i o n ( e ) { r e t u r n e = n . f r o m ( e ) , e . s i z e ? n e w n ( t h i s . s u b t r a c t ( e ) . c o n t e n t . c o n c a t ( e . c o n t e n t ) ) : t h i s } , s u b t r a c t : f u n c t i o n ( e ) { v a r t = t h i s ; e = n . f r o m ( e ) ; f o r ( v a r r = 0 ; r < e . c o n t e n t . l e n g t h ; r + = 2 ) t = t . r e m o v e ( e . c o n t e n t [ r ] ) ; r e t u r n t } , t o O b j e c t : f u n c t i o n ( ) { v a r e = { } ; r e t u r n t h i s . f o r E a c h ( f u n c t i o n ( t , n ) { e [ t ] = n } ) , e } , g e t s i z e ( ) { r e t u r n t h i s . c o n t e n t . l e n g t h > > 1 } } , n . f r o m = f u n c t i o n ( e ) { i f ( e i n s t a n c e o f n ) r e t u r n e ; v a r t = [ ] ; i f ( e ) f o r ( v a r r i n e ) t . p u s h ( r , e [ r ] ) ; r e t u r n n e w n ( t ) } ; f u n c t i o n r ( e , t , n ) { f o r ( l e t i = 0 ; ; i + + ) { i f ( i = = e . c h i l d C o u n t | | i = = t . c h i l d C o u n t ) r e t u r n e . c h i l d C o u n t = = t . c h i l d C o u n t ? n u l l : n ; l e t s = e . c h i l d ( i ) , c = t . c h i l d ( i ) ; i f ( s = = c ) n + = s . n o d e S i z e ; e l s e { i f ( ! s . s a m e M a r k u p ( c ) ) r e t u r n n ; i f ( s . i s T e x t & & s . t e x t ! = c . t e x t ) { l e t e = s . t e x t , t = c . t e x t , r = 0 ; f o r ( ; e [ r ] = = t [ r ] ; r + + ) n + + ; r e t u r n r & & r < e . l e n g t h & & r < t . l e n g t h & & o ( e . c h a r C o d e A t ( r - 1 ) ) & & a ( e . c h a r C o d e A t ( r ) ) & & n - - , n } i f ( s . c o n t e n t . s i z e | | c . c o n t e n t . s i z e ) { l e t e = r ( s . c o n t e n t , c . c o n t e n t , n + 1 ) ; i f ( e ! = n u l l ) r e t u r n e } n + = s . n o d e S i z e } } } f u n c t i o n i ( e , t , n , r ) { f o r ( l e t s = e . c h i l d C o u n t , c = t . c h i l d C o u n t ; ; ) { i f ( s = = 0 | | c = = 0 ) r e t u r n s = = c ? n u l l : { a : n , b : r } ; l e t l = e . c h i l d ( - - s ) , u = t . c h i l d ( - - c ) , d = l . n o d e S i z e ; i f ( l = = u ) n - = d , r - = d ; e l s e { i f ( ! l . s a m e M a r k u p ( u ) ) r e t u r n { a : n , b : r } ; i f ( l . i s T e x t & & l . t e x t ! = u . t e x t ) { l e t e = l . t e x t , t = u . t e x t , i = e . l e n g t h , s = t . l e n g t h ; f o r ( ; i > 0 & & s > 0 & & e [ i - 1 ] = = t [ s - 1 ] ; ) i - - , s - - , n - - , r - - ; r e t u r n i & & s & & i < e . l e n g t h & & o ( e . c h a r C o d e A t ( i - 1 ) ) & & a ( e . c h a r C o d e A t ( i ) ) & & ( n + + , r + + ) , { a : n , b : r } } i f ( l . c o n t e n t . s i z e | | u . c o n t e n t . s i z e ) { l e t e = i ( l . c o n t e n t , u . c o n t e n t , n - 1 , r - 1 ) ; i f ( e ) r e t u r n e } n - = d , r - = d } } } f u n c t i o n a ( e ) { r e t u r n e > = 5 6 3 2 0 & & e < 5 7 3 4 4 } f u n c t i o n o ( e ) { r e t u r n e > = 5 5 2 9 6 & & e < 5 6 3 2 0 } v a r s = c l a s s e { c o n s t r u c t o r ( e , t ) { i f ( t h i s . c o n t e n t = e , t h i s . s i z e = t | | 0 , t = = n u l l ) f o r ( l e t t = 0 ; t < e . l e n g t h ; t + + ) t h i s . s i z e + = e [ t ] . n o d e S i z e } n o d e s B e t w e e n ( e , t , n , r = 0 , i ) { f o r ( l e t a = 0 , o = 0 ; o < t ; a + + ) { l e t s = t h i s . c o n t e n t [ a ] , c = o + s . n o d e S i z e ; i f ( c > e & & n ( s , r + o , i | | n u l l , a ) ! = = ! 1 & & s . c o n t e n t . s i z e ) { l e t i = o + 1 ; s . n o d e s B e t w e e n ( M a t h . m a x ( 0 , e - i ) , M a t h . m i n ( s . c o n t e n t . s i z e , t - i ) , n , r + i ) } o = c } } d e s c e n d a n t s ( e ) { t h i s . n o d e s B e t w e e n ( 0 , t h i s . s i z e , e ) } t e x t B e t w e e n ( e , t , n , r ) { l e t i = ` ` , a = ! 0 ; r e t u r n t h i s . n o d e s B e t w e e n ( e , t , ( o , s ) = > { l e t c = o . i s T e x t ? o . t e x t . s l i c e ( M a t h . m a x ( e , s ) - s , t - s ) : o . i s L e a f ? r ? t y p e o f r = = ` f u n c t i o n ` ? r ( o ) : r : o . t y p e . s p e c . l e a f T e x t ? o . t y p e . s p e c . l e a f T e x t ( o ) : ` ` : ` ` ; o . i s B l o c k & & ( o . i s L e a f & & c | | o . i s T e x t b l o c k ) & & n & & ( a ? a = ! 1 : i + = n ) , i + = c } , 0 ) , i } a p p e n d ( t ) { i f ( ! t . s i z e ) r e t u r n t h i s ; i f ( ! t h i s . s i z e ) r e t u r n t ; l e t n = t h i s . l a s t C h i l d , r = t . f i r s t C h i l d , i = t h i s . c o n t e n t . s l i c e ( ) , a = 0 ; f o r ( n . i s T e x t & & n . s a m e M a r k u p ( r ) & & ( i [ i . l e n g t h - 1 ] = n . w i t h T e x t ( n . t e x t + r . t e x t ) , a = 1 ) ; a < t . c o n t e n t . l e n g t h ; a + + ) i . p u s h ( t . c o n t e n t [ a ] ) ; r e t u r n n e w e ( i , t h i s . s i z e + t . s i z e ) } c u t ( t , n = t h i s . s i z e ) { i f ( t = = 0 & & n = = t h i s . s i z e ) r e t u r n t h i s ; l e t r = [ ] , i = 0 ; i f ( n > t ) f o r ( l e t e = 0 , a = 0 ; a < n ; e + + ) { l e t o = t h i s . c o n t e n t [ e ] , s = a + o . n o d e S i z e ; s > t & & ( ( a < t | | s > n ) & & ( o = o . i s T e x t ? o . c u t ( M a t h . m a x ( 0 , t - a ) , M a t h . m i n ( o . t e x t . l e n g t h , n - a ) ) : o . c u t ( M a t h . m a x ( 0 , t - a - 1 ) , M a t h . m i n ( o . c o n t e n t . s i z e , n - a - 1 ) ) ) , r . p u s h ( o ) , i + = o . n o d e S i z e ) , a = s } r e t u r n n e w e ( r , i ) } c u t B y I n d e x ( t , n ) { r e t u r n t = = n ? e . e m p t y : t = = 0 & & n = = t h i s . c o n t e n t . l e n g t h ? t h i s : n e w e ( t h i s . c o n t e n t . s l i c e ( t , n ) ) } r e p l a c e C h i l d ( t , n ) { l e t r = t h i s . c o n t e n t [ t ] ; i f ( r = = n ) r e t u r n t h i s ; l e t i = t h i s . c o n t e n t . s l i c e ( ) , a = t h i s . s i z e + n . n o d e S i z e - r . n o d e S i z e ; r e t u r n i [ t ] = n , n e w e ( i , a ) } a d d T o S t a r t ( t ) { r e t u r n n e w e ( [ t ] . c o n c a t ( t h i s . c o n t e n t ) , t h i s . s i z e + t . n o d e S i z e ) } a d d T o E n d ( t ) { r e t u r n n e w e ( t h i s . c o n t e n t . c o n c a t ( t ) , t h i s . s i z e + t . n o d e S i z e ) } e q ( Line truncated
`)}};fe.empty=new fe(!0);var pe=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``& & this.tokens.pop(),this.tokens[0]==``& & this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e& & (this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function me(e){let t=[];do t.push(he(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function he(e){let t=[];do t.push(ge(e));while(e.next&&e.next!=`)`&&e.next!=`|`); return t.length==1?t[0]:{type:`seq`,exprs:t}}function ge(e){let t=be(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=ve(e,t);else break;return t}function _e(e){/\D/.test(e.next)& & e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function ve(e,t){let n=_e(e),r=n;return e.eat(`,`)& & (r=e.next==`}`?-1:_e(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function ye(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)& & i.push(r)}return i.length==0& & e.err(`No node type or group '`+t+`' found`),i}function be(e){if(e.eat(`(`)){let t=me(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=ye(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline& & e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function xe(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t< e.min ; t + + ) { let t = n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for ( let t = e.min;t<e.max;t++){let t = n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if ( e . type = =`name`)return[r(t,void 0 , e . value ) ] ; else throw Error ( ` Unknown expr type ` ) } } function Se ( e , t ) { return t-e } function Ce ( e , t ) { let n = [];return r ( t ) , n . sort ( Se ) ; function r ( t ) { let i = e[t];if(i.length==1&&!i[0].term)return r ( i [ 0 ] . to ) ; n . push ( t ) ; for ( let e = 0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function we ( e ) { let t = Object.create(null);return n ( Ce ( e , 0 ) ) ; function n ( r ) { let i = [];r.forEach(t= > {e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e< i.length ; e + + ) i [ e ] [ 0 ] = = t & & ( r = i[e][1]);Ce(e,n).forEach(e= > {r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})}); let a=t[r.join(`,`)]=new fe(r.indexOf(e.length-1)>-1);for(let e=0;e< i.length ; e + + ) { let r = i[e][1].sort(Se);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a } } function Te ( e , t ) { for ( let n = 0,r=[e];n<r.length;n++){let e = r[n],i=!e.validEnd,a=[];for(let t = 0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes ( ` + a . join ( ` , ` ) + ` ) in a required position ( see https: / / prosemirror . net / docs / guide / # generatable ) ` ) } } function Ee ( e ) { let t = Object.create(null);for(let n in e ) { let r = e[n];if(!r.hasDefault)return null ; t [ n ] = r . default } return t } function De ( e , t ) { let n = Object.create(null);for(let r in e ) { let i = e[r],a=t&&t[r];if(a===void 0 ) { if ( i . hasDefault ) a = i.default;else throw RangeError ( ` No value supplied for attribute ` + r ) } else i . validate & & i . validate ( a ) ; n [ r ] = a } return n } function Oe ( e , t ) { let n = Object.create(null);if(t)for(let r in t ) n [ r ] = new je ( e , r , t [ r ] ) ; return n } var ke = class e { constructor ( e , t , n ) { this . name = e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` ` ) : [ ] , this . attrs = Oe(e,n.attrs),this.defaultAttrs=Ee(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline ( ) { return ! this . isBlock } get isTextblock ( ) { return this . isBlock & & this . inlineContent } get isLeaf ( ) { return this . contentMatch = =fe.empty}get isAtom ( ) { return this . isLeaf | | ! ! this . spec . atom } isInGroup ( e ) { return this . groups . indexOf ( e ) > -1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e& & this.defaultAttrs?this.defaultAttrs:De(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new ce(this,this.coLine truncated
`);else if(a.linebreakReplacement& & /[\r\n]/.test(n)& & this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n< e.length ; n + + ) n & & this . insertNode ( a . linebreakReplacement . create ( ) , t , ! 0 ) , e [ n ] & & this . insertNode ( a . text ( e [ n ] ) , t , ! / \ S / . test ( e [ n ] ) ) ; n = ``}else n = n.replace(/\r?\n|\r/g,` ` ) ; n & & this . insertNode ( a . text ( n ) , t , ! / \ S / . test ( n ) ) , this . findInText ( e ) } else this . findInside ( e ) } addElement ( e , t , n ) { let r = this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a = e.nodeName.toLowerCase(),o;B e.hasOwnProperty(a)&&this.parser.normalizeLists&&q e(e);let s = this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:z e.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if ( ! s | | s . skip | | s . closeParent ) { s & & s . closeParent ? this . open = Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n , r = this.needsBlock;if(R e.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if ( ! e . firstChild ) { this . leafFallback ( e , t ) ; break out } let o = s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n = this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0 ) } this . localPreserveWS = r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
`),t)}ignoreFallback(e,t){e.nodeName!=`BR`||this.top.type& & this.top.type.inlineContent||this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n& & n.length)for(let e=0;e< this.parser.matchedStyles.length ; e + + ) { let r = this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e ; ; ) { let n = this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null ; if ( t = n.clearMark?t.filter(e= > !n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node){if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e& & (i=!0,n=e)}}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e); else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement& & (r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i& & this.sync(o)& & this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break; if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e< r.length ; e + + ) t = this.enterInner(r[e],null,t,!1);return t } insertNode ( e , t , n ) { if ( e . isInline & & this . needsBlock & & ! this . top . type ) { let e = this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r = this.findPlace(e,t,n);if(r){this.closeExtra();let t = this.top;t.match&&=t.match.matchType(e.type);let n = d.none;for(let i of r . concat ( e . marks ) ) ( t . type ? t . type . allowsMarkType ( i . type ) :Xe ( i . type , e . type ) ) & & ( n = i.addToSet(n));return t . content . push ( e . mark ( n ) ) , ! 0 } return ! 1 } enter ( e , t , n , r ) { let i = this.findPlace(e.create(t),n,!1);return i & & = this . enterInner ( e , t , n , ! 0 , r ) , i } enterInner ( e , t , n , r = !1,i){this.closeExtra();let a = this.top;a.match=a.match&&a.match.matchType(e);let o = We(e,i,a.options);a.options&Ue&&a.content.length==0&&(o|=Ue);let s = d.none;return n = n.filter(t= > !(a.type?a.type.allowsMarkType(t.type):Xe(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new Ge(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=Ve); return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t& & e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n< this.find.length ; n + + ) this . find [ n ] . node = =e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t = 0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r = 0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t = 0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`) > -1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen& & (!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null; if(!e||e.name!=s&&!e.isInGroup(s))return!1; o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n& & n.isTextblock& & n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock& & t.defaultAttrs)return t}}};function qe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e& & Be.hasOwnProperty(e)& & n?(n.appendChild(t),t=n):e==`li`?n=t:e& & (n=null)}}function Je(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatcheLine truncated
`))}})}function Ht(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Ut(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new Et(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new p(s.from(o),0,0),1,!0))}function Wt(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent; if(a< 0 | | i . parent . type . spec . isolating | | ! i . parent . canReplace ( i . index ( ) , i . parent . childCount ) | | ! o . type . validContent ( i . parent . content . cutByIndex ( i . index ( ) , i . parent . childCount ) ) ) return ! 1 ; for ( let e = i.depth-1,t=n-2;e > a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1]; s&&(o=o.replaceChild(0,s.type.create(s.attrs))); let c=r&&r[t]||n; if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0]; return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function Gt(e,t,n=1,r){let i=e.doc.resolve(t),a=s.empty,o=s.empty;for(let e=i.depth,t=i.depth-n,c=n-1;e>t;e--,c--){a=s.from(i.node(e).copy(a));let t=r&&r[c]; o=s.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new Tt(t,t,new p(a.append(o),n,n),!0))}function Kt(e,t){let n=e.resolve(t),r=n.index();return Jt(n.nodeBefore,n.nodeAfter)& & n.parent.canReplace(r,r+1)}function qt(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i< t.childCount ; i + + ) { let a = t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n . validEnd } function Jt ( e , t ) { return ! ! ( e & & t & & ! e . isLeaf & & qt ( e , t ) ) } function Yt ( e , t , n = -1){let r = e.resolve(t);for(let e = r.depth;;e--){let i , a , o = r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n > 0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i& & !i.isTextblock& & Jt(i,a)& & r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n< 0 ? r . before ( e ) :r . after ( e ) } } function Xt ( e , t , n ) { let r = null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e = o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s = e.steps.length;if(r===!1){let r = e.doc.resolve(t+n);Vt(e,r.node(),r.before(),s)}o.inlineContent&&At(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c = e.mapping.slice(s),l=c.map(t-n);if(e.step(new Tt ( l , c . map ( t + n , -1 ) , p . empty , ! 0 ) ) , r = ==!0){let t = e.doc.resolve(l);Bt(e,t.node(),t.before(),e.steps.length)}return e } function Zt ( e , t , n ) { let r = e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t ; if ( r . parentOffset = =0)for(let e = r.depth-1;e > =0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t< r.node ( e ) . childCount ) return null } return null } function Qt ( e , t , n ) { let r = e.resolve(t);if(!n.content.size)return t ; let i = n.content;for(let e = 0;e<n.openStart;e++)i=i.firstChild.content;for(let e = 1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t = r.depth;t > =0;t--){let n=t==r.depth?0:r.pos< =(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e& & o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n< 0 ? r . before ( t + 1 ) :r . after ( t + 1 ) } return null } function $ t ( e , t , n = t,r=p.empty){if(t==n&&!r.size)return null ; let i = e.resolve(t),a=e.resolve(n);return en ( i , a , r ) ? new Tt ( t , n , r ) :new tn ( i , a , r ) . fit ( ) } function en ( e , t , n ) { return ! n . openStart & & ! n . openEnd & & e . start ( ) = = t . start ( ) & & e . parent . canReplace ( e . index ( ) , t . index ( ) , n . content ) } var tn = class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=s.empty;for(let t = 0;t<=e.depth;t++){let n = e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t = e.depth;t > 0;t--)this.placed=s.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e< 0 ? this . $ to:n . doc . resolve ( e ) ) ; if ( ! r ) return null ; let i = this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s = new p ( i , a , o ) ; return e > -1?new Et(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new Tt(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n< e ; n + + ) { let i = t.firstChild;if(t.childCount > 1&&(r=0),i.type.spec.isolating&&r<=n){e=n; break}t=i.content}for(let t=1;t< =2;t++)for(let n=t=Line truncated
`).scrollIntoView()),!0)};function ar(e){for(let t=0;t< e.edgeCount ; t + + ) { let { type:n } = e . edge ( t ) ; if ( n . isTextblock & & ! n . hasRequiredAttrs ( ) ) return n } return null } var or = (e,t)= > {let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=ar(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(T.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},sr=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof En||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=ar(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill()); o.setSelection(E.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},cr=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1& & n.after()!=n.end(-1)){let r=n.before();if(Wt(e.doc,r))return t& & t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Mt(r); return i!=null&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)}; function lr(e){return(t,n)=>{if(t.selection instanceof D&&t.selection.node.isBlock){let{$from:e}=t.selection; return!e.parentOffset||!Wt(t.doc,e.pos)?!1:(n&&n(t.tr.split(e.pos).scrollIntoView()),!0)}if(!t.selection.$from.depth)return!1; let r=t.tr;!t.selection.empty& & (t.selection instanceof E||t.selection instanceof En)&&r.deleteSelection(); let{$from:i}=r.selection,a=r.steps.length,o=[],s,c,l=!1,u=!1;for(let t=i.depth;;t--)if(i.node(t).isBlock){l=i.end(t)==i.pos+(i.depth-t),u=i.start(t)==i.pos-(i.depth-t),c=ar(i.node(t-1).contentMatchAt(i.indexAfter(t-1)));let n=e&&e(i.parent,l,i); o.unshift(n||(l&&c?{type:c}:null)),s=t; break}else{if(t==1)return!1;o.unshift(null)}let d=i.pos,f=Wt(r.doc,d,o.length,o);if(f||=(o[0]=c?{type:c}:null,Wt(r.doc,d,o.length,o)),!f)return!1;if(r.split(d,o.length,o),!l& & u& & i.node(s).type!=c){let e=r.mapping.slice(a),t=e.map(i.before(s)),n=r.doc.resolve(t);c& & i.node(s-1).canReplaceWith(n.index(),n.index()+1,c)& & r.setNodeMarkup(e.map(i.before(s)),c)}return n& & n(r.scrollIntoView()),!0}}var ur=lr(),dr=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a!=0& & (i=n.before(a),t& & t(e.tr.setSelection(D.create(e.doc,i))),!0)},fr=(e,t)=>(t& & t(e.tr.setSelection(new En(e.doc))),!0);function pr(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size& & t.parent.canReplace(a-1,a)?(n& & n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||Kt(e.doc,t.pos))?!1:(n& & n(e.tr.join(t.pos).scrollIntoView()),!0)}function mr(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,c,l=i.type.spec.isolating||a.type.spec.isolating;if(!l&&pr(e,t,n))return!0; let u=!l&&t.parent.canReplace(t.index(),t.index()+1); if(u& & (o=(c=i.contentMatchAt(i.childCount)).findWrapping(a.type))& & c.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,c=s.empty;for(let e=o.length-1;e>=0;e--)c=s.from(o[e].create(null,c));c=s.from(i.copy(c));let l=e.tr.step(new Et(t.pos-1,r,t.pos,r,new p(c,1,0),o.length,!0)),u=l.doc.resolve(r+2*o.length);u.nodeAfter& & u.nodeAfter.type==i.type& & Kt(l.doc,u.pos)& & l.join(u.pos),n(l.scrollIntoView())}return!0}let d=a.type.spec.isolating||r>0&&l?null:T.findFrom(t,1),f=d&&d.$from.blockRange(d.$to),m=f&&Mt(f); if(m!=null& & m>=t.depth)return n&&n(e.tr.lift(f,m).scrollIntoView()),!0; if(u& & Jn(a,`start`,!0)& & Jn(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let c=a,l=1;for(;!c.isTextblock;c=c.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,c.content)){if(n){let r=s.empty;for(let e=o.length-1;e>=0;e--)r=s.from(o[e].copy(r));n(e.tr.step(new Et(t.pos-o.length,t.pos+a.nodeSize,t.pos+l,t.pos+a.nodeSize-l,new p(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function hr(e){return function(t,n){let r=t.selection,i=e< 0 ? r . $ from:r . $ to , a = i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i . node ( a ) . isTextblock ? ( n & & n ( t . tr . setSelection ( E . create ( t . doc , e < 0 ? i . start ( a ) :i . end ( a ) ) ) ) , ! 0 ) : ! 1 } } var gr = hr(-1),_r=hr(1);function vr ( e , t = null){return function ( n , r ) { let { $ from:i , $ to:a } = n . selection , o = i.blockRange(a),s=o&&Pt(o,e,t);return s ? ( r & & r ( n . tr . wrap ( o , s ) . scrollIntoView ( ) ) , ! 0 ) : ! 1 } } function yr ( e , t = null){return function ( n , r ) { let i = !1;for(let r = 0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)= > {if(i)return!1;if(r.isTextblock&&!r.hasMarkup(e,t)){if(r.type==e)i=!0; else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r< n.selection.ranges.length ; r + + ) { let { $ from: { pos:a } , $ to: { pos:o } } = n . selection . ranges [ r ] ; i . setBlockType ( a , o , e , t ) } r ( i . scrollIntoView ( ) ) } return ! 0 } } function br ( . . . e ) { return function ( t , n , r ) { for ( let i = 0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var xr = br(Hn,Wn,Yn),Sr=br(Hn,Qn,$n),Cr={Enter:br(ir,sr Line truncated
`),u& & t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:Nr(n)+1}); break}let e=t.pmViewDesc;if(e& & e.node& & e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n& & (n.nodeName==`BR`||n.contentEditable==`false`)}}if(ai& & l.focusNode& & l.focusNode!=s.node& & A(l.focusNode)){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&li)&&Rr(o.node,o.offset,l.anchorNode,l.anchorOffset)&&Rr(s.node,s.offset,l.focusNode,l.focusOffset))return; let d=!1;if((c.extend||e==t)&&!(u&&ai)){c.collapse(o.node,o.offset); try{e!=t& & c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM& & e.type!=`selection`}get contentLost(){return this.contentDOM& & this.contentDOM!=this.dom& & !this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r< this.children.length ; r + + ) { let i = this.children[r],a=n+i.size;if(n==a?e<=a&&t > =n:e< a & & t > n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?Xi:Yi,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Zi:i.markDirty(e-r,t-r); return}i.dirty=i.dom==i.contentDOM& & i.dom.parentNode==this.contentDOM& & !i.children.length?Xi:Zi}n=a}this.dirty=Xi}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?Xi:Yi;t.dirty< n & & ( t . dirty = n)}}get domAtom ( ) { return ! 1 } get ignoreForCoords ( ) { return ! 1 } get ignoreForSelection ( ) { return ! 1 } isText ( e ) { return ! 1 } } , $ i = class extends Qi { constructor ( e , t , n , r ) { let i , a = t.type.toDOM;if(typeof a = =`function`&&(a=a(n,()= > {if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){let e=A(a)?a:document.createElement(`span`);e!=a& & (e.appendChild(a),a=e),e.hasAttribute(`contenteditable`)||(e.contentEditable=`false`),e.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==Ji& & e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},ea=class extends Qi{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`& & e.target.nodeValue==e.oldValue}},ta=class e extends Qi{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r); return o& & o.dom||(o=Ze.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty& Zi||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Zi& & this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Ji){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty< this.dirty & & ( e . dirty = this.dirty),this.dirty=Ji}}slice(t,n,r){let i = e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=Sa(a,n,o,r)),t > 0&&(a=Sa(a,0,t,r)); for(let e=0;e< a.length ; e + + ) a [ e ] . parent = i;return i . children = a,i}ignoreMutation(e){return this . spec . ignoreMutation ? this . spec . ignoreMutation ( e ) :super . ignoreMutation ( e ) } destroy ( ) { this . spec . destroy & & this . spec . destroy ( ) , super . destroy ( ) } } , na = class e extends Qi { constructor ( e , t , n , r , i , a , o ) { super ( e , [ ] , i , a ) , this . node = t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create ( t , n , r , i , a , o ) { let s = a.nodeViews[n.type.name],c,l=s&&s(n,a,()= > {if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM; if(n.isText){if(!u)u=document.createTextNode(n.text);else if(!j(u))throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=Ze.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0)); let f=u;return u=pa(u,r,n),l?c=new oa(t,n,r,i,u,d||null,f,l):n.isText?new ia(t,n,r,i,u,f):new e(t,n,r,i,u,d||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(t.preserveWhitespace=`full`),!this.contentDOM)t.getContent=()=>this.node.content; else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;bLine truncated
`),slice:t}}function o o(e,t,n,r,i){let a=i.parent.type.spec.code,o,c;if(!n& & !t)return null;let l=!!t&&(r||a||!n); if(l){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return c=new p(s.from(e.state.schema.text(t.replace(/\r\n?/g,`
`))),0,0),e.someProp(`transformPasted`,t=>{c=t(c,e,!0)}),c;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)c=n;else{let n=i.marks(),{schema:r}=e.state,a=et.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e& & t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=yo(n),_i&&bo(o); let u=o& & o.querySelector(`[data-pm-slice]`),d=u& & /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute(`data-pm-slice`)||``);if(d& & d[3])for(let e=+d[3];e>0;e--){let e=o.firstChild;for(;e&&!D(e); )e=e.nextSibling;if(!e)break;o=e}if(c||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||Be.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||d),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!so.test(e.parentNode.nodeName)?{ignore:!0}:null}}),d)c=xo(mo(c,+d[1],+d[2]),d[4]); else if(c=p.maxOpen(co(c.content,i),!0),c.openStart||c.openEnd){let e=0,t=0;for(let t=c.content.firstChild;e< c.openStart & & ! t . type . spec . isolating ; e + + , t = t.firstChild);for(let e = c.content.lastChild;t<c.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);c=mo(c,e,t)}return e . someProp ( ` transformPasted ` , t = > {c=t(c,e,l)}),c}var so = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function co ( e , t ) { if ( e . childCount < 2 ) return e ; for ( let n = t.depth;n > =0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&uo(t,i,e,a[a.length-1],0))a[a.length-1]=n; else{a.length&&(a[a.length-1]=fo(a[a.length-1],i.length)); let n=lo(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return s.from(a)}return e}function lo(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,s.from(e));return e}function uo(e,t,n,r,i){if(i< e.length & & i < t . length & & e [ i ] = = t [ i ] ) { let a = uo(e,t,n,r.lastChild,i+1);if(a)return r . copy ( r . content . replaceChild ( r . childCount-1 , a ) ) ; if ( r . contentMatchAt ( r . childCount ) . matchType ( i = =e.length-1?n.type:e[i+1]))return r . copy ( r . content . append ( s . from ( lo ( n , e , i + 1 ) ) ) ) } } function fo ( e , t ) { if ( t = =0)return e ; let n = e.content.replaceChild(e.childCount-1,fo(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(s.empty,!0);return e . copy ( n . append ( r ) ) } function po ( e , t , n , r , i , a ) { let o = t<0?e.firstChild:e.lastChild,c=o.content;return e . childCount > 1& & (a=0),i< r-1 & & ( c = po(c,t,n,r,i+1,a)),i > =n& & (c=t< 0 ? o . contentMatchAt ( 0 ) . fillBefore ( c , a < = i ) . append ( c ) :c . append ( o . contentMatchAt ( o . childCount ) . fillBefore ( s . empty , ! 0 ) ) ) , e . replaceChild ( t < 0 ? 0:e . childCount-1 , o . copy ( c ) ) } function mo ( e , t , n ) { return t < e . openStart & & ( e = new p ( po ( e . content , -1 , t , e . openStart , 0 , e . openEnd ) , t , e . openEnd ) ) , n < e . openEnd & & ( e = new p ( po ( e . content , 1 , n , e . openEnd , 0 , 0 ) , e . openStart , n ) ) , e } var ho = {thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]};function go ( ) { return document . implementation . createHTMLDocument ( ` title ` ) } var _o = null;function vo ( e ) { let t = window.trustedTypes;if(!t)return e ; if ( ! _o ) { if ( _o = t.defaultPolicy)try{return _o . createHTML ( e ) } catch { } _o = t.createPolicy(`ProseMirrorClipboard`,{createHTML:e= > e})}return _o.createHTML(e)}function yo(e){let t=/^(\s*< meta [ ^ > ]*>)*/.exec(e);t&&(e=e.slice(t[0].length)); let n=go(),r=n.body,i=/< ([a-z][^>\s]+)/i.exec(e),a;if((a=i& & ho[i[1].toLowerCase()])& & (e=a.map(e=>`< `+e+`>`).join(``)+e+a.map(e=>`< /`+e+`>`).reverse().join(``)),r.innerHTML=vo(e),a)for(let e=0;e< a.length ; e + + ) r = r.querySelector(a[e])||r;for(let e = 0;e<n.styleSheets.length;e++){let t = n.styleSheets[e];for(let e = 0;e<t.rules.length;e++){let n = t.rules[e];if(n instanceof CSSStyleRule ) { let e = r.querySelectorAll(n.selectorText);for(let t = 0;t<e.length;t++)e[t].style.cssText+=n.style.cssText}}}return r } function bo ( e ) { let t = e.querySelectorAll(ui?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n = 0;n<t.length;n++){let r = t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` ` ) , r ) } } function xo ( e , t ) { if ( ! e . size ) return e ; let n = e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e } let { content:i , openStart:a , openEnd:o } = e ; for ( let e = r.length-2;e > =0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;try{i=s.from(t.create(r[e+1],i))}catch{break}a++,o++}return new p(i,a,o)}var So={},Co={},wo={touchstart:!0,touchmove:!0},To=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariCompoLine truncated
`),slice:t}}function r o(e,t,n,r,i){let a=i.parent.type.spec.code,o,c;if(!n& & !t)return null;let l=!!t&&(r||a||!n); if(l){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return c=new p(s.from(e.state.schema.text(t.replace(/\r\n?/g,`
`))),0,0),e.someProp(`transformPasted`,t=>{c=t(c,e,!0)}),c;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)c=n;else{let n=i.marks(),{schema:r}=e.state,a=Ze.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e& & t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=go(n),mi&&_o(o); let u=o& & o.querySelector(`[data-pm-slice]`),d=u& & /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute(`data-pm-slice`)||``);if(d& & d[3])for(let e=+d[3];e>0;e--){let e=o.firstChild;for(;e&&!A(e); )e=e.nextSibling;if(!e)break;o=e}if(c||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||Le.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||d),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!io.test(e.parentNode.nodeName)?{ignore:!0}:null}}),d)c=vo(uo(c,+d[1],+d[2]),d[4]); else if(c=p.maxOpen(ao(c.content,i),!0),c.openStart||c.openEnd){let e=0,t=0;for(let t=c.content.firstChild;e< c.openStart & & ! t . type . spec . isolating ; e + + , t = t.firstChild);for(let e = c.content.lastChild;t<c.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);c=uo(c,e,t)}return e . someProp ( ` transformPasted ` , t = > {c=t(c,e,l)}),c}var io = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function ao ( e , t ) { if ( e . childCount < 2 ) return e ; for ( let n = t.depth;n > =0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&so(t,i,e,a[a.length-1],0))a[a.length-1]=n; else{a.length&&(a[a.length-1]=co(a[a.length-1],i.length)); let n=oo(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return s.from(a)}return e}function oo(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,s.from(e));return e}function so(e,t,n,r,i){if(i< e.length & & i < t . length & & e [ i ] = = t [ i ] ) { let a = so(e,t,n,r.lastChild,i+1);if(a)return r . copy ( r . content . replaceChild ( r . childCount-1 , a ) ) ; if ( r . contentMatchAt ( r . childCount ) . matchType ( i = =e.length-1?n.type:e[i+1]))return r . copy ( r . content . append ( s . from ( oo ( n , e , i + 1 ) ) ) ) } } function co ( e , t ) { if ( t = =0)return e ; let n = e.content.replaceChild(e.childCount-1,co(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(s.empty,!0);return e . copy ( n . append ( r ) ) } function lo ( e , t , n , r , i , a ) { let o = t<0?e.firstChild:e.lastChild,c=o.content;return e . childCount > 1& & (a=0),i< r-1 & & ( c = lo(c,t,n,r,i+1,a)),i > =n& & (c=t< 0 ? o . contentMatchAt ( 0 ) . fillBefore ( c , a < = i ) . append ( c ) :c . append ( o . contentMatchAt ( o . childCount ) . fillBefore ( s . empty , ! 0 ) ) ) , e . replaceChild ( t < 0 ? 0:e . childCount-1 , o . copy ( c ) ) } function uo ( e , t , n ) { return t < e . openStart & & ( e = new p ( lo ( e . content , -1 , t , e . openStart , 0 , e . openEnd ) , t , e . openEnd ) ) , n < e . openEnd & & ( e = new p ( lo ( e . content , 1 , n , e . openEnd , 0 , 0 ) , e . openStart , n ) ) , e } var fo = {thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]};function po ( ) { return document . implementation . createHTMLDocument ( ` title ` ) } var mo = null;function ho ( e ) { let t = window.trustedTypes;if(!t)return e ; if ( ! mo ) { if ( mo = t.defaultPolicy)try{return mo . createHTML ( e ) } catch { } mo = t.createPolicy(`ProseMirrorClipboard`,{createHTML:e= > e})}return mo.createHTML(e)}function go(e){let t=/^(\s*< meta [ ^ > ]*>)*/.exec(e);t&&(e=e.slice(t[0].length)); let n=po(),r=n.body,i=/< ([a-z][^>\s]+)/i.exec(e),a;if((a=i& & fo[i[1].toLowerCase()])& & (e=a.map(e=>`< `+e+`>`).join(``)+e+a.map(e=>`< /`+e+`>`).reverse().join(``)),r.innerHTML=ho(e),a)for(let e=0;e< a.length ; e + + ) r = r.querySelector(a[e])||r;for(let e = 0;e<n.styleSheets.length;e++){let t = n.styleSheets[e];for(let e = 0;e<t.rules.length;e++){let n = t.rules[e];if(n instanceof CSSStyleRule ) { let e = r.querySelectorAll(n.selectorText);for(let t = 0;t<e.length;t++)e[t].style.cssText+=n.style.cssText}}}return r } function _o ( e ) { let t = e.querySelectorAll(si?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n = 0;n<t.length;n++){let r = t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` ` ) , r ) } } function vo ( e , t ) { if ( ! e . size ) return e ; let n = e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e } let { content:i , openStart:a , openEnd:o } = e ; for ( let e = r.length-2;e > =0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;try{i=s.from(t.create(r[e+1],i))}catch{break}a++,o++}return new p(i,a,o)}var yo={},bo={},xo={touchstart:!0,touchmove:!0},So=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariCompoLine truncated
`,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a); let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1; if(e.isText){var d;s+=e==null||(d=e.text)==null?void 0:d.slice(Math.max(r,n)-n,i-n)}}),s}function Hu(e,t){return Vu(e,{from:0,to:e.content.size},t)}function Uu(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Wu(e,t){let n=j(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function Gu(e,t){let n=$l(typeof t==`string`?t:t.name,e.schema);return n===`node`?Wu(e,t):n===`mark`?du(e,t):{}}function Ku(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function qu(e){let t=Ku(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from& & e.oldRange.to< =t.oldRange.to& & e.newRange.from>=t.newRange.from& & e.newRange.to< =t.newRange.to))}function Ju(e){let{mapping:t,steps:n}=e,r=[],i=t.invert();return t.maps.forEach((e,a)=>{let o=[];if(e.ranges.length)e.forEach((e,t)=>{o.push({from:e,to:t})});else{let{from:e,to:t}=n[a];if(e===void 0||t===void 0)return;o.push({from:e,to:t})}let s=t.slice(a);o.forEach(({from:e,to:t})=>{let n=s.map(e,-1),a=s.map(t),o=i.map(n,-1),c=i.map(a);r.push({oldRange:{from:o,to:c},newRange:{from:n,to:a}})})}),qu(r)}function Yu(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=ml(n.resolve(e),t.type);i& & r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{e& & e?.nodeSize!==void 0& & r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var Xu=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null; ){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]},Zu=e=>{let t=e.depth-1;if(t< 0 ) return null ; let n = e.index(t);return n = ==0?null:e.node(t).child(n-1)};function Qu ( e , t ) { return t . nodes [ e ] | | t . marks [ e ] | | null } function $ u ( e , t , n ) { return Object . fromEntries ( Object . entries ( n ) . filter ( ( [ n ] ) = > {let r=e.find(e=>e.type===t&&e.name===n); return r?r.attribute.keepOnSplit:!1}))}var ed=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n}; function td(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?hl(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!a||a.name===e.type.name).find(e=>dl(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1; if(!e.isText&&!e.marks.length)return; let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>!a||a.name===e.mark.type.name).filter(e=>dl(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>!a||e.mark.type!==a&&e.mark.type.excludes(a)).reduce((e,t)=>e+t.to-t.from,0); return(c>0?c+l:c)>=o}function nd(e,t,n={}){if(!t)return Jl(e,null,n)||td(e,null,n);let r=$l(t,e.schema);return r===`node`?Jl(e,t,n):r===`mark`& & td(e,t,n)}var rd=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=hu(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset< r.parent.nodeSize-2 | | n . pos ! = = r . pos ) } , id = e= > {let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function ad(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function od(e,t){let{nodeExtensions:n}=Eu(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=N(M(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`& & i.split(` `).includes(`list`)}function sd(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1& & (sd(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function cd(e){return e instanceof w}function ld(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.apply==`function`& & typeof t.getMap==`function`& & typeof t.invert==`function`& & typeof t.map==`function`& & typeof t.merge==`function`& & typeof t.toJSON==`function`}function ud(e){if(typeof e!=`object`||!e)return!1;let t=e;if(!ld(t))return!1;let n=t.toJSON();return!(typeof n!=`object`||!n||n.stepType!==`replace`)}var dd=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function fd(e,t){let n=t.mapping.mapResult(e.position);return{position:new dd(n.pos),mapResult:n}}function pdLine truncated
`),i=n.isParagraphContinuation??(e=>k f(e,n.blockTokens)),a=0;for(let e of r){if(!e.trim()||!i(e))break;a+=1}return{mainContent:[e,...r.slice(0,a).map(e=>e.trimStart())].join(`
`,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a); let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1; if(e.isText){var d;s+=e==null||(d=e.text)==null?void 0:d.slice(Math.max(r,n)-n,i-n)}}),s}function Bu(e,t){return zu(e,{from:0,to:e.content.size},t)}function Vu(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Hu(e,t){let n=N(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function Uu(e,t){let n=Zl(typeof t==`string`?t:t.name,e.schema);return n===`node`?Hu(e,t):n===`mark`?lu(e,t):{}}function Wu(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function Gu(e){let t=Wu(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from& & e.oldRange.to< =t.oldRange.to& & e.newRange.from>=t.newRange.from& & e.newRange.to< =t.newRange.to))}function Ku(e){let{mapping:t,steps:n}=e,r=[],i=t.invert();return t.maps.forEach((e,a)=>{let o=[];if(e.ranges.length)e.forEach((e,t)=>{o.push({from:e,to:t})});else{let{from:e,to:t}=n[a];if(e===void 0||t===void 0)return;o.push({from:e,to:t})}let s=t.slice(a);o.forEach(({from:e,to:t})=>{let n=s.map(e,-1),a=s.map(t),o=i.map(n,-1),c=i.map(a);r.push({oldRange:{from:o,to:c},newRange:{from:n,to:a}})})}),Gu(r)}function qu(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=fl(n.resolve(e),t.type);i& & r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{e& & e?.nodeSize!==void 0& & r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var Ju=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null; ){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]},Yu=e=>{let t=e.depth-1;if(t< 0 ) return null ; let n = e.index(t);return n = ==0?null:e.node(t).child(n-1)};function Xu ( e , t ) { return t . nodes [ e ] | | t . marks [ e ] | | null } function Zu ( e , t , n ) { return Object . fromEntries ( Object . entries ( n ) . filter ( ( [ n ] ) = > {let r=e.find(e=>e.type===t&&e.name===n); return r?r.attribute.keepOnSplit:!1}))}var Qu=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n}; function $u(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?pl(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!a||a.name===e.type.name).find(e=>ll(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1; if(!e.isText&&!e.marks.length)return; let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>!a||a.name===e.mark.type.name).filter(e=>ll(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>!a||e.mark.type!==a&&e.mark.type.excludes(a)).reduce((e,t)=>e+t.to-t.from,0); return(c>0?c+l:c)>=o}function ed(e,t,n={}){if(!t)return Kl(e,null,n)||$u(e,null,n);let r=Zl(t,e.schema);return r===`node`?Kl(e,t,n):r===`mark`& & $u(e,t,n)}var td=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=pu(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset< r.parent.nodeSize-2 | | n . pos ! = = r . pos ) } , nd = e= > {let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function rd(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function id(e,t){let{nodeExtensions:n}=wu(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=F(P(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`& & i.split(` `).includes(`list`)}function ad(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1& & (ad(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function od(e){return e instanceof D}function sd(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.apply==`function`& & typeof t.getMap==`function`& & typeof t.invert==`function`& & typeof t.map==`function`& & typeof t.merge==`function`& & typeof t.toJSON==`function`}function cd(e){if(typeof e!=`object`||!e)return!1;let t=e;if(!sd(t))return!1;let n=t.toJSON();return!(typeof n!=`object`||!n||n.stepType!==`replace`)}var ld=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function ud(e,t){let n=t.mapping.mapResult(e.position);return{position:new ld(n.pos),mapResult:n}}function ddLine truncated
`),i=n.isParagraphContinuation??(e=>U f(e,n.blockTokens)),a=0;for(let e of r){if(!e.trim()||!i(e))break;a+=1}return{mainContent:[e,...r.slice(0,a).map(e=>e.trimStart())].join(`
`),nestedContent:r.slice(a).join(`
`)}}function j f(e,t,n){let r=e.split(`
`),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o< r.length ; ) { let e = r[o],u=e.match(t.itemPattern);if(!u){if(i.length > 0)break;if(e.trim()===``){o+=1,a=`${a}${e}\n`;continue}return}let d=t.extractItemData(u),{indentLevel:f,mainContent:p}=d;a=`${a}${e}\n`;let m=[p];for(o+=1;o< r.length ; ) { var c ; let e = r[o];if(e.trim()===``){var l ; let t = r.slice(o+1).findIndex(e= > e.trim()!==``);if(t===-1)break;if((((l=r[o+1+t].match(/^(\s*)/))==null||(l=l[1])==null?void 0:l.length)||0)>f){m.push(e),a=`${a}${e}\n`,o+=1;continue}break}if((((c=e.match(/^(\s*)/))==null||(c=c[1])==null?void 0:c.length)||0)>f)m.push(e),a=`${a}${e}\n`,o+=1;else break}let h,g=m.slice(1);if(g.length>0){let e=A f(p,g.map(e=>O f(e,f+s)).join(`
`),n);d.mainContent=e.mainContent;let r=e.nestedContent;r.trim()& & (h=t.customNestedParser?t.customNestedParser(r):n.blockTokens(r))}let _=t.createToken(d,h);i.push(_)}if(i.length!==0)return{items:i,raw:a.slice(0,e.length)}}var M f=4;function N f(e){let t=0;for(let n of e)t=n===` `?t+M f-t%M f:t+1;return t}function P f(e,t,n,r,i){if(!e||!Array.isArray(e.content))return``;let a=typeof n==`function`?n(r):n,[o,...s]=e.content,c=t.renderChildren([o]),l=`${a}${i?.indentMainContent?c.split(`
`)}}function G f(e,t,n){let r=e.split(`
`),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o< r.length ; ) { let e = r[o],u=e.match(t.itemPattern);if(!u){if(i.length > 0)break;if(e.trim()===``){o+=1,a=`${a}${e}\n`;continue}return}let d=t.extractItemData(u),{indentLevel:f,mainContent:p}=d;a=`${a}${e}\n`;let m=[p];for(o+=1;o< r.length ; ) { var c ; let e = r[o];if(e.trim()===``){var l ; let t = r.slice(o+1).findIndex(e= > e.trim()!==``);if(t===-1)break;if((((l=r[o+1+t].match(/^(\s*)/))==null||(l=l[1])==null?void 0:l.length)||0)>f){m.push(e),a=`${a}${e}\n`,o+=1;continue}break}if((((c=e.match(/^(\s*)/))==null||(c=c[1])==null?void 0:c.length)||0)>f)m.push(e),a=`${a}${e}\n`,o+=1;else break}let h,g=m.slice(1);if(g.length>0){let e=W f(p,g.map(e=>H f(e,f+s)).join(`
`),n);d.mainContent=e.mainContent;let r=e.nestedContent;r.trim()& & (h=t.customNestedParser?t.customNestedParser(r):n.blockTokens(r))}let _=t.createToken(d,h);i.push(_)}if(i.length!==0)return{items:i,raw:a.slice(0,e.length)}}var K f=4;function q f(e){let t=0;for(let n of e)t=n===` `?t+K f-t%K f:t+1;return t}function J f(e,t,n,r,i){if(!e||!Array.isArray(e.content))return``;let a=typeof n==`function`?n(r):n,[o,...s]=e.content,c=t.renderChildren([o]),l=`${a}${i?.indentMainContent?c.split(`
`).map((e,n)=>n===0?e:t.indent(e)).join(`
`):c}`;return s& & s.length>0& & s.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=e=>{if(!i?.alignNestedToPrefix)return t.indent(e);let n=t.indent(``),r=N f(a);return(N f(n)>=r?n:` `.repeat(r))+e},o=r.split(`
`):c}`;return s& & s.length>0& & s.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=e=>{if(!i?.alignNestedToPrefix)return t.indent(e);let n=t.indent(``),r=q f(a);return(q f(n)>=r?n:` `.repeat(r))+e},o=r.split(`
`).map(e=>n(e||``)).join(`
`);l+=e.type===`paragraph`?`\n\n${o}`:`\n${o}`}}),l}function F f(e,t){let n={...e};return E f(e)& & E f(t)& & Object.keys(t).forEach(r=>{E f(t[r])& & E f(e[r])?n[r]=F f(e[r],t[r]):n[r]=t[r]}),n}function I f(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]& & (l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged& & t.view.dispatch(a)}var L f=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},R f=(e,t)=>{if(u l(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith& & (n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r};function z f(e){let{editor:t,from:n,to:r,text:i,insertText:a}=e;if(!a)return{inputTransaction:null,tr:t.view.state.tr};let o=t.view.state.tr.insertText(i,n,r);return{inputTransaction:o,tr:V n.create({doc:o.doc,selection:o.selection,storedMarks:o.storedMarks}).tr}}function Bf (e){let{editor:t,from:n,to:r,text:i,rule:a,match:o,plugin:s,insertText:c}=e,{view:l}=t,{inputTransaction:u,tr:d}=z f({editor:t,from:n,to:r,text:i,insertText:c}),f=u?n+i.length:r,p=q c({state:l.state,transaction:d}),m={from:n-(o[0].length-i.length),to:f},{commands:h,chain:g,can:_}=new J c({editor:t,state:p});return a.handler({state:p,range:m,match:o,commands:h,chain:g,can:_})===null||!d.steps.length?!1:(u& & (l.dispatch(u),!l.state.doc.eq(u.doc))||(z c(d),d.setMeta(`inputRule`,!0),a.undoable& & d.setMeta(s,{transform:d,from:n,to:f,text:i}),l.dispatch(d)),!0)}function Vf (e,t,n){let r=t[0].length-n.length;if(r< =0)return!0;let i=e.parentOffset-r;return i>=0& & e.parent.textBetween(i,e.parentOffset)===t[0].slice(0,r)}function Hf (e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o,insertText:s}=e,{view:c}=t;if(c.composing)return!1;let l=c.state.doc.resolve(n);if(l.parent.type.spec.code||(l.nodeBefore||l.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let u=ed (l)+i;for(let e of a){let a=R f(u,e.find);if(a& & Vf (l,a,i)& & Bf ({editor:t,from:n,to:r,text:i,rule:e,match:a,plugin:o,insertText:s}))return!0}return!1}function Uf (e){let{editor:t,rules:n}=e,r=new T ({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let c=e.getMeta(`applyInputRules`);return c&&setTimeout(()=>{let{text:e}=c; e=typeof e==`string`?e:_ u(s.from(e),a.schema);let{from:i}=c,o=i+e.length;Hf ({editor:t,from:i,to:o,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return Hf ({editor:t,from:i,to:a,text:o,rules:n,plugin:r,insertText:!0})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&Hf ({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1; let{$cursor:a}=e.state.selection;return a?Hf ({editor:t,from:a.pos,to:a.pos,text:`
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var Wf=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...N(M(this,`addOptions`,{name:this.name}))}}get storage(){return{...N(M(this,`addStorage`,{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>Ff(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},Gf=class e extends Wf{constructor(...e){super(...e),this.type=`mark`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a& & n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},Kf=class{constructor(e){this.find=e.find,this.handler=e.handler}},qf=(e,t,n)=>{if(ul(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith& & (t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function Jf(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new Jc({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{var f;if((f=e.type)!=null&&(f=f.spec)!=null&&f.code||!(e.isText||e.isTextblock||e.isInline))return; let p=e.content?.size??e.nodeSize??0,m=Math.max(r,t),h=Math.min(i,t+p);m>=h||qf(e.isText?e.text||``:e.textBetween(m-t,h-t,void 0,` `),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=m+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}var Yf=null,Xf=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function Zf(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent< `u`?new ClipboardEvent(`paste`):null,c;try{c=typeof DragEvent< `u`?new DragEvent(`drop`):null}catch{c=null}let l=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let s=e.tr,l=qc({state:e,transaction:s});if(Jf({editor:t,state:l,from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:c})& & s.steps.length){try{c=typeof DragEvent< `u`?new DragEvent(`drop`):null}catch{c=null}return o=typeof ClipboardEvent< `u`?new ClipboardEvent(`paste`):null,s}};return t.on(`destroy`,()=>{Yf===t& & (Yf=null)}),n.map(e=>new T({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(Yf=t)},i=()=>{Yf&&=null}; return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,c=t,!a){let e=Yf;e?.isEditable&&setTimeout(()=>{if(e.isDestroyed)return; let t=e.state.selection;t& & e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let c=t[0],u=c.getMeta(`uiEvent`)===`paste`&&!i,d=c.getMeta(`uiEvent`)===`drop`&&!a,f=c.getMeta(`applyPasteRules`),p=!!f; if(!u&&!d&&!p)return; if(p){let{text:t}=f;t=typeof t==`string`?t:_u(s.from(t),r.schema);let{from:n}=f,i=n+t.length,a=Xf(t);return l({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let m=n.doc.content.findDiffStart(r.doc.content),h=n.doc.content.findDiffEnd(r.doc.content);if(wf(m)& & h& & m!==h.b)return l({rule:e,state:r,from:m,to:h,pasteEvt:o})}}))}var Qf=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=t,this.baseExtensions=e,this.extensions=Bu(e),this.hasSchemaSpec=t.options.schemaSpec!==void 0,this.schema=Ru(this.extensions,t,t.options.schemaSpec),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=M(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Qu(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this,t=zu([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Qu(t.name,this.schema)},r=[],i=M(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`& & M(t,`exitable`,n)& & (a.ArrowRight=()=>Gf.handleExit({editor:e,mark:t})),i){leLine truncated
`);l+=e.type===`paragraph`?`\n\n${o}`:`\n${o}`}}),l}function Y f(e,t){let n={...e};return T f(e)& & T f(t)& & Object.keys(t).forEach(r=>{T f(t[r])& & T f(e[r])?n[r]=Y f(e[r],t[r]):n[r]=t[r]}),n}function X f(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]& & (l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged& & t.view.dispatch(a)}var Z f=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},Q f=(e,t)=>{if(c l(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith& & (n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r};function $ f(e){let{editor:t,from:n,to:r,text:i,insertText:a}=e;if(!a)return{inputTransaction:null,tr:t.view.state.tr};let o=t.view.state.tr.insertText(i,n,r);return{inputTransaction:o,tr:R n.create({doc:o.doc,selection:o.selection,storedMarks:o.storedMarks}).tr}}function ep (e){let{editor:t,from:n,to:r,text:i,rule:a,match:o,plugin:s,insertText:c}=e,{view:l}=t,{inputTransaction:u,tr:d}=$ f({editor:t,from:n,to:r,text:i,insertText:c}),f=u?n+i.length:r,p=G c({state:l.state,transaction:d}),m={from:n-(o[0].length-i.length),to:f},{commands:h,chain:g,can:_}=new K c({editor:t,state:p});return a.handler({state:p,range:m,match:o,commands:h,chain:g,can:_})===null||!d.steps.length?!1:(u& & (l.dispatch(u),!l.state.doc.eq(u.doc))||(L c(d),d.setMeta(`inputRule`,!0),a.undoable& & d.setMeta(s,{transform:d,from:n,to:f,text:i}),l.dispatch(d)),!0)}function tp (e,t,n){let r=t[0].length-n.length;if(r< =0)return!0;let i=e.parentOffset-r;return i>=0& & e.parent.textBetween(i,e.parentOffset)===t[0].slice(0,r)}function np (e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o,insertText:s}=e,{view:c}=t;if(c.composing)return!1;let l=c.state.doc.resolve(n);if(l.parent.type.spec.code||(l.nodeBefore||l.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let u=Qu (l)+i;for(let e of a){let a=Q f(u,e.find);if(a& & tp (l,a,i)& & ep ({editor:t,from:n,to:r,text:i,rule:e,match:a,plugin:o,insertText:s}))return!0}return!1}function rp (e){let{editor:t,rules:n}=e,r=new O ({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let c=e.getMeta(`applyInputRules`);return c&&setTimeout(()=>{let{text:e}=c; e=typeof e==`string`?e:h u(s.from(e),a.schema);let{from:i}=c,o=i+e.length;np ({editor:t,from:i,to:o,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return np ({editor:t,from:i,to:a,text:o,rules:n,plugin:r,insertText:!0})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&np ({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1; let{$cursor:a}=e.state.selection;return a?np ({editor:t,from:a.pos,to:a.pos,text:`
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var ip=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...F(P(this,`addOptions`,{name:this.name}))}}get storage(){return{...F(P(this,`addStorage`,{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>Yf(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},ap=class e extends ip{constructor(...e){super(...e),this.type=`mark`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a& & n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},op=class{constructor(e){this.find=e.find,this.handler=e.handler}},sp=(e,t,n)=>{if(cl(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith& & (t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function cp(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new Kc({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{var f;if((f=e.type)!=null&&(f=f.spec)!=null&&f.code||!(e.isText||e.isTextblock||e.isInline))return; let p=e.content?.size??e.nodeSize??0,m=Math.max(r,t),h=Math.min(i,t+p);m>=h||sp(e.isText?e.text||``:e.textBetween(m-t,h-t,void 0,` `),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=m+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}var lp=null,up=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function dp(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent< `u`?new ClipboardEvent(`paste`):null,c;try{c=typeof DragEvent< `u`?new DragEvent(`drop`):null}catch{c=null}let l=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let s=e.tr,l=Gc({state:e,transaction:s});if(cp({editor:t,state:l,from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:c})& & s.steps.length){try{c=typeof DragEvent< `u`?new DragEvent(`drop`):null}catch{c=null}return o=typeof ClipboardEvent< `u`?new ClipboardEvent(`paste`):null,s}};return t.on(`destroy`,()=>{lp===t& & (lp=null)}),n.map(e=>new O({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(lp=t)},i=()=>{lp&&=null}; return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,c=t,!a){let e=lp;e?.isEditable&&setTimeout(()=>{if(e.isDestroyed)return; let t=e.state.selection;t& & e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let c=t[0],u=c.getMeta(`uiEvent`)===`paste`&&!i,d=c.getMeta(`uiEvent`)===`drop`&&!a,f=c.getMeta(`applyPasteRules`),p=!!f; if(!u&&!d&&!p)return; if(p){let{text:t}=f;t=typeof t==`string`?t:hu(s.from(t),r.schema);let{from:n}=f,i=n+t.length,a=up(t);return l({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let m=n.doc.content.findDiffStart(r.doc.content),h=n.doc.content.findDiffEnd(r.doc.content);if(Cf(m)& & h& & m!==h.b)return l({rule:e,state:r,from:m,to:h,pasteEvt:o})}}))}var fp=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=t,this.baseExtensions=e,this.extensions=Ru(e),this.hasSchemaSpec=t.options.schemaSpec!==void 0,this.schema=Iu(this.extensions,t,t.options.schemaSpec),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=P(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Xu(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this,t=Lu([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Xu(t.name,this.schema)},r=[],i=P(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`& & P(t,`exitable`,n)& & (a.ArrowRight=()=>ap.handleExit({editor:e,mark:t})),i){leLine truncated
`)}}})]}}),ep=F.create({name:`commands`,addCommands(){return{...Xd}}}),tp=F.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){var n;let r=()=>{var n,r;if(((n=this.editor.options.coreExtensionOptions)==null||(n=n.delete)==null||(r=n.filterTransaction)==null?void 0:r.call(n,e))??e.getMeta(`y-sync$`))return;let i=fu(e.before,[e,...t]);Ju(i).forEach(t=>{i.mapping.mapResult(t.oldRange.from).deletedAfter& & i.mapping.mapResult(t.oldRange.to).deletedBefore& & i.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{let a=r+n.nodeSize-2,o=t.oldRange.from< =r&&a<=t.oldRange.to; this.editor.emit(`delete`,{type:`node`,node:n,from:r,to:a,newFrom:i.mapping.map(r),newTo:i.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:i})})});let a=i.mapping;i.steps.forEach((t,n)=>{if(t instanceof Ct){let r=a.slice(n).map(t.from,-1),o=a.slice(n).map(t.to),s=a.invert().map(r,-1),c=a.invert().map(o),l=r>0&&i.doc.nodeAt(r-1)?.marks.some(e=>e.eq(t.mark)),u=i.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark)); this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:r,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:i})}})};((n=this.editor.options.coreExtensionOptions)==null||(n=n.delete)==null?void 0:n.async)??!0?setTimeout(r,0):r()}}),np=F.create({name:`drop`,addProseMirrorPlugins(){return[new T({key:new E(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),rp=F.create({name:`editable`,addProseMirrorPlugins(){return[new T({key:new E(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),ip=new E(`focusEvents`),ap=F.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new T({key:ip,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),op=F.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:S.atStart(r).from===o; return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()}; return Sl()||Gl()?i:r},addProseMirrorPlugins(){return[new T({key:new E(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`)); if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=S.atStart(t.doc).from,l=S.atEnd(t.doc).to;if(a||o!==c||s!==l||!sd(n.doc))return;let u=n.tr,d=qc({state:n,transaction:u}),{commands:f}=new Jc({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),sp=F.create({name:`paste`,addProseMirrorPlugins(){return[new T({key:new E(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),cp=F.create({name:`tabindex`,addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new T({key:new E(`tabindex`),props:{attributes:()=>!this.editor.isEditable& & this.options.value===void 0?{}:{tabindex:this.options.value??`0`}}})]}}),lp=F.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=Eu(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t& & (t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new T({key:new E(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),up=!1;function dp(e){if(up)return;up=!0;let t;try{let n=Ot.fromJSON(e,{from:0,tLine truncated
`)}}})]}}),mp=L.create({name:`commands`,addCommands(){return{...Jd}}}),hp=L.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){var n;let r=()=>{var n,r;if(((n=this.editor.options.coreExtensionOptions)==null||(n=n.delete)==null||(r=n.filterTransaction)==null?void 0:r.call(n,e))??e.getMeta(`y-sync$`))return;let i=uu(e.before,[e,...t]);Ku(i).forEach(t=>{i.mapping.mapResult(t.oldRange.from).deletedAfter& & i.mapping.mapResult(t.oldRange.to).deletedBefore& & i.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{let a=r+n.nodeSize-2,o=t.oldRange.from< =r&&a<=t.oldRange.to; this.editor.emit(`delete`,{type:`node`,node:n,from:r,to:a,newFrom:i.mapping.map(r),newTo:i.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:i})})});let a=i.mapping;i.steps.forEach((t,n)=>{if(t instanceof bt){let r=a.slice(n).map(t.from,-1),o=a.slice(n).map(t.to),s=a.invert().map(r,-1),c=a.invert().map(o),l=r>0&&i.doc.nodeAt(r-1)?.marks.some(e=>e.eq(t.mark)),u=i.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark)); this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:r,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:i})}})};((n=this.editor.options.coreExtensionOptions)==null||(n=n.delete)==null?void 0:n.async)??!0?setTimeout(r,0):r()}}),gp=L.create({name:`drop`,addProseMirrorPlugins(){return[new O({key:new k(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),_p=L.create({name:`editable`,addProseMirrorPlugins(){return[new O({key:new k(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),vp=new k(`focusEvents`),yp=L.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new O({key:vp,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),bp=L.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:T.atStart(r).from===o; return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()}; return bl()||Ul()?i:r},addProseMirrorPlugins(){return[new O({key:new k(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`)); if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=T.atStart(t.doc).from,l=T.atEnd(t.doc).to;if(a||o!==c||s!==l||!ad(n.doc))return;let u=n.tr,d=Gc({state:n,transaction:u}),{commands:f}=new Kc({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),xp=L.create({name:`paste`,addProseMirrorPlugins(){return[new O({key:new k(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),Sp=L.create({name:`tabindex`,addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new O({key:new k(`tabindex`),props:{attributes:()=>!this.editor.isEditable& & this.options.value===void 0?{}:{tabindex:this.options.value??`0`}}})]}}),Cp=L.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=wu(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t& & (t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new O({key:new k(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),wp=!1;function Tp(e){if(wp)return;wp=!0;let t;try{let n=Tt.fromJSON(e,{from:0,tLine truncated
position: relative;
}
@@ -98,53 +98,54 @@ img.ProseMirror-separator {
.ProseMirror-focused .ProseMirror-gapcursor {
display: block;
}`,mp=class extends ef{constructor(e={}){super(),this.css=null,this.className=`tiptap`,this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document< `u`?document.createElement(`div`):null,content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:fd,createMappablePosition:pd},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit(`beforeCreate`,{editor:this}),this.on(`mount`,this.options.onMount),this.on(`unmount`,this.options.onUnmount),this.on(`contentError`,this.options.onContentError),this.on(`create`,this.options.onCreate),this.on(`update`,this.options.onUpdate),this.on(`selectionUpdate`,this.options.onSelectionUpdate),this.on(`transaction`,this.options.onTransaction),this.on(`focus`,this.options.onFocus),this.on(`blur`,this.options.onBlur),this.on(`destroy`,this.options.onDestroy),this.on(`drop`,({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc();if(!this.editorState){let e=bl(t,this.options.autofocus);this.editorState=Vn.create({doc:t,schema:this.schema,selection:e||void 0})}dp(this.schema),this.options.element& & this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),this.emit(`mount`,{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state; let e=this.editorView.dom;e?.editor& & delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css& & !document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==`function`?this.css.remove():this.css.parentNode& & this.css.parentNode.removeChild(this.css)}catch(e){console.warn(`Failed to remove CSS element:`,e)}this.css=null,this.emit(`unmount`,{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():Jc.createFakeChain()}can(){return this.commandManager?this.commandManager.can():Jc.createFallbackCan()}injectCSS(){this.options.injectCSS& & typeof document< `u`& & (this.css=Cf(pp,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView& & this.state& & !this.isDestroyed& & (this.options.editorProps& & this.view.setProps({...this.options.editorProps,attributes:this.getEditorViewAttributes()}),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t& & this.emit(`update`,{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable& & this.view& & this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return tf& & !this.hasWarnedStaleDecorationRead& & $d(this)& & (this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView& & (this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=Ou(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.recoLine truncated
}`,Op=class extends Qd{constructor(e={}){super(),this.css=null,this.className=`tiptap`,this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document< `u`?document.createElement(`div`):null,content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:ud,createMappablePosition:dd},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit(`beforeCreate`,{editor:this}),this.on(`mount`,this.options.onMount),this.on(`unmount`,this.options.onUnmount),this.on(`contentError`,this.options.onContentError),this.on(`create`,this.options.onCreate),this.on(`update`,this.options.onUpdate),this.on(`selectionUpdate`,this.options.onSelectionUpdate),this.on(`transaction`,this.options.onTransaction),this.on(`focus`,this.options.onFocus),this.on(`blur`,this.options.onBlur),this.on(`destroy`,this.options.onDestroy),this.on(`drop`,({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc();if(!this.editorState){let e=vl(t,this.options.autofocus);this.editorState=Rn.create({doc:t,schema:this.schema,selection:e||void 0})}Tp(this.schema),this.options.element& & this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),this.emit(`mount`,{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state; let e=this.editorView.dom;e?.editor& & delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css& & !document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==`function`?this.css.remove():this.css.parentNode& & this.css.parentNode.removeChild(this.css)}catch(e){console.warn(`Failed to remove CSS element:`,e)}this.css=null,this.emit(`unmount`,{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():Kc.createFakeChain()}can(){return this.commandManager?this.commandManager.can():Kc.createFallbackCan()}injectCSS(){this.options.injectCSS& & typeof document< `u`& & (this.css=xf(Dp,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView& & this.state& & !this.isDestroyed& & (this.options.editorProps& & this.view.setProps({...this.options.editorProps,attributes:this.getEditorViewAttributes()}),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t& & this.emit(`update`,{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable& & this.view& & this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return $d& & !this.hasWarnedStaleDecorationRead& & Zd(this)& & (this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView& & (this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=Eu(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.recoLine truncated
`,textSerializers:n={}}=e||{};return Hu(this.state.doc,{blockSeparator:t,textSerializers:{...Uu(this.schema),...n}})}get isEmpty(){return sd(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit(`destroy`),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null; return new fp(t,this,!1,n)}get $doc(){return this.$pos(0)}};function hp(e){return new Lf({find:e.find,handler:({state:t,range:n,match:r})=>{let i=N(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(Yu(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type& & n!==t.mark.type)).filter(e=>e.to>c).length)return null;l< n.to & & a . delete ( l , n . to ) , c > n.from&&a.delete(n.from+r,c); let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function gp(e){return new Lf({find:e.find,handler:({state:t,range:n,match:r})=>{let i=N(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function _p(e){return new Lf({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=N(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function vp(e){return new Lf({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=N(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&Lt(s,e.type,a); if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks(); if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l& & l.type===e.type& & Yt(o.doc,n.from-1)& & (!e.joinPredicate||e.joinPredicate(r,l))& & o.join(n.from-1)},undoable:e.undoable})}var yp=class e extends Wf{constructor(...e){super(...e),this.type=`node`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function bp(e){return new Kf({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=N(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(Yu(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type& & n!==t.mark.type)).filter(e=>e.to>u).length)return null;d< n.to & & o . delete ( d , n . to ) , u > n.from& & o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0& & r.input!==void 0& & r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}var xp=()=>new Map,Sp=e=>{let t=xp();return e.forEach((e,n)=>{t.set(n,e)}),t},Cp=(e,t,n)=>{let r=e.get(t);return r===void 0& & e.set(t,r=n()),r},wp=(e,t)=>{let n=[];for(let[r,i]of e)n.push(t(i,r));return n},Tp=(e,t)=>{for(let[n,r]of e)if(t(r,n))return!0;return!1},Ep=()=>new Set,Dp=e=>e[e.length-1],Op=(e,t)=>{for(let n=0;n< t.length ; n + + ) e . push ( t [ n ] ) } , kp = Array.from,Ap=(e,t)= > {for(let n=0;n< e.length ; n + + ) if ( ! t ( e [ n ] , n , e ) ) return ! 1 ; return ! 0 } , jp = (e,t)= > {for(let n=0;n< e.length ; n + + ) if ( t ( e [ n ] , n , e ) ) return ! 0 ; return ! 1 } , Mp = (e,t)= > {let n=Array(e);for(let r=0;r< e ; r + + ) n [ r ] = t ( r , n ) ; return n } , Np = Array.isArray,Pp=class{constructor(){this._observers=xp()}on(e,t){return Cp ( this . _observers , e , Ep ) . add ( t ) , t } once ( e , t ) { let n = (...r)= > {this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0& & (n.delete(t),n.size===0& & this._observers.delete(e))}emit(e,t){return kp((this._observers.get(e)||xp()).values()).forEach(e=>e(...t))}destroy(){this._observers=xp()}},Fp=class{constructor(){this._observers=xp()}on(e,t){Cp(this._observers,e,Ep).add(t)}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0& & (n.delete(t),n.size===0& & this._observers.delete(e))}emit(e,t){return kp((this._observers.get(e)||xp()).values()).forEach(e=>e(...t))}destroy(){this._observers=xp()}},IpLine truncated
`)}},Jh=(e,t)=>e===t?!0:e==null||t==null||e.constructor!==t.constructor?!1:e[oh]?sh(e,t):Np(e)?Ap(e,e=>jp(t,t=>Jh(e,t))):ch(e)?mh(e,(e,n)=>Jh(e,t[n])):!1,Yh=class{static _dilutes=!1;extends(e){let[t,n]=[this.shape,e.shape];return this.constructor._dilutes& & ([n,t]=[t,n]),Jh(t,n)}equals(e){return this.constructor===e.constructor& & xh(this.shape,e.shape)}[Kh](){return!0}[oh](e){return this.equals(e)}validate(e){return this.check(e)}check(e,t){km()}get nullable(){return Eg(this,Vg)}get optional(){return new ig(this)}cast(e){return Gg(e,this),e}expect(e){return Gg(e,this),e}},Xh=class extends Yh{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t=void 0){let n=e?.constructor===this.shape&&(this._c==null||this._c(e)); return!n& & t?.extend(null,this.shape.name,e?.constructor.name,e?.constructor===this.shape?`Check failed`:`Constructor match failed`),n}},B=(e,t=null)=>new Xh(e,t);B(Xh);var Zh=class extends Yh{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape(e);return!n& & t?.extend(null,`custom prop`,e?.constructor.name,`failed to check custom prop`),n}},V=e=>new Zh(e);B(Zh);var Qh=class extends Yh{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape.some(t=>t===e);return!n& & t?.extend(null,this.shape.join(` | `),e.toString()),n}},$h=(...e)=>new Qh(e),eg=B(Qh),tg=RegExp.escape||(e=>e.replace(/[().|&,$^[\]]/g,e=>`\\`+e)),ng=e=>{if(Ig.check(e))return[tg(e)]; if(eg.check(e))return e.shape.map(e=>e+``);if(Fg.check(e))return[`[+-]?\\d+.?\\d*`];if(Lg.check(e))return[`.*`];if(Dg.check(e))return e.shape.map(ng).flat(1);R()};B(class extends Yh{constructor(e){super(),this.shape=e,this._r=RegExp(`^`+e.map(ng).map(e=>`(${e.join(`|`)})`).join(``)+`$`)}check(e,t){let n=this._r.exec(e)!=null;return!n& & t?.extend(null,this._r.toString(),e.toString(),`String doesn't match string template.`),n}});var rg=Symbol(`optional`),ig=class extends Yh{constructor(e){super(),this.shape=e}check(e,t){let n=e===void 0||this.shape.check(e);return!n& & t?.extend(null,`undefined (optional)`,`()`),n}get[rg](){return!0}},ag=B(ig),og=class extends Yh{check(e,t){return t?.extend(null,`never`,typeof e),!1}};new og,B(og);var sg=class e extends Yh{constructor(e,t=!1){super(),this.shape=e,this._isPartial=t}static _dilutes=!0;get partial(){return new e(this.shape,!0)}check(e,t){return e==null?(t?.extend(null,`object`,`null`),!1):mh(this.shape,(n,r)=>{let i=this._isPartial&&!hh(e,r)||n.check(e[r],t); return!i& & t?.extend(r.toString(),n.toString(),typeof e[r],`Object property does not match`),i})}},cg=e=>new sg(e),lg=B(sg),ug=V(e=>e!=null& & (e.constructor===Object||e.constructor==null)),dg=class extends Yh{constructor(e,t){super(),this.shape={keys:e,values:t}}check(e,t){return e!=null& & mh(e,(n,r)=>{let i=this.shape.keys.check(r,t);return!i& & t?.extend(r+``,`Record`,typeof e,i?`Key doesn't match schema`:`Value doesn't match value`),i& & this.shape.values.check(n,t)})}},fg=(e,t)=>new dg(e,t),pg=B(dg),mg=class extends Yh{constructor(e){super(),this.shape=e}check(e,t){return e!=null& & mh(this.shape,(n,r)=>{let i=n.check(e[r],t);return!i& & t?.extend(r.toString(),`Tuple`,typeof n),i})}},hg=(...e)=>new mg(e);B(mg);var gg=class extends Yh{constructor(e){super(),this.shape=e.length===1?e[0]:new Tg(e)}check(e,t){let n=Np(e)&&Ap(e,e=>this.shape.check(e)); return!n& & t?.extend(null,`Array`,``),n}},_g=(...e)=>new gg(e),vg=B(gg),yg=V(e=>Np(e)),bg=class extends Yh{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t){let n=e instanceof this.shape&&(this._c==null||this._c(e)); return!n& & t?.extend(null,this.shape.name,e?.constructor.name),n}},xg=(e,t=null)=>new bg(e,t);B(bg);var Sg=xg(Yh),Cg=B(class extends Yh{constructor(e){super(),this.len=e.length-1,this.args=hg(...e.slice(-1)),this.res=e[this.len]}check(e,t){let n=e.constructor===Function&&e.length<=this.len; return!n& & t?.extend(null,`function`,typeof e),n}}),wg=V(e=>typeof e==`function`);B(class extends Yh{constructor(e){super(),this.shape=e}check(e,t){let n=Ap(this.shape,n=>n.check(e,t));return!n& & t?.extend(null,`Intersectinon`,typeof e),n}},e=>e.shape.length>0);var Tg=class extends Yh{static _dilutes=!0;constructor(e){super(),this.shape=e}check(e,t){let n=jp(this.shape,n=>n.check(e,t));return t?.extend(null,`Union`,typeof e),n}},Eg=(...e)=>e.findIndex(e=>Dg.check(e))>=0?Eg(...e.map(e=>Wg(e)).map(e=>Dg.check(e)?e.shape:[e]).flat(1)):e.length===1?e[0]:new Tg(e),Dg=B(Tg),Og=()=>!0,kg=V(Og),Ag=B(Zh,e=>e.shape===Og),jg=V(e=>typeof e==`bigint`),Mg=V(e=>e===jg),Ng=V(e=>typeof e==`symbol`);V(e=>e===Ng);var Pg=V(e=>typeof e==`number`),Fg=V(e=>e===Pg),Ig=V(e=>typeof e==`string`),Lg=V(e=>e===Ig),Rg=V(e=>typeof e==`boolean`),zg=V(e=>e===Rg),Bg=$h(void 0);B(Qh,e=>e.shape.length===1& & e.shape[0]===void 0),$h(void 0);var Vg=$h(null),Hg=B(Qh,e=>e.shape.length===1&&e.shape[0]===null); B(Uint8Array),B(Xh,e=>e.shape===Uint8Array);var Ug=Eg(Pg,Ig,Vg,Bg,jg,Rg,Ng);(()=>{let e=_g(kg),t=fg(Ig,kg),n=Eg(Pg,Ig,Vg,Rg,e,t);return e.shape=n,t.shape.values=n,n})();var Wg=e=>{if(Sg.check(e))return e;if(ug.check(e)){let t={};for(let n in Line truncated
`;n.right=new J(H(o,U(a.store,o)),n.left,n.left& & n.left.lastId,n.right,n.right& & n.right.id,t,null,new Bb (i)),n.right.integrate(e,0),n.forward()}$y (e,t,n,s)},a b=(e,t,n,r,i)=>{let a=t,o=x p();for(;a&&(!a.countable||a.deleted); ){if(!a.deleted& & a.content.constructor===q){let e=a.content;o.set(e.key,e)}a=a.right}let s=0,c=!1;for(;t!==a;){if(n===t& & (c=!0),!t.deleted){let n=t.content;switch(n.constructor){case q:{let{key:a,value:l}=n,u=r.get(a)??null;(o.get(a)!==n||u===l)&&(t.delete(e),s++,!c&&(i.get(a)??null)===l&&u!==l&&(u===null?i.delete(a):i.set(a,u))),!c&&!t.deleted&&e b(i,n); break}}}t=t.right}return s},o b=(e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable); )t=t.right;let n=new Set;for(;t&&(t.deleted||!t.countable); ){if(!t.deleted& & t.content.constructor===q){let r=t.content.key;n.has(r)?t.delete(e):n.add(r)}t=t.left}},s b=e=>{let t=0;return W(e.doc,n=>{let r=e._start,i=e._start,a=x p(),o=S p(a);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case q:e b(o,i.content);break;default:t+=a b(n,r,i,a,o),a=S p(o),r=i}i=i.right}}),t},c b=e=>{let t=new Set,n=e.doc;for(let[r,i]of e.afterState.entries()){let a=e.beforeState.get(r)||0;i!==a& & Vv (e,n.store.clients.get(r),a,i,e=>{!e.deleted& & e.content.constructor===q& & e.constructor!==w b& & t.add(e.parent)})}W(n,n=>{w _(e,e.deleteSet,e=>{if(e instanceof w b||!e.parent._hasFormatting||t.has(e.parent))return;let r=e.parent;e.content.constructor===q?t.add(r):o b(n,e)});for(let e of t)s b(e)})},l b=(e,t,n)=>{let r=n,i=S p(t.currentAttributes),a=t.right;for(;n>0&&t.right!==null; ){if(t.right.deleted===!1)switch(t.right.content.constructor){case Xb :case Mb :case Bb :n< t.right.length & & Rv ( e , H ( t . right . id . client , t . right . id . clock + n ) ) , n- = t.right.length,t.right.delete(e)}t.forward()}a&&a b(e,a,t.right,i,t.currentAttributes);let o = (t.left||t.right).parent;return o . _searchMarker & & Sy ( o . _searchMarker , t . index , -r + n ) , t } , ub = class extends fy { constructor ( e , t , n ) { super ( e , t ) , this . childListChanged = !1,this.keysChanged=new Set , n . forEach ( e = > {e===null?this.childListChanged=!0:this.keysChanged.add(e)})}get changes ( ) { if ( this . _changes = ==null){let e = {keys:this.keys,delta:this.delta,added:new Set , deleted:new Set } ; this . _changes = e}return this . _changes } get delta ( ) { if ( this . _delta = ==null){let e = this.target.doc,t=[];W(e,e= > {let n=new Map,r=new Map,i=this.target._start,a=null,o={},s=``,c=0,l=0,u=()=>{if(a!==null){let e=null;switch(a){case`delete`:l>0&&(e={delete:l}),l=0; break;case`insert`:(typeof s==`object`||s.length>0)&&(e={insert:s},n.size>0&&(e.attributes={},n.forEach((t,n)=>{t!==null&&(e.attributes[n]=t)}))),s=``; break;case`retain`:c>0&&(e={retain:c},p h(o)||(e.attributes=l h({},o))),c=0}e&&t.push(e),a=null}}; for(;i!==null;){switch(i.content.constructor){case Xb :case Mb :this.adds(i)?this.deletes(i)||(u(),a=`insert`,s=i.content.getContent()[0],u()):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=1):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=1); break;case Bb :this.adds(i)?this.deletes(i)||(a!==`insert`&&(u(),a=`insert`),s+=i.content.str):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=i.length):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=i.length); break;case q:{let{key:t,value:s}=i.content;if(this.adds(i))this.deletes(i)||(Yy (n.get(t)??null,s)?s!==null& & i.delete(e):(a===`retain`& & u(),Yy (s,r.get(t)??null)?delete o[t]:o[t]=s));else if(this.deletes(i)){r.set(t,s);let e=n.get(t)??null;Yy (e,s)||(a===`retain`& & u(),o[t]=e)}else if(!i.deleted){r.set(t,s);let n=o[t];n!==void 0& & (Yy (n,s)?n!==null& & i.delete(e):(a===`retain`& & u(),s===null?delete o[t]:o[t]=s))}i.deleted||(a===`insert`&&u(),e b(n,i.content)); break}}i=i.right}for(u();t.length>0;){let e=t[t.length-1];if(e.retain!==void 0& & e.attributes===void 0)t.pop();else break}}),this._delta=t}return this._delta}},d b=class e extends G{constructor(e){super(),this._pending=e===void 0?[]:[()=>this.insert(0,e)],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??m y(),this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach(e=>e())}catch(e){console.error(e)}this._pending=null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}_callObserver(e,t){super._callObserver(e,t);let n=new u b(this,e,t);C y(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??m y(); let e=``,t=this._start;for(;t!==null;)!t.deleted&&t.countable&&t.content.constructor===Bb &&(e+=t.content.str),t=t.right; return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){this.doc===null?this._pending.push(()=>this.applyDelta(e)):W(this.doc,n=>{let r=new Xy (null,this._start,0,new Map);for(let i=0;i< e.length ; i + + ) { let a = e[i];if(a.insert!==void 0 ) { let o = !t&&typeof a . insert = =`string`&&i===e.length-1&&r.right===null&&a.insert.slice(-1)===`
`?a.insert.slice(0,-1):a.insert;(typeof o!=`string`||o.length>0)& & rb(n,this,r,o,a.attributes||{})}else a.retain===void 0?a.delete!==void 0&&lb(n,r,a.delete):ib(n,this,r,a.retain,a.attributes||{})}})}toDelta(e,t,n){this.doc??my(); let r=[],i=new Map,a=this.doc,o=``,s=this._start;function c(){if(o.length>0){let e={},t=!1;i.forEach((n,r)=>{t=!0,e[r]=n});let n={insert:o};t& & (n.attributes=e),r.push(n),o=``}}let l=()=>{for(;s!==null;){if(Av(s,e)||t!==void 0& & Av(s,t))switch(s.content.constructor){case Bb:{let r=i.get(`ychange`);e!==void 0& & !Av(s,e)?(r===void 0||r.user!==s.id.client||r.type!==`removed`)& & (c(),i.set(`ychange`,n?n(`removed`,s.id):{type:`removed`})):t!==void 0& & !Av(s,t)?(r===void 0||r.user!==s.id.client||r.type!==`added`)& & (c(),i.set(`ychange`,n?n(`added`,s.id):{type:`added`})):r!==void 0&&(c(),i.delete(`ychange`)),o+=s.content.str; break}case Xb:case Mb:{c();let e={insert:s.content.getContent()[0]};if(i.size>0){let t={};e.attributes=t,i.forEach((e,n)=>{t[n]=e})}r.push(e);break}case q:Av(s,e)&&(c(),eb(i,s.content))}s=s.right}c()}; return e||t?W(a,n=>{e&&jv(n,e),t&&jv(n,t),l()},`cleanup`):l(),r}insert(e,t,n){if(t.length<=0)return; let r=this.doc;r===null?this._pending.push(()=>this.insert(e,t,n)):W(r,r=>{let i=Qy(r,this,e,!n);n||(n={},i.currentAttributes.forEach((e,t)=>{n[t]=e})),rb(r,this,i,t,n)})}insertEmbed(e,t,n){let r=this.doc;r===null?this._pending.push(()=>this.insertEmbed(e,t,n||{})):W(r,r=>{let i=Qy(r,this,e,!n);rb(r,this,i,t,n||{})})}delete(e,t){if(t===0)return;let n=this.doc;n===null?this._pending.push(()=>this.delete(e,t)):W(n,n=>{lb(n,Qy(n,this,e,!0),t)})}format(e,t,n){if(t===0)return;let r=this.doc;r===null?this._pending.push(()=>this.format(e,t,n)):W(r,r=>{let i=Qy(r,this,e,!1);i.right!==null& & ib(r,this,i,t,n)})}removeAttribute(e){this.doc===null?this._pending.push(()=>this.removeAttribute(e)):W(this.doc,t=>{Iy(t,this,e)})}setAttribute(e,t){this.doc===null?this._pending.push(()=>this.setAttribute(e,t)):W(this.doc,n=>{Ly(n,this,e,t)})}getAttribute(e){return Ry(this,e)}getAttributes(){return zy(this)}_write(e){e.writeTypeRef(Gb)}},fb=e=>new db,pb=class{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??my()}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type; if(e!==null& & (!this._firstCall||e.deleted||!this._filter(t)))do if(t=e.content.type,!e.deleted&&(t.constructor===K||t.constructor===mb)&&t._start!==null)e=t._start; else for(;e!==null;){let t=e.next;if(t!==null){e=t;break}e=e.parent===this._root?null:e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type))); return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}},mb=class e extends G{constructor(){super(),this._prelimContent=[]}get firstChild(){let e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof G?e.clone():e)),t}get length(){return this.doc??my(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new pb(this,e)}querySelector(e){e=e.toUpperCase();let t=new pb(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e).next(); return t.done?null:t.value}querySelectorAll(e){return e=e.toUpperCase(),kp(new pb(this,t=>t.nodeName& & t.nodeName.toUpperCase()===e))}_callObserver(e,t){Cy(this,e,new _b(this,t,e))}toString(){return Oy(this,e=>e.toString()).join(``)}toJSON(){return this.toString()}toDOM(e=document,t={},n){let r=e.createDocumentFragment();return n!==void 0& & n._createAssociation(r,this),Dy(this,i=>{r.insertBefore(i.toDOM(e,t,n),null)}),r}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):W(this.doc,n=>{Ny(n,this,e,t)})}insertAfter(e,t){if(this.doc!==null)W(this.doc,n=>{let r=e& & e instanceof G?e._item:e;jy(n,this,r,t)});else{let n=this._prelimContent,r=e===null?0:n.findIndex(t=>t===e)+1;if(r===0& & e!==null)throw Om(`Reference item not found`);n.splice(r,0,...t)}}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):W(this.doc,n=>{Fy(n,this,e,t)})}toArray(){return Ty(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return Ay(this,e)}slice(e=0,t=this.length){return wy(this,e,t)}forEach(e){Dy(this,e)}_write(e){e.writeTypeRef(qb)}},hb=e=>new mb,K=class e extends mb{constructor(e=`UNDEFINED`){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach((e,t)=>{this.setAttribute(t,e)}),this._prelimAttrs=null}_copy(){return new e(this.nodeName)}clone(){let t=new e(this.nodeName);return dh(this.getAttributes(),(e,n)=>{t.setAttribute(n,e)}),t.insert(0,this.toArray().map(e=>e instanceof G?e.Line truncated
`,textSerializers:n={}}=e||{};return Bu(this.state.doc,{blockSeparator:t,textSerializers:{...Vu(this.schema),...n}})}get isEmpty(){return ad(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit(`destroy`),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null; return new Ep(t,this,!1,n)}get $doc(){return this.$pos(0)}};function kp(e){return new Zf({find:e.find,handler:({state:t,range:n,match:r})=>{let i=F(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(qu(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type& & n!==t.mark.type)).filter(e=>e.to>c).length)return null;l< n.to & & a . delete ( l , n . to ) , c > n.from&&a.delete(n.from+r,c); let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function Ap(e){return new Zf({find:e.find,handler:({state:t,range:n,match:r})=>{let i=F(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function jp(e){return new Zf({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=F(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function Mp(e){return new Zf({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=F(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&Pt(s,e.type,a); if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks(); if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l& & l.type===e.type& & Kt(o.doc,n.from-1)& & (!e.joinPredicate||e.joinPredicate(r,l))& & o.join(n.from-1)},undoable:e.undoable})}var Np=e=>`touches`in e,Pp=class{constructor(e){var t;this.directions=[`bottom-left`,`bottom-right`,`top-left`,`top-right`],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:``,wrapper:``,handle:``,resizing:``},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState=`false`,this.classNames.resizing& & this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp)},this.handleKeyDown=e=>{e.key===`Shift`& & (this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{e.key===`Shift`& & (this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.element.draggable=!1,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,e.options?.min& & (this.minSize={...this.minSize,...e.options.min}),e.options?.max& & (this.maxSize=e.options.max),e!=null& & (t=e.options)!=null& & t.directions& & (this.directions=e.options.directions),e.options?.preserveAspectRatio& & (this.preserveAspectRatio=e.options.preserveAspectRatio),e.options?.className& & (this.classNames={container:e.options.className.container||``,wrapper:e.options.className.wrapper||``,handle:e.options.className.handle||``,resizing:e.options.className.resizinLine truncated
`)}},gg=(e,t)=>e===t?!0:e==null||t==null||e.constructor!==t.constructor?!1:e[Ch]?wh(e,t):Yp(e)?Kp(e,e=>qp(t,t=>gg(e,t))):Th(e)?jh(e,(e,n)=>gg(e,t[n])):!1,_g=class{static _dilutes=!1;extends(e){let[t,n]=[this.shape,e.shape];return this.constructor._dilutes& & ([n,t]=[t,n]),gg(t,n)}equals(e){return this.constructor===e.constructor& & Rh(this.shape,e.shape)}[mg](){return!0}[Ch](e){return this.equals(e)}validate(e){return this.check(e)}check(e,t){Km()}get nullable(){return Yg(this,u_)}get optional(){return new Dg(this)}cast(e){return m_(e,this),e}expect(e){return m_(e,this),e}},vg=class extends _g{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t=void 0){let n=e?.constructor===this.shape&&(this._c==null||this._c(e)); return!n& & t?.extend(null,this.shape.name,e?.constructor.name,e?.constructor===this.shape?`Check failed`:`Constructor match failed`),n}},V=(e,t=null)=>new vg(e,t);V(vg);var yg=class extends _g{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape(e);return!n& & t?.extend(null,`custom prop`,e?.constructor.name,`failed to check custom prop`),n}},bg=e=>new yg(e);V(yg);var xg=class extends _g{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape.some(t=>t===e);return!n& & t?.extend(null,this.shape.join(` | `),e.toString()),n}},Sg=(...e)=>new xg(e),Cg=V(xg),wg=RegExp.escape||(e=>e.replace(/[().|&,$^[\]]/g,e=>`\\`+e)),Tg=e=>{if(a_.check(e))return[wg(e)]; if(Cg.check(e))return e.shape.map(e=>e+``);if(i_.check(e))return[`[+-]?\\d+.?\\d*`];if(o_.check(e))return[`.*`];if(Xg.check(e))return e.shape.map(Tg).flat(1);z()};V(class extends _g{constructor(e){super(),this.shape=e,this._r=RegExp(`^`+e.map(Tg).map(e=>`(${e.join(`|`)})`).join(``)+`$`)}check(e,t){let n=this._r.exec(e)!=null;return!n& & t?.extend(null,this._r.toString(),e.toString(),`String doesn't match string template.`),n}});var Eg=Symbol(`optional`),Dg=class extends _g{constructor(e){super(),this.shape=e}check(e,t){let n=e===void 0||this.shape.check(e);return!n& & t?.extend(null,`undefined (optional)`,`()`),n}get[Eg](){return!0}},Og=V(Dg),kg=class extends _g{check(e,t){return t?.extend(null,`never`,typeof e),!1}};new kg,V(kg);var Ag=class e extends _g{constructor(e,t=!1){super(),this.shape=e,this._isPartial=t}static _dilutes=!0;get partial(){return new e(this.shape,!0)}check(e,t){return e==null?(t?.extend(null,`object`,`null`),!1):jh(this.shape,(n,r)=>{let i=this._isPartial&&!Mh(e,r)||n.check(e[r],t); return!i& & t?.extend(r.toString(),n.toString(),typeof e[r],`Object property does not match`),i})}},jg=e=>new Ag(e),Mg=V(Ag),Ng=bg(e=>e!=null& & (e.constructor===Object||e.constructor==null)),Pg=class extends _g{constructor(e,t){super(),this.shape={keys:e,values:t}}check(e,t){return e!=null& & jh(e,(n,r)=>{let i=this.shape.keys.check(r,t);return!i& & t?.extend(r+``,`Record`,typeof e,i?`Key doesn't match schema`:`Value doesn't match value`),i& & this.shape.values.check(n,t)})}},Fg=(e,t)=>new Pg(e,t),Ig=V(Pg),Lg=class extends _g{constructor(e){super(),this.shape=e}check(e,t){return e!=null& & jh(this.shape,(n,r)=>{let i=n.check(e[r],t);return!i& & t?.extend(r.toString(),`Tuple`,typeof n),i})}},Rg=(...e)=>new Lg(e);V(Lg);var zg=class extends _g{constructor(e){super(),this.shape=e.length===1?e[0]:new Jg(e)}check(e,t){let n=Yp(e)&&Kp(e,e=>this.shape.check(e)); return!n& & t?.extend(null,`Array`,``),n}},Bg=(...e)=>new zg(e),Vg=V(zg),Hg=bg(e=>Yp(e)),Ug=class extends _g{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t){let n=e instanceof this.shape&&(this._c==null||this._c(e)); return!n& & t?.extend(null,this.shape.name,e?.constructor.name),n}},Wg=(e,t=null)=>new Ug(e,t);V(Ug);var Gg=Wg(_g),Kg=V(class extends _g{constructor(e){super(),this.len=e.length-1,this.args=Rg(...e.slice(-1)),this.res=e[this.len]}check(e,t){let n=e.constructor===Function&&e.length<=this.len; return!n& & t?.extend(null,`function`,typeof e),n}}),qg=bg(e=>typeof e==`function`);V(class extends _g{constructor(e){super(),this.shape=e}check(e,t){let n=Kp(this.shape,n=>n.check(e,t));return!n& & t?.extend(null,`Intersectinon`,typeof e),n}},e=>e.shape.length>0);var Jg=class extends _g{static _dilutes=!0;constructor(e){super(),this.shape=e}check(e,t){let n=qp(this.shape,n=>n.check(e,t));return t?.extend(null,`Union`,typeof e),n}},Yg=(...e)=>e.findIndex(e=>Xg.check(e))>=0?Yg(...e.map(e=>p_(e)).map(e=>Xg.check(e)?e.shape:[e]).flat(1)):e.length===1?e[0]:new Jg(e),Xg=V(Jg),Zg=()=>!0,Qg=bg(Zg),$g=V(yg,e=>e.shape===Zg),e_=bg(e=>typeof e==`bigint`),t_=bg(e=>e===e_),n_=bg(e=>typeof e==`symbol`);bg(e=>e===n_);var r_=bg(e=>typeof e==`number`),i_=bg(e=>e===r_),a_=bg(e=>typeof e==`string`),o_=bg(e=>e===a_),s_=bg(e=>typeof e==`boolean`),c_=bg(e=>e===s_),l_=Sg(void 0);V(xg,e=>e.shape.length===1& & e.shape[0]===void 0),Sg(void 0);var u_=Sg(null),d_=V(xg,e=>e.shape.length===1&&e.shape[0]===null); V(Uint8Array),V(vg,e=>e.shape===Uint8Array);var f_=Yg(r_,a_,u_,l_,e_,s_,n_);(()=>{let e=Bg(Qg),t=Fg(a_,Qg),n=Yg(r_,a_,u_,s_,e,t);return e.shape=n,t.shape.values=n,n})();var p_=e=>{if(Gg.check(e))return e;if(Ng.check(e)){let t={Line truncated
`;n.right=new J(H(o,U(a.store,o)),n.left,n.left& & n.left.lastId,n.right,n.right& & n.right.id,t,null,new fx (i)),n.right.integrate(e,0),n.forward()}Tb (e,t,n,s)},j b=(e,t,n,r,i)=>{let a=t,o=L p();for(;a&&(!a.countable||a.deleted); ){if(!a.deleted& & a.content.constructor===q){let e=a.content;o.set(e.key,e)}a=a.right}let s=0,c=!1;for(;t!==a;){if(n===t& & (c=!0),!t.deleted){let n=t.content;switch(n.constructor){case q:{let{key:a,value:l}=n,u=r.get(a)??null;(o.get(a)!==n||u===l)&&(t.delete(e),s++,!c&&(i.get(a)??null)===l&&u!==l&&(u===null?i.delete(a):i.set(a,u))),!c&&!t.deleted&&E b(i,n); break}}}t=t.right}return s},M b=(e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable); )t=t.right;let n=new Set;for(;t&&(t.deleted||!t.countable); ){if(!t.deleted& & t.content.constructor===q){let r=t.content.key;n.has(r)?t.delete(e):n.add(r)}t=t.left}},N b=e=>{let t=0;return W(e.doc,n=>{let r=e._start,i=e._start,a=L p(),o=R p(a);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case q:E b(o,i.content);break;default:t+=j b(n,r,i,a,o),a=R p(o),r=i}i=i.right}}),t},P b=e=>{let t=new Set,n=e.doc;for(let[r,i]of e.afterState.entries()){let a=e.beforeState.get(r)||0;i!==a& & py (e,n.store.clients.get(r),a,i,e=>{!e.deleted& & e.content.constructor===q& & e.constructor!==X b& & t.add(e.parent)})}W(n,n=>{q _(e,e.deleteSet,e=>{if(e instanceof X b||!e.parent._hasFormatting||t.has(e.parent))return;let r=e.parent;e.content.constructor===q?t.add(r):M b(n,e)});for(let e of t)N b(e)})},F b=(e,t,n)=>{let r=n,i=R p(t.currentAttributes),a=t.right;for(;n>0&&t.right!==null; ){if(t.right.deleted===!1)switch(t.right.content.constructor){case Sx :case ix :case fx :n< t.right.length & & uy ( e , H ( t . right . id . client , t . right . id . clock + n ) ) , n- = t.right.length,t.right.delete(e)}t.forward()}a&&j b(e,a,t.right,i,t.currentAttributes);let o = (t.left||t.right).parent;return o . _searchMarker & & Jy ( o . _searchMarker , t . index , -r + n ) , t } , Ib = class extends Ry { constructor ( e , t , n ) { super ( e , t ) , this . childListChanged = !1,this.keysChanged=new Set , n . forEach ( e = > {e===null?this.childListChanged=!0:this.keysChanged.add(e)})}get changes ( ) { if ( this . _changes = ==null){let e = {keys:this.keys,delta:this.delta,added:new Set , deleted:new Set } ; this . _changes = e}return this . _changes } get delta ( ) { if ( this . _delta = ==null){let e = this.target.doc,t=[];W(e,e= > {let n=new Map,r=new Map,i=this.target._start,a=null,o={},s=``,c=0,l=0,u=()=>{if(a!==null){let e=null;switch(a){case`delete`:l>0&&(e={delete:l}),l=0; break;case`insert`:(typeof s==`object`||s.length>0)&&(e={insert:s},n.size>0&&(e.attributes={},n.forEach((t,n)=>{t!==null&&(e.attributes[n]=t)}))),s=``; break;case`retain`:c>0&&(e={retain:c},A h(o)||(e.attributes=E h({},o))),c=0}e&&t.push(e),a=null}}; for(;i!==null;){switch(i.content.constructor){case Sx :case ix :this.adds(i)?this.deletes(i)||(u(),a=`insert`,s=i.content.getContent()[0],u()):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=1):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=1); break;case fx :this.adds(i)?this.deletes(i)||(a!==`insert`&&(u(),a=`insert`),s+=i.content.str):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=i.length):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=i.length); break;case q:{let{key:t,value:s}=i.content;if(this.adds(i))this.deletes(i)||(xb (n.get(t)??null,s)?s!==null& & i.delete(e):(a===`retain`& & u(),xb (s,r.get(t)??null)?delete o[t]:o[t]=s));else if(this.deletes(i)){r.set(t,s);let e=n.get(t)??null;xb (e,s)||(a===`retain`& & u(),o[t]=e)}else if(!i.deleted){r.set(t,s);let n=o[t];n!==void 0& & (xb (n,s)?n!==null& & i.delete(e):(a===`retain`& & u(),s===null?delete o[t]:o[t]=s))}i.deleted||(a===`insert`&&u(),E b(n,i.content)); break}}i=i.right}for(u();t.length>0;){let e=t[t.length-1];if(e.retain!==void 0& & e.attributes===void 0)t.pop();else break}}),this._delta=t}return this._delta}},L b=class e extends G{constructor(e){super(),this._pending=e===void 0?[]:[()=>this.insert(0,e)],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??B y(),this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach(e=>e())}catch(e){console.error(e)}this._pending=null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}_callObserver(e,t){super._callObserver(e,t);let n=new I b(this,e,t);Y y(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??B y(); let e=``,t=this._start;for(;t!==null;)!t.deleted&&t.countable&&t.content.constructor===fx &&(e+=t.content.str),t=t.right; return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){this.doc===null?this._pending.push(()=>this.applyDelta(e)):W(this.doc,n=>{let r=new Sb (null,this._start,0,new Map);for(let i=0;i< e.length ; i + + ) { let a = e[i];if(a.insert!==void 0 ) { let o = !t&&typeof a . insert = =`string`&&i===e.length-1&&r.right===null&&a.insert.slice(-1)===`
`?a.insert.slice(0,-1):a.insert;(typeof o!=`string`||o.length>0)& & kb(n,this,r,o,a.attributes||{})}else a.retain===void 0?a.delete!==void 0&&Fb(n,r,a.delete):Ab(n,this,r,a.retain,a.attributes||{})}})}toDelta(e,t,n){this.doc??By(); let r=[],i=new Map,a=this.doc,o=``,s=this._start;function c(){if(o.length>0){let e={},t=!1;i.forEach((n,r)=>{t=!0,e[r]=n});let n={insert:o};t& & (n.attributes=e),r.push(n),o=``}}let l=()=>{for(;s!==null;){if(ny(s,e)||t!==void 0& & ny(s,t))switch(s.content.constructor){case fx:{let r=i.get(`ychange`);e!==void 0& & !ny(s,e)?(r===void 0||r.user!==s.id.client||r.type!==`removed`)& & (c(),i.set(`ychange`,n?n(`removed`,s.id):{type:`removed`})):t!==void 0& & !ny(s,t)?(r===void 0||r.user!==s.id.client||r.type!==`added`)& & (c(),i.set(`ychange`,n?n(`added`,s.id):{type:`added`})):r!==void 0&&(c(),i.delete(`ychange`)),o+=s.content.str; break}case Sx:case ix:{c();let e={insert:s.content.getContent()[0]};if(i.size>0){let t={};e.attributes=t,i.forEach((e,n)=>{t[n]=e})}r.push(e);break}case q:ny(s,e)&&(c(),Eb(i,s.content))}s=s.right}c()}; return e||t?W(a,n=>{e&&ry(n,e),t&&ry(n,t),l()},`cleanup`):l(),r}insert(e,t,n){if(t.length<=0)return; let r=this.doc;r===null?this._pending.push(()=>this.insert(e,t,n)):W(r,r=>{let i=wb(r,this,e,!n);n||(n={},i.currentAttributes.forEach((e,t)=>{n[t]=e})),kb(r,this,i,t,n)})}insertEmbed(e,t,n){let r=this.doc;r===null?this._pending.push(()=>this.insertEmbed(e,t,n||{})):W(r,r=>{let i=wb(r,this,e,!n);kb(r,this,i,t,n||{})})}delete(e,t){if(t===0)return;let n=this.doc;n===null?this._pending.push(()=>this.delete(e,t)):W(n,n=>{Fb(n,wb(n,this,e,!0),t)})}format(e,t,n){if(t===0)return;let r=this.doc;r===null?this._pending.push(()=>this.format(e,t,n)):W(r,r=>{let i=wb(r,this,e,!1);i.right!==null& & Ab(r,this,i,t,n)})}removeAttribute(e){this.doc===null?this._pending.push(()=>this.removeAttribute(e)):W(this.doc,t=>{cb(t,this,e)})}setAttribute(e,t){this.doc===null?this._pending.push(()=>this.setAttribute(e,t)):W(this.doc,n=>{lb(n,this,e,t)})}getAttribute(e){return ub(this,e)}getAttributes(){return db(this)}_write(e){e.writeTypeRef(_x)}},Rb=e=>new Lb,zb=class{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??By()}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type; if(e!==null& & (!this._firstCall||e.deleted||!this._filter(t)))do if(t=e.content.type,!e.deleted&&(t.constructor===K||t.constructor===Bb)&&t._start!==null)e=t._start; else for(;e!==null;){let t=e.next;if(t!==null){e=t;break}e=e.parent===this._root?null:e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type))); return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}},Bb=class e extends G{constructor(){super(),this._prelimContent=[]}get firstChild(){let e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof G?e.clone():e)),t}get length(){return this.doc??By(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new zb(this,e)}querySelector(e){e=e.toUpperCase();let t=new zb(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e).next(); return t.done?null:t.value}querySelectorAll(e){return e=e.toUpperCase(),Gp(new zb(this,t=>t.nodeName& & t.nodeName.toUpperCase()===e))}_callObserver(e,t){Yy(this,e,new Ub(this,t,e))}toString(){return eb(this,e=>e.toString()).join(``)}toJSON(){return this.toString()}toDOM(e=document,t={},n){let r=e.createDocumentFragment();return n!==void 0& & n._createAssociation(r,this),$y(this,i=>{r.insertBefore(i.toDOM(e,t,n),null)}),r}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):W(this.doc,n=>{ab(n,this,e,t)})}insertAfter(e,t){if(this.doc!==null)W(this.doc,n=>{let r=e& & e instanceof G?e._item:e;rb(n,this,r,t)});else{let n=this._prelimContent,r=e===null?0:n.findIndex(t=>t===e)+1;if(r===0& & e!==null)throw Gm(`Reference item not found`);n.splice(r,0,...t)}}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):W(this.doc,n=>{sb(n,this,e,t)})}toArray(){return Zy(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return nb(this,e)}slice(e=0,t=this.length){return Xy(this,e,t)}forEach(e){$y(this,e)}_write(e){e.writeTypeRef(yx)}},Vb=e=>new Bb,K=class e extends Bb{constructor(e=`UNDEFINED`){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach((e,t)=>{this.setAttribute(t,e)}),this._prelimAttrs=null}_copy(){return new e(this.nodeName)}clone(){let t=new e(this.nodeName);return Oh(this.getAttributes(),(e,n)=>{t.setAttribute(n,e)}),t.insert(0,this.toArray().map(e=>e instanceof G?e.Line truncated
`).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
`))}),n.join(`
>
`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>Aw (this.editor,this.type)}},addInputRules(){return[v p({find:jw ,type:this.type})]}}),Nw =/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Pw =/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Fw =/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Iw =/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Lw=Gf .create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`& & null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)& & null}]},renderHTML({HTMLAttributes:e}){return kw (`strong`,{...P (this.options.HTMLAttributes,e),children:kw (`slot`,{})})},markdownTokenName:`strong`,parseMarkdown:(e,t)=>t.applyMark(`bold`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`< strong > `,close:`< / strong > `}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[h p({find:Nw ,type:this.type}),h p({find:Fw ,type:this.type})]},addPasteRules(){return[b p({find:Pw ,type:this.type}),b p({find:Iw ,type:this.type})]}}),Rw =e=>{let t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0& & e[t.index-1]==="`"?null:{index:t.index,text:t[0],replaceWith:t[1]}},zw =e=>{let t=/`([^`]+)`(?!`)/g,n=[],r;for(;(r=t.exec(e))!==null;)r.index>0&&e[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]}); return n};function Bw (e){let t=new Set((e.match(/`+/g)||[]).map(e=>e.length)),n=1;for(;t.has(n);)n+=1;return n}var Vw=Gf .create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,P (this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t,n)=>{var r;if(!e.content)return``;let i=typeof(n==null||(r=n.meta)==null?void 0:r.markText)==`string`?n.meta.markText:``,a="`".repeat(Bw (i)),o=i.startsWith("`")||i.endsWith("`")?` `:``;return`${a}${o}${t.renderChildren(e.content)}${o}${a}`},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[h p({find:Rw ,type:this.type})]},addPasteRules(){return[b p({find:zw ,type:this.type})]}}),Hw =4,Uw =/^```([a-z]+)?[\s\n]$/,Ww =/^~~~([a-z]+)?[\s\n]$/,Gw=y p.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Hw ,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t& & [...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,P (this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1& & e.raw?.startsWith(`~~~`)===!1& & e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(`
`):`\`\`\`${r}\n\n\`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??Hw ,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,`
`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>nT (this.editor,this.type)}},addInputRules(){return[M p({find:rT ,type:this.type})]}}),aT =/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,oT =/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,sT =/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,cT =/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,lT=ap .create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`& & null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)& & null}]},renderHTML({HTMLAttributes:e}){return tT (`strong`,{...I (this.options.HTMLAttributes,e),children:tT (`slot`,{})})},markdownTokenName:`strong`,parseMarkdown:(e,t)=>t.applyMark(`bold`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`< strong > `,close:`< / strong > `}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[k p({find:aT ,type:this.type}),k p({find:sT ,type:this.type})]},addPasteRules(){return[I p({find:oT ,type:this.type}),I p({find:cT ,type:this.type})]}}),uT =e=>{let t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0& & e[t.index-1]==="`"?null:{index:t.index,text:t[0],replaceWith:t[1]}},dT =e=>{let t=/`([^`]+)`(?!`)/g,n=[],r;for(;(r=t.exec(e))!==null;)r.index>0&&e[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]}); return n};function fT (e){let t=new Set((e.match(/`+/g)||[]).map(e=>e.length)),n=1;for(;t.has(n);)n+=1;return n}var pT=ap .create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,I (this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t,n)=>{var r;if(!e.content)return``;let i=typeof(n==null||(r=n.meta)==null?void 0:r.markText)==`string`?n.meta.markText:``,a="`".repeat(fT (i)),o=i.startsWith("`")||i.endsWith("`")?` `:``;return`${a}${o}${t.renderChildren(e.content)}${o}${a}`},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[k p({find:uT ,type:this.type})]},addPasteRules(){return[I p({find:dT ,type:this.type})]}}),mT =4,hT =/^```([a-z]+)?[\s\n]$/,gT =/^~~~([a-z]+)?[\s\n]$/,_T=F p.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:mT ,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t& & [...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,I (this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1& & e.raw?.startsWith(`~~~`)===!1& & e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(`
`):`\`\`\`${r}\n\n\`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??mT ,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,`
`,`
`).split(`
`).map(e=>o+e).join(`
`);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??Hw ,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;return i.parent.type===this.type?a?e.commands.command(({tr:e})=>{let{pos:r}=i,a=i.start(),o=i.end(),s=n.doc.textBetween(a,o,`
`);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??mT ,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;return i.parent.type===this.type?a?e.commands.command(({tr:e})=>{let{pos:r}=i,a=i.start(),o=i.end(),s=n.doc.textBetween(a,o,`
`,`
`).split(`
`),c=0,l=0,u=r-a;for(let e=0;e< s.length ; e + = 1 ) { if ( l + s [ e ] . length > =u){c=e;break}l+=s[e].length+1}let d=s[c].match(/^ */)?.[0]||``,f=Math.min(d.length,t);if(f===0)return!0;let p=a;for(let e=0;e< c ; e + = 1 ) p + = s [ e ] . length + 1 ; return e . delete ( p , p + f ) , r-p < = f & & e . setSelection ( C . create ( e . doc , p ) ) , ! 0 } ) :e . commands . command ( ( { tr:e } ) = > {let{from:i,to:a}=r,o=n.doc.textBetween(i,a,`
`),c=0,l=0,u=r-a;for(let e=0;e< s.length ; e + = 1 ) { if ( l + s [ e ] . length > =u){c=e;break}l+=s[e].length+1}let d=s[c].match(/^ */)?.[0]||``,f=Math.min(d.length,t);if(f===0)return!0;let p=a;for(let e=0;e< c ; e + = 1 ) p + = s [ e ] . length + 1 ; return e . delete ( p , p + f ) , r-p < = f & & e . setSelection ( E . create ( e . doc , p ) ) , ! 0 } ) :e . commands . command ( ( { tr:e } ) = > {let{from:i,to:a}=r,o=n.doc.textBetween(i,a,`
`,`
`).split(`
`).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(`
`);return e.replaceWith(i,a,n.schema.text(o)),!0}):!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let a=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
`);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:e})=>{if(!this.options.exitOnArrowUp)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type||r.parentOffset!==0)return!1;let a=r.before();return a>0?!1:e.commands.insertDefaultBlock({pos:a})},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(S .near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[_ p({find:Uw ,type:this.type,getAttributes:e=>({language:e[1]})}),_ p({find:Ww ,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new T ({key:new E (`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,`
`));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type& & a.setSelection(C .near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),Kw=y p.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
`);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:e})=>{if(!this.options.exitOnArrowUp)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type||r.parentOffset!==0)return!1;let a=r.before();return a>0?!1:e.commands.insertDefaultBlock({pos:a})},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(T .near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[j p({find:hT ,type:this.type,getAttributes:e=>({language:e[1]})}),j p({find:gT ,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new O ({key:new k (`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,`
`));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type& & a.setSelection(E .near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),vT=F p.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
`):``}),qw=y p.create({name:`hardBreak`,markdownTokenName:`br`,addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,P (this.options.HTMLAttributes,e)]},renderText(){return`
`):``}),yT=F p.create({name:`hardBreak`,markdownTokenName:`br`,addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,I (this.options.HTMLAttributes,e)]},renderText(){return`
`},renderMarkdown:()=>`
`,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks(); return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t& & s& & a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Jw=yp.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,P(this.options.HTMLAttributes,t),0]},parseMarkdown(e,t){let n=e.depth||1;return this.options.levels.includes(n)?t.createNode(`heading`,{level:n},t.parseInline(e.tokens||[])):t.createNode(`paragraph`,void 0,t.parseInline(e.tokens||[]))},renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${t.renderChildren(e.content)}`:``},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>_p({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),Yw=yp.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,P(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!Sf(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return cd(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(C.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(w.create(t.doc,n.pos)):t.setSelection(C.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i& & (t.insert(r,i),t.setSelection(C.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[gp({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Xw=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Zw=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Qw=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,$w=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,eT=Gf.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`& & null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,P(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`< em > `,close:`< / em > `}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[hp({find:Xw,type:this.type}),hp({find:Qw,type:this.type})]},addPasteRules(){return[bp({find:Zw,type:this.type}),bp({find:$w,type:this.type})]}}),tT=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zLine truncated
`,DE=`️ `,OE=` `,kE=` `,AE=null,jE=null;function ME(e=[]){let t={};gT.groups=t;let n=new gT;AE??=IE(tT),jE??=IE(nT),Q(n,`'`,qT),Q(n,`{`,AT),Q(n,`}`,jT),Q(n,`[`,MT),Q(n,`]`,NT),Q(n,`(`,PT),Q(n,`)`,FT),Q(n,`< `,IT),Q(n,`>`,LT),Q(n,`( `,RT),Q(n,`) `,zT),Q(n,`「`,BT),Q(n,`」`,VT),Q(n,`『`,HT),Q(n,`』`,UT),Q(n,`< `,WT),Q(n,`> `,GT),Q(n,`&`,KT),Q(n,`*`,JT),Q(n,`@`,YT),Q(n,"`",ZT),Q(n,`^`,QT),Q(n,`:`,$T),Q(n,`,`,eE),Q(n,`$`,tE),Q(n,`.`,nE),Q(n,`=`,rE),Q(n,`!`,iE),Q(n,`-`,aE),Q(n,`%`,oE),Q(n,`|`,sE),Q(n,`+`,cE),Q(n,`#`,lE),Q(n,`?`,uE),Q(n,`"`,dE),Q(n,`/`,mE),Q(n,`; `,pE),Q(n,`~`,hE),Q(n,`_`,gE),Q(n,`\\`,XT),Q(n,`・`,fE);let r=Z(n,CE,DT,{[rT]:!0});Z(r,CE,r);let i=Z(r,bE,bT,{[oT]:!0}),a=Z(r,xE,xT,{[sT]:!0}),o=Z(n,bE,vT,{[iT]:!0});Z(o,CE,i),Z(o,bE,o),Z(i,CE,i),Z(i,bE,i);let s=Z(n,xE,yT,{[aT]:!0});Z(s,bE),Z(s,CE,a),Z(s,xE,s),Z(a,CE,a),Z(a,bE),Z(a,xE,a);let c=Q(n,EE,kT,{[fT]:!0}),l=Q(n,TE,OT,{[fT]:!0}),u=Z(n,wE,OT,{[fT]:!0});Q(n,kE,u),Q(l,EE,c),Q(l,kE,u),Z(l,wE,u),Q(u,TE),Q(u,EE),Z(u,wE,u),Q(u,kE,u);let d=Z(n,SE,_E,{[lT]:!0});Q(d,`#`),Z(d,SE,d),Q(d,DE,d);let f=Q(d,OE);Q(f,`#`),Z(f,SE,d);let p=[[bE,o],[CE,i]],m=[[bE,null],[xE,s],[CE,a]];for(let e=0;e< AE.length ; e + + ) FE ( n , AE [ e ] , CT , vT , p ) ; for ( let e = 0;e<jE.length;e++)FE(n,jE[e],wT,yT,m);mT(CT,{tld:!0,ascii:!0},t),mT(wT,{utld:!0,alpha:!0},t),FE(n,`file`,TT,vT,p),FE(n,`mailto`,TT,vT,p),FE(n,`http`,ET,vT,p),FE(n,`https`,ET,vT,p),FE(n,`ftp`,ET,vT,p),FE(n,`ftps`,ET,vT,p),mT(TT,{scheme:!0,ascii:!0},t),mT(ET,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)= > e[0]>t[0]?1:-1);for(let t=0;t< e.length ; t + + ) { let r = e[t][0],i=e[t][1]?{[uT]:!0}:{[dT]:!0};r.indexOf(`-`) > =0?i[cT]=!0:bE.test(r)?CE.test(r)?i[oT]=!0:i[iT]=!0:i[rT]=!0,_T(n,r,r,i)}return _T(n,`localhost`,ST,{ascii:!0}),n.jd=new gT(vE),{start:n,tokens:Object.assign({groups:t},yE)}}function NE(e,t){let n=PE(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o< r ; ) { let s = e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d > =0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++; a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function PE(e){let t=[],n=e.length,r=0;for(;r< n ; ) { let i = e.charCodeAt(r),a,o=i<55296||i > 56319||r+1===n||(a=e.charCodeAt(r+1))< 56320 | | a > 57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function FE(e,t,n,r,i){let a,o=t.length;for(let n=0;n< o-1 ; n + + ) { let o = t[n];e.j[o]?a=e.j[o]:(a=new gT ( r ) , a . jr = i.slice(),e.j[o]=a),e=a}return a = new gT ( n ) , a . jr = i.slice(),e.j[t[o-1]]=a,a}function IE ( e ) { let t = [],n=[],r=0;for(;r<e.length;){let i = 0;for(;`0123456789`.indexOf(e[r+i]) > =0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var LE={defaultProtocol:`http`,events:null,format:zE,formatHref:zE,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],ignoreClasses:[],render:null};function RE(e,t=null){let n=Object.assign({},LE);e& & (n=Object.assign(n,e instanceof RE?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e< r.length ; e + + ) i . push ( r [ e ] . toUpperCase ( ) ) ; this . o = n,t&&(this.defaultRender=t),this.ignoreTags=i,this.ignoreClasses=n.ignoreClasses.slice()}RE.prototype={o:LE,ignoreTags:[],ignoreClasses:[],isIgnoredClass(e){if(typeof e ! = ` string ` | | this . ignoreClasses . length = ==0)return!1;let t = e.split(/\s+/);for(let e = 0;e<t.length;e++)if(this.ignoreClasses.indexOf(t[e]) > =0)return!0;return!1},defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i& & (typeof i==`object`?(i=n.t in i?i[n.t]:LE[e],typeof i==`function`& & r& & (i=i(t,n))):typeof i==`function`& & r& & (i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`& & t!=null& & (r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}};function zE(e){return e}function BE(e,t){this.t=`token`,this.v=e,this.tk=t}BE.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n& & r.length>n?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=LE.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s& & (o.clLine truncated
`,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks(); return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t& & s& & a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),bT=Fp.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,I(this.options.HTMLAttributes,t),0]},parseMarkdown(e,t){let n=e.depth||1;return this.options.levels.includes(n)?t.createNode(`heading`,{level:n},t.parseInline(e.tokens||[])):t.createNode(`paragraph`,void 0,t.parseInline(e.tokens||[]))},renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${t.renderChildren(e.content)}`:``},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>jp({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),xT=Fp.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,I(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!bf(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return od(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(E.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(D.create(t.doc,n.pos)):t.setSelection(E.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i& & (t.insert(r,i),t.setSelection(E.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Ap({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),ST=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,CT=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,wT=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,TT=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,ET=ap.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`& & null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,I(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`< em > `,close:`< / em > `}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[kp({find:ST,type:this.type}),kp({find:wT,type:this.type})]},addPasteRules(){return[Ip({find:CT,type:this.type}),Ip({find:TT,type:this.type})]}}),DT=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zLine truncated
`,$E=`️ `,eD=` `,tD=` `,nD=null,rD=null;function iD(e=[]){let t={};HT.groups=t;let n=new HT;nD??=cD(DT),rD??=cD(OT),Q(n,`'`,yE),Q(n,`{`,nE),Q(n,`}`,rE),Q(n,`[`,iE),Q(n,`]`,aE),Q(n,`(`,oE),Q(n,`)`,sE),Q(n,`< `,cE),Q(n,`>`,lE),Q(n,`( `,uE),Q(n,`) `,dE),Q(n,`「`,fE),Q(n,`」`,pE),Q(n,`『`,mE),Q(n,`』`,hE),Q(n,`< `,gE),Q(n,`> `,_E),Q(n,`&`,vE),Q(n,`*`,bE),Q(n,`@`,xE),Q(n,"`",CE),Q(n,`^`,wE),Q(n,`:`,TE),Q(n,`,`,EE),Q(n,`$`,DE),Q(n,`.`,OE),Q(n,`=`,kE),Q(n,`!`,AE),Q(n,`-`,jE),Q(n,`%`,ME),Q(n,`|`,NE),Q(n,`+`,PE),Q(n,`#`,FE),Q(n,`?`,IE),Q(n,`"`,LE),Q(n,`/`,BE),Q(n,`; `,zE),Q(n,`~`,VE),Q(n,`_`,HE),Q(n,`\\`,SE),Q(n,`・`,RE);let r=Z(n,YE,$T,{[kT]:!0});Z(r,YE,r);let i=Z(r,KE,KT,{[MT]:!0}),a=Z(r,qE,qT,{[NT]:!0}),o=Z(n,KE,WT,{[AT]:!0});Z(o,YE,i),Z(o,KE,o),Z(i,YE,i),Z(i,KE,i);let s=Z(n,qE,GT,{[jT]:!0});Z(s,KE),Z(s,YE,a),Z(s,qE,s),Z(a,YE,a),Z(a,KE),Z(a,qE,a);let c=Q(n,QE,tE,{[RT]:!0}),l=Q(n,ZE,eE,{[RT]:!0}),u=Z(n,XE,eE,{[RT]:!0});Q(n,tD,u),Q(l,QE,c),Q(l,tD,u),Z(l,XE,u),Q(u,ZE),Q(u,QE),Z(u,XE,u),Q(u,tD,u);let d=Z(n,JE,UE,{[FT]:!0});Q(d,`#`),Z(d,JE,d),Q(d,$E,d);let f=Q(d,eD);Q(f,`#`),Z(f,JE,d);let p=[[KE,o],[YE,i]],m=[[KE,null],[qE,s],[YE,a]];for(let e=0;e< nD.length ; e + + ) sD ( n , nD [ e ] , YT , WT , p ) ; for ( let e = 0;e<rD.length;e++)sD(n,rD[e],XT,GT,m);BT(YT,{tld:!0,ascii:!0},t),BT(XT,{utld:!0,alpha:!0},t),sD(n,`file`,ZT,WT,p),sD(n,`mailto`,ZT,WT,p),sD(n,`http`,QT,WT,p),sD(n,`https`,QT,WT,p),sD(n,`ftp`,QT,WT,p),sD(n,`ftps`,QT,WT,p),BT(ZT,{scheme:!0,ascii:!0},t),BT(QT,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)= > e[0]>t[0]?1:-1);for(let t=0;t< e.length ; t + + ) { let r = e[t][0],i=e[t][1]?{[IT]:!0}:{[LT]:!0};r.indexOf(`-`) > =0?i[PT]=!0:KE.test(r)?YE.test(r)?i[MT]=!0:i[AT]=!0:i[kT]=!0,UT(n,r,r,i)}return UT(n,`localhost`,JT,{ascii:!0}),n.jd=new HT(WE),{start:n,tokens:Object.assign({groups:t},GE)}}function aD(e,t){let n=oD(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o< r ; ) { let s = e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d > =0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++; a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function oD(e){let t=[],n=e.length,r=0;for(;r< n ; ) { let i = e.charCodeAt(r),a,o=i<55296||i > 56319||r+1===n||(a=e.charCodeAt(r+1))< 56320 | | a > 57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function sD(e,t,n,r,i){let a,o=t.length;for(let n=0;n< o-1 ; n + + ) { let o = t[n];e.j[o]?a=e.j[o]:(a=new HT ( r ) , a . jr = i.slice(),e.j[o]=a),e=a}return a = new HT ( n ) , a . jr = i.slice(),e.j[t[o-1]]=a,a}function cD ( e ) { let t = [],n=[],r=0;for(;r<e.length;){let i = 0;for(;`0123456789`.indexOf(e[r+i]) > =0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var lD={defaultProtocol:`http`,events:null,format:dD,formatHref:dD,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],ignoreClasses:[],render:null};function uD(e,t=null){let n=Object.assign({},lD);e& & (n=Object.assign(n,e instanceof uD?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e< r.length ; e + + ) i . push ( r [ e ] . toUpperCase ( ) ) ; this . o = n,t&&(this.defaultRender=t),this.ignoreTags=i,this.ignoreClasses=n.ignoreClasses.slice()}uD.prototype={o:lD,ignoreTags:[],ignoreClasses:[],isIgnoredClass(e){if(typeof e ! = ` string ` | | this . ignoreClasses . length = ==0)return!1;let t = e.split(/\s+/);for(let e = 0;e<t.length;e++)if(this.ignoreClasses.indexOf(t[e]) > =0)return!0;return!1},defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i& & (typeof i==`object`?(i=n.t in i?i[n.t]:lD[e],typeof i==`function`& & r& & (i=i(t,n))):typeof i==`function`& & r& & (i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`& & t!=null& & (r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}};function dD(e){return e}function fD(e,t){this.t=`token`,this.v=e,this.tk=t}fD.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n& & r.length>n?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=lD.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s& & (o.clLine truncated
1. Must only contain digits, lowercase ASCII letters or "-"
2. Cannot start or end with "-"
3. "-" cannot repeat`);$.customSchemes.push([e,t])}function eD(){$.scanner=ME($.customSchemes);for(let e=0;e< $.tokenQueue.length;e++)$.tokenQueue[e][1]({scanner:$.scanner});$.parser=qE($.scanner.tokens);for(let e=0;e< $.pluginQueue.length;e++)$.pluginQueue[e][1]({scanner:$.scanner,parser:$.parser});return $.initialized=!0,$}function tD(e){return $.initialized||eD(),JE($.parser.start,e,NE($.scanner.start,e))}tD.scan=NE;function nD(e,t=null,n=null){if(t& & typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new RE(n),i=tD(e),a=[];for(let e=0;e< i.length ; e + + ) { let n = i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a } var rD = `[\0- \ xA0 - \ u2029 ] ` , iD = new RegExp ( rD ) , aD = RegExp(`${rD}$`),oD=RegExp(`${rD}+$`),sD=new RegExp ( rD , ` g ` ) ; function cD ( e , t , n ) { let r = e.doc.resolve(t.to);if(!r.nodeBefore?.isText)return;let i = e.doc.textBetween(t.from,t.to,` `,` `).match(oD)?.[0];if(!i)return;let a = t.to-i.length,o=Yu(a,t.to,e.doc).filter(e= > e.mark.type===n);if(!o.length)return;let{nodeAfter:s}=r;if(s&&o.some(e=>e.mark.isInSet(s.marks)))return; let c=e.storedMarks;e.removeMark(a,t.to,n),e.setStoredMarks(c),e.selection.empty& & e.selection.from===t.to& & e.removeStoredMark(n)}function lD(e){return e.length===1?e[0].isLink:e.length===3& & e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function uD(e){return new T({key:new E(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`)); if(!i||a)return;let{tr:o}=r,s=fu(n.doc,[...t]);if(!t.some(Kc)){let t=[];s.steps.forEach((e,n)=>{if(!(e instanceof Ot)||!e.slice.size)return;let r=s.mapping.slice(n+1),i=r.map(e.from,1),a=r.map(e.from+e.slice.size,-1);i< a & & t . push ( { from:i , to:a } ) } ) , t . sort ( ( e , t ) = > t.to-e.to),t.forEach(t=>cD(o,t,e.type))}if(Ju(s).forEach(({newRange:t})=>{let n=pu(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!aD.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i& & a){let t=a.split(iD).filter(Boolean);if(t.length< =0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=tD(n).map(t=>t.toObject(e.defaultProtocol));if(!lD(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{Yu(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function dD(e){return new T({key:new E(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1; let a=!1;if(e.enableClickSelection& & (a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=Gu(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r& & (window.open(r,o),a=!0)}return a}}})}var fD=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘ (.*?)’ ))?\)$/,pD=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘ (.*?)’ ))?\)/g;function mD(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`; --r)n+=1;return n%2==1}function hD(e,t){let n=0,r=0;for(;r< t ; ) { if ( e [ r ] ! = = " ` " | | n = ==0&&mD(e,r)){r+=1;continue}let i = 0;for(;r<t&&e[r]==="`";)i+=1,r+=1;n===0?n=i:i===n&&(n=0)}return n > 0}function gD(e,t,n){let[,r,i]=t;return(t.index?e[t.index-1]:void 0)===`!`||mD(e,t.index??0)||hD(e,t.index??0)?!1:!!r.trim()& & n(i)}function _D(e){let[t,n,r,,i,a,o]=e,s=i??a??o;return{index:e.index??0,text:t,replaceWith:n,data:{href:r,title:s||null,markdown:!0}}}function vD(e,t){return e.index< t.index + t . text . length & & t . index < e . index + e . text . length } function yD ( e ) { return { href:e . data ? . href , title:e . data ? . title ? ? null } } function bD ( e ) { let t = hp({find:t= > {let n=fD.exec(t);return!n||!gD(t,n,e.isAllowedHref)?null:_D(n)},type:e.type,getAttributes:yD});return new Lf({find:t.find,handler:e=>{let n=t.handler(e);return n!==null& & e.state.tr.steps.length& & e.state.tr.setMeta(`preventAutolink`,!0),n}})}function xD(e){let t=bp({find:t=>{let n=[];for(let r of t.matchAll(pD))gD(t,r,e.isAllowedHref)&&n.push(_D(r)); let r=(e.findPlainUrls?.call(e,t)??[]).filter(e=>!n.some(t=>vD(t,e)));return[...n,...r]},type:e.type,getAttributes:yD});return new Kf({find:t.find,handler:e=>{let n=t.handler(e);return n!==null& & e.state.tr.steps.length& & e.match.data?.markdown& & e.state.tr.setMeta(`preventAutolink`,!0),n}})}function SD(e){return new T({key:new E(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=nD(c,{defaultProtocol:Line truncated
`):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(TD,this.editor.getAttributes(ED)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=vp({find:DD,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=vp({find:DD,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(ED),editor:this.editor})),[e]}}),kD=(e,t,n)=>{let{selection:r}=e; if(!r.empty)return null;let{$from:i}=r;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let a=-1;for(let e=i.depth;e>0;--e)if(i.node(e).type.name===t){a=e;break}if(a< 0 ) return null ; let o = i.node(a),s=i.index(a);if(s+1 > =o.childCount)return null;let c=o.child(s+1);if(!n.includes(c.type.name))return null;let l=e.schema.nodes[t],u=!1;if(c.forEach(e=>{e.type===l& & e.childCount>1& & (u=!0)}),!u)return null;let d=e.doc.resolve(i.after()).nodeAfter;if(!d||!n.includes(d.type.name))return null;let f=[];return d.forEach(e=>{f.push(e)}),f.length===0?null:{listItemDepth:a,nestedList:d,nestedListPos:i.after(),insertPos:i.after(a),items:f}},AD=(e,t,n,r)=>{let i=kD(e,n,r);if(!i)return!1;let{selection:a}=e,{nestedList:o,nestedListPos:c,insertPos:l,items:u}=i,d=e.tr;d.delete(c,c+o.nodeSize);let f=d.mapping.map(l);return d.insert(f,s.from(u)),d.setSelection(a.map(d.doc,d.mapping)),t& & t(d),!0},jD=(e,t,n)=>AD(e.state,e.view.dispatch,t,n),MD=(e,t)=>F.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>jD(this.editor,e,t);return{Delete:n,"Mod-Delete":n}}}),ND=[[1e3,`m`],[900,`cm`],[500,`d`],[400,`cd`],[100,`c`],[90,`xc`],[50,`l`],[40,`xl`],[10,`x`],[9,`ix`],[5,`v`],[4,`iv`],[1,`i`]],PD=`abcdefghijklmnopqrstuvwxyz`,FD=String.raw`\d+|[ivxlcdmIVXLCDM]+|${`[a-zA-Z]{1,2}`}`;function ID(e){let t=e,n=``;for(let[e,r]of ND)for(;t>=e;)n+=r,t-=e;return n}function LD(e){return ID(e).toUpperCase()}function RD(e){let t=e.toLowerCase(),n=0,r=0;for(;n< t.length ; ) { let e = !1;for(let[i,a]of ND ) if ( t . startsWith ( a , n ) ) { r + = i , n + = a . length , e = !0;break}if(!e)return 0 } return r } function zD ( e ) { if ( ! / ^ [ ivxlcdmIVXLCDM ] + $ / . test ( e ) ) return ! 1 ; let t = RD(e);return t < = 0 ? ! 1: ( e = ==e.toLowerCase()?ID(t):LD(t))===e}function BD ( e ) { let t = e.toLowerCase();if(t.length===1)return t . charCodeAt ( 0 ) -97 + 1 ; if ( t . length = ==2){let e = t.charCodeAt(0)-97,n=t.charCodeAt(1)-97;return(e+1)*26+n+1}return 0 } function VD ( e ) { if ( e < = 26 ) return PD [ e-1 ] ; let t = Math.floor((e-1)/26)-1,n=(e-1)%26;return t < 0 ? PD [ n ] :PD [ t ] + PD [ n ] } function HD ( e ) { if ( e & & ! / ^ \ d + $ / . test ( e ) ) { if ( zD ( e ) ) return e = ==e.toLowerCase()?`i`:`I`;if(/^[a-z]{1,2}$/.test(e))return`a`;if(/^[A-Z]{1,2}$/.test(e))return`A`}}function UD ( e ) { if ( / ^ \ d + $ / . test ( e ) ) return parseInt ( e , 10 ) ; let t = HD(e);if(t===`i`||t===`I`)return RD ( e ) ; if ( t = ==`a`||t===`A`){let t = BD(e);return t > 0?t:1}let n=parseInt(e,10);return Number.isNaN(n)?1:n}function WD(e,t){if(e===`numeric`)return String(t);switch(e){case`a`:return VD(t);case`A`:return VD(t).toUpperCase();case`i`:return ID(t);case`I`:return LD(t);default:return String(t)}}function GD(e){if(e.length===0)return!1;let t=HD(e[0])??`numeric`,n=UD(e[0]);if(n< 1 ) return ! 1 ; for ( let r = 0;r<e.length;r++){let i = WD(t,n+r);if(e[r]!==i)return!1}return!0}function KD ( e ) { return { type:HD ( e ) , start:UD ( e ) } } function qD ( e ) { let { type:t , start:n } = KD ( e ) , r = {};return t & & ( r . type = t),n!==1&&(r.start=n),r}function JD ( e , t , n = `. ` ) { let r = t+1;if(!e||e===`1`)return`${r}${n}`;switch(e){case`a`:return`${VD(r)}${n}`;case`A`:return`${VD(r).toUpperCase()}${n}`;case`i`:return`${ID(r)}${n}`;case`I`:return`${LD(r)}${n}`;default:return`${r}${n}`}}function YD ( e ) { return ! e [ 0 ] | | e [ 0 ] . type = ==`paragraph`?e:[{type:`paragraph`,content:[]},...e]}function XD ( e ) { let t = e.content?.[0];return t ? . type = ==`paragraph`&&!t.content?.length}var ZD = ` `,QD=1,$D=e= > (e?.level??QD)>QD;function eO(e){let t=e.tokens?.[0];return!!(e.text& & e.tokens?.length===1& & t?.type===`list`& & t.ordered& & t.raw===e.text)}function tO(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:`text`,raw:e,text:e}])}var nO=yp.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,P(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0){if(eO(e))return{type:`listItem`,content:[{type:`paragraph`,content:tO(e.text||``,t)}]}; let[i,...a]=e.tokens;if(i.type===`heading`)return{type:`listItem`,content:[{type:`paragraph`,content:t.parseInline(i.tokens??[])},...a.length>0?n(a):[]]};Line truncated
3. "-" cannot repeat`);$.customSchemes.push([e,t])}function ED(){$.scanner=iD($.customSchemes);for(let e=0;e< $.tokenQueue.length;e++)$.tokenQueue[e][1]({scanner:$.scanner});$.parser=yD($.scanner.tokens);for(let e=0;e< $.pluginQueue.length;e++)$.pluginQueue[e][1]({scanner:$.scanner,parser:$.parser});return $.initialized=!0,$}function DD(e){return $.initialized||ED(),bD($.parser.start,e,aD($.scanner.start,e))}DD.scan=aD;function OD(e,t=null,n=null){if(t& & typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new uD(n),i=DD(e),a=[];for(let e=0;e< i.length ; e + + ) { let n = i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a } var kD = `[\0- \ xA0 - \ u2029 ] ` , AD = new RegExp ( kD ) , jD = RegExp(`${kD}$`),MD=RegExp(`${kD}+$`),ND=new RegExp ( kD , ` g ` ) ; function PD ( e , t , n ) { let r = e.doc.resolve(t.to);if(!r.nodeBefore?.isText)return;let i = e.doc.textBetween(t.from,t.to,` `,` `).match(MD)?.[0];if(!i)return;let a = t.to-i.length,o=qu(a,t.to,e.doc).filter(e= > e.mark.type===n);if(!o.length)return;let{nodeAfter:s}=r;if(s&&o.some(e=>e.mark.isInSet(s.marks)))return; let c=e.storedMarks;e.removeMark(a,t.to,n),e.setStoredMarks(c),e.selection.empty& & e.selection.from===t.to& & e.removeStoredMark(n)}function FD(e){return e.length===1?e[0].isLink:e.length===3& & e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function ID(e){return new O({key:new k(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`)); if(!i||a)return;let{tr:o}=r,s=uu(n.doc,[...t]);if(!t.some(Wc)){let t=[];s.steps.forEach((e,n)=>{if(!(e instanceof Tt)||!e.slice.size)return;let r=s.mapping.slice(n+1),i=r.map(e.from,1),a=r.map(e.from+e.slice.size,-1);i< a & & t . push ( { from:i , to:a } ) } ) , t . sort ( ( e , t ) = > t.to-e.to),t.forEach(t=>PD(o,t,e.type))}if(Ku(s).forEach(({newRange:t})=>{let n=du(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!jD.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i& & a){let t=a.split(AD).filter(Boolean);if(t.length< =0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=DD(n).map(t=>t.toObject(e.defaultProtocol));if(!FD(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{qu(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function LD(e){return new O({key:new k(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1; let a=!1;if(e.enableClickSelection& & (a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=Uu(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r& & (window.open(r,o),a=!0)}return a}}})}var RD=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘ (.*?)’ ))?\)$/,zD=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘ (.*?)’ ))?\)/g;function BD(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`; --r)n+=1;return n%2==1}function VD(e,t){let n=0,r=0;for(;r< t ; ) { if ( e [ r ] ! = = " ` " | | n = ==0&&BD(e,r)){r+=1;continue}let i = 0;for(;r<t&&e[r]==="`";)i+=1,r+=1;n===0?n=i:i===n&&(n=0)}return n > 0}function HD(e,t,n){let[,r,i]=t;return(t.index?e[t.index-1]:void 0)===`!`||BD(e,t.index??0)||VD(e,t.index??0)?!1:!!r.trim()& & n(i)}function UD(e){let[t,n,r,,i,a,o]=e,s=i??a??o;return{index:e.index??0,text:t,replaceWith:n,data:{href:r,title:s||null,markdown:!0}}}function WD(e,t){return e.index< t.index + t . text . length & & t . index < e . index + e . text . length } function GD ( e ) { return { href:e . data ? . href , title:e . data ? . title ? ? null } } function KD ( e ) { let t = kp({find:t= > {let n=RD.exec(t);return!n||!HD(t,n,e.isAllowedHref)?null:UD(n)},type:e.type,getAttributes:GD});return new Zf({find:t.find,handler:e=>{let n=t.handler(e);return n!==null& & e.state.tr.steps.length& & e.state.tr.setMeta(`preventAutolink`,!0),n}})}function qD(e){let t=Ip({find:t=>{let n=[];for(let r of t.matchAll(zD))HD(t,r,e.isAllowedHref)&&n.push(UD(r)); let r=(e.findPlainUrls?.call(e,t)??[]).filter(e=>!n.some(t=>WD(t,e)));return[...n,...r]},type:e.type,getAttributes:GD});return new op({find:t.find,handler:e=>{let n=t.handler(e);return n!==null& & e.state.tr.steps.length& & e.match.data?.markdown& & e.state.tr.setMeta(`preventAutolink`,!0),n}})}function JD(e){return new O({key:new k(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=OD(c,{defaultProtocol:Line truncated
`):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ZD,this.editor.getAttributes(QD)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=Mp({find:$D,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Mp({find:$D,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(QD),editor:this.editor})),[e]}}),tO=(e,t,n)=>{let{selection:r}=e; if(!r.empty)return null;let{$from:i}=r;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let a=-1;for(let e=i.depth;e>0;--e)if(i.node(e).type.name===t){a=e;break}if(a< 0 ) return null ; let o = i.node(a),s=i.index(a);if(s+1 > =o.childCount)return null;let c=o.child(s+1);if(!n.includes(c.type.name))return null;let l=e.schema.nodes[t],u=!1;if(c.forEach(e=>{e.type===l& & e.childCount>1& & (u=!0)}),!u)return null;let d=e.doc.resolve(i.after()).nodeAfter;if(!d||!n.includes(d.type.name))return null;let f=[];return d.forEach(e=>{f.push(e)}),f.length===0?null:{listItemDepth:a,nestedList:d,nestedListPos:i.after(),insertPos:i.after(a),items:f}},nO=(e,t,n,r)=>{let i=tO(e,n,r);if(!i)return!1;let{selection:a}=e,{nestedList:o,nestedListPos:c,insertPos:l,items:u}=i,d=e.tr;d.delete(c,c+o.nodeSize);let f=d.mapping.map(l);return d.insert(f,s.from(u)),d.setSelection(a.map(d.doc,d.mapping)),t& & t(d),!0},rO=(e,t,n)=>nO(e.state,e.view.dispatch,t,n),iO=(e,t)=>L.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>rO(this.editor,e,t);return{Delete:n,"Mod-Delete":n}}}),aO=[[1e3,`m`],[900,`cm`],[500,`d`],[400,`cd`],[100,`c`],[90,`xc`],[50,`l`],[40,`xl`],[10,`x`],[9,`ix`],[5,`v`],[4,`iv`],[1,`i`]],oO=`abcdefghijklmnopqrstuvwxyz`,sO=String.raw`\d+|[ivxlcdmIVXLCDM]+|${`[a-zA-Z]{1,2}`}`;function cO(e){let t=e,n=``;for(let[e,r]of aO)for(;t>=e;)n+=r,t-=e;return n}function lO(e){return cO(e).toUpperCase()}function uO(e){let t=e.toLowerCase(),n=0,r=0;for(;n< t.length ; ) { let e = !1;for(let[i,a]of aO ) if ( t . startsWith ( a , n ) ) { r + = i , n + = a . length , e = !0;break}if(!e)return 0 } return r } function dO ( e ) { if ( ! / ^ [ ivxlcdmIVXLCDM ] + $ / . test ( e ) ) return ! 1 ; let t = uO(e);return t < = 0 ? ! 1: ( e = ==e.toLowerCase()?cO(t):lO(t))===e}function fO ( e ) { let t = e.toLowerCase();if(t.length===1)return t . charCodeAt ( 0 ) -97 + 1 ; if ( t . length = ==2){let e = t.charCodeAt(0)-97,n=t.charCodeAt(1)-97;return(e+1)*26+n+1}return 0 } function pO ( e ) { if ( e < = 26 ) return oO [ e-1 ] ; let t = Math.floor((e-1)/26)-1,n=(e-1)%26;return t < 0 ? oO [ n ] :oO [ t ] + oO [ n ] } function mO ( e ) { if ( e & & ! / ^ \ d + $ / . test ( e ) ) { if ( dO ( e ) ) return e = ==e.toLowerCase()?`i`:`I`;if(/^[a-z]{1,2}$/.test(e))return`a`;if(/^[A-Z]{1,2}$/.test(e))return`A`}}function hO ( e ) { if ( / ^ \ d + $ / . test ( e ) ) return parseInt ( e , 10 ) ; let t = mO(e);if(t===`i`||t===`I`)return uO ( e ) ; if ( t = ==`a`||t===`A`){let t = fO(e);return t > 0?t:1}let n=parseInt(e,10);return Number.isNaN(n)?1:n}function gO(e,t){if(e===`numeric`)return String(t);switch(e){case`a`:return pO(t);case`A`:return pO(t).toUpperCase();case`i`:return cO(t);case`I`:return lO(t);default:return String(t)}}function _O(e){if(e.length===0)return!1;let t=mO(e[0])??`numeric`,n=hO(e[0]);if(n< 1 ) return ! 1 ; for ( let r = 0;r<e.length;r++){let i = gO(t,n+r);if(e[r]!==i)return!1}return!0}function vO ( e ) { return { type:mO ( e ) , start:hO ( e ) } } function yO ( e ) { let { type:t , start:n } = vO ( e ) , r = {};return t & & ( r . type = t),n!==1&&(r.start=n),r}function bO ( e , t , n = `. ` ) { let r = t+1;if(!e||e===`1`)return`${r}${n}`;switch(e){case`a`:return`${pO(r)}${n}`;case`A`:return`${pO(r).toUpperCase()}${n}`;case`i`:return`${cO(r)}${n}`;case`I`:return`${lO(r)}${n}`;default:return`${r}${n}`}}function xO ( e ) { return ! e [ 0 ] | | e [ 0 ] . type = ==`paragraph`?e:[{type:`paragraph`,content:[]},...e]}function SO ( e ) { let t = e.content?.[0];return t ? . type = ==`paragraph`&&!t.content?.length}var CO = ` `,wO=1,TO=e= > (e?.level??wO)>wO;function EO(e){let t=e.tokens?.[0];return!!(e.text& & e.tokens?.length===1& & t?.type===`list`& & t.ordered& & t.raw===e.text)}function DO(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:`text`,raw:e,text:e}])}var OO=Fp.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,I(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0){if(EO(e))return{type:`listItem`,content:[{type:`paragraph`,content:DO(e.text||``,t)}]}; let[i,...a]=e.tokens;if(i.type===`heading`)return{type:`listItem`,content:[{type:`paragraph`,content:t.parseInline(i.tokens??[])},...a.length>0?n(a):[]]};Line truncated
`).trim(),contentLines:m,raw:g.join(`
`)}),r=h,n=h}return[t,r]}var b O=RegExp(`^(${FD })([.)])\\s+(.+)$`);function x O(e){let t=e.split(`
`).filter(e=>e.trim().length>0);if(t.length===0)return null;let n=[];for(let e of t){let t=e.trim().match(b O);if(!t)return null;n.push({marker:t[1],content:t[3]})}return GD (n.map(e=>e.marker))?{type:`orderedList`,attrs:qD (n[0].marker),content:n.map(e=>({type:`listItem`,content:[{type:`paragraph`,content:[{type:`text`,text:e.content}]}]}))}:null}function S O(e,t,n){let r=[],i=0;for(;i< e.length ; ) { let a = e[i];if(a.indent===t){let{paragraphLines:o,blockLines:s}=v O(a.contentLines),c=o.join(`
`)}),r=h,n=h}return[t,r]}var K O=RegExp(`^(${sO })([.)])\\s+(.+)$`);function q O(e){let t=e.split(`
`).filter(e=>e.trim().length>0);if(t.length===0)return null;let n=[];for(let e of t){let t=e.trim().match(K O);if(!t)return null;n.push({marker:t[1],content:t[3]})}return _O (n.map(e=>e.marker))?{type:`orderedList`,attrs:yO (n[0].marker),content:n.map(e=>({type:`listItem`,content:[{type:`paragraph`,content:[{type:`text`,text:e.content}]}]}))}:null}function J O(e,t,n){let r=[],i=0;for(;i< e.length ; ) { let a = e[i];if(a.indent===t){let{paragraphLines:o,blockLines:s}=W O(a.contentLines),c=o.join(`
`).trim(),l=[];c&&l.push({type:`paragraph`,raw:c,tokens:n.inlineTokens(c)}); let u=s.join(`
`).trim();if(u){let e=n.blockTokens(u);l.push(...e)}let d=i+1,f=[];for(;d< e.length & & e [ d ] . indent > t;)f.push(e[d]),d+=1;if(f.length>0){let e=S O(f,Math.min(...f.map(e=>e.indent)),n);l.push({type:`list`,ordered:!0,start:f[0].number,typeMarker:f[0].type,items:e,raw:f.map(e=>e.raw).join(`
`)})}r.push({type:`list_item`,raw:a.raw,tokens:l}),i=d}else i+=1}return r}function C O(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e])); else if(e.type===`text`& & e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0& & n.push(...r)}}),{type:`listItem`,content:n}})}var w O=64;function T O(e,t){let n=[],r=0;for(;n.length< t ; ) { let t = e.indexOf(`
`,r);if(t===-1)return n.push(e.slice(r)),n;n.push(e.slice(r,t)),r=t+1}return n}function E O(e){let t=e.indexOf(`
`),n=t===-1?e:e.slice(0,t);if(!f O.test(n))return[[],0,[]];let r=w O,i=T O(e,r),a=y O(i);for(;a[1]===i.length&&i.length===r; )r*=2,i=T O(e,r),a=y O(i);return[a[0],a[1],i]}var D O=`listItem`,OO =`textStyle`,kO =/^(\d+)\.\s$/;function AO (e){let t=e.match(/list-style-type\s*:\s*([^;]+)/i);if(!t)return null;switch(t[1].trim().toLowerCase()){case`upper-roman`:return`I`;case`lower-roman`:return`i`;case`upper-alpha`:case`upper-latin`:return`A`;case`lower-alpha`:case`lower-latin`:return`a`;default:return null}}var jO=y p.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>{let t=e.getAttribute(`type`);if(t)return t;let n=e.getAttribute(`style`);if(n){let e=AO (n);if(e)return e}let r=e.querySelector(`li`);if(r){let e=r.getAttribute(`style`);if(e){let t=AO (e);if(t)return t}}return null}}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,type:n,...r}=e,i=P (this.options.HTMLAttributes,r);return t!==1&&(i.start=t),n&&n!==`1`&&(i.type=n),[`ol`,i,0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[]; let n=e.start||1,r=e.typeMarker,i=e.items?C O(e.items,t):[],a={};return n!==1& & (a.start=n),r& & (a.type=r),Object.keys(a).length>0?{type:`orderedList`,attrs:a,content:i}:{type:`orderedList`,content:i}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
`):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:()=>-1,tokenize:(e,t,n)=>{let[r,i,a]=E O(e);if(r.length===0)return;let o=S O(r,r[0].indent,n);if(o.length!==0)return{type:`list`,ordered:!0,start:r[0]?.number||1,typeMarker:r[0]?.type,items:o,raw:a.slice(0,i).join(`
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(DO,this.editor.getAttributes(OO)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new T({props:{handlePaste:(e,t)=>{if((t.clipboardData?.getData(`text/html`))?.trim())return!1;let n=t.clipboardData?.getData(`text/plain`);if(!n)return!1;let r=xO(n);if(!r)return!1;try{let t=e.state.schema.nodeFromJSON(r),n=e.state.tr.replaceSelectionWith(t);return e.dispatch(n),!0}catch{return!1}}}})]},addInputRules(){let e=(e,t)=>(!t.attrs.type||t.attrs.type===`1`)&&t.childCount+t.attrs.start===+e[1],t=vp({find:kO,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:e}); return(this.options.keepMarks||this.options.keepAttributes)& & (t=vp({find:kO,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(OO)}),joinPredicate:e,editor:this.editor})),[t]}}),MO=/^\s*(\[([( |x])?\])\s$/,NO=`position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0`,PO=(e,t,n)=>{var r;return(n==null||(r=n.checkboxLabel)==null?void 0:r.call(n,e,t))||`Task item checkbox for ${e.textContent||`empty task item`}`},FO=yp.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:e=>e.querySelector(`div`)??e}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,P(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens& & e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens& & e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>Pf(e,t,`- [${e.attrs?.checked?`x`:` `}] `,void 0,{indentMainContent:!0}),addExtensions(){return this.options.nested?[MD(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`);o.style.cssText=NO;let l=e=>{let t=PO(e,e.attrs.checked,this.options.a11y);s.setAttribute(`aria-label`,t),o.textContent=t};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked; return}let{checked:i}=t.target;r.isEditable& & typeof n==`function`& & r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)}); let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=Mu(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[vp({find:MO,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),IO=yp.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`uLine truncated
`):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=jf(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(t){let r={type:`taskList`,raw:t.raw,items:t.items},i=e.slice(t.raw.length);return i.trim()?[r,...n.blockTokens(i)]:[r]}return n.blockTokens(e)},i=jf(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});F.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(OD.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(nO.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(dO.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(jO.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(FO.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(IO.configure(this.options.taskList)),e}}); var LO=` `,RO=`\xA0`,zO=yp.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,P(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1& & n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1& & n[0].type===`text`& & (n[0].raw===LO||n[0].text===LO||n[0].raw===RO||n[0].text===RO)& & r.length===1& & r[0].type===`text`& & (r[0].text===LO||r[0].text===RO)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){var i,a;let e=Array.isArray(n==null||(i=n.previousNode)==null?void 0:i.content)?n.previousNode.content:[];return(n==null||(a=n.previousNode)==null?void 0:a.type)===`paragraph`& & e.length===0?LO:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),BO=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,VO=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,HO=Gf.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,P(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[hp({find:BO,type:this.type})]},addPasteRules(){return[bp({find:VO,type:this.type})]}}),UO=yp.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),WO=Gf.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,P(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`< u > ${t.renderChildren(e)}< / u > `},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.toLowerCase().indexOf(`< u > `)},tokenize(e,t,n){if(!/^< u > /i.test(e))return;let r=/\\[\s\S]|`+|< \/u>/gi;r.lastIndex=3;let i=r.exec(e);for(;i;){if(i[0].startsWith("`")){let t=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/.exec(e.slice(i.index));t& & (r.lastIndex=i.index+t[0].length)}else if(!i[0].startsWith(`\\`)){let t=e.slice(3,i.index);return t?{type:`underline`,raw:e.slice(0,r.lastIndex),text:t,tokens:n.inlineTokens(t)}:void 0}i=r.exec(e)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleULine truncated
`).trim();if(u){let e=n.blockTokens(u);l.push(...e)}let d=i+1,f=[];for(;d< e.length & & e [ d ] . indent > t;)f.push(e[d]),d+=1;if(f.length>0){let e=J O(f,Math.min(...f.map(e=>e.indent)),n);l.push({type:`list`,ordered:!0,start:f[0].number,typeMarker:f[0].type,items:e,raw:f.map(e=>e.raw).join(`
`)})}r.push({type:`list_item`,raw:a.raw,tokens:l}),i=d}else i+=1}return r}function Y O(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e])); else if(e.type===`text`& & e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0& & n.push(...r)}}),{type:`listItem`,content:n}})}var X O=64;function Z O(e,t){let n=[],r=0;for(;n.length< t ; ) { let t = e.indexOf(`
`,r);if(t===-1)return n.push(e.slice(r)),n;n.push(e.slice(r,t)),r=t+1}return n}function Q O(e){let t=e.indexOf(`
`),n=t===-1?e:e.slice(0,t);if(!R O.test(n))return[[],0,[]];let r=X O,i=Z O(e,r),a=G O(i);for(;a[1]===i.length&&i.length===r; )r*=2,i=Z O(e,r),a=G O(i);return[a[0],a[1],i]}var $ O=`listItem`,ek =`textStyle`,t k=/^(\d+)\.\s$/;function nk (e){let t=e.match(/list-style-type\s*:\s*([^;]+)/i);if(!t)return null;switch(t[1].trim().toLowerCase()){case`upper-roman`:return`I`;case`lower-roman`:return`i`;case`upper-alpha`:case`upper-latin`:return`A`;case`lower-alpha`:case`lower-latin`:return`a`;default:return null}}var rk=F p.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>{let t=e.getAttribute(`type`);if(t)return t;let n=e.getAttribute(`style`);if(n){let e=nk (n);if(e)return e}let r=e.querySelector(`li`);if(r){let e=r.getAttribute(`style`);if(e){let t=nk (e);if(t)return t}}return null}}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,type:n,...r}=e,i=I (this.options.HTMLAttributes,r);return t!==1&&(i.start=t),n&&n!==`1`&&(i.type=n),[`ol`,i,0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[]; let n=e.start||1,r=e.typeMarker,i=e.items?Y O(e.items,t):[],a={};return n!==1& & (a.start=n),r& & (a.type=r),Object.keys(a).length>0?{type:`orderedList`,attrs:a,content:i}:{type:`orderedList`,content:i}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
`):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:()=>-1,tokenize:(e,t,n)=>{let[r,i,a]=Q O(e);if(r.length===0)return;let o=J O(r,r[0].indent,n);if(o.length!==0)return{type:`list`,ordered:!0,start:r[0]?.number||1,typeMarker:r[0]?.type,items:o,raw:a.slice(0,i).join(`
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes($O,this.editor.getAttributes(ek)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new O({props:{handlePaste:(e,t)=>{if((t.clipboardData?.getData(`text/html`))?.trim())return!1;let n=t.clipboardData?.getData(`text/plain`);if(!n)return!1;let r=qO(n);if(!r)return!1;try{let t=e.state.schema.nodeFromJSON(r),n=e.state.tr.replaceSelectionWith(t);return e.dispatch(n),!0}catch{return!1}}}})]},addInputRules(){let e=(e,t)=>(!t.attrs.type||t.attrs.type===`1`)&&t.childCount+t.attrs.start===+e[1],t=Mp({find:tk,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:e}); return(this.options.keepMarks||this.options.keepAttributes)& & (t=Mp({find:tk,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(ek)}),joinPredicate:e,editor:this.editor})),[t]}}),ik=/^\s*(\[([( |x])?\])\s$/,ak=`position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0`,ok=(e,t,n)=>{var r;return(n==null||(r=n.checkboxLabel)==null?void 0:r.call(n,e,t))||`Task item checkbox for ${e.textContent||`empty task item`}`},sk=Fp.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:e=>e.querySelector(`div`)??e}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,I(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens& & e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens& & e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>Jf(e,t,`- [${e.attrs?.checked?`x`:` `}] `,void 0,{indentMainContent:!0}),addExtensions(){return this.options.nested?[iO(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`);o.style.cssText=ak;let l=e=>{let t=ok(e,e.attrs.checked,this.options.a11y);s.setAttribute(`aria-label`,t),o.textContent=t};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked; return}let{checked:i}=t.target;r.isEditable& & typeof n==`function`& & r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)}); let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=Au(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[Mp({find:ik,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),ck=Fp.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`uLine truncated
`):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=Gf(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(t){let r={type:`taskList`,raw:t.raw,items:t.items},i=e.slice(t.raw.length);return i.trim()?[r,...n.blockTokens(i)]:[r]}return n.blockTokens(e)},i=Gf(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});L.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(eO.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(OO.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(LO.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(rk.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(sk.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(ck.configure(this.options.taskList)),e}}); var lk=` `,uk=`\xA0`,dk=Fp.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,I(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1& & n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1& & n[0].type===`text`& & (n[0].raw===lk||n[0].text===lk||n[0].raw===uk||n[0].text===uk)& & r.length===1& & r[0].type===`text`& & (r[0].text===lk||r[0].text===uk)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){var i,a;let e=Array.isArray(n==null||(i=n.previousNode)==null?void 0:i.content)?n.previousNode.content:[];return(n==null||(a=n.previousNode)==null?void 0:a.type)===`paragraph`& & e.length===0?lk:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),fk=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,pk=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,mk=ap.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,I(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[kp({find:fk,type:this.type})]},addPasteRules(){return[Ip({find:pk,type:this.type})]}}),hk=Fp.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),gk=ap.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,I(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`< u > ${t.renderChildren(e)}< / u > `},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.toLowerCase().indexOf(`< u > `)},tokenize(e,t,n){if(!/^< u > /i.test(e))return;let r=/\\[\s\S]|`+|< \/u>/gi;r.lastIndex=3;let i=r.exec(e);for(;i;){if(i[0].startsWith("`")){let t=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/.exec(e.slice(i.index));t& & (r.lastIndex=i.index+t[0].length)}else if(!i[0].startsWith(`\\`)){let t=e.slice(3,i.index);return t?{type:`underline`,raw:e.slice(0,r.lastIndex),text:t,tokens:n.inlineTokens(t)}:void 0}i=r.exec(e)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleULine truncated
`);return/\s/.test(n)}):!1}function bj(e){return()=>{let t=e.state.selection.$anchor.pos,{top:n,right:r,bottom:i,left:a}=e.view.coordsAtPos(t);try{return new DOMRect(a,n,r-a,i-n)}catch{return null}}}function xj(e,t,n,r){return n?()=>{let n=r.getState(e.state)?.decorationId;return t.dom.querySelector(`[data-decoration-id="${n}"]`)?.getBoundingClientRect()||null}:bj(e)}function Sj({match:e,dismissedRange:t,state:n,transaction:r,editor:i,shouldResetDismissed:a,effectiveAllowSpaces:o}){return a?.({editor:i,state:n,range:t,match:e,transaction:r,allowSpaces:o})?!1:o?e.range.from===t.from:e.range.from===t.from& & !yj(r)}function Cj({view:e,pluginKeyRef:t}){let n=e.state.tr.setMeta(t,{exit:!0});e.dispatch(n)}function wj({pluginKey:e,decorationTag:t,decorationClass:n,decorationContent:r,decorationEmptyClass:i,renderer:a,dispatchExit:o}){return{handleKeyDown(t,n){var r;let i=e.getState(t.state);if(!i.active)return!1;if(n.key===`Escape`||n.key===`Esc`){var s;return a==null||(s=a.onKeyDown)==null||s.call(a,{view:t,event:n,range:i.range}),o(t),!0}return(a==null||(r=a.onKeyDown)==null?void 0:r.call(a,{view:t,event:n,range:i.range}))||!1},decorations(a){let{active:o,range:s,decorationId:c,query:l}=e.getState(a);if(!o)return null;let u=!l?.length,d=[n];return u& & d.push(i),M.create(a.doc,[hs.inline(s.from,s.to,{nodeName:t,class:d.join(` `),"data-decoration-id":c||void 0,"data-decoration-content":r})])}}}function Tj({editor:e,char:t,effectiveAllowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,findSuggestionMatch:o,allow:s,shouldShow:c,shouldKeepDismissed:l,pluginKey:u}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(d,f,p,m){let{isEditable:h}=e,{composing:g}=e.view,{selection:_}=d,{empty:v,from:y}=_,b={...f},x=d.getMeta(u);if(x& & x.exit)return b.active=!1,b.decorationId=null,b.range={from:0,to:0},b.query=null,b.text=null,b.dismissedRange=f.active?{...f.range}:f.dismissedRange,b;if(b.composing=g,d.docChanged&&b.dismissedRange!==null&&(b.dismissedRange={from:d.mapping.map(b.dismissedRange.from),to:d.mapping.map(b.dismissedRange.to)}),h&&(v||e.view.composing)){(y<f.range.from||y>f.range.to)&&!g&&!f.composing&&(b.active=!1); let u=o({char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:_.$from}),p=`id_${Math.floor(Math.random()*4294967295)}`;u& & s({editor:e,state:m,range:u.range,isActive:f.active})& & (!c||c({editor:e,range:u.range,query:u.query,text:u.text,transaction:d}))?(b.dismissedRange!==null& & !l({match:u,dismissedRange:b.dismissedRange,state:m,transaction:d})& & (b.dismissedRange=null),b.dismissedRange===null?(b.active=!0,b.decorationId=f.decorationId||p,b.range=u.range,b.query=u.query,b.text=u.text):b.active=!1):(u||(b.dismissedRange=null),b.active=!1)}else b.active=!1;return b.active||(b.decorationId=null,b.range={from:0,to:0},b.query=null,b.text=null),b}}}function Ej({editor:e,items:t}){let n=null,r=null,i=null,a=()=>{r!==null& & (clearTimeout(r),r=null),i?.(),i=null},o=e=>new Promise(t=>{i=t,r=setTimeout(()=>{r=null;let e=i;i=null,e?.()},e)}),s=()=>{n?.abort(),a(),n=null};return{abort:s,fetch:async(r,i)=>{s(),n=new AbortController;let a=n;if(i>0& & await o(i),n!==a||a.signal.aborted)return{status:`aborted`};try{let i=await t({editor:e,query:r,signal:a.signal});return n!==a||a.signal.aborted?{status:`aborted`}:{status:`resolved`,items:i}}catch{return n!==a||a.signal.aborted?{status:`aborted`}:{status:`error`}}}}}function Dj({placement:e,offset:t,flip:n,floatingUi:r}){var i;let a=[mj({mainAxis:t.mainAxis??4,crossAxis:t.crossAxis??0})];return n& & a.push(gj()),r!=null& & (i=r.middleware)!=null& & i.length& & a.push(...r.middleware),{placement:e,strategy:r?.strategy??`absolute`,middleware:a}}function Oj(e){if(e instanceof HTMLElement)return e;if(typeof e==`string`)try{let t=document.querySelector(e);if(t)return t}catch{return document.body}return document.body}function kj({getReferenceRect:e,contextElement:t,config:n,container:r,dismissOnOutsideClick:i,dismiss:a}){return(o,s={})=>{let c={getBoundingClientRect:()=>e()??new DOMRect,contextElement:t},l=!1,u=!o.isConnected;u&&Oj(r).appendChild(o),s.onPosition||(o.style.visibility=`hidden`,o.style.width=`max-content`); let d=pj(c,o,()=>{_j(c,o,{placement:n.placement,strategy:n.strategy,middleware:n.middleware}).then(({x:e,y:t,placement:n,strategy:r})=>{s.onPosition?s.onPosition({x:e,y:t,placement:n,strategy:r}):(Object.assign(o.style,{position:r,left:`${e}px`,top:`${t}px`}),l||(l=!0,o.style.visibility=``))})},s.autoUpdate),f;return i& & (f=e=>{let n=e.target;!(n instanceof Node)||o.contains(n)||t.contains(n)||a()},document.addEventListener(`pointerdown`,f,!0)),()=>{d(),f& & document.removeEventListener(`pointerdown`,f,!0),u& & o.remove()}}}function Aj({editor:e,pluginKey:t,items:n,renderer:r,minQueryLength:i,debounce:a,initialItems:o,placement:s,offset:c,container:l,flip:u,floatingUi:d,dismissOnOutsideClick:f,command:p,clientRectFor:m,dispatchExit:h}){let g,_=Ej({editor:e,items:n}),v=Dj({placeLine truncated
< style rel = "stylesheet" crossorigin > / * ! t a i l w i n d c s s v 4 . 3 . 3 | M I T L i c e n s e | h t t p s : / / t a i l w i n d c s s . c o m * /
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:"Inter Variable", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;--font-serif:"Source Serif 4 Variable", "Source Serif 4", "Iowan Old Style", Georgia, serif;--font-mono:"JetBrains Mono Variable", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;--spacing:.25rem;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--radius-xs:4px;--radius-sm:6px;--radius-md:10px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-surface:var(--dw-surface);--color-surface-raised:var(--dw-surface-raised);--color-surface-hover:var(--dw-surface-hover);--color-line:var(--dw-line);--color-line-strong:var(--dw-line-strong);--color-ink:var(--dw-ink);--color-ink-muted:var(--dw-ink-muted);--color-ink-faint:var(--dw-ink-faint);--color-primary:var(--dw-primary);--color-primary-hover:var(--dw-primary-hover);--color-on-primary:var(--dw-on-primary);--color-accent:var(--dw-accent);--color-accent-soft:var(--dw-accent-soft);--color-selection:var(--dw-selection);--color-success:var(--dw-success);--color-success-soft:var(--dw-success-soft);--color-warning:var(--dw-warning);--color-warning-soft:var(--dw-warning-soft);--color-danger:var(--dw-danger);--color-danger-soft:var(--dw-danger-soft);--color-on-danger:var(--dw-on-danger);--color-info:var(--dw-info);--color-info-soft:var(--dw-info-soft);--color-code-bg:var(--dw-code-bg);--text-ui-xs:12px;--text-ui-xs--line-height:16px;--text-ui-xs--letter-spacing:.01em;--text-ui-xs--font-weight:500;--text-ui-sm:13px;--text-ui-sm--line-height:18px;--text-ui-md:14px;--text-ui-md--line-height:20px;--text-doc-h1:30px;--text-doc-h1--line-height:38px;--text-doc-h2:24px;--text-doc-h2--line-height:32px;--text-doc-h3:18px;--text-doc-h3--line-height:28px;--text-doc-body:16px;--text-doc-body--line-height:27px;--text-code:14px;--text-code--line-height:22px;--spacing-control-sm:28px;--spacing-control-md:34px}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;colLine truncated
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:"Inter Variable", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;--font-serif:"Source Serif 4 Variable", "Source Serif 4", "Iowan Old Style", Georgia, serif;--font-mono:"JetBrains Mono Variable", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;--spacing:.25rem;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--radius-xs:4px;--radius-sm:6px;--radius-md:10px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-surface:var(--dw-surface);--color-surface-raised:var(--dw-surface-raised);--color-surface-hover:var(--dw-surface-hover);--color-line:var(--dw-line);--color-line-strong:var(--dw-line-strong);--color-ink:var(--dw-ink);--color-ink-muted:var(--dw-ink-muted);--color-ink-faint:var(--dw-ink-faint);--color-primary:var(--dw-primary);--color-primary-hover:var(--dw-primary-hover);--color-on-primary:var(--dw-on-primary);--color-accent:var(--dw-accent);--color-accent-soft:var(--dw-accent-soft);--color-selection:var(--dw-selection);--color-focus-ring:var(--dw-focus-ring);--color-success:var(--dw-success);--color-success-soft:var(--dw-success-soft);--color-warning:var(--dw-warning);--color-warning-soft:var(--dw-warning-soft);--color-danger:var(--dw-danger);--color-danger-soft:var(--dw-danger-soft);--color-on-danger:var(--dw-on-danger);--color-info:var(--dw-info);--color-info-soft:var(--dw-info-soft);--color-code-bg:var(--dw-code-bg);--text-ui-xs:12px;--text-ui-xs--line-height:16px;--text-ui-xs--letter-spacing:.01em;--text-ui-xs--font-weight:500;--text-ui-sm:13px;--text-ui-sm--line-height:18px;--text-ui-md:14px;--text-ui-md--line-height:20px;--text-doc-h1:30px;--text-doc-h1--line-height:38px;--text-doc-h2:24px;--text-doc-h2--line-height:32px;--text-doc-h3:18px;--text-doc-h3--line-height:28px;--text-doc-body:16px;--text-doc-body--line-height:27px;--text-code:14px;--text-code--line-height:22px;--spacing-control-sm:28px;--spacing-control-md:34px}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-setLine truncated
/*$vite$:1*/< / style >
< / head >
< body >