@netnodeag/kraftwerk 0.54.0 → 0.55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/cli/init.js +2 -0
  2. package/dist/inspector/chat/sessions.js +3 -1
  3. package/inspector/dist/assets/{dist-ByiXz4TR.js → dist-BE34pwMP.js} +1 -1
  4. package/inspector/dist/assets/{dist-Bx7GKFmy.js → dist-BEsFc6FD.js} +1 -1
  5. package/inspector/dist/assets/{dist-BUqCaEU2.js → dist-Bvh8zyxa.js} +1 -1
  6. package/inspector/dist/assets/{dist-yMnOsWJc.js → dist-CFA64Yc7.js} +1 -1
  7. package/inspector/dist/assets/dist-CUM-iKNF.js +1 -0
  8. package/inspector/dist/assets/{dist-DiJi5Oj5.js → dist-CcIFukP1.js} +1 -1
  9. package/inspector/dist/assets/{dist-nr-aInCP.js → dist-Cude8a0m.js} +1 -1
  10. package/inspector/dist/assets/{dist-bY9OPiz6.js → dist-T8k-QVDQ.js} +1 -1
  11. package/inspector/dist/assets/{dist-CzRSjkPt.js → dist-U99ikhIT.js} +1 -1
  12. package/inspector/dist/assets/{dist-CYN-kVi9.js → dist-zx0nNkxV.js} +1 -1
  13. package/inspector/dist/assets/{dist-C8DnORyS.js → dist-zzOk7PS8.js} +1 -1
  14. package/inspector/dist/assets/editor-DaJiuQSH.js +117 -0
  15. package/inspector/dist/assets/index-ClLft79D.css +1 -0
  16. package/inspector/dist/assets/index-DSeNsrDz.js +224 -0
  17. package/inspector/dist/index.html +2 -2
  18. package/package.json +1 -1
  19. package/inspector/dist/assets/dist-DNSyvq_9.js +0 -1
  20. package/inspector/dist/assets/editor-CJj1y1g9.js +0 -120
  21. package/inspector/dist/assets/index-fICe4HKG.js +0 -221
  22. package/inspector/dist/assets/index-hkfqFX7i.css +0 -1
  23. package/inspector/dist/assets/roboto-latin-400-normal-BqEyEoaF.woff2 +0 -0
  24. package/inspector/dist/assets/roboto-latin-400-normal-D27F5sTu.woff +0 -0
  25. package/inspector/dist/assets/roboto-latin-500-normal-7RbcRiD8.woff2 +0 -0
  26. package/inspector/dist/assets/roboto-latin-500-normal-fsTFPL3E.woff +0 -0
  27. package/inspector/dist/assets/roboto-latin-600-normal-CzqH9ZEY.woff2 +0 -0
  28. package/inspector/dist/assets/roboto-latin-600-normal-X4S5XP0J.woff +0 -0
  29. package/inspector/dist/assets/roboto-latin-700-normal-BZpUvMxY.woff2 +0 -0
  30. package/inspector/dist/assets/roboto-latin-700-normal-YuyVweIx.woff +0 -0
  31. package/inspector/dist/assets/roboto-mono-latin-400-normal-DBZPkcnn.woff +0 -0
  32. package/inspector/dist/assets/roboto-mono-latin-400-normal-GekRknry.woff2 +0 -0
  33. package/inspector/dist/assets/roboto-mono-latin-500-normal-D6j6AMzd.woff +0 -0
  34. package/inspector/dist/assets/roboto-mono-latin-500-normal-pxIOXZmA.woff2 +0 -0
  35. package/inspector/dist/assets/roboto-mono-latin-700-normal-CHYrj1DZ.woff +0 -0
  36. package/inspector/dist/assets/roboto-mono-latin-700-normal-foxDnrFi.woff2 +0 -0
@@ -0,0 +1,117 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-yFKhRrHN.js","assets/dist-H3rerbMg.js","assets/dist-CPlSMtdY.js","assets/dist-CF7An11X.js","assets/dist-Cude8a0m.js","assets/index-DSeNsrDz.js","assets/index-ClLft79D.css","assets/dist-rE2oRtJp.js","assets/dist-BEsFc6FD.js","assets/dist-CFA64Yc7.js","assets/dist-D8nmL5S9.js","assets/dist-Bvh8zyxa.js","assets/dist-5wk4daHl.js","assets/dist-T8k-QVDQ.js","assets/dist-zx0nNkxV.js","assets/dist-U99ikhIT.js","assets/dist-CXS6W3P9.js","assets/dist-DaG9QYNU.js","assets/dist-zzOk7PS8.js","assets/dist-Ceimhh7q.js","assets/dist-ZMc9InB9.js","assets/dist-DNBDudvB.js","assets/dockerfile-DJkHQgkl.js","assets/simple-mode-DXiLM1-G.js","assets/factor-LKH5gN8L.js","assets/nsis-viPvXFiq.js","assets/pug-3K-JMW4g.js","assets/javascript-Bu8mWwtz.js","assets/dist-CcIFukP1.js","assets/dist-BE34pwMP.js"])))=>i.map(i=>d[i]);
2
+ import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./index-DSeNsrDz.js";import{$ as s,A as c,At as l,B as u,C as d,Ct as f,D as p,Dt as m,E as h,Et as g,F as _,Ft as v,G as y,H as b,Ht as x,I as S,J as C,K as w,L as T,Lt as E,M as ee,Mt as D,Nt as O,O as te,Ot as ne,P as k,Pt as A,Q as re,R as j,Rt as ie,S as ae,St as oe,T as se,U as ce,Ut as le,V as M,Vt as ue,W as de,X as fe,Y as pe,_ as me,_t as he,a as ge,b as _e,bt as ve,c as ye,ct as be,d as xe,dt as Se,et as Ce,f as we,ft as Te,g as Ee,gt as De,ht as Oe,it as ke,j as Ae,jt as je,k as Me,kt as Ne,l as N,lt as Pe,mt as Fe,nt as Ie,o as Le,ot as Re,p as ze,pt as Be,q as Ve,rt as He,st as Ue,tt as We,u as Ge,vt as P,w as Ke,wt as qe,yt as Je,z as Ye,zt as Xe}from"./dist-H3rerbMg.js";import{n as Ze,r as Qe}from"./dist-BEsFc6FD.js";import{i as $e,n as et,o as tt,r as nt,t as rt}from"./dist-CPlSMtdY.js";var it=class e{static create(t,n,r,i,a){let o=i+(i<<8)+t+(n<<4)|0;return new e(t,n,r,o,a,[],[])}constructor(e,t,n,r,i,a,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=i,this.children=a,this.positions=o,this.hashProp=[[E.contextHash,r]]}addChild(e,t){e.prop(E.contextHash)!=this.hash&&(e=new x(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new x(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new x(Xe.none,e,t,n,this.hashProp)})}},F;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(F||={});var at=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},ot=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return ut(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function st(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==F.OrderedList?_t:gt)(n,t,!1);return r>0&&(e.type!=F.BulletList||mt(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var ct={[F.Blockquote](e,t,n){return n.next==62&&(n.markers.push(Gt(F.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(lt(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0)},[F.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[F.OrderedList]:st,[F.BulletList]:st,[F.Document](){return!0}};function lt(e){return e==32||e==9||e==10||e==13}function ut(e,t=0){for(;t<e.length&&lt(e.charCodeAt(t));)t++;return t}function dt(e,t,n){for(;t>n&&lt(e.charCodeAt(t-1));)t--;return t}function ft(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function pt(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function mt(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!lt(n))return-1}return n&&e.next==45&&yt(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(jt.SetextHeading)>-1||r<3?-1:1}function ht(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function gt(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||lt(e.text.charCodeAt(e.pos+1)))&&(!n||ht(t,F.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function _t(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!lt(e.text.charCodeAt(r+1))||n&&!ht(t,F.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function vt(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function yt(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&lt(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var bt=/^[ \t]*$/,xt=/-->/,St=/\?>/,Ct=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,xt],[/^\s*<\?/,St],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,bt],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,bt]];function wt(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=Ct.length-+!!n;e<t;e++)if(Ct[e][0].test(r))return e;return-1}function Tt(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.skipSpace(t),i=e.countIndent(r,t,n);return i>=n+5||r==e.text.length?n+1:i}function Et(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==F.CodeText?e[r].to=n:e.push(Gt(F.CodeText,t,n))}var Dt={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(Et(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){Et(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==F.CodeText?Et(o,e.from,e.to):o.push(e);s=[]}Et(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&Et(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=F.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(F.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=ft(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=dt(t.text,t.text.length,o),c=[Gt(F.CodeMark,r,r+a)];o<s&&c.push(Gt(F.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&Et(c,e.lineStart-1,e.lineStart),c.push(Gt(F.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}{o=!0,n||(Et(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(Et(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(F.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=pt(t);return n<0?!1:(e.startContext(F.Blockquote,t.pos),e.addNode(F.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(mt(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(F.HorizontalRule,n),!0},BulletList(e,t){let n=gt(t,e,!1);if(n<0)return!1;e.block.type!=F.BulletList&&e.startContext(F.BulletList,t.basePos,t.next);let r=Tt(t,t.pos+1);return e.startContext(F.ListItem,t.basePos,r-t.baseIndent),e.addNode(F.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=_t(t,e,!1);if(n<0)return!1;e.block.type!=F.OrderedList&&e.startContext(F.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=Tt(t,t.pos+n);return e.startContext(F.ListItem,t.basePos,r-t.baseIndent),e.addNode(F.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=vt(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=dt(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!lt(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(F.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(F.HeaderMark,o-r,a-r);let c=s.finish(F.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=wt(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=Ct[n][1],a=[],o=i!=bt;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==xt?F.CommentBlock:i==St?F.ProcessingInstructionBlock:F.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},Ot=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
3
+ `+t.scrub(),i=this.advance(r);return i>-1&&i<r.length&&this.complete(e,n,i)}finish(e,t){return(this.stage==2||this.stage==3)&&ut(t.content,this.pos)==t.content.length&&this.complete(e,t,t.content.length)}complete(e,t,n){return e.addLeafElement(t,Gt(F.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;)if(this.stage==-1)return-1;else if(this.stage==0){if(!this.nextStage(rn(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(Gt(F.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(tn(e,ut(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=ut(e,this.pos),n=0;if(t>this.pos){let r=nn(e,t,this.start);if(r){let t=kt(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||=kt(e,this.pos),n>0&&n<e.length?n:-1}else return kt(e,this.pos)}};function kt(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n==10)break;if(!lt(n))return-1}return t}var At=class{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:yt(t),i=t.next;if(r<0)return!1;let a=Gt(F.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,Gt(i==61?F.SetextHeading1:F.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),a])),!0}finish(){return!1}},jt={LinkReference(e,t){return t.content.charCodeAt(0)==91?new Ot(t):null},SetextHeading(){return new At}},Mt=[(e,t)=>vt(t)>=0,(e,t)=>ft(t)>=0,(e,t)=>pt(t)>=0,(e,t)=>gt(t,e,!0)>=0,(e,t)=>_t(t,e,!0)>=0,(e,t)=>mt(t,e,!0)>=0,(e,t)=>wt(t,e,!0)>=0],Nt={text:``,end:0},Pt=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new ot,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=it.create(F.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new cn(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;start:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(n!=0){if(n==1)return null;e.forward();continue start}}break}if(e.pos==e.text.length)return this.nextLine()?null:this.finish();let t=new at(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}lines:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break lines}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+=`
4
+ `+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=ln(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=Nt;if(t.end=e,e>=this.to)t.text=``;else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,i=this.lineChunkAt(r);t.end=r+i.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+i,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw Error(`Unhandled block context `+F[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
5
+ `?``:t;else{let e=t.indexOf(`
6
+ `);n=e<0?t:t.slice(0,e)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=it.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e==`number`&&(e=new x(this.parser.nodeSet.types[e],Vt,Vt,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(on(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?Ft(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=on(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(F.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e==`string`?Gt(this.parser.getNodeType(e),t,n,r):new Wt(e,t)}get buffer(){return new Ht(this.parser.nodeSet)}};function Ft(e,t,n,r,i){let a=e[t].to,o=[],s=[],c=n.from+r;function l(n,i){for(;i?n>=a:n>a;){let i=e[t+1].from-a;r+=i,n+=i,t++,a=e[t].to}}for(let u=n.firstChild;u;u=u.nextSibling){l(u.from+r,!0);let n=u.from+r,d,f=i.get(u.tree);f?d=f:u.to+r>a?(d=Ft(e,t,u,r,i),l(u.to+r,!1)):d=u.toTree(),o.push(d),s.push(n-c)}return l(n.to+r,!1),new x(n.type,o,s,n.to+r-c,n.tree?n.tree.propValues:void 0)}var It=class e extends ue{constructor(e,t,n,r,i,a,o,s,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=i,this.skipContextMarkup=a,this.inlineParsers=o,this.inlineNames=s,this.wrappers=c,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let r=new Pt(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}configure(t){let n=Rt(t);if(!n)return this;let{nodeSet:r,skipContextMarkup:i}=this,a=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),s=this.blockNames.slice(),c=this.inlineParsers.slice(),l=this.inlineNames.slice(),u=this.endLeafBlock.slice(),d=this.wrappers;if(Lt(n.defineNodes)){i=Object.assign({},i);let e=r.types.slice(),t;for(let r of n.defineNodes){let{name:n,block:a,composite:o,style:s}=typeof r==`string`?{name:r}:r;if(e.some(e=>e.name==n))continue;o&&(i[e.length]=(e,t,n)=>o(t,n,e.value));let c=e.length,l=o?[`Block`,`BlockContext`]:a?c>=F.ATXHeading1&&c<=F.SetextHeading2?[`Block`,`LeafBlock`,`Heading`]:[`Block`,`LeafBlock`]:void 0;e.push(Xe.define({id:c,name:n,props:l&&[[E.group,l]]})),s&&(t||={},Array.isArray(s)||s instanceof S?t[n]=s:Object.assign(t,s))}r=new ie(e),t&&(r=r.extend(T(t)))}if(Lt(n.props)&&(r=r.extend(...n.props)),Lt(n.remove))for(let e of n.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(a[t]=o[t]=void 0),n>-1&&(c[n]=void 0)}if(Lt(n.parseBlock))for(let e of n.parseBlock){let t=s.indexOf(e.name);if(t>-1)a[t]=e.parse,o[t]=e.leaf;else{let t=e.before?zt(s,e.before):e.after?zt(s,e.after)+1:s.length-1;a.splice(t,0,e.parse),o.splice(t,0,e.leaf),s.splice(t,0,e.name)}e.endLeaf&&u.push(e.endLeaf)}if(Lt(n.parseInline))for(let e of n.parseInline){let t=l.indexOf(e.name);if(t>-1)c[t]=e.parse;else{let t=e.before?zt(l,e.before):e.after?zt(l,e.after)+1:l.length-1;c.splice(t,0,e.parse),l.splice(t,0,e.name)}}return n.wrap&&(d=d.concat(n.wrap)),new e(r,a,o,s,u,i,c,l,d)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new an(this,e,t);outer:for(let e=t;e<n.end;){let t=n.char(e);for(let r of this.inlineParsers)if(r){let i=r(n,t,e);if(i>=0){e=i;continue outer}}e++}return n.resolveMarkers(0)}};function Lt(e){return e!=null&&e.length>0}function Rt(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=Rt(e[0]);if(e.length==1)return t;let n=Rt(e.slice(1));if(!n||!t)return t||n;let r=(e,t)=>(e||Vt).concat(t||Vt),i=t.wrap,a=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:i?a?(e,t,n,r)=>i(a(e,t,n,r),t,n,r):i:a}}function zt(e,t){let n=e.indexOf(t);if(n<0)throw RangeError(`Position specified relative to unknown parser ${t}`);return n}var Bt=[Xe.none];for(let e=1,t;t=F[e];e++)Bt[e]=Xe.define({id:e,name:t,props:e>=F.Escape?[]:[[E.group,e in ct?[`Block`,`BlockContext`]:[`Block`,`LeafBlock`]]],top:t==`Document`});var Vt=[],Ht=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+r*4),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return x.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}},Ut=class{constructor(e,t,n,r=Vt){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new Ht(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}},Wt=class{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return Vt}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}};function Gt(e,t,n,r){return new Ut(e,t,n,r)}var Kt={resolve:`Emphasis`,mark:`EmphasisMark`},qt={resolve:`Emphasis`,mark:`EmphasisMark`},Jt={},Yt={},Xt=class{constructor(e,t,n,r){this.type=e,this.from=t,this.to=n,this.side=r}},Zt=`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`,Qt=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{Qt=RegExp(`[\\p{S}|\\p{P}]`,`u`)}catch{}var $t={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let r=e.char(n+1);for(let t=0;t<32;t++)if(Zt.charCodeAt(t)==r)return e.append(Gt(F.Escape,n,n+2));return-1},Entity(e,t,n){if(t!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return r?e.append(Gt(F.Entity,n,n+1+r[0].length)):-1},InlineCode(e,t,n){if(t!=96||n&&e.char(n-1)==96)return-1;let r=n+1;for(;r<e.end&&e.char(r)==96;)r++;let i=r-n,a=0;for(;r<e.end;r++)if(e.char(r)==96){if(a++,a==i&&e.char(r+1)!=96)return e.append(Gt(F.InlineCode,n,r+1,[Gt(F.CodeMark,n,n+i),Gt(F.CodeMark,r+1-i,r+1)]))}else a=0;return-1},HTMLTag(e,t,n){if(t!=60||n==e.end-1)return-1;let r=e.slice(n+1,e.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return e.append(Gt(F.Autolink,n,n+1+i[0].length,[Gt(F.LinkMark,n,n+1),Gt(F.URL,n+1,n+i[0].length),Gt(F.LinkMark,n+i[0].length,n+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(a)return e.append(Gt(F.Comment,n,n+1+a[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return e.append(Gt(F.ProcessingInstruction,n,n+1+o[0].length));let s=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return s?e.append(Gt(F.HTMLTag,n,n+1+s[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let r=n+1;for(;e.char(r)==t;)r++;let i=e.slice(n-1,n),a=e.slice(r,r+1),o=Qt.test(i),s=Qt.test(a),c=/\s|^$/.test(i),l=/\s|^$/.test(a),u=!l&&(!s||c||o),d=!c&&(!o||l||s),f=u&&(t==42||!d||o),p=d&&(t==42||!u||s);return e.append(new Xt(t==95?Kt:qt,n,r,!!f|(p?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(Gt(F.HardBreak,n,n+2));if(t==32){let t=n+1;for(;e.char(t)==32;)t++;if(e.char(t)==10&&t>=n+2)return e.append(Gt(F.HardBreak,n,t+1))}return-1},Link(e,t,n){return t==91?e.append(new Xt(Jt,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new Xt(Yt,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let t=e.parts.length-1;t>=0;t--){let r=e.parts[t];if(r instanceof Xt&&(r.type==Jt||r.type==Yt)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let i=e.takeContent(t),a=e.parts[t]=en(e,i,r.type==Jt?F.Link:F.Image,r.from,n+1);if(r.type==Jt)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof Xt&&t.type==Jt&&(t.side=0)}return a.to}}return-1}};function en(e,t,n,r,i){let{text:a}=e,o=e.char(i),s=i;if(t.unshift(Gt(F.LinkMark,r,r+(n==F.Image?2:1))),t.push(Gt(F.LinkMark,i-1,i)),o==40){let n=e.skipSpace(i+1),r=tn(a,n-e.offset,e.offset),o;r&&(n=e.skipSpace(r.to),n!=r.to&&(o=nn(a,n-e.offset,e.offset),o&&(n=e.skipSpace(o.to)))),e.char(n)==41&&(t.push(Gt(F.LinkMark,i,i+1)),s=n+1,r&&t.push(r),o&&t.push(o),t.push(Gt(F.LinkMark,n,s)))}else if(o==91){let n=rn(a,i-e.offset,e.offset,!1);n&&(t.push(n),s=n.to)}return Gt(n,r,s,t)}function tn(e,t,n){if(e.charCodeAt(t)==60){for(let r=t+1;r<e.length;r++){let i=e.charCodeAt(r);if(i==62)return Gt(F.URL,t+n,r+1+n);if(i==60||i==10)return!1}return null}{let r=0,i=t;for(let t=!1;i<e.length;i++){let n=e.charCodeAt(i);if(lt(n))break;if(t)t=!1;else if(n==40)r++;else if(n==41){if(!r)break;r--}else n==92&&(t=!0)}return i>t?Gt(F.URL,t+n,i+n):i==e.length&&null}}function nn(e,t,n){let r=e.charCodeAt(t);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let r=t+1,a=!1;r<e.length;r++){let o=e.charCodeAt(r);if(a)a=!1;else if(o==i)return Gt(F.LinkTitle,t+n,r+1+n);else o==92&&(a=!0)}return null}function rn(e,t,n,r){for(let i=!1,a=t+1,o=Math.min(e.length,a+999);a<o;a++){let o=e.charCodeAt(a);if(i)i=!1;else if(o==93)return!r&&Gt(F.LinkLabel,t+n,a+1+n);else{if(r&&!lt(o)&&(r=!1),o==91)return!1;o==92&&(i=!0)}}return null}var an=class{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,i){return this.append(new Xt(e,t,n,!!r|(i?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof Xt&&(t.type==Jt||t.type==Yt))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof Xt&&n.type.resolve&&n.side&2))continue;let r=n.type==Kt||n.type==qt,i=n.to-n.from,a,o=t-1;for(;o>=e;o--){let e=this.parts[o];if(e instanceof Xt&&e.side&1&&e.type==n.type&&!(r&&(n.side&1||e.side&2)&&(e.to-e.from+i)%3==0&&((e.to-e.from)%3||i%3))){a=e;break}}if(!a)continue;let s=n.type.resolve,c=[],l=a.from,u=n.to;if(r){let e=Math.min(2,a.to-a.from,i);l=a.to-e,u=n.from+e,s=e==1?`Emphasis`:`StrongEmphasis`}a.type.mark&&c.push(this.elt(a.type.mark,l,a.to));for(let e=o+1;e<t;e++)this.parts[e]instanceof Ut&&c.push(this.parts[e]),this.parts[e]=null;n.type.mark&&c.push(this.elt(n.type.mark,n.from,u));let d=this.elt(s,l,u,c);this.parts[o]=r&&a.from!=l?new Xt(a.type,a.from,l,a.side):null,(this.parts[t]=r&&n.to!=u?new Xt(n.type,u,n.to,n.side):null)?this.parts.splice(t,0,d):this.parts[t]=d}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof Ut&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof Xt&&n.type==e&&n.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof Xt?t:null}skipSpace(e){return ut(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e==`string`?Gt(this.parser.getNodeType(e),t,n,r):new Wt(e,t)}};an.linkStart=Jt,an.imageStart=Yt;function on(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r<n.length&&n[r].to<e.to;)r++;if(r<n.length&&n[r].from<e.from){let t=n[r];t instanceof Ut&&(n[r]=new Ut(t.type,t.from,t.to,on(t.children,[e])))}else n.splice(r++,0,e)}return n}var sn=[F.CodeBlock,F.ListItem,F.OrderedList,F.BulletList],cn=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&this.input.read(e-1,e)!=`
7
+ `;)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(E.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-+!!this.fragment.openEnd,i=e.absoluteLineStart,a=i,o=e.block.children.length,s=a,c=o;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=ln(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new x(e.parser.nodeSet.types[F.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is(`Block`)&&(sn.indexOf(t.type.id)<0?(a=t.to-n,o=e.block.children.length):(a=s,o=c),s=t.to-n,c=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-i}};function ln(e,t){let n=e;for(let r=1;r<t.length;r++){let i=t[r-1].to,a=t[r].from;i<e&&(n-=a-i)}return n}var un=T({"Blockquote/...":j.quote,HorizontalRule:j.contentSeparator,"ATXHeading1/... SetextHeading1/...":j.heading1,"ATXHeading2/... SetextHeading2/...":j.heading2,"ATXHeading3/...":j.heading3,"ATXHeading4/...":j.heading4,"ATXHeading5/...":j.heading5,"ATXHeading6/...":j.heading6,"Comment CommentBlock":j.comment,Escape:j.escape,Entity:j.character,"Emphasis/...":j.emphasis,"StrongEmphasis/...":j.strong,"Link/... Image/...":j.link,"OrderedList/... BulletList/...":j.list,"BlockQuote/...":j.quote,"InlineCode CodeText":j.monospace,"URL Autolink":j.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":j.processingInstruction,"CodeInfo LinkLabel":j.labelName,LinkTitle:j.string,Paragraph:j.content}),dn=new It(new ie(Bt).extend(un),Object.keys(Dt).map(e=>Dt[e]),Object.keys(Dt).map(e=>jt[e]),Object.keys(Dt),Mt,ct,Object.keys($t).map(e=>$t[e]),Object.keys($t),[]);function fn(e,t,n){let r=[];for(let i=e.firstChild,a=t;;i=i.nextSibling){let e=i?i.from:n;if(e>a&&r.push({from:a,to:e}),!i)break;a=i.to}return r}function pn(e){let{codeParser:t,htmlParser:n}=e;return{wrap:le((e,r)=>{let i=e.type.id;if(t&&(i==F.CodeBlock||i==F.FencedCode)){let n=``;if(i==F.FencedCode){let t=e.node.getChild(F.CodeInfo);t&&(n=r.read(t.from,t.to))}let a=t(n);if(a)return{parser:a,overlay:e=>e.type.id==F.CodeText,bracketed:i==F.FencedCode}}else if(n&&(i==F.HTMLBlock||i==F.HTMLTag||i==F.CommentBlock))return{parser:n,overlay:fn(e.node,e.from,e.to)};return null})}}var mn={resolve:`Strikethrough`,mark:`StrikethroughMark`},hn={defineNodes:[{name:`Strikethrough`,style:{"Strikethrough/...":j.strikethrough}},{name:`StrikethroughMark`,style:j.processingInstruction}],parseInline:[{name:`Strikethrough`,parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),i=e.slice(n+2,n+3),a=/\s|^$/.test(r),o=/\s|^$/.test(i),s=Qt.test(r),c=Qt.test(i);return e.addDelimiter(mn,n,n+2,!o&&(!c||a||s),!a&&(!s||o||c))},after:`Emphasis`}]};function gn(e,t,n=0,r,i=0){let a=0,o=!0,s=-1,c=-1,l=!1,u=()=>{r.push(e.elt(`TableCell`,i+s,i+c,e.parser.parseInline(t.slice(s,c),i+s)))};for(let d=n;d<t.length;d++){let n=t.charCodeAt(d);n==124&&!l?((!o||s>-1)&&a++,o=!1,r&&(s>-1&&u(),r.push(e.elt(`TableDelimiter`,d+i,d+i+1))),s=c=-1):(l||n!=32&&n!=9)&&(s<0&&(s=d),c=d+1),l=!l&&n==92}return s>-1&&(a++,r&&u()),a}function _n(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(t==124)return!0;t==92&&n++}return!1}var vn=/^[>\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,yn=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&vn.test(r=t.text.slice(t.pos))){let i=[];gn(e,n.content,0,i,n.start)==gn(e,r,0)&&(this.rows=[e.elt(`TableHeader`,n.start,n.start+n.content.length,i),e.elt(`TableDelimiter`,e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];gn(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt(`TableRow`,e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(`Table`,t.start,t.start+t.content.length,this.rows)),!0):!1}},bn={defineNodes:[{name:`Table`,block:!0},{name:`TableHeader`,style:{"TableHeader/...":j.heading}},`TableRow`,{name:`TableCell`,style:j.content},{name:`TableDelimiter`,style:j.processingInstruction}],parseBlock:[{name:`Table`,leaf(e,t){return _n(t.content,0)?new yn:null},endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof yn)||!_n(t.text,t.basePos))return!1;let r=e.peekLine();return vn.test(r)&&gn(e,t.text,t.basePos)==gn(e,r,t.basePos)},before:`SetextHeading`}]},xn=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(`Task`,t.start,t.start+t.content.length,[e.elt(`TaskMarker`,t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},Sn={defineNodes:[{name:`Task`,block:!0,style:j.list},{name:`TaskMarker`,style:j.atom}],parseBlock:[{name:`TaskList`,leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name==`ListItem`?new xn:null},after:`SetextHeading`}]},Cn=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,wn=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,Tn=/[\w-]+\.[\w-]+($|[/:])/,En=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,Dn=/\/[a-zA-Z\d@.]+/gy;function On(e,t,n,r){let i=0;for(let a=t;a<n;a++)e[a]==r&&i++;return i}function kn(e,t){wn.lastIndex=t;let n=wn.exec(e);if(!n||Tn.exec(n[0])[0].indexOf(`_`)>-1)return-1;let r=t+n[0].length;for(;;){let n=e[r-1],i;if(/[?!.,:*_~]/.test(n)||n==`)`&&On(e,t,r,`)`)>On(e,t,r,`(`))r--;else if(n==`;`&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+i.index;else break}return r}function An(e,t){En.lastIndex=t;let n=En.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r==`_`||r==`-`?-1:t+n[0].length-+(r==`.`)}var jn=[bn,Sn,hn,{parseInline:[{name:`Autolink`,parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;Cn.lastIndex=r;let i=Cn.exec(e.text),a=-1;return!i||(i[1]||i[2]?(a=kn(e.text,r+i[0].length),a>-1&&e.hasOpenLink&&(a=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,a))[0].length)):i[3]?a=An(e.text,r):(a=An(e.text,r+i[0].length),a>-1&&i[0]==`xmpp:`&&(Dn.lastIndex=a,i=Dn.exec(e.text),i&&(a=i.index+i[0].length))),a<0)?-1:(e.addElement(e.elt(`URL`,n,a+e.offset)),a+e.offset)}}]}];function Mn(e,t,n){return(r,i,a)=>{if(i!=e||r.char(a+1)==e)return-1;let o=[r.elt(n,a,a+1)];for(let i=a+1;i<r.end;i++){let s=r.char(i);if(s==e)return r.addElement(r.elt(t,a,i+1,o.concat(r.elt(n,i,i+1))));if(s==92&&o.push(r.elt(`Escape`,i,i+++2)),lt(s))break}return-1}}var Nn={defineNodes:[{name:`Superscript`,style:j.special(j.content)},{name:`SuperscriptMark`,style:j.processingInstruction}],parseInline:[{name:`Superscript`,parse:Mn(94,`Superscript`,`SuperscriptMark`)}]},Pn={defineNodes:[{name:`Subscript`,style:j.special(j.content)},{name:`SubscriptMark`,style:j.processingInstruction}],parseInline:[{name:`Subscript`,parse:Mn(126,`Subscript`,`SubscriptMark`)}]},Fn={defineNodes:[{name:`Emoji`,style:j.character}],parseInline:[{name:`Emoji`,parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt(`Emoji`,n,n+1+r[0].length))}}]},In=me({commentTokens:{block:{open:`<!--`,close:`-->`}}}),Ln=new E,Rn=dn.configure({props:[d.add(e=>!e.is(`Block`)||e.is(`Document`)||zn(e)!=null||Bn(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),Ln.add(zn),p.add({Document:()=>null}),Ae.add({Document:In})]});function zn(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function Bn(e){return e.name==`OrderedList`||e.name==`BulletList`}function Vn(e,t){let n=e;for(;;){let e=n.nextSibling,r;if(!e||(r=zn(e.type))!=null&&r<=t)break;n=e}return n.to}var Hn=Ke.of((e,t,n)=>{for(let r=_(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop(Ln);if(e==null)continue;let t=Vn(r,e);if(t>n)return{from:n,to:t}}return null});function Un(e){return new ye(In,e,[],`markdown`)}var Wn=Un(Rn),Gn=Un(Rn.configure([jn,Pn,Nn,Fn,{props:[d.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));function Kn(e,t){return n=>{if(n&&e){let t=null;if(n=/\S*/.exec(n)[0],t=typeof e==`function`?e(n):N.matchLanguageName(e,n,!0),t instanceof N)return t.support?t.support.language.parser:xe.getSkippingParser(t.load());if(t)return t.parser}return t?t.parser:null}}var qn=class{constructor(e,t,n,r,i,a,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=i,this.type=a,this.item=o}blank(e,t=!0){let n=this.spaceBefore+(this.node.name==`Blockquote`?`>`:``);if(e!=null){for(;n.length<e;)n+=` `;return n}for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=` `;return n+(t?this.spaceAfter:``)}marker(e,t){let n=this.node.name==`OrderedList`?String(+Yn(this.item,e)[2]+t):``;return this.spaceBefore+n+this.type+this.spaceAfter}};function Jn(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if(t.name==`FencedCode`)return r;(t.name==`ListItem`||t.name==`Blockquote`)&&n.push(t)}for(let e=n.length-1;e>=0;e--){let i=n[e],a,o=t.lineAt(i.from),s=i.from-o.from;if(i.name==`Blockquote`&&(a=/^ *>( ?)/.exec(o.text.slice(s))))r.push(new qn(i,s,s+a[0].length,``,a[1],`>`,null));else if(i.name==`ListItem`&&i.parent.name==`OrderedList`&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(s)))){let e=a[3],t=a[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new qn(i.parent,s,s+t,a[1],e,a[2],i))}else if(i.name==`ListItem`&&i.parent.name==`BulletList`&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))){let e=a[4],t=a[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=a[2];a[3]&&(n+=a[3].replace(/[xX]/,` `)),r.push(new qn(i.parent,s,s+t,a[1],e,n,i))}}return r}function Yn(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function Xn(e,t,n,r=0){for(let i=-1,a=e;;){if(a.name==`ListItem`){let e=Yn(a,t),o=+e[2];if(i>=0){if(o!=i+1)return;n.push({from:a.from+e[1].length,to:a.from+e[0].length,insert:String(i+2+r)})}i=o}let e=a.nextSibling;if(!e)break;a=e}}function Zn(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(c)!=` `)return e;let r=O(e,4,n),i=``;for(let e=r;e>0;)e>=4?(i+=` `,e-=4):(i+=` `,e--);return i+e.slice(n)}var Qn=(e={})=>({state:t,dispatch:n})=>{let r=_(t),{doc:i}=t,a=null,o=t.changeByRange(n=>{if(!n.empty||!Gn.isActiveAt(t,n.from,-1)&&!Gn.isActiveAt(t,n.from,1))return a={range:n};let o=n.from,s=i.lineAt(o),c=Jn(r.resolveInner(o,-1),i);for(;c.length&&c[c.length-1].from>o-s.from;)c.pop();if(!c.length)return a={range:n};let l=c[c.length-1];if(l.to-l.spaceAfter.length>o-s.from)return a={range:n};let u=o>=l.to-l.spaceAfter.length&&!/\S/.test(s.text.slice(l.to));if(l.item&&u){if(l.item.from<s.from&&!/^[\s>]*$/.test(s.text.slice(0,l.to)))return a={range:n};let r=l.node.firstChild,u=l.node.getChild(`ListItem`,`ListItem`);if(r.to>=o||u&&u.to<o||s.from>0&&!/[^\s>]/.test(i.lineAt(s.from-1).text)||e.nonTightLists===!1){let e=c.length>1?c[c.length-2]:null,t,n=``;e&&e.item?(t=s.from+e.from,n=e.marker(i,1)):t=s.from+(e?e.to:0);let r=[{from:t,to:o,insert:n}];return l.node.name==`OrderedList`&&Xn(l.item,i,r,-2),e&&e.node.name==`OrderedList`&&Xn(e.item,i,r),{range:P.cursor(t+n.length),changes:r}}{let e=nr(c,t,s);return{range:P.cursor(o+e.length+1),changes:{from:s.from,insert:e+t.lineBreak}}}}if(l.node.name==`Blockquote`&&u&&s.from){let e=i.lineAt(s.from-1),r=/>\s*$/.exec(e.text);if(r&&r.index==l.from){let i=t.changes([{from:e.from+r.index,to:e.to},{from:s.from+l.from,to:s.to}]);return{range:n.map(i),changes:i}}}let d=[];l.node.name==`OrderedList`&&Xn(l.item,i,d);let f=l.item&&l.item.from<s.from,p=``;if(!f||/^[\s\d.)\-+*>]*/.exec(s.text)[0].length>=l.to)for(let e=0,t=c.length-1;e<=t;e++)p+=e==t&&!f?c[e].marker(i,1):c[e].blank(e<t?O(s.text,4,c[e+1].from)-p.length:null);let m=o;for(;m>s.from&&/\s/.test(s.text.charAt(m-s.from-1));)m--;return p=Zn(p,t),tr(l.node,t.doc)&&(p=nr(c,t,s)+t.lineBreak+p),d.push({from:m,to:o,insert:t.lineBreak+p}),{range:P.cursor(m+p.length+1),changes:d}});return!a&&(n(t.update(o,{scrollIntoView:!0,userEvent:`input`})),!0)},$n=Qn();function er(e){return e.name==`QuoteMark`||e.name==`ListMark`}function tr(e,t){if(e.name!=`OrderedList`&&e.name!=`BulletList`)return!1;let n=e.firstChild,r=e.getChild(`ListItem`,`ListItem`);if(!r)return!1;let i=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+ +!o<a.number}function nr(e,t,n){let r=``;for(let t=0,i=e.length-2;t<=i;t++)r+=e[t].blank(t<i?O(n.text,4,e[t+1].from)-r.length:null,t<i);return Zn(r,t)}function rr(e,t){let n=e.resolveInner(t,-1),r=t;er(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(er(e))r=e.from;else if(e.name==`OrderedList`||e.name==`BulletList`)n=e.lastChild,r=n.to;else break;return n}var ir=({state:e,dispatch:t})=>{let n=_(e),r=null,i=e.changeByRange(t=>{let i=t.from,{doc:a}=e;if(t.empty&&Gn.isActiveAt(e,t.from)){let t=a.lineAt(i),r=Jn(rr(n,i),a);if(r.length){let n=r[r.length-1],a=n.to-n.spaceAfter.length+ +!!n.spaceAfter;if(i-t.from>a&&!/\S/.test(t.text.slice(a,i-t.from)))return{range:P.cursor(t.from+a),changes:{from:t.from+a,to:i}};if(i-t.from==a&&(n.item&&t.from<=n.item.from||/^[\s>]*$/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from<n.item.from&&/\S/.test(t.text.slice(n.from,n.to))){let i=n.blank(O(t.text,4,n.to)-O(t.text,4,n.from));return r==t.from&&(i=Zn(i,e)),{range:P.cursor(r+i.length),changes:{from:r,to:t.from+n.to,insert:i}}}if(r<i)return{range:P.cursor(r),changes:{from:r,to:i}}}}}return r={range:t}});return!r&&(t(e.update(i,{scrollIntoView:!0,userEvent:`delete`})),!0)},ar=[{key:`Enter`,run:$n},{key:`Backspace`,run:ir}],or=Ze({matchClosingTags:!1});function sr(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=Wn,completeHTMLTags:a=!0,pasteURLAsLink:o=!0,htmlTagLanguage:s=or}=e;if(!(i instanceof It))throw RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],l=[s.support,Hn],u;o&&l.push(fr),n instanceof Ge?(l.push(n.support),u=n.language):n&&(u=n);let d=t||u?Kn(t,u):void 0;c.push(pn({codeParser:d,htmlParser:s.language.parser})),r&&l.push(oe.high(He.of(ar)));let f=Un(i.configure(c));return a&&l.push(f.data.of({autocomplete:cr})),new Ge(f,l)}function cr(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let i=_(t).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name==`CodeBlock`||i.name==`FencedCode`||i.name==`ProcessingInstructionBlock`||i.name==`CommentBlock`||i.name==`Link`||i.name==`Image`)return null;i=i.parent}return{from:n-r[0].length,to:n,options:ur(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}var lr=null;function ur(){if(lr)return lr;let e=Qe(new rt(Je.create({extensions:or}),0,!0));return lr=e?e.options:[]}var dr=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,fr=M.domEventHandlers({paste:(e,t)=>{let{main:n}=t.state.selection;if(n.empty)return!1;let r=e.clipboardData?.getData(`text/plain`);if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r=`https://`+r),!Gn.isActiveAt(t.state,n.from,1)))return!1;let i=_(t.state),a=!1;return i.iterate({from:n.from,to:n.to,enter:e=>{(e.from>n.from||dr.test(e.name))&&(a=!0)},leave:e=>{e.to<n.to&&(a=!0)}}),!a&&(t.dispatch({changes:[{from:n.from,insert:`[`},{from:n.to,insert:`](${r})`}],userEvent:`input.paste`,scrollIntoView:!0}),!0)}}),I=a(t(),1),L=n(),pr=Object.defineProperty,mr=(e,t,n)=>t in e?pr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hr=(e,t,n)=>mr(e,typeof t==`symbol`?t:t+``,n),gr=class e{constructor(e=new Map){this.map=e}clone(){return new e(new Map(this.map))}increment(e){let t=this.map.get(e)??0;this.map.set(e,t+1)}decrement(e,t){let n=this.map.get(e);n!==void 0&&(--n,this.map.set(e,n),n===0&&t())}},_r=class{constructor(){hr(this,`map`,new Map)}getOrCreate(e){let t=this.map.get(e);return t===void 0&&(t=new Set,this.map.set(e,t)),t}get(e){return this.map.get(e)}use(e,t){let n=this.get(e);n!==void 0&&t(n)}delete(e){return this.map.delete(e)}};function vr(e,t){return t(e),e}function yr(){}var br=`cell`;function xr(e,t){return e===t}var Sr=new Map,Cr,wr=class{constructor(e={}){hr(this,`subscriptions`,new _r),hr(this,`singletonSubscriptions`,new Map),hr(this,`graph`,new _r),hr(this,`state`,new Map),hr(this,`distinctNodes`,new Map),hr(this,`executionMaps`,new Map),hr(this,`definitionRegistry`,new Set),hr(this,`combinedCells`,[]);for(let t of Object.getOwnPropertySymbols(e))this.state.set(t,e[t])}cellInstance(e,t=!0,n=Symbol()){return this.state.has(n)||this.state.set(n,e),t!==!1&&!this.distinctNodes.has(n)&&this.distinctNodes.set(n,t===!0?xr:t),n}signalInstance(e=!0,t=Symbol()){return e!==!1&&this.distinctNodes.set(t,e===!0?xr:e),t}sub(e,t){this.register(e);let n=this.subscriptions.getOrCreate(e);return n.add(t),()=>n.delete(t)}singletonSub(e,t){return this.register(e),t===void 0?this.singletonSubscriptions.delete(e):this.singletonSubscriptions.set(e,t),()=>this.singletonSubscriptions.delete(e)}resetSingletonSubs(){this.singletonSubscriptions.clear()}subMultiple(e,t){let n=this.signalInstance();return this.connect({map:e=>(...t)=>{e(t)},sink:n,sources:e}),this.sub(n,t)}pubIn(e){var t;let n=Reflect.ownKeys(e),r=this.getExecutionMap(n),i=r.refCount.clone(),a=r.participatingNodes.slice(),o=new Map(this.state),s=e=>{this.graph.use(e,t=>{for(let{sources:n,sink:r}of t)n.has(e)&&i.decrement(r,()=>{a.splice(a.indexOf(r),1),s(r)})})};for(;;){let n=a.shift();if(n===void 0)break;let i=n,c=!1,l=e=>{let t=this.distinctNodes.get(i);if(t!=null&&t(o.get(i),e)){c=!1;return}c=!0,o.set(i,e),this.state.has(i)&&this.state.set(i,e)};if(Object.prototype.hasOwnProperty.call(e,i)?l(e[i]):r.projections.use(i,e=>{for(let t of e){let e=[...Array.from(t.sources),...Array.from(t.pulls)].map(e=>o.get(e));t.map(l)(...e)}}),c){let e=o.get(i);this.inContext(()=>{this.subscriptions.use(i,t=>{for(let n of t)n(e)})}),(t=this.singletonSubscriptions.get(i))==null||t(e)}else s(i)}}connect({sources:e,pulls:t=[],map:n,sink:r}){let i={map:n,pulls:new Set(t),sink:this.register(r),sources:new Set(e)};for(let n of[...e,...t])this.register(n),this.graph.getOrCreate(n).add(i);this.executionMaps.clear()}pub(e,t){this.pubIn({[e]:t})}pipe(e,...t){return this.combineOperators(...t)(e)}transformer(...e){return t=>vr(this.signalInstance(),n=>(this.link(this.pipe(n,...e),t),n))}link(e,t){this.connect({map:e=>t=>{e(t)},sink:t,sources:[e]})}combine(...e){return vr(this.signalInstance(),t=>{this.connect({map:e=>(...t)=>{e(t)},sink:t,sources:e})})}combineCells(...e){let t=this.combinedCells.find(t=>e.length===t.sources.length&&e.every((e,n)=>e===t.sources[n]));if(t)return t.cell;let n=this.cellInstance(e.map(e=>this.getValue(e)),!0);return this.connect({map:e=>(...t)=>{e(t)},sink:n,sources:e}),this.combinedCells.push({sources:e,cell:n}),n}getValue(e){return this.register(e),this.state.get(e)}getValues(e){return e.map(e=>this.getValue(e))}register(e){let t=Sr.get(e);return t===void 0||this.definitionRegistry.has(e)?e:(this.definitionRegistry.add(e),vr(t.type===br?this.cellInstance(t.initial,t.distinct,e):this.signalInstance(t.distinct,e),e=>{this.inContext(()=>{t.init(this,e)})}))}inContext(e){let t=Cr;Cr=this;let n=e();return Cr=t,n}changeWith(e,t,n){this.connect({sources:[t],pulls:[e],sink:e,map:e=>(t,r)=>{e(n(r,t))}})}calculateExecutionMap(e){let t=[],n=new Set,r=new _r,i=new gr,a=new _r,o=(e,s=0)=>{i.increment(e),!n.has(e)&&(this.register(e),r.use(e,e=>{s=Math.max(...Array.from(e).map(e=>t.indexOf(e)))+1}),this.graph.use(e,t=>{for(let n of t)n.sources.has(e)?(a.getOrCreate(n.sink).add(n),o(n.sink,s)):r.getOrCreate(n.sink).add(e)}),n.add(e),t.splice(s,0,e))};return e.forEach(o),{participatingNodes:t,pendingPulls:r,projections:a,refCount:i}}getExecutionMap(e){let t=e;if(e.length===1){t=e[0];let n=this.executionMaps.get(t);if(n!==void 0)return n}else for(let[t,n]of this.executionMaps.entries())if(Array.isArray(t)&&t.length===e.length&&t.every(t=>e.includes(t)))return n;let n=this.calculateExecutionMap(e);return this.executionMaps.set(t,n),n}combineOperators(...e){return t=>{for(let n of e)t=n(t,this);return t}}};function R(e,t=yr,n=!0){return vr(Symbol(),r=>{Sr.set(r,{type:br,distinct:n,initial:e,init:t})})}function Tr(e=yr,t=!1){return vr(Symbol(),n=>{Sr.set(n,{type:`signal`,distinct:t,init:e})})}function Er(e=yr){return vr(Symbol(),t=>{Sr.set(t,{type:`signal`,distinct:!1,init:e})})}var Dr=I.createContext(null);function Or(){let e=I.useContext(Dr);if(e===null)throw Error(`useRealm must be used within a RealmContextProvider`);return e}function kr(e){let t=Or();t.register(e);let n=I.useCallback(n=>t.sub(e,n),[t,e]);return I.useSyncExternalStore(n,()=>t.getValue(e),()=>t.getValue(e))}function Ar(...e){let t=Or();return kr(I.useMemo(()=>t.combineCells.apply(t,e),[t,...e]))}function jr(e){let t=Or();return t.register(e),I.useCallback(n=>{t.pub(e,n)},[t,e])}function Mr(e){return(t,n)=>{let r=n.signalInstance();return n.connect({map:t=>n=>{t(e(n))},sink:r,sources:[t]}),r}}function Nr(...e){return(t,n)=>{let r=n.signalInstance();return n.connect({map:e=>(...t)=>{e(t)},pulls:e,sink:r,sources:[t]}),r}}function Pr(e){return(t,n)=>{let r=n.signalInstance();return n.connect({map:t=>n=>{e(n)&&t(n)},sink:r,sources:[t]}),r}}function Fr(e,t){return(n,r)=>{let i=r.signalInstance();return r.connect({map:n=>r=>{n(t=e(t,r))},sink:i,sources:[n]}),i}}var Ir=new WeakMap;function Lr(e,t){let n=Ir.get(e);return n||(n=new Set,Ir.set(e,n)),n.add(t),()=>{n.delete(t)}}function Rr(e){let t=Ir.get(e);if(Ir.delete(e),!t)return;let n=!1,r;for(let e of[...t].reverse())try{e()}catch(e){n||(n=!0,r=e)}if(n)throw r instanceof Error?r:Error(`Realm cleanup failed with a non-Error value`)}function zr(e){return function(t){return{init:n=>e.init?.call(e,n,t),postInit:n=>e.postInit?.call(e,n,t),update:n=>e.update?.call(e,n,t)}}}function Br({children:e,plugins:t}){let[n,r]=I.useState(null);return I.useEffect(()=>{var e,n;let i=new wr;try{for(let n of t)(e=n.init)==null||e.call(n,i);for(let e of t)(n=e.postInit)==null||n.call(e,i)}catch(e){try{Rr(i)}catch(t){throw AggregateError([e,t],`Realm plugin initialization and cleanup both failed`)}throw e}return r(i),()=>{Rr(i)}},[]),I.useEffect(()=>{var e;if(n)for(let r of t)(e=r.update)==null||e.call(r,n)}),n?I.createElement(Dr.Provider,{value:n},e):null}function z(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Vr(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Hr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Ur=Hr&&`documentMode`in document?document.documentMode:null,Wr=Hr&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Gr=Hr&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Kr=!(!Hr||!(`InputEvent`in window)||Ur)&&`getTargetRanges`in new window.InputEvent(`input`),qr=Hr&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Jr=Hr&&/Android/.test(navigator.userAgent),Yr=Hr&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!Jr,Xr=Hr&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Zr=Hr&&Jr&&Xr,Qr=Hr&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Wr&&!Xr,$r=0,ei=1,ti=2,ni=1,ri=2,ii=3,ai=4,oi=5,si=6,ci=Yr||qr||Qr?`\xA0`:`​`,li=`
8
+
9
+ `,ui=Gr?`\xA0`:ci,di=`֑-߿יִ-﷽ﹰ-ﻼ`,fi=`A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿`;RegExp(`^[^`+fi+`]*[`+di+`]`),RegExp(`^[^`+di+`]*[`+fi+`]`);var pi={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},mi={directionless:1,unmergeable:2},hi={center:2,end:6,justify:4,left:1,right:3,start:5},gi={[ri]:`center`,[si]:`end`,[ai]:`justify`,[ni]:`left`,[ii]:`right`,[oi]:`start`},_i={normal:0,segmented:2,token:1},vi={[$r]:`normal`,[ti]:`segmented`,[ei]:`token`},yi=`$config`;function bi(){return cf()._blockCursorElement}function xi(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-slot`)}var Si=class e{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){let t=this.getInsertionAnchor();return t!==null&&t.parentElement!==this.element&&z(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&z(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&z(359),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,n){if(this.element===e)return t===e&&n===0?`before`:`after`;let r=Ci(e,this.element);if(r===null)return`after`;let i=Array.prototype.indexOf.call(e.childNodes,r);if(i<0)return`after`;if(t===e)return n<=i?`before`:`after`;let a=Ci(e,t);if(a===null)return`after`;let o=Array.prototype.indexOf.call(e.childNodes,a);return o>=0&&o<=i?`before`:`after`}getInsertionAnchor(){return this.before}};function Ci(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;return n}var wi=class e extends Si{withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;xi(t);)e=t,t=t.nextSibling;let n=e?e.nextSibling:this.element.firstChild;return n!==null&&n===bi()?n:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(this.element.__lexicalLastChildKind=e,e===null)this.removeManagedLineBreak();else{let t=e===`decorator`&&(Qr||qr||Yr);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let t=this.element,n=e.nodeName===`IMG`?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.getManagedLineBreak();if(t){if(e===(t.nodeName===`IMG`))return;this.removeManagedLineBreak()}let n=this.element,r=this.before,i=Ud().createElement(`br`);if(i.setAttribute(`data-lexical-managed-linebreak`,`true`),n.insertBefore(i,r),e){let e=Ud().createElement(`img`);e.setAttribute(`data-lexical-managed-linebreak`,`true`),e.style.setProperty(`display`,`inline`,`important`),e.style.setProperty(`border`,`0px`,`important`),e.style.setProperty(`margin`,`0px`,`important`),e.alt=``,n.insertBefore(e,i),n.__lexicalLineBreak=e}else n.__lexicalLineBreak=i}getFirstChildOffset(){let e=this.getFirstChild(),t=this.getInsertionAnchor(),n=0;for(let r=this.element.firstChild;r!==null&&r!==e&&r!==t;r=r.nextSibling)n++;return n}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset(),n=bi(),i=this.element.childNodes,a=Math.min(r,i.length),o=0;for(let e=t;e<a;e++)i[e]!==n&&o++;return[e,Math.min(o,e.getChildrenSize())]}let i=Ti(t,n);i.push(r);let a=Ti(t,this.element),o=e.getIndexWithinParent();for(let e=0;e<a.length;e++){let t=i[e],n=a[e];if(t===void 0||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}};function Ti(e,t){let n=[],r=t;for(;r!==e&&r!==null;r=r.parentNode){let e=0;for(let t=r.previousSibling;t!==null;t=t.previousSibling)e++;n.push(e)}return r!==e&&z(225),n.reverse()}var Ei;try{Ei=`0.48.0+prod.esm`}catch{}var Di=Ei??`"<unknown>+source"`,Oi=class{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){let e=Array.from(this._front).reverse();for(let t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}},ki=null;function Ai(e,t=1e3){return e instanceof ji?e.clone():e.size<t?new Map(e):new ji().init(new Map(e),void 0,e.size)}var ji=class e{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new e().init(this._old,this._nursery,this._size)}init(e,t,n){return this._old=e,this._nursery=t,this._size=n,this}get size(){return this._size}has(e){return this.get(e)!==void 0}getWithTombstone(e){let t=this._nursery&&this._nursery.get(e);return t===void 0?this._old&&this._old.get(e):t}get(e){let t=this.getWithTombstone(e);return t===ki?void 0:t}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){let e=new Map(this._old);for(let[t,n]of this._nursery)n===ki?e.delete(t):e.set(t,n);this._old=e,this._nursery=void 0}return this._mutable=!1,this}set(e,t){let n=this.getWithTombstone(e);if(n===t)return this;let r=this.getNursery();return n!==ki&&n!==void 0||(this._size++,n===ki&&r.delete(e)),r.set(e,t),this}delete(e){let t=this.has(e);return t&&(this.getNursery().set(e,ki),this._size--),t}getOrInsert(e,t){let n=this.get(e);return n===void 0?(this.set(e,t),t):n}getOrInsertComputed(e,t){let n=this.get(e);if(n!==void 0)return n;let r=t(e);return this.set(e,r),r}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(let e of this.entries())yield e[0]}*values(){for(let e of this.entries())yield e[1]}*entries(){let e=this._nursery,t=this._old;if(t)for(let n of t){let t=n[0],r=e?e.get(t):void 0;r!==ki&&(r!==void 0&&(n[1]=r),yield n)}if(e)for(let n of e)n[1]===ki||t&&t.has(n[0])||(yield n)}forEach(e,t){t!==void 0&&(e=e.bind(t));for(let[t,n]of this.entries())e(n,t,this)}get[Symbol.toStringTag](){return`GenMap`}[Symbol.iterator](){return this.entries()}};function Mi(e,t,n,r,i,a){if(W(e)){let o=e.getFirstChild();for(;o!==null;){let e=o.__key;o.__parent===t&&((W(o)||Pf(o)&&o.__slots!==null)&&Mi(o,e,n,r,i,a),n.has(e)||a.delete(e),i.push(e)),o=o.getNextSibling()}}for(let o of Pf(e)&&e.__slots!==null?e.__slots.values():[]){let e=r.get(o);e!==void 0&&Ff(e)&&e.__slotHost===t&&((W(e)||Pf(e)&&e.__slots!==null)&&Mi(e,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o))}}var Ni=!1,Pi=0;function Fi(e){Pi=e.timeStamp}function Ii(e,t,n){let r=e.nodeName===`BR`,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&Gu(e,n)!==void 0}function Li(e,t,n){let r=Id(Td(n)),i=r&&Kd(r,n._rootElement),a=null,o=null;i!==null&&i.anchorNode===e&&(a=i.anchorOffset,o=i.focusOffset);let s=e.nodeValue;s!==null&&id(t,s,a,o,!1)}function Ri(e,t,n){if(H(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return Mu(t)&&n.isAttached()}function zi(e,t,n){for(let r=e;r&&!Sf(r);r=yd(r)){let e=Gu(r,t);if(e!==void 0){let t=Hu(e,n);if(t)return Gl(t)||!K(r)?void 0:[r,t]}}}function Bi(e,t,n){Ni=!0;let r=performance.now()-Pi>100;try{Bl(e,()=>{let i=U()||function(e){return e.read(`latest`,()=>{let e=U();return e===null?null:e.clone()})}(e),a=new Map,o=e._editorState,s=e._blockCursorElement,c=!1,l=``;for(let n=0;n<t.length;n++){let u=t[n],d=u.type,f=u.target,p=zi(f,e,o);if(!p)continue;let[m,h]=p;if(d===`characterData`)r&&V(h)&&Mu(f)&&Ri(i,f,h)&&Li(f,h,e);else if(d===`childList`){c=!0;let t=u.addedNodes;for(let n=0;n<t.length;n++){let r=t[n],i=Uu(r),a=r.parentNode;if(!(a==null||r===s||i!==null||Ii(r,a,e)||e._slotsUsed&&K(r)&&r.hasAttribute(`data-lexical-slot`)||Sf(r))){if(Gr){let e=(K(r)?r.innerText:null)||r.nodeValue;e&&(l+=e)}a.removeChild(r)}}let n=u.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){let r=n[i];(Ii(r,f,e)||s===r)&&(f.appendChild(r),t++)}r!==t&&a.set(m,h)}}}if(a.size>0)for(let[t,n]of a)n.reconcileObservedMutation(t,e);let u=n.takeRecords();if(u.length>0){for(let t=0;t<u.length;t++){let n=u[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){let n=r[t],a=n.parentNode;a==null||n.nodeName!==`BR`||Ii(n,i,e)||a.removeChild(n)}}n.takeRecords()}i!==null&&(c&&Xu(i),Gr&&_d(e)&&i.insertRawText(l))})}finally{Ni=!1}}function Vi(e){let t=e._observer;t!==null&&Bi(e,t.takeRecords(),t)}function Hi(e){(function(e){Pi===0&&Td(e).addEventListener(`textInput`,Fi,!0)})(e),e._observer=new MutationObserver((t,n)=>{Bi(e,t,n)})}var Ui=`latest`,Wi=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||ea).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}};function Gi(e,t){return new Wi(e,t)}function Ki(e,t,n=Ui){let r=(n===`latest`?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function qi(e,t,n){let r;if(bl(),typeof n==`function`){let i=e.getLatest(),a=Ki(i,t);if(r=n(a),t.isEqual(a,r))return i}else r=n;let i=e.getWritable();return Zi(i).updateFromKnown(t,r),i}function Ji(e){let t=new Map,n=new Set;for(let{ownNodeConfig:r}of Of(typeof e==`function`?e:e.replace))if(r&&r.stateConfigs)for(let e of r.stateConfigs){let r;`stateConfig`in e?(r=e.stateConfig,e.flat&&n.add(r.key)):r=e,t.set(r.key,r)}return{flatKeys:n,sharedConfigMap:t}}var Yi=new Set([`__proto__`,`constructor`,`prototype`]),Xi=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState,o=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i;this.size=o}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return $i(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){if(Yi.has(i))continue;let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=$i(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){if(Yi.has(e))return;let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function Zi(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new Xi(t,Qi(t));return t.__state=n,n}function Qi(e){return e.__state?e.__state.sharedNodeState:Su(cf(),e.getType()).sharedNodeState}function $i(e){if(e)for(let t in e)return e}function ea(e){return e}function ta(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function na(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function ra(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function ia(e,t){let n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,o=t.__format,s=t.__style,c=e.__state,l=t.__state;return(n===null||n===a)&&(r===null||r===o)&&(i===null||i===s)&&(e.__state===null||c===l||function(e,t){if(e===t)return!0;let n=new Set;return!(e&&ta(n,e,t)||t&&ta(n,t,e)||e&&na(n,e,t)||t&&na(n,t,e))}(c,l))}function aa(e,t){let n=e.mergeWithSibling(t),r=wl()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function oa(e){let t,n,r=e;if(r.__text!==``||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&V(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==``){if(ia(t,r)){r=aa(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&V(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==``){if(ia(r,n)){r=aa(r,n);break}break}n.remove()}}else r.remove()}function sa(e){return ca(e.anchor),ca(e.focus),e}function ca(e){for(;e.type===`element`;){let t=e.getNode(),n=e.offset,r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),V(r)){e.set(r.__key,i?r.getTextContentSize():0,`text`,!0);break}if(!W(r))break;e.set(r.__key,i?r.getChildrenSize():0,`element`,!0)}}var la=Symbol.for(`@lexical/CachedTextSize`);function ua(e,t){return Da.read(()=>{let n=0,r=e;for(let e=0;e<t&&r!==null;e++){let i=Ea.get(r);if(i===void 0&&z(345,r),W(i)){let a=Oa.get(r);if(a!==void 0&&W(a)&&a.__parent!==i.__parent)n+=i.getTextContentSize();else{let e=ka.get(r),t=e&&e.__lexicalTextContent;typeof t!=`string`&&z(346,i.getType()),n+=t.length}e<t-1&&!i.isInline()&&(n+=2)}else{let e=i[la];e===void 0&&z(347,i.getType(),r),n+=e}r=i.__next}return n},{editor:ma})}function da(e){W(e)||e[la]===void 0&&(e[la]=V(e)?e.__text.length:e.getTextContentSize())}var fa=4,pa,ma,ha,ga=``,_a=null,va=null,ya=null;function ba(){return{firstTextKey:ya,format:_a,style:va}}function xa(e){e.firstTextKey!==null&&(_a=e.format,va=e.style,ya=e.firstTextKey)}function Sa(e){if(ya!==null)return;let t=e.__lexicalFirstTextKey;if(t===void 0&&z(348),t===null)return;let n=Oa.get(t);V(n)&&(_a=n.getFormat(),va=n.getStyle(),ya=t)}var Ca,wa,Ta,Ea,Da,Oa,ka,Aa,ja,Ma,Na=!1,Pa=!1;function Fa(e,t){let n=Ea.get(e),r=Oa.has(e);if(t!==null){let n=ao(e);n.parentNode===t&&t.removeChild(n)}if(!r){if(ma._keyToDOMMap.delete(e),W(n)){let e=jf(n,Ea);Ia(e,0,e.length-1,null)}if(n!==void 0){for(let e of Ga(n).values()){let t=qa(e);Fa(e,null),t!==null&&t.remove()}md(ja,ha,Ca,n,`destroyed`)}}}function Ia(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];t!==void 0&&Fa(t,r)}}function La(e,t){e.setProperty(`text-align`,t)}var Ra=`40px`;function za(e,t){let n=pa.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}e.style.setProperty(`padding-inline-start`,t===0?``:`calc(${t} * var(--lexical-indent-base-value, ${Ra}))`)}function Ba(e,t){let n=e.style;t===0?La(n,``):t===1?La(n,`left`):t===2?La(n,`center`):t===3?La(n,`right`):t===4?La(n,`justify`):t===5?La(n,`start`):t===6&&La(n,`end`)}function Va(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(ql(e))return null;let n=e.getParent();return n===null||kd(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function Ha(e){let t=Ud().createElement(`div`);return t.setAttribute(`data-lexical-slot`,e),t.style.display=`none`,t}function Ua(e,t,n){t||e.contentEditable===`false`?Cf(n,ma):n.removeAttribute(`contenteditable`)}function Wa(e,t,n){let r=ga,i=ba();ga=``;let a=``,o=Gl(e);for(let[r,i]of n){let n=Ha(r);Ua(t,o,n),t.appendChild(n),ga=``;let s=ba();Ya(i,uf(e,n,ma)),xa(s),Ka(e,r,t,n),a+=ga}return xa(i),ga=r,a}function Ga(e){return Pf(e)&&e.__slots!==null?e.__slots:Nf}function Ka(e,t,n,r){let i=Ma.$getSlotTargetElement(e,t,n,ma);i!==null&&(r.parentElement!==i&&i.appendChild(r),r.style.display=``)}function qa(e){let t=ka.get(e);return t===void 0?null:t.parentElement}function Ja(e,t,n){let r=Ga(e),i=Ga(t);for(let[e,t]of r)if(!i.has(e)){let e=qa(t);Fa(t,null),e!==null&&e.remove()}let a=ga,o=ba(),s=``,c=null,l=Gl(t);for(let[e,a]of i){let i=r.get(e),o=i===void 0?null:qa(i);ga=``;let u=ba();if(o===null){o=Ha(e);let r=null;for(let e of n.children)if(!e.hasAttribute(`data-lexical-slot`)){r=e;break}n.insertBefore(o,r),Ya(a,uf(t,o,ma))}else i===a?eo(a,o):(i!==void 0&&Fa(i,o),Ya(a,uf(t,o,ma)));if(xa(u),Ua(n,l,o),Ka(t,e,n,o),s+=ga,o.parentElement===n){let e=c===null?n.firstChild:c.nextSibling;e!==o&&n.insertBefore(o,e),c=o}}return xa(o),ga=a,s}function Ya(e,t){let n=Oa.get(e);if(n===void 0&&z(60),t!==null){let r=Ea.get(e);if(r!==void 0){let i=ka.get(e);if(i!==void 0){let a=Ff(r)?r.__slotHost:null,o=Ff(n)?n.__slotHost:null,s=r.__parent!==n.__parent||a!==o,c=o!==null&&i.parentElement!==t.element;if(s||c)return t.insertChild(i),eo(e,t.element)}}}let r=Ma.$createDOM(n,ma);if(function(e,t,n){let r=n._keyToDOMMap;Wu(t,n,e),r.set(e,t)}(e,r,ma),V(n)?r.setAttribute(`data-lexical-text`,`true`):Gl(n)&&(r.setAttribute(`data-lexical-decorator`,`true`),xf(r,{captureSelection:!0})),W(n)){let e=n.__indent,t=n.__size;Va(r,n),e!==0&&za(r,e);let i=Ga(n),a=i.size>0?Wa(n,r,i):``;if(t===0)r.__lexicalTextContent=a,r.__lexicalFirstTextKey=null,ga+=a,i.size>0&&(r.__lexicalSlotTextLength=a.length);else{let e=ga,o=t-1;if(Xa(jf(n,Oa),n,0,o,uf(n,r,ma)),a!==``){let t=r.__lexicalTextContent||``;r.__lexicalTextContent=a+t,ga=e+a+t}i.size>0&&(r.__lexicalSlotTextLength=a.length)}let o=n.__format;o!==0&&Ba(r,o),n.isInline()||Za(null,n,r)}else{let t=n.getTextContent();if(Gl(n)){let t=n.decorate(ma,pa);t!==null&&to(e,t),r.contentEditable=`false`;let i=Ga(n);i.size>0&&Wa(n,r,i)}ga+=t}return t!==null&&t.insertChild(r),Ma.$decorateDOM(n,null,r,ma),da(n),md(ja,ha,Ca,n,`created`),r}function Xa(e,t,n,r,i){let a=ga,o=ba();ga=``,_a=null,va=null,ya=null;let s=n;for(;s<=r;++s){let t=ba();Ya(e[s],i);let n=Oa.get(e[s]);n!==null&&V(n)?_a===null&&(_a=n.getFormat(),va=n.getStyle(),ya=n.__key):W(n)&&s<r&&!n.isInline()&&(ga+=li),xa(t)}let c=ma._keyToDOMMap.get(t.__key);c===void 0&&z(349,t.__key),c.__lexicalTextContent=ga,c.__lexicalFirstTextKey=ya,ga=a+ga,xa(o)}function Za(e,t,n){let r=uf(t,n,ma),i=r.element.__lexicalLastChildKind??null,a=function(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return ru(e)?`line-break`:Gl(e)&&e.isInline()?`decorator`:null}return Ga(e).size>0?null:`empty`}return null}(t,Oa);i!==a&&r.setManagedLineBreak(a)}function Qa(e,t,n){var r;_a=null,va=null,ya=null,function(e,t,n){let r=ga,i=e.__size,a=t.__size;ga=``;let o=n.element,s=ma._keyToDOMMap.get(t.__key);s===void 0&&z(351,t.__key);let c=a-i;if(!Na&&Math.abs(c)<=1&&i>=fa&&e.__first===t.__first&&(c!==0||!ma._cloneNotNeeded.has(e.__key))){let i=s.__lexicalTextContent,l=Aa.get(e.__key);if(!Na&&typeof i==`string`&&l!==void 0){let a=function(e,t){let n=t.size;if(n===0||n>=e.__size)return null;let r=e.__last,i=null,a=0;for(;r!==null&&a<n;){if(!t.has(r))return null;i=r;let e=Oa.get(r);if(e===void 0)return null;r=e.__prev,a++}return a!==n||r!==null&&t.has(r)?null:i}(t,l);if(a!==null){let u=l.size;if(c===0){let e=ua(a,u),n=a,c=0;for(;n!==null&&c<u;){let e=Oa.get(n);if(e===void 0)break;let t=ba();eo(n,o),V(e)&&_a===null&&(_a=e.getFormat(),va=e.getStyle(),ya=e.__key),xa(t),n=e.__next,c++}let d=``;for(n=a,c=0;n!==null&&c<u;){let e=Oa.get(n);if(e===void 0)break;let t;if(W(e)){let r=ma._keyToDOMMap.get(n),i=r&&r.__lexicalTextContent;typeof i!=`string`&&z(352,e.getType()),t=i}else t=e.getTextContent();d+=t,c<u-1&&W(e)&&!e.isInline()&&(d+=li),n=e.__next,c++}let f=s.__lexicalSlotTextLength||0,p=f>0?i.slice(f):i,m=p.slice(0,p.length-e)+d;s.__lexicalTextContent=m,ga=r+m,$a(t,s,l);return}if(function(e,t,n,r,i,a,o,s){if(s!==1&&s!==-1||o!==(s===1?2:1))return!1;let c=o-s,l=e.__last;for(let e=0;e<c-1;e++){if(l===null)return!1;let e=Ea.get(l);if(e===void 0)return!1;l=e.__prev}if(l===null)return!1;let u=Oa.get(a),d=Ea.get(l);if(u===void 0||d===void 0||u.__prev!==d.__prev)return!1;let f=[],p=a;for(let e=0;e<o;e++){if(p===null)return!1;f.push(p);let e=Oa.get(p);p=e?e.__next:null}let m=[];p=l;for(let e=0;e<c;e++){if(p===null)return!1;m.push(p);let e=Ea.get(p);p=e?e.__next:null}let h=new Set(m),g=new Set(f),_=[],v=0,y=0;for(;v<c&&y<o;)if(f[y]===m[v])_.push({key:f[y],kind:`reconcile`}),v++,y++;else if(g.has(m[v])){if(h.has(f[y]))return!1;_.push({key:f[y],kind:`create`,nextIndex:y}),y++}else _.push({key:m[v],kind:`destroy`}),v++;for(;v<c;)_.push({key:m[v++],kind:`destroy`});for(;y<o;)_.push({key:f[y],kind:`create`,nextIndex:y}),y++;let b=ua(l,c);for(let e of _){let t=ba();if(e.kind===`reconcile`)eo(e.key,n.element);else if(e.kind===`destroy`)Fa(e.key,n.element);else{let t=null;for(let n=e.nextIndex+1;n<o;n++){let e=ma._keyToDOMMap.get(f[n]);if(e!==void 0){t=e;break}}Ya(e.key,n.withBefore(t??n.before))}if(e.kind!==`destroy`){let t=Oa.get(e.key);t&&V(t)&&_a===null&&(_a=t.getFormat(),va=t.getStyle(),ya=t.__key)}xa(t)}let x=``;for(let e=0;e<o;e++){let t=Oa.get(f[e]);if(t===void 0)return!1;let n;if(W(t)){let r=ma._keyToDOMMap.get(f[e]),i=r&&r.__lexicalTextContent;typeof i!=`string`&&z(350,t.getType()),n=i}else n=t.getTextContent();x+=n,e<o-1&&W(t)&&!t.isInline()&&(x+=li)}let S=r.__lexicalSlotTextLength||0,C=S>0?i.slice(S):i;return r.__lexicalTextContent=C.slice(0,C.length-b)+x,!0}(e,0,n,s,i,a,u,c)){let e=s.__lexicalTextContent;typeof e!=`string`&&z(353),ga=r+e,$a(t,s,l);return}}}if(c===0){let t=e.__first,n=0;for(;t!==null;){let e=Oa.get(t);if(e===void 0)break;let r=Na||Ta.has(t)||wa.has(t),i=ba();if(r)eo(t,o);else{let n,r;if(W(e)){r=ka.get(t);let i=r&&r.__lexicalTextContent;typeof i!=`string`&&z(354,e.getType()),n=i}else n=e.getTextContent();ga+=n,r!==void 0&&Sa(r)}V(e)?_a===null&&(_a=e.getFormat(),va=e.getStyle(),ya=e.__key):W(e)&&n<a-1&&!e.isInline()&&(ga+=li),xa(i),t=e.__next,n++}s.__lexicalTextContent=ga,s.__lexicalFirstTextKey=ya,ga=r+ga;return}}if(i===1&&a===1){let r=e.__first,i=t.__first;if(r===i)eo(r,o);else{let e=ao(r),t=Ya(i,null);try{e.parentNode===o?o.replaceChild(t,e):n.insertChild(t)}catch(n){if(typeof n==`object`&&n){let a=`${n.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${i}}, old child: {tag: ${e.tagName}, key: ${r}}.`;throw Error(a)}throw n}Fa(r,null)}let a=Oa.get(i);V(a)&&_a===null&&(_a=a.getFormat(),va=a.getStyle(),ya=a.__key)}else{let r=jf(e,Ea),s=jf(t,Oa);if(r.length!==i&&z(227),s.length!==a&&z(228),i===0)a!==0&&Xa(s,t,0,a-1,n);else if(a===0){if(i!==0){let e=n.after==null&&n.before==null&&Ga(t).size===0&&n.element.__lexicalLineBreak==null;Ia(r,0,i-1,e?null:o),e&&(o.textContent=``)}}else(function(e,t,n,r,i,a){let o=r-1,s=i-1,c,l,u=a.getFirstChild(),d=0,f=0;for(;d<=o&&f<=s;){let e=t[d],r=n[f],i=ba();if(e===r)u=no(eo(r,a.element)),d++,f++;else{if(l===void 0&&(l=ro(n,f)),c===void 0)c=ro(t,d);else if(!c.has(e)){d++,xa(i);continue}if(!l.has(e)){u=no(ao(e)),Fa(e,a.element),d++,c.delete(e),xa(i);continue}if(c.has(r)){let e=vd(ma,r);e!==u&&a.withBefore(u??a.before).insertChild(e),u=no(eo(r,a.element)),d++,f++}else Ya(r,a.withBefore(u??a.before)),f++}let o=Oa.get(r);o!==null&&V(o)?_a===null&&(_a=o.getFormat(),va=o.getStyle(),ya=o.__key):W(o)&&f<=s&&!o.isInline()&&(ga+=li),xa(i)}let p=d>o,m=f>s;if(p&&!m){let t=n[s+1],r=t===void 0?null:ma.getElementByKey(t);Xa(n,e,f,s,a.withBefore(r??a.before))}else m&&!p&&Ia(t,d,o,a.element)})(t,r,s,i,a,n)}s.__lexicalTextContent=ga,s.__lexicalFirstTextKey=ya,ga=r+ga}(e,t,uf(t,n,ma)),kd(t)||(r=t,_a==null||_a===r.__textFormat||Pa||r.setTextFormat(_a),function(e){va==null||va===e.__textStyle||Pa||e.setTextStyle(va)}(t))}function $a(e,t,n){let r=t.__lexicalFirstTextKey;if(r!=null){let t=e.__key,i=r;for(;i!==null;){let e=Oa.get(i);if(e===void 0){i=null;break}if(e.__parent===t)break;i=e.__parent}if(i!==null&&!n.has(i)){let e=Oa.get(r);if(V(e))return _a=e.getFormat(),void(va=e.getStyle())}}t.__lexicalFirstTextKey=ya}function eo(e,t){let n=Ea.get(e),r=Oa.get(e);n!==void 0&&r!==void 0||z(61);let i=Na||Ta.has(e)||wa.has(e),a=vd(ma,e);if(n===r&&!i){let e;if(W(n)){let t=a.__lexicalTextContent;typeof t!=`string`&&z(355,n.getType()),e=t,Sa(a)}else e=n.getTextContent();return ga+=e,a}if(n!==r&&i&&md(ja,ha,Ca,r,`updated`),Ma.$updateDOM(r,n,a,ma)){let n=Ya(e,null);return t===null&&z(62),t.replaceChild(n,a),Fa(e,null),n}if(W(n)){W(r)||z(334,e);let t=r.__indent;(Na||t!==n.__indent)&&za(a,t);let o=r.__format;(Na||o!==n.__format)&&Ba(a,o);let s=i&&(Ga(r).size>0||Ga(n).size>0)?Ja(n,r,a):``;if(i){let e=ga;if(Qa(n,r,a),ql(r)||r.isInline()||Za(0,r,a),s!==``){let t=a.__lexicalTextContent||``;a.__lexicalTextContent=s+t,ga=e+s+t,a.__lexicalSlotTextLength=s.length}else(Ga(r).size>0||Ga(n).size>0)&&(a.__lexicalSlotTextLength=0)}else{let e=a.__lexicalTextContent;typeof e!=`string`&&z(356,n.getType()),ga+=e,Sa(a)}if((Na||r.__dir!==n.__dir||r.__parent!==n.__parent)&&(Va(a,r),ql(r)&&!Na))for(let e of r.getChildren())W(e)&&Va(vd(ma,e.getKey()),e)}else{let t=r.getTextContent();if(Gl(r)){let t=r.decorate(ma,pa);t!==null&&to(e,t),i&&(Ga(r).size>0||Ga(n).size>0)&&Ja(n,r,a)}ga+=t}if(!Pa&&ql(r)){let e=r.getLatest();if(e.__cachedText!==ga){let t=e.getWritable();t.__cachedText=ga,r=t}}return Ma.$decorateDOM(r,n,a,ma),da(r),a}function to(e,t){let n=ma._pendingDecorators,r=ma._decorators;if(n===null){if(r[e]===t)return;n=qu(ma)}n[e]=t}function no(e){let t=e.nextSibling;return t!==null&&t===ma._blockCursorElement&&(t=t.nextSibling),t}function ro(e,t){let n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function io(e,t,n,r,i,a){ga=``,_a=null,va=null,ya=null,Na=r===2,ma=n,pa=n._config,Ma=n._config.dom||mu,ha=n._nodes,Ca=ma._listeners.mutation,wa=i,Ta=a,Ea=e._nodeMap,Da=e,Oa=t._nodeMap,Pa=t._readOnly,ka=Ai(n._keyToDOMMap),Aa=function(){let e=new Map,t=t=>{for(let n of t){let t=Oa.get(n);if(t===void 0)continue;let r=t.__parent;if(r===null)continue;let i=e.get(r);i===void 0&&(i=new Set,e.set(r,i)),i.add(n)}};return t(wa.keys()),t(Ta),e}();let o=new Map;return ja=o,eo(`root`,null),ma=void 0,ha=void 0,wa=void 0,Ta=void 0,Ea=void 0,Da=void 0,Oa=void 0,pa=void 0,ka=void 0,Aa=void 0,ja=void 0,Ma=mu,o}function ao(e){let t=ka.get(e);return t===void 0&&z(75,e),t}function B(e){return{type:e}}var oo=B(`SELECTION_CHANGE_COMMAND`),so=B(`SELECTION_INSERT_CLIPBOARD_NODES_COMMAND`),co=B(`CLICK_COMMAND`),lo=B(`BEFORE_INPUT_COMMAND`),uo=B(`INPUT_COMMAND`),fo=B(`COMPOSITION_START_COMMAND`),po=B(`COMPOSITION_END_COMMAND`),mo=B(`DELETE_CHARACTER_COMMAND`),ho=B(`INSERT_LINE_BREAK_COMMAND`),go=B(`INSERT_PARAGRAPH_COMMAND`),_o=B(`CONTROLLED_TEXT_INSERTION_COMMAND`),vo=B(`PASTE_COMMAND`),yo=B(`REMOVE_TEXT_COMMAND`),bo=B(`DELETE_WORD_COMMAND`),xo=B(`DELETE_LINE_COMMAND`),So=B(`FORMAT_TEXT_COMMAND`),Co=B(`SET_TEXT_FORMAT_COMMAND`),wo=B(`UNDO_COMMAND`),To=B(`REDO_COMMAND`),Eo=B(`KEYDOWN_COMMAND`),Do=B(`KEY_ARROW_RIGHT_COMMAND`),Oo=B(`MOVE_TO_END`),ko=B(`KEY_ARROW_LEFT_COMMAND`),Ao=B(`MOVE_TO_START`),jo=B(`KEY_ARROW_UP_COMMAND`),Mo=B(`KEY_ARROW_DOWN_COMMAND`),No=B(`KEY_ENTER_COMMAND`),Po=B(`KEY_SPACE_COMMAND`),Fo=B(`KEY_BACKSPACE_COMMAND`),Io=B(`KEY_ESCAPE_COMMAND`),Lo=B(`KEY_DELETE_COMMAND`),Ro=B(`KEY_TAB_COMMAND`),zo=B(`INSERT_TAB_COMMAND`),Bo=B(`INDENT_CONTENT_COMMAND`),Vo=B(`OUTDENT_CONTENT_COMMAND`),Ho=B(`DROP_COMMAND`),Uo=B(`FORMAT_ELEMENT_COMMAND`),Wo=B(`DRAGSTART_COMMAND`),Go=B(`DRAGOVER_COMMAND`),Ko=B(`DRAGEND_COMMAND`),qo=B(`COPY_COMMAND`),Jo=B(`CUT_COMMAND`),Yo=B(`SELECT_ALL_COMMAND`),Xo=B(`CLEAR_EDITOR_COMMAND`),Zo=B(`CLEAR_HISTORY_COMMAND`),Qo=B(`CAN_REDO_COMMAND`),$o=B(`CAN_UNDO_COMMAND`),es=B(`FOCUS_COMMAND`),ts=B(`BLUR_COMMAND`),ns=B(`KEY_MODIFIER_COMMAND`);function rs(e){let t=new Map;return{dispose(){for(let e of t.values())e.dispose();t.clear()},register(n,r){let i=t.get(n);i===void 0&&(i={dispose:e(n,r),holders:new Set},t.set(n,i));let a=()=>{let e=t.get(n);e&&e.holders.delete(a)&&e.holders.size===0&&(t.delete(n),e.dispose())};return i.holders.add(a),a}}}function is(e,t,n,r){return e.addEventListener(t,n,r),e.removeEventListener.bind(e,t,n,r)}var as=Object.freeze({}),os=[[`keydown`,function(e,t){let n=t._inputState;n.lastKeyDownTimeStamp=e.timeStamp,n.lastKeyCode=e.key,e.key!==`Backspace`&&_s(n),!t.isComposing()&&G(t,Eo,e)}],[`pointerdown`,function(e,t){let n=Qd(e),r=e.pointerType;ef(n)&&r!==`touch`&&r!==`pen`&&e.button===0&&Bl(t,()=>{wf(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}],[`compositionstart`,function(e,t){G(t,fo,e)}],[`compositionend`,function(e,t){let n=t._inputState;Gr?n.compositionPhase=`ending-firefox`:qr||!Yr&&!Qr?G(t,po,e):(n.compositionPhase=`ending-safari`,n.compositionEndData=e.data)}],[`input`,function(e,t){e.stopPropagation();let n=t._inputState;_s(n),Bl(t,()=>{ys(e,t)||t.dispatchCommand(uo,e)},{event:e}),n.unprocessedBeforeInputData=null}],[`click`,function(e,t){Bl(t,()=>{let n=U(),r=Id(Td(t)),i=Jc();if(r){if(H(n)){let e=n.anchor,t=e.getNode();e.type===`element`&&e.offset===0&&n.isCollapsed()&&!ql(t)&&Yu().getChildrenSize()===1&&t.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i)&&(r.removeAllRanges(),n.dirty=!0)}else if(e.pointerType===`touch`||e.pointerType===`pen`){let n=Kd(r,t._rootElement).anchorNode;(K(n)||Mu(n))&&Xu(qc(i,r,t,e))}}G(t,co,e)})}],[`cut`,as],[`copy`,as],[`dragstart`,as],[`dragover`,as],[`dragend`,as],[`paste`,as],[`focus`,as],[`blur`,as],[`drop`,as]];Kr&&os.push([`beforeinput`,(e,t)=>function(e,t){let n=e.inputType;n===`deleteCompositionText`||Gr&&_d(t)||n!==`insertCompositionText`&&Bl(t,()=>{ys(e,t)||G(t,lo,e)},{event:e})}(e,t)]);var ss=new WeakMap,cs=new WeakMap,ls=rs(e=>(e.addEventListener(`selectionchange`,ks),()=>e.removeEventListener(`selectionchange`,ks)));function us(e,t,n,r,i,a){let o=e.anchor,s=e.focus,c=o.getNode(),l=wl(),u;if(a!==void 0)u=a;else{let e=Id(Td(l));u=e===null?null:Kd(e,l._rootElement)}let d=u===null?null:u.anchorNode,f=o.key,p=l.getElementByKey(f),m=n.length;return f!==s.key||!V(c)||(!i&&(!Kr||l._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||c.isDirty()&&m<2||$u(n))&&o.offset!==s.offset&&!c.isComposing()||ju(c)||c.isDirty()&&m>1||(i||!Kr)&&p!==null&&!c.isComposing()&&d!==ff(c,p,l)||u!==null&&t!==null&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||!c.isComposing()&&(c.getFormat()!==e.format||c.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=Au(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(V(t)||W(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,c)}function ds(e,t){return Mu(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function fs(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=Kd(e,t._rootElement),s=t._inputState;s.isSelectionChangeFromDOMUpdate&&(s.isSelectionChangeFromDOMUpdate=!1,ds(r,i)&&ds(a,o)&&!s.postDeleteSelectionToRestore)||Bl(t,()=>{if(!n)return void Xu(null);if(!Eu(t,r,a))return;let c=U();if(s.postDeleteSelectionToRestore&&H(c)&&c.isCollapsed()){let e=c.anchor,t=s.postDeleteSelectionToRestore.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(c=s.postDeleteSelectionToRestore.clone(),Xu(c))}if(s.postDeleteSelectionToRestore=null,H(c)){let n=c.anchor,l=n.getNode();if(c.isCollapsed()){e.type===`Range`&&r===a&&(c.dirty=!0);let i=Td(t).event,o=i?i.timeStamp:performance.now(),{format:u,style:d,offset:f,key:p,timeStamp:m}=s.collapsedSelectionFormat,h=Yu(),g=!1===t.isComposing()&&h.getTextContent()===``;if(o<m+200&&n.offset===f&&n.key===p)ps(c,u,d);else if(n.type===`text`)V(l)||z(141),ms(c,l);else if(n.type===`element`&&!g){W(l)||z(259);let e=n.getNode();e.isEmpty()?function(e,t){ps(e,t.getTextFormat(),t.getTextStyle())}(c,e):ps(c,c.format,``)}}else{let e=n.key,t=c.focus.key,r=c.getNodes(),a=r.length,s=c.isBackward(),l=s?o:i,u=s?i:o,d=s?t:e,f=s?e:t,p=2047,m=!1;for(let e=0;e<a;e++){let t=r[e],n=t.getTextContentSize();if(V(t)&&n!==0&&!(e===0&&t.__key===d&&l===n||e===a-1&&t.__key===f&&u===0)&&(m=!0,p&=t.getFormat(),p===0))break}c.format=m?p:0}}G(t,oo,void 0)})}function ps(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function ms(e,t){ps(e,t.getFormat(),t.getStyle())}function hs(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function gs(e){let{lastKeyCode:t}=wl()._inputState;if(e==null||e.length<=1||t==null)return;let n=t.length===1?t:t===`Enter`?`
10
+ `:t===`Tab`?` `:null;if(!n)return;let r=U();if(!H(r)||!r.isCollapsed())return;let i=r.anchor.getNode();if(!V(i))return;let{offset:a}=r.anchor;if(i.getTextContentSize()===a){let e=i.getNextSibling();if(n===`
11
+ `){if(ru(e))e.selectEnd();else if(!e){let e=Af(i,Uc),t=e&&e.getNextSibling();W(t)&&t.selectStart()}}else n===` `?hc(e)&&e.selectEnd():V(e)&&e.getTextContent()[0]===n&&e.select(1,1)}else i.getTextContent()[a]===n&&i.select(a+1,a+1)}function _s(e){e.isInsertTextAfterHandledSelectionCommand=!1,e.handledSelectionCommandTimeoutId!==null&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function vs(e){_s(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>_s(e),0)}function ys(e,t){let n=Qd(e);if(K(n)&&wf(n,t))return!0;let r=t.getRootElement();if(r===null)return!1;let i=Zd(r.ownerDocument);return i!==null&&r.contains(i)&&wf(i,t)}function bs(e){let t=e.inputType,n=hs(e),r=wl(),i=r._inputState,a=U();if(t===`insertText`&&e.data&&i.isInsertTextAfterHandledSelectionCommand){if(_s(i),e.preventDefault(),H(a)&&!a.isCollapsed()){let e=a.isBackward()?a.anchor:a.focus;a.anchor.set(e.key,e.offset,e.type),a.focus.set(e.key,e.offset,e.type)}return!0}if(t===`deleteContentBackward`){if(a===null){let e=Jc();if(!H(e))return!0;Xu(e.clone())}if(H(a)){let t=a.anchor.key===a.focus.key;if(function(e,t){return e.lastKeyCode===`MediaLast`&&t<e.lastKeyDownTimeStamp+30}(i,e.timeStamp)&&r.isComposing()&&t){if(Bu(null),i.lastKeyDownTimeStamp=0,setTimeout(()=>{Bl(r,()=>{Bu(null)})},30),H(a)){let e=a.anchor.getNode();e.markDirty(),V(e)||z(142),ms(a,e)}}else{if(Bu(null),qr&&n!==null&&!n.collapsed&&(a.applyDOMRange(n),!a.isCollapsed()))return e.preventDefault(),a.removeText(),!0;e.preventDefault();let o=a.anchor.getNode(),s=o.getTextContent(),c=o.canInsertTextAfter(),l=a.anchor.offset===0&&a.focus.offset===s.length,u=Zr&&t&&!l&&c;if(u&&a.isCollapsed()&&(u=!Gl(gd(a.anchor,!0))),!u){G(r,mo,!0);let e=U();Zr&&H(e)&&e.isCollapsed()&&(i.postDeleteSelectionToRestore=e,setTimeout(()=>i.postDeleteSelectionToRestore=null))}}return!0}}if(!H(a))return!0;let o=e.data;i.unprocessedBeforeInputData!==null&&rd(!1,r,i.unprocessedBeforeInputData),a.dirty&&i.unprocessedBeforeInputData===null||!a.isCollapsed()||ql(a.anchor.getNode())||n===null||a.applyDOMRange(n),i.unprocessedBeforeInputData=null;let s=a.anchor,c=a.focus,l=s.getNode(),u=c.getNode();if(t===`insertText`||t===`insertTranspose`){if(o===`
12
+ `)e.preventDefault(),G(r,ho,!1);else if(o===li)e.preventDefault(),G(r,go,void 0);else if(o==null&&e.dataTransfer){let t=e.dataTransfer.getData(`text/plain`);e.preventDefault(),a.insertRawText(t)}else o!=null&&us(a,n,o,e.timeStamp,!0)?(e.preventDefault(),G(r,_o,o),gs(o)):i.unprocessedBeforeInputData=o;return i.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),t){case`insertFromYank`:case`insertFromDrop`:case`insertReplacementText`:G(r,_o,e),gs((e.dataTransfer?e.dataTransfer.getData(`text/plain`):null)??e.data);break;case`insertFromComposition`:{let t=i.hadOrphanedCompositionEvents;i.hadOrphanedCompositionEvents=!1;let n=r._compositionKey;Bu(null),t||G(r,_o,e),ws(n);break}case`insertLineBreak`:Bu(null),G(r,ho,!1);break;case`insertParagraph`:Bu(null),i.isInsertLineBreak&&!qr?(i.isInsertLineBreak=!1,G(r,ho,!1)):G(r,go,void 0);break;case`insertFromPaste`:case`insertFromPasteAsQuotation`:G(r,vo,e);break;case`deleteByComposition`:(function(e,t){return e!==t||W(e)||W(t)||!Au(e)||!Au(t)})(l,u)&&G(r,yo,e);break;case`deleteByDrag`:xd(Us),G(r,yo,e);break;case`deleteByCut`:G(r,yo,e);break;case`deleteContent`:G(r,mo,!1);break;case`deleteWordBackward`:G(r,bo,!0);break;case`deleteWordForward`:G(r,bo,!1);break;case`deleteHardLineBackward`:case`deleteSoftLineBackward`:G(r,xo,!0);break;case`deleteContentForward`:case`deleteHardLineForward`:case`deleteSoftLineForward`:G(r,xo,!1);break;case`formatStrikeThrough`:G(r,So,`strikethrough`);break;case`formatBold`:G(r,So,`bold`);break;case`formatItalic`:G(r,So,`italic`);break;case`formatUnderline`:G(r,So,`underline`);break;case`historyUndo`:G(r,wo,void 0);break;case`historyRedo`:G(r,To,void 0)}return!0}function xs(e){let t=wl(),n=t._inputState,r=U(),i=e.data,a=hs(e),o=!1;if(i!=null&&H(r)){let s=Id(Td(t)),c=s===null?null:Kd(s,t._rootElement),l=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&!t.isComposing();l&&(n.hadOrphanedCompositionEvents=!0);let u=r.anchor.getNode(),d=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&t.isComposing()&&V(u)&&ju(u);if(!l&&!d&&us(r,a,i,e.timeStamp,!1,c)){if(o=!0,n.compositionPhase===`ending-firefox`){let e=Ts(t,i);if(n.compositionPhase=`idle`,e)return xd(Ws),Zu(),!0}let a=r.anchor.getNode();if(s===null||c===null)return!0;let l=r.isBackward(),u=l?r.anchor.offset:r.focus.offset,d=l?r.focus.offset:r.anchor.offset;Kr&&!r.isCollapsed()&&V(a)&&c.anchorNode!==null&&a.getTextContent().slice(0,u)+i+a.getTextContent().slice(u+d)===nd(c.anchorNode)||G(t,_o,i);let f=i.length;Gr&&f>1&&e.inputType===`insertCompositionText`&&!t.isComposing()&&(r.anchor.offset-=f,r._cachedNodes=null,r._cachedIsBackward=null),Zr&&t.isComposing()&&(n.lastKeyDownTimeStamp=0,Bu(null))}}return o||(rd(!1,t,i===null?void 0:i),n.compositionPhase===`ending-firefox`&&(Ts(t,i||void 0),xd(`composition-end`),n.compositionPhase=`idle`)),Zu(),!0}function Ss(e){let t=wl(),n=t._inputState,r=U();if(H(r)&&!t.isComposing()){n.compositionPhase=`composing`,n.hadOrphanedCompositionEvents=!1;let i=r.anchor,a=r.anchor.getNode();if(Bu(i.key),xd(`composition-start`),e.timeStamp<n.lastKeyDownTimeStamp+30||i.type===`element`||!r.isCollapsed()||!Zr&&(a.getFormat()!==r.format||V(a)&&a.getStyle()!==r.style)||V(a)&&(ju(a)||i.offset===0&&!a.canInsertTextBefore()||i.offset===a.getTextContentSize()&&!a.canInsertTextAfter())){G(t,_o,ui);let e=U();H(e)&&Bu(e.anchor.key)}}return!0}function Cs(e){let t=wl();return t._inputState.compositionPhase=`idle`,Ts(t,e.data),xd(Ws),!0}function ws(e){if(e===null)return;let t=Hu(e);if(!V(t)||t.getType()===`text`||ju(t)||!t.isAttached())return;let n=U(),r=H(n)&&n.anchor.key===e?n.anchor.offset:null,i=dc(t.getTextContent());if(i.setFormat(t.getFormat()),i.setStyle(t.getStyle()),t.replace(i),r!==null){let e=Math.min(r,i.getTextContentSize());i.select(e,e)}}function Ts(e,t){let n=e._compositionKey;if(Bu(null),n!==null&&t!=null){if(t===``){let t=Hu(n),r=e.getElementByKey(n),i=r!==null&&V(t)?ff(t,r,e):null;if(i!==null&&i.nodeValue!==null&&V(t)){let n=Id(Td(e)),r=n&&Kd(n,e._rootElement),a=null,o=null;r!==null&&r.anchorNode===i&&(a=r.anchorOffset,o=r.focusOffset),id(t,i.nodeValue,a,o,!0)}return ws(n),!1}if(t[t.length-1]===`
13
+ `){let t=U();if(H(t)||Cc(t)){if(H(t)){let e=t.focus;t.anchor.set(e.key,e.offset,e.type)}return G(e,No,null),ws(n),!1}}let r=Hu(n);if(r!==null&&V(r)&&ju(r)){r.markDirty();let e=U(),i=r.getTextContentSize(),a=H(e)&&e.anchor.key===n?e.anchor.offset:i;return r.select(a,a).insertText(t),!0}}return rd(!0,e,t),ws(n),!1}function Es(e){let t=wl(),n=t._inputState;if(e.key==null)return!0;if(n.compositionPhase===`ending-safari`){let r=dd(e);if(r&&Bl(t,()=>{Ts(t,n.compositionEndData)}),n.compositionPhase=`idle`,n.compositionEndData=``,r)return!0}if(function(e){return cd(e,`ArrowRight`,{shiftKey:`any`})}(e))G(t,Do,e);else if(function(e){return cd(e,`ArrowRight`,{...ld,shiftKey:`any`})}(e))G(t,Oo,e);else if(function(e){return cd(e,`ArrowLeft`,{shiftKey:`any`})}(e))G(t,ko,e);else if(function(e){return cd(e,`ArrowLeft`,{...ld,shiftKey:`any`})}(e))G(t,Ao,e);else if(function(e){return cd(e,`ArrowUp`,{altKey:`any`,shiftKey:`any`})}(e))G(t,jo,e);else if(function(e){return cd(e,`ArrowDown`,{altKey:`any`,shiftKey:`any`})}(e))G(t,Mo,e);else if(function(e){return cd(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`,shiftKey:!0})}(e))n.isInsertLineBreak=!0,G(t,No,e);else if(function(e){return e.key===` `}(e))G(t,Po,e);else if(function(e){return Wr&&cd(e,`o`,{ctrlKey:!0})}(e))e.preventDefault(),n.isInsertLineBreak=!0,G(t,ho,!0);else if(function(e){return cd(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`})}(e))n.isInsertLineBreak=!1,G(t,No,e);else if(function(e){return cd(e,`Backspace`,{shiftKey:`any`})||Wr&&cd(e,`h`,{ctrlKey:!0})}(e))dd(e)?G(t,Fo,e)&&vs(n):(e.preventDefault(),G(t,mo,!0));else if(function(e){return e.key===`Escape`}(e))G(t,Io,e);else if(function(e){return cd(e,`Delete`,{})||Wr&&cd(e,`d`,{ctrlKey:!0})}(e))(function(e){return e.key===`Delete`})(e)?G(t,Lo,e):(e.preventDefault(),G(t,mo,!1));else if(function(e){return cd(e,`Backspace`,ud)}(e))e.preventDefault(),G(t,bo,!0);else if(function(e){return cd(e,`Delete`,ud)}(e))e.preventDefault(),G(t,bo,!1);else if(function(e){return Wr&&cd(e,`Backspace`,{metaKey:!0})}(e))e.preventDefault(),G(t,xo,!0);else if(function(e){return Wr&&(cd(e,`Delete`,{metaKey:!0})||cd(e,`k`,{ctrlKey:!0}))}(e))e.preventDefault(),G(t,xo,!1);else if(function(e){return cd(e,`b`,ld)}(e))e.preventDefault(),G(t,So,`bold`);else if(function(e){return cd(e,`u`,ld)}(e))e.preventDefault(),G(t,So,`underline`);else if(function(e){return cd(e,`i`,ld)}(e))e.preventDefault(),G(t,So,`italic`);else if(function(e){return cd(e,`Tab`,{shiftKey:`any`})}(e))G(t,Ro,e);else if(function(e){return cd(e,`z`,ld)}(e))e.preventDefault(),G(t,wo,void 0);else if(function(e){return Wr?cd(e,`z`,{metaKey:!0,shiftKey:!0}):cd(e,`y`,{ctrlKey:!0})||cd(e,`z`,{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),G(t,To,void 0);else{let r=t._editorState._selection;(function(e){return cd(e,`a`,ld)})(e)?(e.preventDefault(),G(t,Yo,e)&&vs(n)):r===null||H(r)||(function(e){return cd(e,`c`,ld)}(e)?(e.preventDefault(),G(t,qo,e)):function(e){return cd(e,`x`,ld)}(e)&&(e.preventDefault(),G(t,Jo,e)))}return function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(ns,e),!0}function Ds(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}var Os=new Map;function ks(e){let t=Ld(e.target);if(t===null)return;let n=bd(e.target),r=null,i=null,a=n===null?void 0:cs.get(n);if(n!==null){if(a!==void 0){let e=a.editors,n=a.hasShadowEditor;if(n===void 0){n=!1;for(let t of e)if(t._rootElement!==null&&Rd(t._rootElement.getRootNode())){n=!0;break}a.hasShadowEditor=n}if(n){let n=null,a=null;for(let o of e){let e=o._rootElement;if(e===null)continue;let s=Kd(t,e).anchorNode;if(s!==null&&Ou(s)===o){if(Rd(e.getRootNode())){r=o,i=s;break}n===null&&(n=o,a=s)}}r===null&&n!==null&&(r=n,i=a)}else{let e=t.anchorNode;e===null||K(e)&&e.shadowRoot!==null||(r=Ou(e),r!==null&&(i=e))}}if(r===null){let e=Zd(n);r=e===null?null:Ou(e)}}if(r===null)return;if(r._inputState.isSelectionChangeFromMouseDown){if(a!==void 0)for(let e of a.editors)e._inputState.isSelectionChangeFromMouseDown=!1;Bl(r,()=>{let n=Jc(),a=i??Kd(t,r._rootElement).anchorNode;(K(a)||Mu(a))&&Xu(qc(n,t,r,e))})}let o=ed(r),s=o[o.length-1],c=s._key,l=Os.get(c),u=l||s;u!==r&&fs(t,u,!1),fs(t,r,!0),r===s?l&&Os.delete(c):Os.set(c,r)}function As(e){e._lexicalHandled=!0}function js(e){return!0===e._lexicalHandled}function Ms(e){let t=ss.get(e);if(t===void 0)return;let n=cs.get(t);if(n===void 0)return;ss.delete(e);let r=ku(e);Du(r)?(function(e){if(e._parentEditor!==null){let t=ed(e),n=t[t.length-1]._key;Os.get(n)===e&&Os.delete(n)}else Os.delete(e._key)}(r),n.editors.delete(r),n.hasShadowEditor=void 0,e.__lexicalEditor=null):r&&z(198);let i=Ds(e);for(let e=0;e<i.length;e++)i[e]();e.__lexicalEventHandles=[]}function Ns(e,t,n){bl();let r=e.__key,i=e.getParent();if(i===null)return void(If(e)!==null&&z(367,r,String(If(e))));let a=function(e){let t=U();if(!H(t)||!W(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),a=r.getNode();return Cd(i,e)&&n.set(e.__key,0,`element`),Cd(a,e)&&r.set(e.__key,0,`element`),t}(e),o=!1;if(H(a)&&t){let t=a.anchor,n=a.focus;t.key===r&&(Zc(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(Zc(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else Cc(a)&&t&&e.isSelected()&&e.selectPrevious();if(H(a)&&t&&!o){let t=e.getIndexWithinParent();Ru(e),Yc(a,i,t,-1)}else Ru(e);n||kd(i)||i.canBeEmpty()||!i.isEmpty()||Ns(i,t),t&&a&&ql(i)&&i.isEmpty()&&i.selectEnd()}function Ps(e){return e}var Fs=Symbol.for(`ephemeral`);function Is(e){return e[Fs]||!1}var Ls={configurable:!0,enumerable:!1,value:void 0,writable:!0},Rs=class{__type;__key;__parent;__prev;__next;__state;[la];static getType(){let{ownNodeType:e}=Df(this);return e===void 0&&z(64,this.name),e}static clone(e){z(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||Mf(this.constructor);return Object.assign(t,{extends:n}),typeof e==`string`&&Object.assign(t,{type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&=this.__state.getWritable(this).resetOnCopyNode()}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",Ls),Object.defineProperty(this,la,Ls),Lu(this,e)}getType(){return this.__type}isInline(){z(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e===`root`)return!0;let t=Hu(e);if(t===null)break;e=t.__parent===null?If(t):t.__parent}return!1}isSelected(e){let t=e||U();if(t==null)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(V(this))return n;if(H(t)&&t.anchor.type===`element`&&t.focus.type===`element`){if(t.isCollapsed())return!1;let e=this.getParent();if(Gl(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:Hu(e)}getParentOrThrow(){let e=this.getParent();return e===null&&z(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(kd(t)||If(e)!==null)return W(e)||e===this&&Gl(e)||z(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&z(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:Hu(e)}getPreviousSiblings(){let e=[],t=this.getParent();if(t===null)return e;let n=t.getFirstChild();for(;n!==null&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:Hu(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=W(this)?this:this.getParent(),n=W(e)?e:e.getParent(),r=t&&n?Mp(t,n):null;return r?r.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=Mp(this,e);return t!==null&&(t.type===`descendant`||(t.type===`branch`?kp(t)===-1:(t.type!==`same`&&t.type!==`ancestor`&&z(279),!1)))}isParentOf(e){return Cd(e,this)}getNodesBetween(e){let t=this.isBefore(e),n=[],r=new Set,i=this;for(;i!==null;){let a=i.__key;if(r.has(a)||(r.add(a),n.push(i)),i===e)break;let o=W(i)?t?i.getFirstChild():i.getLastChild():null;if(o!==null){i=o;continue}let s=t?i.getNextSibling():i.getPreviousSibling();if(s!==null){i=s;continue}let c=i.getParentOrThrow();if(r.has(c.__key)||n.push(c),c===e)break;let l=null,u=c;do{if(u===null&&z(68),l=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),u===null)break;l!==null||r.has(u.__key)||n.push(u)}while(l===null);i=l}return t||n.reverse(),n}isDirty(){let e=wl()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(Is(this))return this;let e=Hu(this.__key);return e===null&&z(113),e}getWritable(){if(Is(this))return this;bl();let e=Sl(),t=wl(),n=e._nodeMap,r=this.__key,i=this.getLatest(),a=t._cloneNotNeeded,o=U();if(o!==null&&o.setCachedNodes(null),a.has(r))return zu(i),i;let s=gf(i);return a.add(r),zu(s),n.set(r,s),s}getTextContent(){return Yf(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){z(70)}updateDOM(e,t,n){z(71)}getDOMSlot(e){return new Si(e)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){z(18,this.name)}updateFromJSON(e){return function(e,t){let n=e.getWritable(),r=t.$,i=r;for(let e of Qi(n).flatKeys)e in t&&(i!==void 0&&i!==r||(i={...r}),i[e]=t[e]);return(n.__state||i)&&Zi(e).updateFromJSON(i),n}(this,e)}static transform(){return null}remove(e){Ns(this,!0,e)}replace(e,t){bl();let n=U();n!==null&&(n=n.clone()),Md(this,e);let r=this.getLatest(),i=this.__key,a=e.__key,o=e.getWritable(),s=this.getParentOrThrow().getWritable(),c=s.__size,l=o.getParent(),u=l===null?-1:o.getIndexWithinParent();Ru(o),l!==null&&H(n)&&Yc(n,l,u,-1);let d=r.getPreviousSibling(),f=r.getNextSibling(),p=r.__prev,m=r.__next,h=r.__parent;Ns(r,!1,!0),d===null?s.__first=a:d.getWritable().__next=a,o.__prev=p,f===null?s.__last=a:f.getWritable().__prev=a,o.__next=m,o.__parent=h,s.__size=c;let g=0;t&&(W(this)&&W(o)||z(139),g=o.getChildrenSize(),o.splice(g,0,this.getChildren()));let _=Vf(this);if(_.length>0){Pf(this)&&Pf(o)||z(368,this.__key,o.__key);for(let e of _){let t=Hf(this,e);t!==null&&($f(this,e),Qf(o,e,t))}}if(H(n)){Xu(n);let e=n.anchor,r=n.focus;e.key===i&&(t&&e.type===`element`?e.set(o.__key,g+e.offset,`element`):yc(e,o)),r.key===i&&(t&&r.type===`element`?r.set(o.__key,g+r.offset,`element`):yc(r,o))}return Vu()===i&&Bu(a),o}insertAfter(e,t=!0){bl(),Md(this,e);let n=this.getWritable(),r=e.getWritable();this.getParentOrThrow();let i=r.getParent(),a=U(),o=!1,s=!1;if(i!==null){let n=e.getIndexWithinParent();if(H(a)){let e=i.__key,t=a.anchor,r=a.focus;o=t.type===`element`&&t.key===e&&t.offset===n+1,s=r.type===`element`&&r.key===e&&r.offset===n+1}Ru(r),t&&H(a)&&Yc(a,i,n,-1)}else Ru(r);let c=this.getNextSibling(),l=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(c===null?l.__last=u:c.getWritable().__prev=u,l.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&H(a)){let e=this.getIndexWithinParent();Yc(a,l,e+1);let t=l.__key;o&&a.anchor.set(t,e+2,`element`),s&&a.focus.set(t,e+2,`element`)}return e}insertBefore(e,t=!0){bl(),Md(this,e);let n=this.getWritable(),r=e.getWritable();this.getParentOrThrow();let i=r.__key,a=U(),o=r.getParent(),s=o===null?-1:r.getIndexWithinParent();Ru(r),o!==null&&t&&H(a)&&Yc(a,o,s,-1);let c=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),u=n.__prev,d=this.getIndexWithinParent();return c===null?l.__first=i:c.getWritable().__next=i,l.__size++,n.__prev=i,r.__prev=u,r.__next=n.__key,r.__parent=n.__parent,t&&H(a)&&Yc(a,this.getParentOrThrow(),d),e}isParentRequired(){return!1}createParentElementNode(){return lu()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){bl();let n=Lf(this);if(n!==null)return n.selectPrevious(e,t);let r=this.getPreviousSibling(),i=this.getParentOrThrow();if(r===null)return i.select(0,0);if(W(r))return r.select();if(!V(r)){let e=r.getIndexWithinParent()+1;return i.select(e,e)}return r.select(e,t)}selectNext(e,t){bl();let n=Lf(this);if(n!==null)return n.selectNext(e,t);let r=this.getNextSibling(),i=this.getParentOrThrow();if(r===null)return i.select();if(W(r))return r.select(0,0);if(!V(r)){let e=r.getIndexWithinParent();return i.select(e,e)}return r.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}};function zs(e){return e instanceof Rs}var Bs=`historic`,Vs=`history-push`,Hs=`history-merge`,Us=`skip-selection-focus`,Ws=`composition-end`,Gs=`!important`;function Ks(e){let t={};if(!e)return t;let n=``,r=``,i=null,a=!1,o=!1,s=!1,c=0,l=e.length,u=-1;for(let d=0;d<l;d++){let l=e[d];if(a)l===`*`&&e[d+1]===`/`&&(a=!1,d++);else if(o)u===-1&&(u=d),o=!1;else if(i===null){if(l!==`/`||e[d+1]!==`*`){if(l!==`"`&&l!==`'`){if(l!==`(`){if(l!==`)`){if(s||l!==`:`||c!==0){if(l===`;`&&c===0){u!==-1&&(s?r+=e.slice(u,d):n+=e.slice(u,d),u=-1);let i=n.trim(),a=r.trim();i!==``&&a!==``&&(t[i]=a),n=``,r=``,s=!1;continue}u===-1&&(u=d)}else u!==-1&&(n+=e.slice(u,d),u=-1),s=!0}else u===-1&&(u=d),c=Math.max(0,c-1)}else u===-1&&(u=d),c++}else u===-1&&(u=d),i=l}else u!==-1&&(s?r+=e.slice(u,d):n+=e.slice(u,d),u=-1),a=!0,d++}else u===-1&&(u=d),l===`\\`?o=!0:l===i&&(i=null)}u!==-1&&(s?r+=e.slice(u,l):n+=e.slice(u,l));let d=n.trim(),f=r.trim();return d!==``&&f!==``&&(t[d]=f),t}function qs(e,t,n){let r=n.trimEnd(),i=r.length-10;i>=0&&r.slice(i).toLowerCase()===Gs?e.setProperty(t,r.slice(0,i).trim(),`important`):e.setProperty(t,n,``)}function Js(e,t,n=``){if(t===n)return;let r=Ks(n),i=Ks(t);for(let t in i)delete r[t],qs(e,t,i[t]);for(let t in r)e.removeProperty(t)}function Ys(e,t){return 16&t?`code`:t&128?`mark`:32&t?`sub`:64&t?`sup`:null}function Xs(e,t){return 1&t?`strong`:2&t?`em`:`span`}function Zs(e,t,n,r,i){let a=r.classList,o=pd(i,`base`);o!==void 0&&a.add(...o),o=pd(i,`underlineStrikethrough`);let s=!1,c=8&t&&4&t;o!==void 0&&(8&n&&4&n?(s=!0,c||a.add(...o)):c&&a.remove(...o));for(let e in pi){let r=pi[e];if(o=pd(i,e),o!==void 0){if(n&r){if(s&&(e===`underline`||e===`strikethrough`)){t&r&&a.remove(...o);continue}((t&r)===0||c&&e===`underline`||e===`strikethrough`)&&a.add(...o)}else t&r&&a.remove(...o)}}}function Qs(e,t,n){let r=n.isComposing(),i=e+(r?ci:``),a=cf(),o=lf(a).$getDOMSlot(n,t,a),s=o.getFirstChild();if(s===null||s.nodeType!==Node.TEXT_NODE)return void o.insertChild(Ud().createTextNode(i));let c=s,l=c.nodeValue;if(l!==i){if(r||Gr){let[e,t,n]=function(e,t){let n=e.length,r=t.length,i=0,a=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;a+i<n&&a+i<r&&e[n-a-1]===t[r-a-1];)a++;return[i,n-i-a,t.slice(i,r-a)]}(l,i);t!==0&&c.deleteData(e,t),c.insertData(e,n)}else c.nodeValue=i}}function $s(e,t,n,r,i,a){Qs(i,e,t);let o=a.theme.text;o!==void 0&&Zs(0,0,r,e,o)}function ec(e,t){let n=Ud().createElement(t);return n.appendChild(e),n}function tc(e){return e!=null&&!0===e.__isInlineFormattable}var nc=class e extends Rs{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}static getType(){return`text`}static clone(t){return new e(t.__text,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e=``,t){super(t),this.__text=e,this.__format=0,this.__style=``,this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return vi[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Vu()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=pi[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type===`text`&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Fu(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=Ys(0,n),i=Xs(0,n),a=r===null?i:r,o=Ud().createElement(a),s=o;this.hasFormat(`code`)&&o.setAttribute(`spellcheck`,`false`),r!==null&&(s=Ud().createElement(i),o.appendChild(s)),$s(s,this,0,n,this.__text,e);let c=this.__style;return c!==``&&Js(o.style,c),o}updateDOM(e,t,n){let r=this.__text,i=e.__format,a=this.__format,o=Ys(0,i),s=Ys(0,a),c=Xs(0,i),l=Xs(0,a);if((o===null?c:o)!==(s===null?l:s))return!0;if(o===s&&c!==l){let e=t.firstChild;e??z(48);let i=Ud().createElement(l);return $s(i,this,0,a,r,n),t.replaceChild(i,e),!1}let u=t;s!==null&&o!==null&&(u=t.firstChild,u??z(49)),Qs(r,u,this);let d=n.theme.text;d!==void 0&&i!==a&&Zs(0,i,a,u,d);let f=e.__style,p=this.__style;return f!==p&&Js(t.style,p,f),!1}static importDOM(){return{"#text":()=>({conversion:sc,priority:0}),b:()=>({conversion:ic,priority:0}),code:()=>({conversion:uc,priority:0}),em:()=>({conversion:uc,priority:0}),i:()=>({conversion:uc,priority:0}),mark:()=>({conversion:uc,priority:0}),s:()=>({conversion:uc,priority:0}),span:()=>({conversion:rc,priority:0}),strong:()=>({conversion:uc,priority:0}),sub:()=>({conversion:uc,priority:0}),sup:()=>({conversion:uc,priority:0}),u:()=>({conversion:uc,priority:0})}}static importJSON(e){return dc().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return K(t)||z(132),t.style.whiteSpace=`pre-wrap`,this.hasFormat(`lowercase`)?t.style.textTransform=`lowercase`:this.hasFormat(`uppercase`)?t.style.textTransform=`uppercase`:this.hasFormat(`capitalize`)&&(t.style.textTransform=`capitalize`),this.hasFormat(`bold`)&&(t=ec(t,`b`)),this.hasFormat(`italic`)&&(t=ec(t,`i`)),this.hasFormat(`strikethrough`)&&(t=ec(t,`s`)),this.hasFormat(`underline`)&&(t=ec(t,`u`)),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e==`string`?pi[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e==`string`?mi[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=Fu(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=_i[e];if(this.__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){bl();let n=e,r=t,i=U(),a=this.getTextContent(),o=this.__key;if(typeof a==`string`){let e=a.length;n===void 0&&(n=e),r===void 0&&(r=e)}else n=0,r=0;if(!H(i))return Wc(o,n,o,r,`text`,`text`);{let e=Vu();e!==i.anchor.key&&e!==i.focus.key||Bu(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),a=i.__text,o=n.length,s=e;s<0&&(s=o+s,s<0&&(s=0));let c=U();if(r&&H(c)){let t=e+o;c.setTextNodeRange(i,t,i,t)}return i.__text=a.slice(0,s)+n+a.slice(s+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){bl();let t=this.getLatest(),n=t.getTextContent();if(n===``)return[];let r=t.__key,i=Vu(),a=n.length;e.sort((e,t)=>e-t),e.push(a);let o=[],s=e.length;for(let t=0,r=0;t<a&&r<=s;r++){let i=e[r];i>t&&(o.push(n.slice(t,i)),t=i)}let c=o.length;if(c===1)return[t];let l=o[0],u=t.getParent(),d,f=t.getFormat(),p=t.getStyle(),m=t.__detail,h=!1,g=null,_=null,v=U();if(H(v)){let[e,t]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];e.type===`text`&&e.key===r&&(g=e),t.type===`text`&&t.key===r&&(_=t)}t.isSegmented()?(d=dc(l),d.__format=f,d.__style=p,d.__detail=m,d.__state=ra(t,d),h=!0):d=t.setTextContent(l);let y=[d];for(let e=1;e<c;e++){let n=dc(o[e]);n.__format=f,n.__style=p,n.__detail=m,n.__state=ra(t,n);let a=n.__key;i===r&&Bu(a),y.push(n)}let b=g?g.offset:null,x=_?_.offset:null,S=0;for(let e of y){if(!g&&!_)break;let t=S+e.getTextContentSize();if(g!==null&&b!==null&&b<=t&&b>=S&&(g.set(e.getKey(),b-S,`text`),b<t&&(g=null)),_!==null&&x!==null&&x<=t&&x>=S){_.set(e.getKey(),x-S,`text`);break}S=t}if(u!==null){(function(e){let t=e.getPreviousSibling(),n=e.getNextSibling();t!==null&&zu(t),n!==null&&zu(n)})(this);let e=u.getWritable(),t=this.getIndexWithinParent();h?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),H(v)&&Yc(v,u,t,c-1)}return y}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||z(50);let n=this.__key,r=e.__key,i=this.__text,a=i.length;Vu()===r&&Bu(n);let o=U();if(H(o)){let i=o.anchor,s=o.focus;i!==null&&i.key===r&&Qc(i,t,n,e,a),s!==null&&s.key===r&&Qc(s,t,n,e,a)}let s=e.__text,c=t?s+i:i+s;this.setTextContent(c);let l=this.getWritable();return e.remove(),l}isTextEntity(){return!1}};function rc(e){return{forChild:fc(e.style),node:null}}function ic(e){let t=e,n=t.style.fontWeight===`normal`;return{forChild:fc(t.style,n?void 0:`bold`),node:null}}var ac=new WeakMap;function oc(e){if(!K(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function sc(e){let t=e;e.parentElement===null&&z(129);let n=t.textContent||``;if(function(e){let t,n=e.parentNode,r=[e];for(;n!==null&&(t=ac.get(n))===void 0&&!oc(n);)r.push(n),n=n.parentNode;let i=t===void 0?n:t;for(let e=0;e<r.length;e++)ac.set(r[e],i);return i}(t)!==null)return{node:il(n)};if(n=n.replace(/\r/g,``).replace(/[ \t\n]+/g,` `),n===``)return{node:null};if(n[0]===` `){let e=t,r=!0;for(;e!==null&&(e=cc(e,!1))!==null;){let t=e.textContent||``;if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===` `){let e=t,r=!0;for(;e!==null&&(e=cc(e,!0))!==null;)if((e.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===``?{node:null}:{node:dc(n)}}function cc(e,t){let n=e;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){let e=n.parentElement;if(e===null)return null;n=e}if(n=e,K(n)){let e=n.style.display;if(e===``&&!rf(n)||e!==``&&!e.startsWith(`inline`))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(Mu(n))return n;if(n.nodeName===`BR`)return null}}var lc={code:`code`,em:`italic`,i:`italic`,mark:`highlight`,s:`strikethrough`,strong:`bold`,sub:`subscript`,sup:`superscript`,u:`underline`};function uc(e){let t=lc[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:fc(e.style,t),node:null}}function dc(e=``){return jd(new nc(e))}function V(e){return e instanceof nc}function fc(e,t){let n=e.fontWeight,r=e.textDecoration.split(` `),i=n===`700`||n===`bold`,a=r.includes(`line-through`),o=e.fontStyle===`italic`,s=r.includes(`underline`),c=e.verticalAlign;return e=>V(e)||tc(e)?(i&&!e.hasFormat(`bold`)&&e.toggleFormat(`bold`),a&&!e.hasFormat(`strikethrough`)&&e.toggleFormat(`strikethrough`),o&&!e.hasFormat(`italic`)&&e.toggleFormat(`italic`),s&&!e.hasFormat(`underline`)&&e.toggleFormat(`underline`),c!==`sub`||e.hasFormat(`subscript`)||e.toggleFormat(`subscript`),c!==`super`||e.hasFormat(`superscript`)||e.toggleFormat(`superscript`),t&&!e.hasFormat(t)&&e.toggleFormat(t),e):e}var pc=class e extends nc{static getType(){return`tab`}static clone(t){return new e(t.__key)}constructor(e){super(` `,e),this.__detail=2}static importDOM(){return null}createDOM(e){let t=super.createDOM(e),n=pd(e.theme,`tab`);return n!==void 0&&t.classList.add(...n),t}static importJSON(e){return mc().updateFromJSON(e)}setTextContent(e){return super.setTextContent(` `)}spliceText(e,t,n,r){return n===``&&t===0||n===` `&&t===1||z(286),this}setDetail(e){return e!==2&&z(127),this}setMode(e){return e!==`normal`&&z(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function mc(){return jd(new pc)}function hc(e){return e instanceof pc}var gc=class{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:Op(Hp(Np(this,`next`)),Hp(Np(e,`next`)))<0}getNode(){let e=Hu(this.key);return e===null&&z(20),e}set(e,t,n,r){let i=this._selection,a=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,yl()||(Vu()===a&&Bu(e),i!==null&&(i.setCachedNodes(null),H(i)&&(i._cachedIsBackward=null),i.dirty=!0)))}};function _c(e,t,n){return new gc(e,t,n)}function vc(e,t){let n=t.__key,r=e.offset,i=`element`;if(V(t)){i=`text`;let e=t.getTextContentSize();r>e&&(r=e)}else if(!W(t)){let e=t.getNextSibling();if(V(e))n=e.__key,r=0,i=`text`;else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function yc(e,t){if(W(t)){let n=t.getLastDescendant();W(n)||V(n)?vc(e,n):vc(e,t)}else vc(e,t)}var bc=class e{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Cc(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes().filter(e=>If(e)===null),n=t.length;if(n===0)return;let r=t[n-1],i;if(V(r))i=r.select();else{let e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=this._nodes,n=[];for(let e of t){let t=Hu(e);t!==null&&n.push(t)}return yl()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),t=``;for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){let e=this.getNodes().filter(e=>If(e)===null);if((U()||Jc())===this&&e[0]){let t=hp(e[0],`next`);Fp(Ep(t,t))}for(let t of e)t.remove();xc()}};function xc(){let e=Yu();if(e.isEmpty()){let t=lu();e.append(t),t.select()}}function H(e){return e instanceof Sc}var Sc=class e{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!H(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);let i=new Set,a=new Set;for(let n of e)if(dp(n)){let{origin:e}=n;t.length===0?i.add(e):(a.add(e),t.push(e))}else{let{origin:e}=n;W(e)&&a.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),up(e.focus)&&W(e.focus.origin)&&e.focus.getNodeAtCaret()===null)for(let n=yp(e.focus.origin,`previous`);dp(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=xp(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!W(e)||a.has(e)||e.isEmpty()||i.has(e))break;t.pop()}if(t.length===0&&e.isCollapsed()){let n=Hp(e.anchor),r=Hp(e.anchor.getFlipped()),i=e=>lp(e)?e.origin:e.getNodeAtCaret(),a=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(a)}return t}(Gp(Lp(this),`next`));return yl()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){return this.anchor.set(e.__key,t,`text`),this.focus.set(n.__key,r,`text`),this}getTextContent(){let e=this.getNodes();if(e.length===0)return``;let t=e[0],n=e[e.length-1],r=this.anchor,i=this.focus,a=r.isBefore(i),[o,s]=Oc(this),c=``,l=!0;for(let u=0;u<e.length;u++){let d=e[u];if(W(d)&&!d.isInline()){l||(c+=`
14
+ `);let e=``;for(let t of Vf(d)){let n=Hf(d,t);n!==null&&(e+=n.getTextContent())}e===``?l=!d.isEmpty():(c+=e,l=!1)}else if(l=!1,V(d)){let e=d.getTextContent();d===t?d===n?r.type===`element`&&i.type===`element`&&i.offset!==r.offset||(e=o<s?e.slice(o,s):e.slice(s,o)):e=a?e.slice(o):e.slice(s):d===n&&(e=a?e.slice(0,s):e.slice(0,o)),c+=e}else!Gl(d)&&!ru(d)||d===n&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(e){let t=wl(),n=t.getEditorState()._selection,r=Hc(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(r===null)return;let[i,a,o]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(a.key,a.offset,a.type,!0),o&&(this.dirty=!0),sa(this)}clone(){let t=this.anchor,n=this.focus;return new e(_c(t.key,t.offset,t.type),_c(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=Fu(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=pi[e];return(this.format&t)!==0}insertRawText(e){this.insertNodes(il(e))}insertText(e){let t=this.anchor,n=this.focus,r=this.format,i=this.style,a=t,o=n;!this.isCollapsed()&&n.isBefore(t)&&(a=n,o=t),a.type===`element`&&function(e,t,n,r){let i=e.getNode(),a=i.getChildAtIndex(e.offset),o=dc();if(o.setFormat(n),o.setStyle(r),uu(a))a.splice(0,0,[o]);else if(a!==null){let e=kd(i)?lu().append(o):o;a.insertBefore(e)}else if(kd(i)){let e=i.getLastChild();W(e)&&!e.isInline()&&e.isEmpty()?e.append(o):i.append(lu().append(o))}else i.append(o);e.is(t)&&t.set(o.__key,0,`text`),e.set(o.__key,0,`text`)}(a,o,r,i),o.type===`element`&&Pp(o,Hp(Np(o,`next`)));let s=a.offset,c=o.offset,l=this.getNodes(),u=l.length,d=l[0];V(d)||z(26);let f=d.getTextContent().length,p=d.getParentOrThrow(),m=l[u-1];if(u===1&&o.type===`element`&&(c=f,o.set(a.key,c,`text`)),this.isCollapsed()&&s===f&&(ju(d)||!d.canInsertTextAfter()||!p.canInsertTextAfter()&&d.getNextSibling()===null)){let t=d.getNextSibling(),n;if(V(t)&&t.canInsertTextBefore()&&!ju(t)?n=t:(n=dc(),n.setFormat(r),n.setStyle(i),p.canInsertTextAfter()?d.insertAfter(n):p.insertAfter(n)),n.select(0,0),d=n,e!==``)return void this.insertText(e)}else if(this.isCollapsed()&&s===0&&(ju(d)||!d.canInsertTextBefore()||!p.canInsertTextBefore()&&d.getPreviousSibling()===null)){let t=d.getPreviousSibling(),n;if(!V(t)||ju(t)?(n=dc(),n.setFormat(r),p.canInsertTextBefore()?d.insertBefore(n):p.insertBefore(n)):n=t,n.select(),d=n,e!==``)return void this.insertText(e)}else if(d.isSegmented()&&s!==f){if(Vu()!==null)d=d.setMode(`normal`).setFormat(r).setStyle(i);else{let e=dc(d.getTextContent());e.setFormat(r),d.replace(e),d=e}}else if(!this.isCollapsed()&&e!==``){let t=m.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||W(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(``),Rc(this.anchor,this.focus),void this.insertText(e)}if(u===1){if(Au(d)){let t=dc(e);t.select(),d.replace(t);return}let t=d.getFormat(),n=d.getStyle();if(s!==c||t===r&&n===i){if(hc(d)){let t=dc(e);t.setFormat(r),t.setStyle(i),t.select(),d.replace(t);return}}else{if(d.getTextContent()!==``){let t=dc(e);if(t.setFormat(r),t.setStyle(i),t.select(),s===0)d.insertBefore(t,!1);else{let[e]=d.splitText(s);e.insertAfter(t,!1)}t.isComposing()&&this.anchor.type===`text`&&(this.anchor.offset-=e.length,this._cachedNodes=null,this._cachedIsBackward=null);return}d.setFormat(r),d.setStyle(i)}let a=c-s;d=d.spliceText(s,a,e,!0),d.getTextContent()===``?d.remove():this.anchor.type===`text`&&(this.format=t,this.style=n,d.isComposing()&&(this.anchor.offset-=e.length,this._cachedNodes=null,this._cachedIsBackward=null))}else{let t=new Set([...d.getParentKeys(),...m.getParentKeys()]),n=W(d)?d:d.getParentOrThrow(),r=W(m)?m:m.getParentOrThrow(),i=m;if(!n.is(r)&&r.isInline())do i=r,r=r.getParentOrThrow();while(r.isInline());if(o.type===`text`&&(c!==0||m.getTextContent()===``)||o.type===`element`&&m.getIndexWithinParent()<c){if(V(m)&&!Au(m)&&c!==m.getTextContentSize()){if(m.isSegmented()){let e=dc(m.getTextContent());m.replace(e),m=e}ql(o.getNode())||o.type!==`text`||(V(m)||z(395),m=m.spliceText(0,c,``)),t.add(m.__key)}else{let e=m.getParentOrThrow();e.canBeEmpty()||e.getChildrenSize()!==1?m.remove():e.remove()}}else t.add(m.__key);let a=r.getChildren(),p=new Set(l),h=n.is(r),g=n.isInline()&&d.getNextSibling()===null?n:d;for(let e=a.length-1;e>=0;e--){let t=a[e];if(t.is(d)||W(t)&&t.isParentOf(d))break;t.isAttached()&&(!p.has(t)||t.is(i)?h||g.insertAfter(t,!1):t.remove())}if(!h){let e=r,n=null;for(;e!==null;){let r=e.getChildren(),i=r.length;(i===0||r[i-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(Au(d)){if(s===f)d.select();else{let t=dc(e);t.select(),d.replace(t)}}else d=d.spliceText(s,f-s,e,!0),d.getTextContent()===``?d.remove():this.anchor.type===`text`&&(this.format=d.getFormat(),this.style=d.getStyle(),d.isComposing()&&(this.anchor.offset-=e.length,this._cachedNodes=null,this._cachedIsBackward=null));for(let e=1;e<u;e++){let n=l[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){let e=U()===this;Ip(this,Vp(Lp(this))),e&&U()!==this&&Xu(this)}formatText(e,t=null){Ec(this,e,t)}insertNodes(e){if(e.length===0)return;this.isCollapsed()||this.removeText();let t=this.anchor.getNode();if(this.anchor.type===`element`&&W(t)&&If(t)!==null){let n=t.isShadowRoot()?t.getFirstChild()??t.append(lu()).getFirstChild():t.getFirstChild();if(t.isShadowRoot()&&n!==null&&!W(n)){let e=lu();n.insertBefore(e),n=e}if(n!==null){n.selectStart();let t=U();return H(t)||z(369),t.insertNodes(e)}}if(this.anchor.type===`element`&&kd(t)){let n=ll(e),r=n.getLastDescendant();t.splice(this.anchor.offset,0,n.getChildren()),r!==null&&r.selectEnd();return}let n=(this.isBackward()?this.focus:this.anchor).getNode(),r=Af(n,sf),i=e[e.length-1];if(W(r)&&`__language`in r){if(`__language`in e[0])this.insertText(e[0].getTextContent());else{let t=ol(this);r.splice(t,0,e),i.selectEnd()}return}if(!e.some(e=>(W(e)||Gl(e))&&!e.isInline())){W(r)||z(211,n.constructor.name,n.getType());let t=ol(this);r.splice(t,0,e),i.selectEnd();return}if(W(r)&&If(r)!==null){let t=ol(this),n=al(e);r.splice(t,0,n);let i=n[n.length-1];i===void 0?r.select(t,t):i.selectEnd();return}if(r===null){let t=ll(e),n=t.getLastDescendant(),r=Np(this.anchor,`next`);for(let e of t.getChildren())r=Xp(e,r);n!==null&&n.selectEnd();return}if(W(r)&&!r.isParentRequired()&&!kd(r.getParentOrThrow())){let t=ol(this),n=al(e);r.splice(t,0,n);let i=n[n.length-1];i===void 0?r.select(t,t):i.selectEnd();return}let a=ll(e),o=a.getLastDescendant(),s=a.getChildren(),c=!W(r)||!r.isEmpty()?this.insertParagraph():null;c&&!r.isAttached()&&(n=this.anchor.getNode(),r=Af(n,sf));let l=s[s.length-1],u=s[0];var d;W(d=u)&&sf(d)&&!d.isEmpty()&&W(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(W(r)||z(211,n.constructor.name,n.getType()),r.append(...u.getChildren()),u=s[1]),u&&(r===null&&z(212,n.constructor.name,n.getType()),function(e,t){let n=t.getParentOrThrow().getLastChild(),r=t,i=[t];for(;r!==n;)r.getNextSibling()||z(140),r=r.getNextSibling(),i.push(r);let a=e;for(let e of i)a=a.insertAfter(e)}(r,u));let f=Af(o,sf);c&&W(f)&&(c.canMergeWhenEmpty()||sf(l))&&(f.append(...c.getChildren()),c.remove()),W(r)&&r.isEmpty()&&r.remove(),o.selectEnd();let p=W(r)?r.getLastChild():null;ru(p)&&f!==r&&p.remove()}insertParagraph(){let e=this.anchor.getNode();if(this.anchor.type===`element`&&kd(e)){let t=lu();return e.splice(this.anchor.offset,0,[t]),t.select(),t}let t=ol(this),n=Af(this.anchor.getNode(),sf);if(n!==null&&If(n)!==null)return null;W(n)||z(213);let r=n.getChildAtIndex(t),i=r?[r,...r.getNextSiblings()]:[],a=n.insertNewAfter(this,!1);return a?(a.append(...i),a.selectStart(),a):null}insertLineBreak(e){let t=nu();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=[...this.getNodes()],t=e.length,n=e[0],r=e[t-1],[i,a]=Oc(this),o=this.isBackward(),[s,c]=o?[this.focus,this.anchor]:[this.anchor,this.focus],[l,u]=o?[a,i]:[i,a];if(t===0)return[];if(t===1){if(V(n)&&!this.isCollapsed()){let e=n.splitText(l,u),t=l===0?e[0]:e[1];return t?(s.set(t.getKey(),0,`text`),c.set(t.getKey(),t.getTextContentSize(),`text`),[t]):[]}return[n]}if(V(n)&&(l===n.getTextContentSize()?e.shift():l!==0&&([,n]=n.splitText(l),e[0]=n,s.set(n.getKey(),0,`text`))),V(r)){let t=r.getTextContent().length;u===0?e.pop():u!==t&&([r]=r.splitText(u),e[e.length-1]=r,c.set(r.getKey(),r.getTextContentSize(),`text`))}return e}modify(e,t,n){if(ul(this,e,t,n))return;let r=e===`move`,i=wl(),a=Id(Td(i));if(!a)return;let o=i._blockCursorElement,s=i._rootElement,c=this.focus.getNode();s===null||o===null||!W(c)||c.isInline()||c.canBeEmpty()||Fd(o,i,s);let l=vd(i,this.focus.key),u=l;if(this.focus.type===`text`&&(u=V(c)?ff(c,l,i):null),this.dirty){let e=vd(i,this.anchor.key),t=e;if(this.anchor.type===`text`){let n=this.anchor.getNode();t=V(n)?ff(n,e,i):null}t&&u&&$c(a,t,this.anchor.offset,u,this.focus.offset)}if(n===`character`&&V(c)&&c.isUnmergeable()&&(t?this.focus.offset===0:this.focus.offset===c.getTextContentSize())){let e=hp(c,t?`previous`:`next`).getNodeAtCaret();if(V(e)){if(!r){let n=e.getTextContentSize();t?this.focus.set(e.__key,n-1,`text`):this.focus.set(e.__key,1,`text`),this.dirty=!0;return}{let n=i.getElementByKey(e.getKey()),r=n?ff(e,n,i):null;if(r){let e=t?r.length:0;$c(a,r,e,r,e)}}}}if(jc(a,e,t?`backward`:`forward`,n),a.rangeCount>0){let e=Wd(a,i._rootElement),n=e||a.getRangeAt(0),o=this.anchor.getNode(),s=ql(o)?o:Dd(o);this.applyDOMRange(n),this.dirty=!0,!r&&(Mc(this,t,s),(e?a.direction!==`backward`:a.anchorNode===n.startContainer&&a.anchorOffset===n.startOffset)||Ac(this))}n===`lineboundary`&&ul(this,e,t,n,`decorators`)}forwardDeletion(e,t,n){if(!n&&(e.type===`element`&&W(t)&&e.offset===t.getChildrenSize()||e.type===`text`&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(e===null?null:e.getNextSibling());if(W(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;let r=wp(Np(t,e?`previous`:`next`));if(r.getTextSlices().every(e=>e===null||e.distance===0)){let e={type:`initial`};for(let t of r.iterNodeCarets(`shadowRoot`))if(dp(t)){if(!t.origin.isInline()){if(t.origin.isShadowRoot()){if(e.type===`merge-block`)break;if(W(r.anchor.origin)&&r.anchor.origin.isEmpty()){let e=Hp(t);Ip(this,Ep(e,e)),r.anchor.origin.remove()}return}e.type!==`merge-next-block`&&e.type!==`merge-block`||(e={block:e.block,caret:t,type:`merge-block`})}}else{if(e.type===`merge-block`)break;if(up(t)){if(W(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(r.anchor.origin))break}else e={block:t.origin,type:`merge-next-block`};continue}if(Gl(t.origin)){if(!t.origin.isIsolated()){if(Vf(t.origin).length>0){if(W(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();let e=Kc();e.add(t.origin.getKey()),Xu(e)}}else if(e.type===`merge-next-block`&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&W(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();let e=Kc();e.add(t.origin.getKey()),Xu(e)}else t.origin.remove()}return}break}}if(e.type===`merge-block`){let{caret:t,block:n}=e;return Vf(n).length>0?void 0:t.origin.isEmpty()&&!n.isEmpty()&&t.origin.getParent()===n.getParent()?void t.origin.remove(!0):(Ip(this,Ep(!t.origin.isEmpty()&&n.isEmpty()?Rp(hp(n,t.direction)):r.anchor,t)),this.removeText())}for(let e=t.getNode();e!==null;){if(If(e)!==null)return;if(W(e)&&e.isShadowRoot())break;e=e.getParent()}}let i=this.focus;if(Nc(this,e,`character`),this.isCollapsed()){if(e&&t.offset===0&&kc(this,t.getNode()))return}else{let r=i.type===`text`?i.getNode():null;if(n=t.type===`text`?t.getNode():null,r!==null&&r.isSegmented()){let t=i.offset,a=r.getTextContentSize();if(r.is(n)||e&&t!==a||!e&&t!==0)return void Fc(r,e,t)}else if(n!==null&&n.isSegmented()){let i=t.offset,a=n.getTextContentSize();if(n.is(r)||e&&i!==0||!e&&i!==a)return void Fc(n,e,i)}(function(e,t){let n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&n.type===`text`&&r.type===`text`){let e=n.offset,a=r.offset,o=e<a,s=o?e:a,c=o?a:e,l=c-1;s!==l&&(function(e){return!($u(e)||Pc(e))})(i.getTextContent().slice(s,c))&&(t?r.set(r.key,l,r.type):n.set(n.key,l,n.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type===`element`&&this.anchor.offset===0){let e=this.anchor.getNode();e.isEmpty()&&ql(e.getParent())&&e.getPreviousSibling()===null&&kc(this,e),xc()}}deleteLine(e){let t=zc(this.anchor);if(t!==null&&Gl(Lf(t)))return this.isCollapsed()||this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),void this.deleteCharacter(e);this.isCollapsed()&&Nc(this,e,`lineboundary`),this.isCollapsed()?this.deleteCharacter(e):Af(this.anchor.getNode(),sf)===Af(this.focus.getNode(),sf)?this.removeText():(this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),this.deleteCharacter(e))}deleteWord(e){if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;Nc(this,e,`word`)}this.isCollapsed()?this.deleteCharacter(e):this.removeText()}isBackward(){let e=this._cachedIsBackward;if(e!==null)return e;let t=this.focus.isBefore(this.anchor);return yl()||(this._cachedIsBackward=t),t}getStartEndPoints(){return[this.anchor,this.focus]}};function Cc(e){return e instanceof bc}function wc(e,t){if(Cc(e)){for(let n of e.getNodes())tc(n)&&n.setFormat(t(n.getFormat()));return}if(e.isCollapsed())return e.setFormat(t(e.format)),void Bu(null);let n=[];for(let r of e.getNodes())V(r)?n.push(r):W(r)?r.setTextFormat(t(r.getTextFormat())):tc(r)&&r.setFormat(t(r.getFormat()));let r=n.length;if(r===0)return e.setFormat(t(e.format)),void Bu(null);let i=e.anchor,a=e.focus,o=e.isBackward(),s=o?a:i,c=o?i:a,l=0,u=n[0],d=s.type===`element`?0:s.offset;if(s.type===`text`&&d===u.getTextContentSize()&&(l=1,u=n[1],d=0),u==null)return;let f=r-1,p=n[f],m=c.type===`text`?c.offset:p.getTextContentSize();if(u.is(p)){if(d===m)return;let n=t(u.getFormat());if(ju(u)||d===0&&m===u.getTextContentSize())u.setFormat(n);else{let e=u.splitText(d,m),t=d===0?e[0]:e[1];t.setFormat(n),s.type===`text`&&s.set(t.__key,0,`text`),c.type===`text`&&c.set(t.__key,m-d,`text`)}e.format=n;return}d===0||ju(u)||([,u]=u.splitText(d),d=0);let h=t(u.getFormat());u.setFormat(h);let g=t(p.getFormat());m>0&&(m===p.getTextContentSize()||ju(p)||([p]=p.splitText(m)),p.setFormat(g));for(let e=l+1;e<f;e++){let r=n[e];r.setFormat(t(r.getFormat()))}s.type===`text`&&s.set(u.__key,d,`text`),c.type===`text`&&c.set(p.__key,m,`text`),e.format=h|g}function Tc(e,t){let n=[];for(let[e,r]of Object.entries(t))typeof r==`boolean`&&n.push([e,r]);n.length!==0&&wc(e,e=>{for(let[t,r]of n)e=Fu(e,t,r?pi[t]:0);return e})}function Ec(e,t,n=null){let r=n===null&&H(e)?Fu(e.format,t,null):n;wc(e,e=>Fu(e,t,r))}function Dc(e){let t=e.offset;if(e.type===`text`)return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function Oc(e){let t=e.getStartEndPoints();if(t===null)return[0,0];let[n,r]=t;return n.type===`element`&&r.type===`element`&&n.key===r.key&&n.offset===r.offset?[0,0]:[Dc(n),Dc(r)]}function kc(e,t){for(let n=t;n;n=n.getParent()){if(W(n)){if(n.collapseAtStart(e))return!0;if(kd(n))break}if(n.getPreviousSibling())break}return!1}function Ac(e){let t=e.focus,n=e.anchor,r=n.key,i=n.offset,a=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,a,!0)}function jc(e,t,n,r){e.modify(t,n,r)}function Mc(e,t,n){let r=e.getNodes(),i=r.filter(e=>Cd(e,n));if(i.length===0||i.length===r.length)return!1;let a=t?i[0]:i[i.length-1],o=W(a)?a:a.getParentOrThrow();return t?o.selectStart():o.selectEnd(),!0}function Nc(e,t,n){if(ul(e,`extend`,t,n))return;let r=wl(),i=Id(Td(r));if(!i||typeof i.modify!=`function`)return;let a=r._blockCursorElement,o=r._rootElement,s=e.anchor,c=e.focus.getNode();o===null||a===null||!W(c)||c.isInline()||c.canBeEmpty()||Fd(a,r,o);let l=e=>{let t=e.getNode(),n=r.getElementByKey(e.key);return n!==null&&e.type===`text`&&V(t)?ff(t,n,r):n},u=s.getNode(),d=l(s);if(d===null)return;let f=s.offset,p=e.isCollapsed(),m=e.focus,h=p?d:l(m);if(h===null)return;let g=m.offset;if($c(i,h,g,h,g),jc(i,`move`,t?`backward`:`forward`,n),i.rangeCount===0)return;let _=Wd(i,o)||i.getRangeAt(0),v=_.startContainer,y=_.startOffset;if(p&&n===`character`&&s.type===`text`&&V(u)&&u.isUnmergeable()&&f===(t?0:u.getTextContentSize())){let n=hp(u,t?`previous`:`next`).getNodeAtCaret();if(V(n)){let r=t?n.getTextContentSize()-1:1;e.focus.set(n.__key,r,`text`),e.dirty=!0;return}}if(p&&n===`character`&&s.type===`text`){let n=t?0:u.getTextContentSize(),r=v===d?y:f===n?-1:n;if(r>=0)return void(r!==f&&(e.focus.set(s.key,r,`text`),e.dirty=!0))}let[b,x,S,C]=t?[v,y,d,f]:[d,f,v,y],w=ql(u)?u:Dd(u);e.applyDOMRange({collapsed:!1,endContainer:S,endOffset:C,startContainer:b,startOffset:x}),e.dirty=!0,!Mc(e,t,w)&&t&&Ac(e),n===`lineboundary`&&ul(e,`extend`,t,n,`decorators`)}var Pc=(()=>{try{let e=RegExp(`\\p{Emoji}`,`u`),t=e.test.bind(e);if(t(`❤️`)&&t(`#️⃣`)&&t(`👍`))return t}catch{}return()=>!1})();function Fc(e,t,n){let r=e,i=r.getTextContent().split(/(?=\s)/g),a=i.length,o=0,s=0;for(let e=0;e<a;e++){let r=e===a-1;if(s=o,o+=i[e].length,t&&o===n||o>n||r){i.splice(e,1),r&&(s=void 0);break}}let c=i.join(``).trim();c===``?r.remove():(r.setTextContent(c),r.select(s,s))}function Ic(e,t,n,r){let i,a=t,o=!1;if(K(e)){let s=!1,c=e.childNodes,l=c.length,u=r._blockCursorElement;a===l&&l>0&&(s=!0,a=l-1),Gu(e,r)!==void 0||wf(e,r)||(o=!0);let d=c[a],f=!1;if(d===u)d=c[a+1],f=!0;else if(u!==null){let n=u.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,u)&&a--}if(i=Qu(d),V(i))a=_p(i,s?`next`:`previous`);else{let c=Qu(e);if(c===null)return null;if(W(c)){let o=r.getElementByKey(c.getKey());o===null&&z(214);let l=uf(c,o,r);[c,a]=l.resolveChildIndex(c,o,e,t),W(c)||z(215),s&&a>=c.getChildrenSize()&&(a=Math.max(0,c.getChildrenSize()-1));let u=c.getChildAtIndex(a);if(W(u)&&function(e,t,n){let r=e.getParent();return n===null||r===null||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){let e=s?u.getLastDescendant():u.getFirstDescendant();e===null?c=u:(u=e,c=W(u)?u:u.getParentOrThrow()),a=0}V(u)?(i=u,c=null,a=_p(u,s?`next`:`previous`)):u!==c&&s&&!f&&(W(c)||z(216),a=Math.min(c.getChildrenSize(),a+1))}else{let n=Lf(c),i=n===null?c:n,o=i.getIndexWithinParent(),s=r.getElementByKey(c.getKey()),l=`after`;if(s!==null&&Qu(e)===c){let n=uf(c,s,r);n.element===s?t===0&&Gl(c)&&(l=`before`):l=n.resolveLeafPosition(s,e,t)}a=l===`before`?o:o+1,c=i.getParentOrThrow()}if(W(c))return[_c(c.__key,a,`element`),o]}}else i=Qu(e);return V(i)?[_c(i.__key,_p(i,a,`clamp`),`text`),o]:null}function Lc(e,t,n){let r=e.offset,i=e.getNode();if(r===0){let r=i.getPreviousSibling(),a=i.getParent();if(t){if((n||!t)&&r===null&&W(a)&&a.isInline()){let t=a.getPreviousSibling();V(t)&&e.set(t.__key,t.getTextContent().length,`text`)}}else W(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),`element`):V(r)&&!i.isUnmergeable()&&e.set(r.__key,r.getTextContent().length,`text`)}else if(r===i.getTextContent().length){let r=i.getNextSibling(),a=i.getParent();if(t&&W(r)&&r.isInline())e.set(r.__key,0,`element`);else if((n||t)&&r===null&&W(a)&&a.isInline()&&!a.canInsertTextAfter()&&a.getTextContentSize()>1){let t=a.getNextSibling();V(t)&&e.set(t.__key,0,`text`)}}}function Rc(e,t,n){if(e.type===`text`&&t.type===`text`){let n=e.isBefore(t),r=e.is(t);Lc(e,n,r),Lc(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}function zc(e){let t=Hu(e.key);return t===null?null:zf(t)}function Bc(e,t,n){let r=zc(e),i=zc(t);if(r===i||r!==null&&i!==null&&r.is(i))return!1;let a=n(r,i);if(r!==null)return W(r)?t.set(r.getKey(),a?r.getChildrenSize():0,`element`):t.set(r.getKey(),a?r.getTextContentSize():0,`text`),!0;let o=Lf(i);if(o===null)return!1;let s=o.getParent();if(s===null)return!1;let c=o.getIndexWithinParent();return t.set(s.getKey(),a?c+1:c,`element`),!0}function Vc(e){let t=Bc(e.anchor,e.focus,(t,n)=>function(e,t,n,r){if(n!==null&&r!==null){let e=Lf(n),t=Lf(r);if(e!==null&&e.is(t)){for(let t of Bf(e).values()){if(t===n.getKey())return!0;if(t===r.getKey())return!1}return!0}return e===null||t===null||e.isBefore(t)}if(n!==null){let e=Lf(n),r=Hu(t.key);return e===null||r===null||!(!e.is(r)&&!e.isParentOf(r))||e.isBefore(r)}let i=Lf(r),a=Hu(e.key);return i!==null&&a!==null&&!i.is(a)&&!i.isParentOf(a)&&a.isBefore(i)}(e.anchor,e.focus,t,n));return t&&(e.dirty=!0),t}function Hc(e,t,n,r,i,a){if(e===null||n===null||!Eu(i,e,n))return null;let o=Ic(e,t,H(a)?a.anchor:null,i);if(o===null)return null;let s=Ic(n,r,H(a)?a.focus:null,i);if(s===null)return null;let[c,l]=o,[u,d]=s;if(c.type===`element`&&u.type===`element`){let t=Qu(e),r=Qu(n);if(Gl(t)&&Gl(r))return null}let f=i._slotsUsed&&Bc(c,u,()=>(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)!==0);return Rc(c,u),[c,u,l||d||f]}function Uc(e){return W(e)&&!e.isInline()}function Wc(e,t,n,r,i,a){let o=Sl(),s=new Sc(_c(e,t,i),_c(n,r,a),0,``);return s.dirty=!0,o._selection=s,s}function Gc(){return new Sc(_c(`root`,0,`element`),_c(`root`,0,`element`),0,``)}function Kc(){return new bc(new Set)}function qc(e,t,n,r){let i=n._window;if(i===null)return null;let a=r||i.event,o=a?a.type:void 0,s=o===`selectionchange`,c=!Ni&&(s||o===`beforeinput`||o===`compositionstart`||o===`compositionend`||o===`click`&&a&&a.detail===3||o===`drop`||o===void 0),l,u,d,f;if(H(e)&&!c)return e.clone();{if(t===null)return null;let r=Kd(t,n._rootElement);if(l=r.anchorNode,u=r.focusNode,d=r.anchorOffset,f=r.focusOffset,(s||o===void 0)&&H(e)&&!Eu(n,l,u))return e.clone()}let p=Hc(l,d,u,f,n,e);if(p===null)return null;let[m,h,g]=p,_=0,v=``;if(H(e)){let t=e.anchor;if(m.key===t.key)_=e.format,v=e.style;else{let e=m.getNode();V(e)?(_=e.getFormat(),v=e.getStyle()):W(e)&&(_=e.getTextFormat(),v=e.getTextStyle())}}let y=new Sc(m,h,_,v);return g&&(y.dirty=!0),y}function U(){return Sl()._selection}function Jc(){return wl()._editorState._selection}function Yc(e,t,n,r=1){let i=e.anchor,a=e.focus,o=i.getNode(),s=a.getNode();if(!t.is(o)&&!t.is(s))return;let c=t.__key;if(e.isCollapsed()){let t=i.offset;if(n<=t&&r>0||n<t&&r<0){let n=Math.max(0,t+r);i.set(c,n,`element`),a.set(c,n,`element`),Xc(e)}}else{let o=e.isBackward(),s=o?a:i,l=s.getNode(),u=o?i:a,d=u.getNode();if(t.is(l)){let e=s.offset;(n<=e&&r>0||n<e&&r<0)&&s.set(c,Math.max(0,e+r),`element`)}if(t.is(d)){let e=u.offset;(n<=e&&r>0||n<e&&r<0)&&u.set(c,Math.max(0,e+r),`element`)}}Xc(e)}function Xc(e){let t=e.anchor,n=t.offset,r=e.focus,i=r.offset,a=t.getNode(),o=r.getNode();if(e.isCollapsed()){if(!W(a))return;let e=a.getChildrenSize(),i=n>=e,o=i?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(V(o)){let e=0;i&&(e=o.getTextContentSize()),t.set(o.__key,e,`text`),r.set(o.__key,e,`text`)}return}if(W(a)){let e=a.getChildrenSize(),r=n>=e,i=r?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(V(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,`text`)}}if(W(o)){let e=o.getChildrenSize(),t=i>=e,n=t?o.getChildAtIndex(e-1):o.getChildAtIndex(i);if(V(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,`text`)}}}function Zc(e,t,n,r,i){let a=null,o=0,s=null;r===null?i!==null&&(a=i.__key,V(i)?s=`text`:W(i)&&(s=`element`)):(a=r.__key,V(r)?(o=r.getTextContentSize(),s=`text`):W(r)&&(o=r.getChildrenSize(),s=`element`)),a!==null&&s!==null?e.set(a,o,s):(o=t.getIndexWithinParent(),o===-1&&(o=n.getChildrenSize()),e.set(n.__key,o,`element`))}function Qc(e,t,n,r,i){e.type===`text`?e.set(n,e.offset+(t?0:i),`text`):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,`element`)}function $c(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch{}}function el(e,t,n){let r=vd(e,t.getKey());if(W(t)){let i=uf(t,r,e);return[i.element,n+i.getFirstChildOffset()]}return[r,n]}function tl(e,t,n,r,i,a){let o=a.getRootNode(),s=Nu(o)||Rd(o)?Zd(o):null;if(i.has(`collaboration`)&&s!==a||s!==null&&Tu(s,s))return;let c=Kd(r,a),l;if(!H(t))return void(e!==null&&Eu(n,c.anchorNode,c.focusNode)&&r.removeAllRanges());let u=t.anchor,d=t.focus,f=u.getNode(),p=d.getNode(),[m,h]=el(n,f,u.offset),[g,_]=el(n,p,d.offset),v=t.format,y=t.style,b=t.isCollapsed(),x=m,S=g,C=!1;if(u.type===`text`?(x=V(f)?ff(f,m,n):null,C=f.getFormat()!==v||f.getStyle()!==y):H(e)&&e.anchor.type===`text`&&(C=!0),d.type===`text`&&(S=V(p)?ff(p,g,n):null),x!==null&&S!==null){if(b&&(e===null||C||H(e)&&(e.format!==v||e.style!==y))&&function(e,t,n,r,i,a){e._inputState.collapsedSelectionFormat={format:t,key:i,offset:r,style:n,timeStamp:a}}(n,v,y,h,u.key,performance.now()),(r.type!==`Range`||!b)&&c.anchorOffset===h&&c.focusOffset===_&&c.anchorNode===x&&c.focusNode===S){if(s===null||!a.contains(s)){let e=s===null?null:Ou(s);e!==null&&e!==n||i.has(`skip-selection-focus`)||a.focus({preventScroll:!0})}if(u.type!==`element`)return}if($c(r,x,h,S,_),Gr&&t.isCollapsed()&&a!==null&&!i.has(`skip-selection-focus`)){let e=Xd(a);if(e===null||!a.contains(e)){let e=Zd(a.ownerDocument),t=e===null?null:Ou(e);t!==null&&t!==n||a.focus({preventScroll:!0})}}if(!i.has(`skip-scroll-into-view`)&&t.isCollapsed()&&a!==null&&a===Xd(a)){let e=H(t)&&t.anchor.type===`element`?x.childNodes[h]||null:(l===void 0&&(l=Gd(r,a)),l);if(e!==null){let t;if(Mu(e)){let n=e.ownerDocument.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();(function(e,t,n){let r=bd(n),i=wd(r);if(r===null||i===null)return;let a=n.getBoundingClientRect();if(t.bottom<a.top)return;let{top:o,bottom:s}=t,c=0,l=0,u=n;for(;u!==null;){let t=u===r.body;if(t){let t=i.visualViewport;if(t){let e=t.offsetTop;c=e,l=e+t.height}else c=0,l=Td(e).innerHeight;let n=i.getComputedStyle(r.documentElement),a=parseFloat(n.scrollPaddingTop),o=parseFloat(n.scrollPaddingBottom);isFinite(a)&&(c+=a),isFinite(o)&&(l-=o)}else{let e=u===n?a:u.getBoundingClientRect();c=e.top,l=e.bottom}let d=0;if(o<c?d=-(c-o):s>l&&(d=s-l),d!==0){if(t)i.scrollBy(0,d);else{let e=u.scrollTop;u.scrollTop+=d;let t=u.scrollTop-e;o-=t,s-=t}}if(t)break;u=yd(u)}})(n,t,a)}}(function(e){e._inputState.isSelectionChangeFromDOMUpdate=!0})(n)}}function nl(e){let t=U()||Jc();t===null&&(t=Yu().selectEnd()),t.insertNodes(e)}function rl(e,t){for(let n of e.split(/(\r?\n|\t)/))n===`
15
+ `||n===`\r
16
+ `?t.linebreak():n===` `?t.tab():n!==``&&t.text(n)}function il(e){let t=[];return rl(e,{linebreak:()=>t.push(nu()),tab:()=>t.push(mc()),text:e=>t.push(dc(e))}),t}function al(e){let t=[];for(let n of e)ru(n)||(!W(n)&&!Gl(n)||n.isInline()?t.push(n):W(n)&&t.push(...al(n.getChildren())));return t}function ol(e){let t=e;e.isCollapsed()||t.removeText();let n=U();H(n)&&(t=n),H(t)||z(161);let r=t.anchor,i=r.getNode(),a=r.offset;for(;!sf(i)&&If(i)===null;){let e=i;if([i,a]=sl(i,a),e.is(i))break}return a}function sl(e,t){let n=e.getParent();if(!n){let e=lu();return Yu().append(e),e.select(),[Yu(),0]}if(V(e)){let r=e.splitText(t);if(r.length===0)return[n,e.getIndexWithinParent()];let i=t===0?0:1;return[n,r[0].getIndexWithinParent()+i]}if(!W(e)||t===0)return[n,e.getIndexWithinParent()];let r=e.getChildAtIndex(t);if(r){let n=new Sc(_c(e.__key,t,`element`),_c(e.__key,t,`element`),0,``),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function cl(e){return ru(e)||Ed(e)||V(e)||e.isParentRequired()}function ll(e){let t=lu(),n=null;for(let r=0;r<e.length;r++){let i=e[r];if(cl(i)){if(n===null){n=i.createParentElementNode(),t.append(n);let a=e[r+1];if(ru(i)&&(a===void 0||!cl(a)))continue}n.append(i)}else t.append(i),n=null}return t}function ul(e,t,n,r,i=`decorators-and-blocks`){if(t===`move`&&r===`character`&&!e.isCollapsed()){let[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}let a=Np(e.focus,n?`previous`:`next`),o=r===`lineboundary`,s=t===`move`,c=a,l=i===`decorators-and-blocks`;if(!Up(c)){for(let e of c){l=!1;let{origin:t}=e;if(!Gl(t)||t.isIsolated()||(c=e,!o||!t.isInline()))break}if(l)for(let e of wp(a).iterNodeCarets(t===`extend`?`shadowRoot`:`root`)){if(dp(e))e.origin.isInline()||(c=e);else{if(W(e.origin))continue;Gl(e.origin)&&!e.origin.isInline()&&(c=e)}break}}if(c===a)return!1;if(s&&!o&&Gl(c.origin)&&c.origin.isKeyboardSelectable()){let e=Kc();return e.add(c.origin.getKey()),Xu(e),!0}return c=Hp(c),s&&Pp(e.anchor,c),Pp(e.focus,c),l||!o}var dl=null,fl=null,pl=!1,ml=!1,hl=!1,gl=new Set,_l=0,vl={characterData:!0,childList:!0,subtree:!0};function yl(){return pl||dl!==null&&dl._readOnly}function bl(){pl&&z(13)}function xl(){_l>99&&z(14)}function Sl(){return dl===null&&z(195,El()),dl}function Cl(e){Sl()!==null&&fl===null&&(fl=e),fl!==e&&Vr(378)}function wl(){return fl===null&&z(337,El()),fl}function Tl(){wl()._dirtyType=2}function El(){let e=0,t=new Set,n=vu.version;if(typeof window<`u`)for(let r of Vd(document)){let i=ku(r);if(Du(i))e++;else if(i){let e=String(i.constructor.version||`<0.17.1`);e===n&&(e+=` (separately built, likely a bundler configuration issue)`),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(`, `)}`),r}function Dl(){return fl}function Ol(e,t,n){let r=t.__type,i=Su(e,r),a=n.get(r);a===void 0&&(a=Array.from(i.transforms),n.set(r,a));let o=a.length;for(let e=0;e<o&&(a[e](t),t.isAttached());e++);}function kl(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function Al(e,t){if(!t)return;let n=e._updateTags,r=t;Array.isArray(t)||(r=[t]);for(let e of r)n.add(e)}function jl(e){return Ml(e,wl()._nodes)}function Ml(e,t){let n=e.type,r=t.get(n);r===void 0&&z(17,n);let i=r.klass;e.type!==i.getType()&&z(18,i.name);let a=i.importJSON(e),o=e.children;if(W(a)&&Array.isArray(o))for(let e=0;e<o.length;e++){let n=Ml(o[e],t);a.append(n)}let s=e.$slots;if(s){Pf(a)||z(379,i.name);for(let e in s)Qf(a,e,Ml(s[e],t))}return a}function Nl(e,t,n){let r=dl,i=pl,a=fl;dl=t,pl=!0,fl=e;try{return n()}finally{dl=r,pl=i,fl=a}}function Pl(e,t){let n=hl;hl=!0;try{(function(e,t){let n=e._pendingEditorState,r=e._rootElement,i=e._headless||r===null;if(n===null)return void(!e._updating&&e._deferred.length>0&&Ll(e,e._deferred));let a=e._editorState,o=a._selection,s=n._selection,c=e._dirtyType!==0,l=dl,u=pl,d=fl,f=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!i&&c&&p!==null){fl=e,dl=n,pl=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),m=io(a,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),ml)throw t;fu(e,null,r,n),Hi(e),e._dirtyType=2,ml=!0,Pl(e,a),ml=!1;return}finally{p.observe(r,vl),e._updating=f,dl=l,pl=u,fl=d}}n._readOnly||=!0;let h=e._dirtyLeaves,g=e._dirtyElements,_=e._normalizedNodes,v=e._updateTags;c&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set),e._updateTags=new Set,function(e,t){let n=e._decorators,r=e._pendingDecorators||n,i=t._nodeMap,a;for(a in r)i.has(a)||(r===n&&(r=qu(e)),delete r[a])}(e,n);let y=i?null:Id(Td(e));if(e._editable&&y!==null&&(c||s===null||s.dirty||!s.is(o))&&r!==null&&!v.has(`skip-dom-selection`)){fl=e,dl=n;try{if(p!==null&&p.disconnect(),c||s===null||s.dirty){let t=e._blockCursorElement;t!==null&&Fd(t,e,r),tl(o,s,e,y,v,r)}(function(e,t,n){let r=e._blockCursorElement;if(H(n)&&n.isCollapsed()&&n.anchor.type===`element`&&t.contains(Xd(t))){let i=n.anchor,a=i.getNode(),o=i.offset,s=!1,c=null;if(o===a.getChildrenSize())Pd(a.getChildAtIndex(o-1))&&(s=!0);else{let t=a.getChildAtIndex(o);if(t!==null&&Pd(t)){let n=t.getPreviousSibling();(n===null||Pd(n))&&(s=!0,c=e.getElementByKey(t.__key))}}if(s){let n=uf(a,e.getElementByKey(a.__key),e).element;r===null&&(e._blockCursorElement=r=function(e){let t=e.theme,n=Ud().createElement(`div`);n.contentEditable=`false`,n.setAttribute(`data-lexical-cursor`,`true`);let r=t.blockCursor;return r!==void 0&&(typeof r==`string`&&(r=t.blockCursor=nm(r)),r!==void 0&&n.classList.add(...r)),n}(e._config)),t.style.caretColor=`transparent`,c===null?n.appendChild(r):n.insertBefore(r,c);return}}r!==null&&Fd(r,e,t)})(e,r,s)}finally{p!==null&&p.observe(r,vl),fl=d,dl=l}}m!==null&&function(e,t,n,r,i){let a=Array.from(e._listeners.mutation),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];for(let e of s){let a=t.get(e);a!==void 0&&o(a,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,m,v,h,a),H(s)||s===null||o!==null&&o.is(s)||e.dispatchCommand(oo,void 0);let b=e._pendingDecorators;b!==null&&(e._decorators=b,e._pendingDecorators=null,Fl(`decorator`,e,!0,b)),function(e,t,n){let r=Ju(t),i=Ju(n);r!==i&&Fl(`textcontent`,e,!0,i)}(e,t||a,n),Fl(`update`,e,!0,{dirtyElements:g,dirtyLeaves:h,editorState:n,mutatedNodes:m,normalizedNodes:_,prevEditorState:t||a,tags:v}),!f&&Ll(e,e._deferred),(function(e){let t=e._updates;if(t.length===0)return void(e._cascadeCount=0);if(function(e){gl.has(e)||(gl.add(e),setTimeout(()=>{gl.delete(e),e._cascadeCount=0},0))}(e),e._cascadeCount++>99)return e._updates=[],e._cascadeCount=0,void e._onWarn(Error(`One or more update listeners are endlessly enqueueing more updates. May have encountered infinite recursion caused by update listeners that trigger additional updates without a stop condition. Editor namespace: ${e._config.namespace}`));let n=t.shift();if(n){let[t,r]=n;zl(e,t,r)}})(e)})(e,t)}finally{hl=n}}function Fl(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=t._listeners[e],i=Array.from(n);for(let[e,t]of i){t&&t();let i=e(...r);n.has(e)?n.set(e,i):i&&i()}}finally{t._updating=i}}function Il(e,t,n,r){let i=ed(e),a;if(!hl)for(let e=0;e<i.length;e++)i[e]._updating||(i[e]._cascadeCount=0);for(let e=4;e>=0;e--)for(let o=0;o<i.length;o++){let s=i[o];if(o>0&&s._updating){a=s;break}let c=s._commands.get(t);if(c!==void 0){let t=c[e];if(t.size>0){let e=!1;if(Bl(s,()=>{for(let i of t)if(i(n,r))return void(e=!0)}),e)return e}}}return a&&a.update(()=>{Il(a,t,n,r)}),!1}function Ll(e,t){if(e._deferred=[],t.length!==0){let n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}function Rl(e,t){let n=e._updates,r=t||!1;for(;n.length!==0;){let t=n.shift();if(t){let[n,i]=t,a=e._pendingEditorState,o;i!==void 0&&(o=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(a===null&&z(191),a._flushSync=!0),o&&e._deferred.push(o),Al(e,i.tag)),a==null?zl(e,n,i):n()}}return r}function zl(e,t,n){let r=e._updateTags,i,a=!1,o=!1;n!==void 0&&(i=n.onUpdate,Al(e,n.tag),a=n.skipTransforms||!1,o=n.discrete||!1),i&&e._deferred.push(i);let s=e._editorState,c=e._pendingEditorState,l=!1;(c===null||c._readOnly)&&(c=e._pendingEditorState=Jl(c||s),l=!0),c._flushSync=o;let u=dl,d=pl,f=fl,p=e._updating;dl=c,pl=!1,e._updating=!0,fl=e;let m=e._headless||e.getRootElement()===null;bu(null);try{l&&(m?s._selection!==null&&(c._selection=s._selection.clone()):c._selection=function(e,t){let n=e.getEditorState()._selection,r=Id(Td(e));return H(n)||n==null?qc(n,r,e,t):n.clone()}(e,n&&n.event||null));let r=e._compositionKey;t(),a=Rl(e,a),function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(H(r)){let e=r.anchor,t=r.focus,i;if(e.type===`text`&&(i=e.getNode(),i.selectionTransform(n,r)),t.type===`text`){let e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(c,e),e._dirtyType!==0&&(a?function(e,t){let n=t._dirtyLeaves,r=e._nodeMap;for(let e of n){let t=r.get(e);V(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&oa(t)}}(c,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,a=Vu(),o=new Map,s=n,c=s.size,l=r,u=l.size;for(;c>0||u>0;){if(c>0){t._dirtyLeaves=new Set;for(let e of s){let r=i.get(e);V(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&oa(r),r!==void 0&&kl(r,a)&&Ol(t,r,o),n.add(e)}if(s=t._dirtyLeaves,c=s.size,c>0){_l++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,l.delete(`root`)&&l.set(`root`,!0);for(let e of l){let n=e[0],s=e[1];if(r.set(n,s),!s)continue;let c=i.get(n);c!==void 0&&kl(c,a)&&Ol(t,c,o)}s=t._dirtyLeaves,c=s.size,l=t._dirtyElements,u=l.size,_l++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),Rl(e),function(e,t,n,r){let i=e._nodeMap,a=t._nodeMap,o=[];for(let[e]of r){let t=a.get(e);t!==void 0&&(t.isAttached()||(W(t)&&Mi(t,e,i,a,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of n){let t=a.get(e);t===void 0||t.isAttached()||(Pf(t)&&t.__slots!==null&&Mi(t,e,i,a,o,n),i.has(e)||n.delete(e),o.push(e))}for(let e of o)a.delete(e);let s=wl(),c=s._compositionKey;c===null||a.has(c)||(s._compositionKey=null)}(s,c,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(c._flushSync=!0);let i=c._selection;if(H(i)){e._slotsUsed&&Vc(i);let t=c._nodeMap,n=i.anchor.key,r=i.focus.key;t.get(n)!==void 0&&t.get(r)!==void 0||z(19)}else Cc(i)&&i._nodes.size===0&&(c._selection=null)}catch(t){t instanceof Error&&e._onError(t),e._pendingEditorState=s,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),Pl(e);return}finally{dl=u,pl=d,fl=f,e._updating=p,_l=0}e._dirtyType!==0||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(r!==null){if(r.dirty||!r.is(n))return!0}else if(n!==null)return!0;return!1}(c,e)?c._flushSync?(c._flushSync=!1,Pl(e)):l&&wu(()=>{Pl(e)}):(c._flushSync=!1,l&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function Bl(e,t,n){fl===e&&n===void 0?t():zl(e,t,n)}function Vl(e){if(kd(e)){let t=null;for(let n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}var Hl=class extends Rs{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for(`ElementNode`),{$transform:Vl,extends:Rs})}constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style=``,this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=``,this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&z(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){return gi[this.getFormat()]||``}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&Vf(this).length===0}isDirty(){let e=wl()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[];for(let t of Vf(this)){let n=Hf(this,t);W(n)&&e.push(...n.getAllTextNodes())}let t=this.getFirstChild();for(;t!==null;){if(V(t)&&e.push(t),W(t)){let n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;W(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;W(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=this.getChildren(),n=t.length;if(e>=n){let e=t[n-1];return W(e)&&e.getLastDescendant()||e||null}let r=t[e];return W(r)&&r.getFirstDescendant()||r||null}getFirstChild(){let e=this.getLatest().__first;return e===null?null:Hu(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&z(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:Hu(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&z(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;n!==null&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;n!==null&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=Yf(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContent(),W(i)&&r!==n-1&&!i.isInline()&&(e+=li)}return e}getTextContentSize(){let e=function(e){let t=0;for(let n of Vf(e)){let r=Hf(e,n);r!==null&&(t+=r.getTextContentSize())}return t}(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContentSize(),W(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==``){let t=hi[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){let t=pi[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return Fu(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){bl();let n=U(),r=e,i=t,a=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let e=this.getFirstChild();if(V(e)||W(e))return e.select(0,0)}else if(!(e!==void 0&&e!==a||t!==void 0&&t!==a)){let e=this.getLastChild();if(V(e)||W(e))return e.select()}}r===void 0&&(r=a),i===void 0&&(i=a);let o=this.__key;return H(n)?(n.anchor.set(o,r,`element`),n.focus.set(o,i,`element`),n.dirty=!0,n):Wc(o,r,o,i,`element`,`element`)}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(e=>e.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==``&&hi[e]||0,this}setStyle(e){return this.getWritable().__style=e||``,this}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){Is(this)&&z(324,this.__key,this.__type);let r=this.getChildrenSize(),i=this.getWritable();e+t<=r||z(226,String(e),String(t),String(r));for(let e of n);let a=i.__key,o=[],s=[],c=this.getChildAtIndex(e+t),l=null,u=r-t+n.length;if(e!==0){if(e===r)l=this.getLastChild();else{let t=this.getChildAtIndex(e);t!==null&&(l=t.getPreviousSibling())}}if(t>0){let e=l===null?this.getFirstChild():l.getNextSibling();for(let n=0;n<t;n++){e===null&&z(100);let t=e.getNextSibling(),n=e.__key;Ru(e.getWritable()),s.push(n),e=t}}let d=l;for(let e of n){d!==null&&e.is(d)&&(l=d=d.getPreviousSibling());let t=e.getWritable();t.__parent===a&&u--,Ru(t);let n=e.__key;if(d===null)i.__first=n,t.__prev=null;else{let e=d.getWritable();e.__next=n,t.__prev=e.__key}e.__key===a&&z(76),t.__parent=a,o.push(n),d=e}if(e+t===r)d!==null&&(d.getWritable().__next=null,i.__last=d.__key);else if(c!==null){let e=c.getWritable();if(d!==null){let t=d.getWritable();e.__prev=d.__key,t.__next=c.__key}else e.__prev=null}if(i.__size=u,s.length){let e=U();if(H(e)){let t=new Set(s),n=new Set(o),{anchor:r,focus:i}=e;Ul(r,t,n)&&Zc(r,r.getNode(),this,l,c),Ul(i,t,n)&&Zc(i,i.getNode(),this,l,c),u!==0||this.canBeEmpty()||kd(this)||this.remove()}}return i}getDOMSlot(e){return new wi(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(K(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+`px`,t.setAttribute(`data-lexical-indent`,String(e)));let n=this.getDirection();n&&(t.dir=n)}return{element:t}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return t===0&&n===``||kd(this)||this.getChildren().some(V)||(t!==0&&(e.textFormat=t),n!==``&&(e.textStyle=n)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||``)}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){let n=uf(this,e,t),r=n.getFirstChild();for(let e=this.getFirstChild();e;e=e.getNextSibling()){let i=t.getElementByKey(e.getKey());i!==null&&(r==null?(n.insertChild(i),r=i):r!==i&&n.replaceChild(i,r),r=r.nextSibling)}}};function W(e){return e instanceof Hl}function Ul(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}var Wl=class extends Rs{__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&z(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function Gl(e){return e instanceof Wl}var Kl=class e extends Hl{__cachedText;static getType(){return`root`}static clone(){return new e}constructor(){super(`root`),this.__cachedText=null}getTopLevelElementOrThrow(){z(51)}getTextContent(){let e=this.__cachedText;return e===null||!yl()&&wl()._dirtyType!==0?super.getTextContent():e}remove(){z(52)}replace(e){z(53)}insertBefore(e){z(54)}insertAfter(e){z(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)W(e)||Gl(e)||z(282);return super.splice(e,t,n)}static importJSON(e){return Yu().updateFromJSON(e)}collapseAtStart(){return!0}};function ql(e){return e instanceof Kl}function Jl(e){return new Ql(Ai(e._nodeMap),null,e._slotsUsed)}function Yl(){return new Ql(new Map([[`root`,new Kl]]),null,!1)}function Xl(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&z(130,n.name),W(e)){let r=t.children;Array.isArray(r)||z(59,n.name);let i=e.getChildren();for(let e=0;e<i.length;e++){let t=Xl(i[e]);r.push(t)}}let r=Vf(e);if(r.length>0){let i={};for(let t of r){let r=Hf(e,t);r===null&&z(366,n.name,t),i[t]=Xl(r)}t.$slots=i}return t}function Zl(e){return e instanceof Ql}var Ql=class e{_nodeMap;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,t=null,n=!1){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=n}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return Nl(t&&t.editor||null,this,e)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t,this._slotsUsed);return n._readOnly=!0,n}toJSON(){return Nl(null,this,()=>({root:Xl(Yu())}))}},$l=class extends Hl{static getType(){return`artificial`}createDOM(e){return Ud().createElement(`div`)}},eu=class e extends Rs{static getType(){return`linebreak`}static clone(t){return new e(t.__key)}constructor(e){super(e)}getTextContent(){return`
17
+ `}createDOM(){return Ud().createElement(`br`)}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>iu(e)||au(e)?null:{conversion:tu,priority:0}}}static importJSON(e){return nu().updateFromJSON(e)}};function tu(e){return{node:nu()}}function nu(){return jd(new eu)}function ru(e){return e instanceof eu}function iu(e){let t=e.parentElement;if(t!==null&&of(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&ou(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&ou(n))return!0}}return!1}function au(e){let t=e.parentElement;if(t!==null&&of(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&ou(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&ou(r))return!0}return!1}function ou(e){return Mu(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||``)}var su=class e extends Hl{static getType(){return`paragraph`}static clone(t){return new e(t.__key)}createDOM(e){let t=Ud().createElement(`p`),n=pd(e.theme,`paragraph`);return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:cu,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(K(t)){this.isEmpty()&&t.append(Ud().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}static importJSON(e){return lu().updateFromJSON(e)}exportJSON(){let e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){let t=this.getChildren().find(V);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){let n=lu();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){let e=this.getChildren();if(e.length===0||V(e[0])&&e[0].getTextContent().trim()===``){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function cu(e){let t=lu();if(bf(t,e),vf(e,t),t.getFormatType()===``){let n=e.getAttribute(`align`);n&&n&&n in hi&&t.setFormat(n)}return yf(t,e),{node:t}}function lu(){return jd(new su)}function uu(e){return e instanceof su}function du(e){console.warn(e)}function fu(e,t,n,r,i){let a=e._keyToDOMMap;a.clear(),e._editorState=Yl(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,i&&i.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,e._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),e._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},compositionEndData:``,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null};let o=e._observer;o!==null&&(o.disconnect(),e._observer=null),t!==null&&(t.textContent=``,function(e,t){let n=`__lexicalKey_${t._key}`;delete e[n]}(t,e)),n!==null&&(n.textContent=``,a.set(`root`,n),Wu(n,e,`root`))}function pu(e){let t=new Set,n=new Set;for(let{klass:r,ownNodeConfig:i}of Of(e)){let e=r.transform;if(!n.has(e)){n.add(e);let i=r.transform();i&&t.add(i)}if(i){let e=i.$transform;e&&t.add(e)}}return t}var mu={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,r)=>{},$exportDOM:(e,t)=>{let n=Cu(t,e.getType());return n&&n.exportDOM!==void 0?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,r,i)=>W(e)&&e.extractWithChild(t,n,r),$getDOMSlot:(e,t,n)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,n,r)=>null,$shouldExclude:(e,t,n)=>W(e)&&e.excludeFromCopy(`html`),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,r)=>e.updateDOM(t,n,r._config)};function hu(e){let t=e||{},n=Dl(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,o=Yl(),s=t.namespace||(i===null?td():i._config.namespace),c=t.editorState,l=[Kl,nc,eu,pc,su,$l,...t.nodes||[]],{onError:u,onWarn:d,html:f}=t,p=t.editable===void 0||t.editable,m;if(e===void 0&&n!==null)m=n._nodes;else{m=new Map;for(let e=0;e<l.length;e++){let n=l[e],r=null,i=null;if(n&&typeof n==`object`){let e=n;n=e.replace,r=e.with,i=e.withKlass||null}if(typeof n!=`function`||!n.prototype||!(n===Rs||n.prototype instanceof Rs)){let r=`<unknown>`;try{r=JSON.parse(Di)}catch{}z(365,String(e-l.length+(t.nodes?t.nodes.length:0)),typeof n==`function`?`${n.name}${typeof n.getType==`function`?` (type ${String(n.getType())})`:``}`:String(n),String(r))}Df(n);let a=n.getType(),o=pu(n);m.set(a,{exportDOM:f&&f.export?f.export.get(n):void 0,klass:n,replace:r,replaceWithKlass:i,sharedNodeState:Ji(l[e]),transforms:o})}}let h=new vu(o,i,m,{disableEvents:a,dom:{...mu,...e&&e.dom},namespace:s,theme:r},u||console.error,d||du,function(e,t){let n=new Map,r=new Set,i=e=>{Object.keys(e).forEach(t=>{let r=n.get(t);r===void 0&&(r=[],n.set(t,r)),r.push(e[t])})};return e.forEach(e=>{let t=e.klass.importDOM;if(t==null||r.has(t))return;r.add(t);let n=t.call(e.klass);n!==null&&i(n)}),t&&i(t),n}(m,f?f.import:void 0),p,e);return c!==void 0&&(h._pendingEditorState=c,h._dirtyType=2),function(e){e.registerCommand(lo,bs,0),e.registerCommand(uo,xs,0),e.registerCommand(fo,Ss,0),e.registerCommand(po,Cs,0),e.registerCommand(Eo,Es,0)}(h),h}function gu(e,t){let n=e.get(t);e.delete(t),n&&n()}function _u(e,t,n){return e.set(t,n),gu.bind(null,e,t)}var vu=class{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_inputState;_createEditorArgs;constructor(e,t,n,r,i,a,o,s,c){this._createEditorArgs=c,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new ji,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=td(),this._onError=i,this._onWarn=a,this._htmlConversions=o,this._editable=s,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},compositionEndData:``,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null}}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return _u(this._listeners.update,e)}registerEditableListener(e){return _u(this._listeners.editable,e)}registerDecoratorListener(e){return _u(this._listeners.decorator,e)}registerTextContentListener(e){return _u(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return am(_u(t,e,e(this._rootElement,null)||void 0),()=>function(e,t,n){let r=e.get(t);r&&r(),e.set(t,t(...n)||void 0)}(t,e,[null,this._rootElement]))}registerCommand(e,t,n){n===void 0&&z(35);let r=this._commands;r.has(e)||r.set(e,[new Oi,new Oi,new Oi,new Oi,new Oi]);let i=r.get(e);i===void 0&&z(36,String(e));let a=function(e){return 7&e}(n),o=i[a];return a===n?o.addBack(t):o.addFront(t),()=>{o.delete(t),i.every(e=>e.size===0)&&r.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(t);a===void 0&&(a=new Set,i.set(t,a)),a.add(r);let o=n&&n.skipInitialization;return o!==void 0&&o||this.initializeMutationListener(t,r),()=>{a.delete(r),a.size===0&&i.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&z(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=hf(n).get(t.getType());if(!r)return;let i=new Map;for(let e of r.keys())i.set(e,`created`);i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set([`registerMutationListener`])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(i!=null){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return function(e,t){let n=hf(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}r.length!==0&&e.update(()=>{for(let e of r)for(let t of e.keys()){let e=Hu(t);e&&e.markDirty()}},e._pendingEditorState===null?{tag:Hs}:void 0)}(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return G(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=pd(this._config.theme,`root`),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,fu(this,t,e,r,{preserveUpdateQueue:!0}),t!==null&&(this._config.disableEvents||Ms(t),n!=null&&t.classList.remove(...n)),e!==null){let t=wd(e),r=e.style;r.userSelect=`text`,r.whiteSpace=`pre-wrap`,r.wordBreak=`break-word`,e.setAttribute(`data-lexical-editor`,`true`),this._window=t,this._dirtyType=2,Hi(this),this._updateTags.add(Hs),Pl(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument;ss.set(e,n);let r=cs.get(n);r===void 0&&(r={editors:new Set,hasShadowEditor:void 0},cs.set(n,r)),r.editors.add(t),r.hasShadowEditor=void 0,e.__lexicalEditor=t;let i=Ds(e);i.push(ls.register(n));for(let n=0;n<os.length;n++){let[r,a]=os[n],o=typeof a==`function`?e=>{js(e)||(As(e),(t.isEditable()||r===`click`)&&a(e,t))}:e=>{if(js(e))return;As(e);let n=t.isEditable();switch(r){case`cut`:return n&&G(t,Jo,e);case`copy`:return G(t,qo,e);case`paste`:return n&&G(t,vo,e);case`dragstart`:return n&&G(t,Wo,e);case`dragover`:return n&&G(t,Go,e);case`dragend`:return n&&G(t,Ko,e);case`focus`:return n&&G(t,es,e);case`blur`:return n&&G(t,ts,e);case`drop`:return n&&G(t,Ho,e)}};i.push(is(e,r,o))}}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add(Hs),Pl(this);Fl(`root`,this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&z(38);let n=e;n._readOnly&&(n=Jl(e),n._selection=e._selection?e._selection.clone():null),Vi(this);let r=this._pendingEditorState,i=t===void 0?null:t.tag;r===null||r.isEmpty()||(i!=null&&this._updateTags.add(i),Pl(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set(`root`,!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,Bl(this,()=>{if(i&&this._updateTags.add(i),e._parsed)for(let[e,t]of n._nodeMap.entries())W(t)?this._dirtyElements.set(e,!0):this._dirtyLeaves.add(e)},{discrete:!this._updating||void 0})}parseEditorState(e,t){return function(e,t,n){let r=Yl(),i=dl,a=pl,o=fl,s=t._dirtyElements,c=t._dirtyLeaves,l=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,dl=r,pl=!1,fl=t,bu(null);try{let i=t._nodes;Ml(e.root,i),n&&n(),r._readOnly=!0,r._parsed=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=c,t._cloneNotNeeded=l,t._dirtyType=u,dl=i,pl=a,fl=o}return r}(typeof e==`string`?JSON.parse(e):e,this,t)}read(...e){let[t,n]=e.length===1?[`force-commit`,e[0]]:e;return t===`force-commit`&&Pl(this),(t===`pending`?this._pendingEditorState||this._editorState:this.getEditorState()).read(n,{editor:this})}update(e,t){(function(e,t,n){e._updating?e._updates.push([t,n]):zl(e,t,n)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute(`autocapitalize`,`off`),Bl(this,()=>{let r=U(),i=Yu();r===null?i.getChildrenSize()!==0&&(t.defaultSelection===`rootStart`?i.selectStart():i.selectEnd()):r.dirty||Xu(r.clone()),xd(`focus`),Sd(()=>{n.removeAttribute(`autocapitalize`),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute(`autocapitalize`))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=Id(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Fl(`editable`,this,!0,e),this._slotsUsed&&this.update(()=>Tl()))}toJSON(){return{editorState:this._editorState.toJSON()}}};vu.version=Di;var yu=null;function bu(e){yu=e}var xu=1;function Su(e,t){let n=Cu(e,t);return n===void 0&&z(30,t),n}function Cu(e,t){return e._nodes.get(t)}var wu=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)};function Tu(e,t){let n=t===void 0?(()=>{let t=e.getRootNode();return Nu(t)||Rd(t)?Zd(t):null})():t;if(!K(n)||n.hasAttribute(`data-lexical-slot`))return!1;let r=Ku(n),i=n.nodeName;return zs(r)&&(i===`INPUT`||i===`TEXTAREA`||n.contentEditable===`true`&&ku(n)==null)}function Eu(e,t,n){let r=e.getRootElement();if(!r)return!1;try{if(!t||!r.contains(t)||!r.contains(n))return!1}catch{return!1}return Ou(t)===e&&e.read(`latest`,()=>!Tu(t))}function Du(e){return e instanceof vu}function Ou(e){let t=e;for(;t!=null;){let e=ku(t);if(Du(e))return e;t=yd(t)}return null}function ku(e){return e?e.__lexicalEditor:null}function Au(e){return hc(e)||e.isToken()}function ju(e){return Au(e)||e.isSegmented()}function Mu(e){return ef(e)&&e.nodeType===3}function Nu(e){return ef(e)&&e.nodeType===9}function Pu(e){let t=e;for(;t!=null;){if(Mu(t))return t;t=t.firstChild}return null}function Fu(e,t,n){let r=pi[t];if(n!==null&&(e&r)===(n&r))return e;let i=e^r;return t===`subscript`?i&=~pi.superscript:t===`superscript`?i&=~pi.subscript:t===`lowercase`?(i&=~pi.uppercase,i&=~pi.capitalize):t===`uppercase`?(i&=~pi.lowercase,i&=~pi.capitalize):t===`capitalize`&&(i&=~pi.lowercase,i&=~pi.uppercase),i}function Iu(e){return V(e)||ru(e)||Gl(e)}function Lu(e,t){let n=function(){let e=yu;return yu=null,e}();if((t||=n&&n.__key)!=null)return void(e.__key=t);bl(),xl();let r=wl(),i=Sl(),a=``+xu++;i._nodeMap.set(a,e),W(e)?r._dirtyElements.set(a,!0):r._dirtyLeaves.add(a),r._cloneNotNeeded.add(a),r._dirtyType===0&&(r._dirtyType=1),e.__key=a}function Ru(e){If(e)!==null&&z(380,e.__key,String(If(e)));let t=e.getParent();if(t!==null){let n=e.getWritable(),r=t.getWritable(),i=e.getPreviousSibling(),a=e.getNextSibling(),o=a===null?null:a.__key,s=i===null?null:i.__key,c=i===null?null:i.getWritable(),l=a===null?null:a.getWritable();i===null&&(r.__first=o),a===null&&(r.__last=s),c!==null&&(c.__next=o),l!==null&&(l.__prev=s),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function zu(e){xl(),Is(e)&&z(323,e.__key,e.__type);let t=e.getLatest(),n=t.__parent===null?Ff(t)?t.__slotHost:null:t.__parent,r=Sl(),i=wl(),a=r._nodeMap,o=i._dirtyElements;n!==null&&function(e,t,n){let r=e;for(;r!==null;){if(n.has(r))return;let e=t.get(r);if(e===void 0)break;n.set(r,!1),r=e.__parent===null?Ff(e)?e.__slotHost:null:e.__parent}}(n,a,o);let s=t.__key;i._dirtyType===0&&(i._dirtyType=1),W(e)?o.set(s,!0):i._dirtyLeaves.add(s)}function Bu(e){bl();let t=wl(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let e=Hu(n);e!==null&&e.getWritable()}if(e!==null){let t=Hu(e);t!==null&&t.getWritable()}}}function Vu(){return yl()?null:wl()._compositionKey}function Hu(e,t){let n=(t||Sl())._nodeMap.get(e);return n===void 0?null:n}function Uu(e,t){let n=Gu(e,wl());return n===void 0?null:Hu(n,t)}function Wu(e,t,n){e[`__lexicalKey_${t._key}`]=n}function Gu(e,t){return e[`__lexicalKey_${t._key}`]}function Ku(e,t){let n=e;for(;n!=null;){let e=Uu(n,t);if(e!==null)return e;n=yd(n)}return null}function qu(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function Ju(e){return e.read(()=>Yu().getTextContent())}function Yu(){return Sl()._nodeMap.get(`root`)}function Xu(e){bl();let t=Sl();e!==null&&(e.dirty=!0,e.setCachedNodes(null),H(e)&&wl()._slotsUsed&&Vc(e)),t._selection=e}function Zu(){bl(),Vi(wl())}function Qu(e){let t=function(e,t){let n=e;for(;n!=null;){let e=Gu(n,t);if(e!==void 0)return e;n=yd(n)}return null}(e,wl());return t===null?null:Hu(t)}function $u(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function ed(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}function td(){return Math.random().toString(36).replace(/[^a-z]+/g,``).substring(0,5)}function nd(e){return Mu(e)?e.nodeValue:null}function rd(e,t,n){let r=Id(Td(t));if(r===null)return;let i=Kd(r,t._rootElement),a=i.anchorNode,{anchorOffset:o,focusOffset:s}=i;if(a!==null){let t=nd(a),r=Ku(a);if(t!==null&&V(r)){if((t===ci||t===ui)&&n){let e=n.length;t=n,o=e,s=e}t!==null&&id(r,t,o,s,e)}}}function id(e,t,n,r,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let o=a.isComposing();if(a.isToken()&&o)return;let s=t;if((o||i)&&(t.endsWith(ci)&&(s=t.slice(0,-ci.length)),i)){let e=ui,t;for(;(t=s.indexOf(e))!==-1;)s=s.slice(0,t)+s.slice(t+e.length),n!==null&&n>t&&(n=Math.max(t,n-e.length)),r!==null&&r>t&&(r=Math.max(t,r-e.length))}let c=a.getTextContent();if(i||s!==c){let t=U();if(s===``){if(Bu(null),Yr||qr||Qr)a.remove();else{let e=wl();ad(a,``,t),setTimeout(()=>{e.update(()=>{a.isAttached()&&a.getTextContent()===``&&a.remove()})},20)}return}let i=a.getParent(),c=Jc(),l=a.getTextContentSize(),u=Vu(),d=a.getKey();if(a.isToken()&&!o||u!==null&&d===u&&!o||H(c)&&(i!==null&&!i.canInsertTextBefore()&&c.anchor.offset===0||c.anchor.key===e.__key&&c.anchor.offset===0&&!a.canInsertTextBefore()&&!o||c.focus.key===e.__key&&c.focus.offset===l&&!a.canInsertTextAfter()&&!o))return void a.markDirty();if(!H(t)||n===null||r===null)return void ad(a,s,t);if(t.setTextNodeRange(a,n,a,r),a.isSegmented()){let e=dc(a.getTextContent());a.replace(e),a=e}ad(a,s,t)}}}function ad(e,t,n){if(e.setTextContent(t),H(n)){let t=e.getKey(),r=!1;for(let i of[`anchor`,`focus`]){let a=n[i];a.type===`text`&&a.key===t&&(a.offset=_p(e,a.offset,`clamp`),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function od(e,t,n){let r=t[n]||!1;return r===`any`||r===e[n]}function sd(e,t){return od(e,t,`altKey`)&&od(e,t,`ctrlKey`)&&od(e,t,`shiftKey`)&&od(e,t,`metaKey`)}function cd(e,t,n){if(!sd(e,n))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1||e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;if(e.code.startsWith(`Digit`)&&/^\d$/.test(t))return e.code===`Digit${t}`;let r=`Key`+t.toUpperCase();return e.code===r}var ld={ctrlKey:!Wr,metaKey:Wr},ud={altKey:Wr,ctrlKey:!Wr};function dd(e){return e.key===`Backspace`}function fd(e){let t=Yu();if(H(e)){let t=e.anchor,n=e.focus,r=t.getNode();if(ql(r))return t.set(r.getKey(),0,`element`),n.set(r.getKey(),r.getChildrenSize(),`element`),sa(e),e;let i=r.getTopLevelElementOrThrow(),a=i.getParent();if(a===null)return W(i)&&(t.set(i.getKey(),0,`element`),n.set(i.getKey(),i.getChildrenSize(),`element`),sa(e)),e;let o=a;return t.set(o.getKey(),0,`element`),n.set(o.getKey(),o.getChildrenSize(),`element`),sa(e),e}{let e=t.select(0,t.getChildrenSize());return Xu(sa(e)),e}}function pd(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;let i=e[t];if(typeof i==`string`){let e=nm(i);return n[t]=e,e}return i}function md(e,t,n,r,i){if(n.size===0)return;let a=r.__type,o=r.__key,s=t.get(a);s===void 0&&z(33,a);let c=s.klass,l=e.get(c);l===void 0&&(l=new Map,e.set(c,l));let u=l.get(o),d=u===`destroyed`&&i===`created`;(u===void 0||d)&&l.set(o,d?`updated`:i)}function hd(e,t,n){let r=e.getParent(),i=n,a=e;return r!==null&&(t&&n===0?(i=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?i-1:i)}function gd(e,t){let n=e.offset;if(e.type===`element`)return hd(e.getNode(),t,n);{let r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return e===null?hd(r.getParentOrThrow(),t,r.getIndexWithinParent()+ +!t):e}}return null}function _d(e){let t=Td(e).event,n=t&&t.inputType;return n===`insertFromPaste`||n===`insertFromPasteAsQuotation`}function G(e,t,n){return Il(e,t,n,e)}function vd(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&z(75,t),n}function yd(e){let t=e.assignedSlot||e.parentElement;if(t!==null)return t;let n=e.parentNode;return Rd(n)?n.host:null}function bd(e){return Nu(e)?e:K(e)?e.ownerDocument:null}function xd(e){bl(),wl()._updateTags.add(e)}function Sd(e){bl(),wl()._deferred.push(e)}function Cd(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function wd(e){let t=bd(e);return t?t.defaultView:null}function Td(e){let t=e._window;return t===null&&z(78),t}function Ed(e){return W(e)&&e.isInline()||Gl(e)&&e.isInline()}function Dd(e){let t=e.getLatest();for(;t!==null;){if(If(t)!==null&&W(t))return t;let e=t.getParentOrThrow();if(kd(e))return e;t=e}return t}function Od(e){return W(e)&&e.isShadowRoot()}function kd(e){return ql(e)||Od(e)}function Ad(e,t=!1){let n=e.constructor.clone(e);return Lu(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function jd(e){let t=wl(),n=e.getType(),r=Cu(t,n);r===void 0&&z(200,e.constructor.name,n);let{replace:i,replaceWithKlass:a}=r;if(i!==null){let t=i(e),r=t.constructor;return a===null?t instanceof e.constructor&&r!==e.constructor||z(202,r.name,r.getType(),e.constructor.name,n):t instanceof a||z(201,a.name,a.getType(),r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&z(203,e.constructor.name,n,r.name,r.getType()),t}return e}function Md(e,t){!ql(e.getParent())||W(t)||Gl(t)||z(99)}function Nd(e){let t=Hu(e);return t===null&&z(63,e),t}function Pd(e){if(!e||e.isInline())return!1;if(Gl(e))return!0;if(W(e)){if(e.isShadowRoot()){let t=e.getParent();return!(W(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function Fd(e,t,n){n.style.removeProperty(`caret-color`),t._blockCursorElement=null;let r=e.parentElement;r!==null&&r.removeChild(e)}function Id(e){return Hr?(e||window).getSelection():null}function Ld(e){let t=wd(e);return t?t.getSelection():null}function Rd(e){return tf(e)&&`host`in e}var zd=[];function Bd(e){let t=e.getRootNode();if(t===e||!Rd(t))return zd;let n=[t],r=t.host;for(;;){let e=r.getRootNode();if(e===r||!Rd(e))break;n.push(e),r=e.host}return n}function*Vd(e){let t=[e],n;for(;n=t.pop();){yield*n.querySelectorAll(`[data-lexical-editor="true"]`);let e=(Nu(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT),r;for(;r=e.nextNode();)r.shadowRoot&&t.push(r.shadowRoot)}}function Hd(e){return e===null?document:e.ownerDocument}function Ud(){let e=Dl();return Hd(e===null?null:e._rootElement)}function Wd(e,t){if(t===null||typeof e.getComposedRanges!=`function`)return null;let n=Bd(t);if(n.length===0)return null;let r=e.getComposedRanges;try{let t=r.call(e,{shadowRoots:n})[0];if(t!==void 0)return t}catch{}try{let t=r.apply(e,n)[0];if(t!==void 0)return t}catch{}return null}function Gd(e,t){let n=Wd(e,t);if(n!==null){let e=qd(n);if(e!==null)return e}return e.rangeCount>0?e.getRangeAt(0):null}function Kd(e,t){let n=Wd(e,t);return n===null?e:Jd(n,Yd(e))}function qd(e){let t=e.startContainer.ownerDocument;if(t===null)return null;let n=t.createRange();try{return n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}catch{return null}}function Jd(e,t){let{startContainer:n,startOffset:r,endContainer:i,endOffset:a}=e;return t===`backward`?{anchorNode:i,anchorOffset:a,direction:t,focusNode:n,focusOffset:r}:{anchorNode:n,anchorOffset:r,direction:t,focusNode:i,focusOffset:a}}function Yd(e){return e.direction}function Xd(e){let t=e.getRootNode();return Nu(t)||Rd(t)?t.activeElement:null}function Zd(e){let t=e.activeElement;for(;t!==null&&t.shadowRoot!==null;){let e=t.shadowRoot.activeElement;if(e===null)break;t=e}return t}function Qd(e){let t=e.target;if(t!==null&&K(t)&&t.shadowRoot!==null&&typeof e.composedPath==`function`){let t=e.composedPath();if(t.length>0)return t[0]}return t}function $d(e){return K(e)&&e.tagName===`A`}function K(e){return ef(e)&&e.nodeType===1}function ef(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function tf(e){return ef(e)&&e.nodeType===11}var nf=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/i;function rf(e){return!(!K(e)||!e.style.display.startsWith(`inline`))||nf.test(e.nodeName)}var af=/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/i;function of(e){return(!K(e)||!e.style.display.startsWith(`inline`))&&af.test(e.nodeName)}function sf(e){if(Gl(e)&&!e.isInline())return!0;if(!W(e)||kd(e))return!1;let t=e.getFirstChild(),n=t===null||ru(t)||V(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function cf(){return wl()}function lf(e=cf()){return e._config.dom||mu}function uf(e,t,n=cf()){let r=lf(n).$getDOMSlot(e,t,n);return W(e)&&(df(r)||z(344,e.getKey(),e.getType())),r}function df(e){return e instanceof wi}function ff(e,t,n=cf()){return Pu(uf(e,t,n).element)}var pf=new WeakMap,mf=new Map;function hf(e){if(!e._readOnly&&e.isEmpty())return mf;e._readOnly||z(192);let t=pf.get(e);return t||(t=function(e){let t=new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),pf.set(e,t)),t}function gf(e){let t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function _f(e){return(t=gf(e))[Fs]=!0,t;var t}function vf(e,t){let n=e.getAttribute(`data-lexical-indent`);if(n!==null){let e=parseInt(n,10);if(Number.isFinite(e)&&e>=0)return void t.setIndent(e)}let r=parseInt(e.style.paddingInlineStart,10)||0,i=Math.round(r/40);t.setIndent(i)}function yf(e,t){let n=t.getAttribute(`dir`);return n===`ltr`||n===`rtl`?e.setDirection(n):e}function bf(e,t){let n=t.style.textAlign;return n&&n in hi?e.setFormat(n):e}function xf(e,t){e.__lexicalUnmanaged=!0,t&&t.captureSelection!==void 0&&(e.__lexicalCapturedSelection=t.captureSelection)}function Sf(e){return!0===e.__lexicalUnmanaged}function Cf(e,t=cf()){let n=t.isEditable();e.contentEditable=n?`true`:`false`,n?e.__lexicalEditor=t:delete e.__lexicalEditor}function wf(e,t){let n=e;for(;n!=null;){if(!0===n.__lexicalCapturedSelection)return!0;if(K(n)&&n.hasAttribute(`data-lexical-slot`)||Gu(n,t)!==void 0)return!1;n=yd(n)}return!1}function Tf(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)&&e[t]!==Rs[t]}var Ef=new WeakMap;function Df(e){let t=Ef.get(e);if(t)return t;let n=e.prototype!=null&&yi in e.prototype?e.prototype[yi]():void 0,r=function(e){if(!(e===Rs||e.prototype instanceof Rs)){let t=`<unknown>`,n=`<unknown>`;try{t=e.getType()}catch{}try{vu.version&&(n=JSON.parse(vu.version))}catch{}z(290,e.name,t,n)}return e===Wl||e===Hl||e===Rs}(e),i=!r&&Tf(e,`getType`)?e.getType():void 0,a,o=i;if(n){if(i)a=n[i];else{for(let[e,t]of Object.entries(n))o=e,a=t;if(!a)for(let e of Object.getOwnPropertySymbols(n)){let t=n[e];if(t){a=t;break}}}}if(!r&&o&&(Tf(e,`getType`)||(e.getType=()=>o),Tf(e,`clone`)||(e.clone=t=>(bu(t),new e)),Tf(e,`importJSON`)||(e.importJSON=a&&a.$importJSON||(t=>new e().updateFromJSON(t))),!Tf(e,`importDOM`)&&a)){let{importDOM:t}=a;t&&(e.importDOM=()=>t)}let s={klass:e,ownNodeConfig:a,ownNodeType:o};return Ef.set(e,s),s}function*Of(e){for(let t=e;t&&(t===Rs||zs(t.prototype));){let e=Df(t);yield e,t=e.ownNodeConfig&&e.ownNodeConfig.extends||Mf(t)}}function kf(e){let t=cf();return bl(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}var Af=(e,t)=>{let n=e;for(;n!=null&&!ql(n);){if(t(n))return n;n=n.getParent()}return null};function jf(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t===null?Hu(r):t.get(r);e??z(174),n.push(r),r=e.__next}return n}function Mf(e){let t=Object.getPrototypeOf(e);if(typeof t==`function`&&t!==Function.prototype)return t;let n=e.prototype&&Object.getPrototypeOf(e.prototype);return n?n.constructor:null}var Nf=new Map;function Pf(e){return W(e)||Gl(e)}function Ff(e){return W(e)||Gl(e)}function If(e){let t=e.getLatest();return Ff(t)?t.__slotHost:null}function Lf(e){let t=If(e);if(t===null)return null;let n=Hu(t);return W(n)||Gl(n)||z(370),n}function Rf(e){let t=Lf(e);if(t===null)return null;let n=e.getLatest().__key;for(let[e,r]of Bf(t))if(r===n)return e;return null}function zf(e){let t=e.getLatest();for(;t!==null;){if(If(t)!==null)return t;t=t.getParent()}return null}function Bf(e){let t=e.getLatest();return Pf(t)&&t.__slots!==null?t.__slots:Nf}function Vf(e){return Array.from(Bf(e).keys())}function Hf(e,t){let n=Bf(e).get(t);return n===void 0?null:Hu(n)}var Uf=[`__proto__`,`constructor`,`prototype`],Wf=Symbol(`slotMapOwner`);function Gf(e){let t=e.__slots;return t!==null&&t[Wf]===e||(t=new Map(t),t[Wf]=e,e.__slots=t),t}var Kf=new WeakMap,qf=[];function Jf(e){for(let{ownNodeConfig:t}of Of(e)){let e=t&&t.slots;if(e)return e}return qf}function Yf(e){let t=``;for(let n of Vf(e)){let r=Hf(e,n);r!==null&&(t+=r.getTextContent())}return t}function Xf(e,t,n){let r=n.get(e),i=n.get(t);return r===void 0?i===void 0?e<t?-1:+(e>t):1:i===void 0?-1:r-i}function Zf(e){let t=e.__slots;if(t===null||t.size<2)return;let n=function(e){let t=Kf.get(e);if(t===void 0){let n=Jf(e),r=new Map;for(let t of n)Uf.includes(t)&&z(371,e.name,t),r.has(t)&&z(372,e.name,t),r.set(t,r.size);t=r,Kf.set(e,t)}return t}(e.constructor),r=null,i=!0;for(let e of t.keys()){if(r!==null&&Xf(r,e,n)>0){i=!1;break}r=e}if(i)return;let a=Array.from(t).sort(([e],[t])=>Xf(e,t,n));t.clear();for(let[e,n]of a)t.set(e,n)}function Qf(e,t,n){t!==`__proto__`&&t!==`constructor`&&t!==`prototype`||z(373,t);let r=e.getLatest();if(r.__slots!==null&&r.__slots.get(t)===n.getLatest().__key)return r;(!W(n)&&!Gl(n)||n.isInline())&&z(374,n.__key);let i=e.getWritable(),a=Gf(i),o=a.get(t);o!==void 0&&ep(o);let s=n.getWritable(),c=Lf(s);if(c!==null){let e=Rf(s);e!==null&&Gf(c.getWritable()).delete(e),s.__slotHost=null}return Ru(s),s.__slotHost=i.__key,a.set(t,s.__key),Zf(i),function(){let e=cf();e._slotsUsed=!0,e._pendingEditorState&&(e._pendingEditorState._slotsUsed=!0)}(),i}function $f(e,t){let n=e.getWritable();if(n.__slots===null)return n;let r=n.__slots.get(t);return r!==void 0&&(ep(r),Gf(n).delete(t)),n}function ep(e){let t=Hu(e);if(t===null)return;let n=t.getWritable();Ff(n)||z(377,e),n.__slotHost=null,n.remove()}var tp={next:`previous`,previous:`next`},np=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return Dp({hasNext:up,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return hp(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return hp(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n=`next`){let r=n===this.direction?t:Array.from(t).reverse(),i=this,a=this.getParentAtCaret(),o=new Map;for(let t=i.getAdjacentCaret();t!==null&&o.size<e;t=t.getAdjacentCaret()){let e=t.origin.getWritable();o.set(e.getKey(),e)}for(let e of r){if(o.size>0){let t=i.getNodeAtCaret();if(t){if(o.delete(t.getKey()),o.delete(e.getKey()),!(t.is(e)||i.origin.is(e))){let n=e.getParent();n&&n.is(a)&&e.remove(),t.replace(e)}}else t===null&&z(263,Array.from(o).join(` `))}else i.insert(e);i=hp(e,this.direction)}for(let e of o.values())e.remove();return this}},rp=class e extends np{type=`child`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:yp(e,this.direction)}getParentCaret(e=`root`){return hp(op(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=ap(this.direction);return hp(this.getNodeAtCaret(),e)||yp(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},ip={root:ql,shadowRoot:kd};function ap(e){return tp[e]}function op(e,t=`root`){return e===null||ip[t](e)?null:If(e)===null?e:null}var sp=class e extends np{type=`sibling`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:hp(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return W(this.origin)?yp(this.origin,this.direction):null}getParentCaret(e=`root`){return hp(op(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=ap(this.direction);return hp(this.getNodeAtCaret(),e)||yp(this.origin.getParentOrThrow(),e)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof cp)&&this.direction===t.direction&&this.origin.is(t.origin)}},cp=class e extends np{type=`text`;offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:gp(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e=`root`){return hp(op(this.getParentAtCaret(),e),this.direction)}getFlipped(){return gp(this.origin,ap(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof sp||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return hp(this.origin,this.direction)}};function lp(e){return e instanceof cp}function up(e){return e instanceof sp}function dp(e){return e instanceof rp}var fp={next:class extends cp{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends cp{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},pp={next:class extends sp{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends sp{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},mp={next:class extends rp{direction=`next`;getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends rp{direction=`previous`;getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function hp(e,t){return e?new pp[t](e):null}function gp(e,t,n){return e?new fp[t](e,_p(e,n)):null}function _p(e,t,n=`error`){let r=e.getTextContentSize(),i=t===`next`?r:t===`previous`?0:t;return(i<0||i>r)&&(n!==`clamp`&&Vr(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function vp(e,t){return new Cp(e,t)}function yp(e,t){return W(e)?new mp[t](e):null}function bp(e){return e&&e.getChildCaret()||e}function xp(e){return e&&bp(e.getAdjacentCaret())}var Sp=class e{type=`node-caret-range`;direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=e=>{let t=this[e].getLatest();return lp(t)?function(e,t){let{direction:n,origin:r}=e;return vp(e,_p(r,t===`focus`?ap(n):n)-e.offset)}(t,e):null},t=e(`anchor`),n=e(`focus`);if(t&&n){let{caret:e}=t,{caret:r}=n;if(e.isSameNodeCaret(r))return[vp(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e=`root`){let t=lp(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=lp(n),i=t=>t.isSameNodeCaret(n)?null:xp(t)||t.getParentCaret(e);return Dp({hasNext:e=>e!==null&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets(`root`)}},Cp=class{type=`slice`;caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return gp(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}};function wp(e){return Ep(e,hp(Yu(),e.direction))}function Tp(e){return Ep(e,e)}function Ep(e,t){return e.direction!==t.direction&&z(265),new Sp(e,t,e.direction)}function Dp(e){let{initial:t,hasNext:n,step:r,map:i}=e,a=t;return{[Symbol.iterator](){return this},next(){if(!n(a))return{done:!0,value:void 0};let e={done:!1,value:i(a)};return a=r(a),e}}}function Op(e,t){let n=Mp(e.origin,t.origin);switch(n===null&&z(275,e.origin.getKey(),t.origin.getKey()),n.type){case`same`:{let n=e.type===`text`,r=t.type===`text`;return n&&r?function(e,t){return Math.sign(e-t)}(e.offset,t.offset):e.type===t.type?0:n?-1:r?1:e.type===`child`?-1:1}case`ancestor`:return e.type===`child`?-1:1;case`descendant`:return t.type===`child`?1:-1;case`branch`:return kp(n)}}function kp(e){let{a:t,b:n}=e,r=t.__key,i=n.__key,a=t,o=n;for(;a&&o;a=a.getNextSibling(),o=o.getNextSibling()){if(a.__key===i)return-1;if(o.__key===r)return 1}return a===null?1:-1}function Ap(e,t){return t.is(e)}function jp(e){return W(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function Mp(e,t){if(e.is(t))return{commonAncestor:e,type:`same`};let n=new Map;for(let[t,r]=jp(e);t;r=t,t=t.getParent())n.set(t,r);for(let[r,i]=jp(t);r;i=r,r=r.getParent()){let a=n.get(r);if(a!==void 0)return a===null?(Ap(e,r)||z(276),{commonAncestor:r,type:`ancestor`}):i===null?(Ap(t,r)||z(277),{commonAncestor:r,type:`descendant`}):((W(a)||Ap(e,a))&&(W(i)||Ap(t,i))&&r.is(a.getParent())&&r.is(i.getParent())||z(278),{a,b:i,commonAncestor:r,type:`branch`})}return null}function Np(e,t){let{type:n,key:r,offset:i}=e,a=Nd(e.key);return n===`text`?(V(a)||z(266,a.getType(),r),gp(a,t,i)):(W(a)||z(267,a.getType(),r),Kp(a,e.offset,t))}function Pp(e,t){let{origin:n,direction:r}=t,i=r===`next`;lp(t)?e.set(n.getKey(),t.offset,`text`):up(t)?V(n)?e.set(n.getKey(),_p(n,r),`text`):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+ +!!i,`element`):(dp(t)&&W(n)||z(268),e.set(n.getKey(),i?0:n.getChildrenSize(),`element`))}function Fp(e){let t=U(),n=H(t)?t:Gc();return Ip(n,e),Xu(n),n}function Ip(e,t){Pp(e.anchor,t.anchor),Pp(e.focus,t.focus)}function Lp(e){let{anchor:t,focus:n}=e,r=Np(t,`next`),i=Np(n,`next`),a=Op(r,i)<=0?`next`:`previous`;return Ep(Wp(r,a),Wp(i,a))}function Rp(e){let{direction:t,origin:n}=e,r=hp(n,ap(t)).getNodeAtCaret();return r?hp(r,t):yp(n.getParentOrThrow(),t)}function zp(e,t=`root`){let n=[e];for(let r=dp(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(Rp(r));return n}function Bp(e){return!!e&&e.origin.isAttached()}function Vp(e,t=`removeEmptySlices`){if(e.isCollapsed())return e;let n=`root`,r=`next`,i=t,a=Gp(e,r),o=zp(a.anchor,n),s=zp(a.focus.getFlipped(),n),c=new Set,l=[];for(let e of a.iterNodeCarets(n))if(dp(e))c.add(e.origin.getKey());else if(up(e)){let{origin:t}=e;W(t)&&!c.has(t.getKey())||l.push(t)}for(let e of l)e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),a=Rp(hp(t,r)),c=t.getMode();if(Math.abs(e.distance)===n&&i===`removeEmptySlices`||c===`token`&&e.distance!==0)a.remove();else if(e.distance!==0){i=`removeEmptySlices`;let t=e.removeTextSlice(),n=e.caret.origin;if(c===`segmented`){let e=t.origin,n=dc(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());a.replaceOrInsert(n),t=gp(n,r,t.offset)}n.is(o[0].origin)&&(o[0]=t),n.is(s[0].origin)&&(s[0]=t.getFlipped())}}let u,d;for(let e of o)if(Bp(e)){u=Hp(e);break}for(let e of s)if(Bp(e)){d=Hp(e);break}let f=function(e,t,n){if(!e||!t)return null;let r=e.getParentAtCaret(),i=t.getParentAtCaret();if(!r||!i)return null;let a=r.getParents().reverse();a.push(r);let o=i.getParents().reverse();o.push(i);let s=Math.min(a.length,o.length),c=0;for(;c<s&&a[c]===o[c];c++);let l=(e,t)=>{let n;for(let r=c;r<e.length;r++){let i=e[r];if(kd(i))return;!n&&t(i)&&(n=i)}return n},u=l(a,sf),d=u&&l(o,e=>n.has(e.getKey())&&sf(e));return d&&Vf(d).length>0?null:u&&d?[u,d]:null}(u,d,c);if(f){let[e,t]=f;yp(e,`previous`).splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){let e=n;n=n.getParent(),e.remove(!0)}}else if(d){let e=function(e){if(dp(e)){let t=e.origin;if(sf(t))return t}else{let t=e.getParentAtCaret();if(t&&sf(t))return t}return null}(d),t=e&&e.getParent(),n=e&&e.getParents().findLast(Od);if(e&&t&&!ql(t)&&e.isEmpty()&&c.has(e.getKey())&&Vf(e).length===0&&(!n||c.has(n.getKey()))){e.remove(!0);let n=t;for(;n&&!ql(n)&&n.isEmpty();){let e=n.getParent();if(e&&ql(e)&&e.getChildrenSize()<=1)break;let t=n;n=e,t.remove(!0)}}}let p=[u,d,...o,...s].find(Bp);if(p)return Tp(Wp(Hp(p),e.direction));z(269,JSON.stringify(o.map(e=>e.origin.__key)))}function Hp(e){let t=function(e){let t=e;for(;dp(t);){let e=xp(t);if(!dp(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(V(t.origin))return lp(t)?t:gp(t.origin,n,n);let r=t.getAdjacentCaret();return up(r)&&V(r.origin)?gp(r.origin,n,ap(n)):t}function Up(e){return lp(e)&&e.offset!==_p(e.origin,e.direction)}function Wp(e,t){return e.direction===t?e:e.getFlipped()}function Gp(e,t){return e.direction===t?e:Ep(Wp(e.focus,t),Wp(e.anchor,t))}function Kp(e,t,n){let r=yp(e,`next`);for(let e=0;e<t;e++){let e=r.getAdjacentCaret();if(e===null)break;r=e}return Wp(r,n)}function qp(e){let{origin:t,offset:n,direction:r}=e;if(n===_p(t,r))return e.getSiblingCaret();if(n===_p(t,ap(r)))return Rp(e.getSiblingCaret());let[i]=t.splitText(n);return V(i)||z(281),Wp(hp(i,`next`),r)}function Jp(e,t){return!0}function Yp(e,{$copyElementNode:t=Ad,$splitTextPointCaretNext:n=qp,rootMode:r=`shadowRoot`,$shouldSplit:i=Jp,removeEmptyDestination:a=!1}={}){if(lp(e))return n(e);let o=e.getParentCaret(r);if(o){let{origin:n}=o;if(dp(e)){let e=Rp(o);if(a&&n.isEmpty())return n.remove(),e;if(!n.canBeEmpty()||!i(n,`first`))return e}let r=function(e){let t=[];for(let n=e.getAdjacentCaret();n;n=n.getAdjacentCaret())t.push(n.origin);return t}(e);(r.length>0||!a&&n.canBeEmpty()&&i(n,`last`))&&o.insert(t(n).splice(0,0,r))}return o}function Xp(e,t,n){let r=Wp(t,`next`);lp(r)&&(r.offset===0?r=hp(r.origin,`previous`).getFlipped():r.offset===r.origin.getTextContentSize()&&(r=hp(r.origin,`next`))),r.origin.is(e)&&(up(r)||z(342,e.getKey(),e.getType()),r=Rp(r)),(e.is(r.getNodeAtCaret())||e.is(r.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let e=r;e;e=Yp(e,n))r=e;return lp(r)&&z(283),r.insert(e.isInline()?lu().append(e):e),Wp(hp(e.getLatest(),`next`),t.direction)}function Zp(e){return e}function Qp(...e){return e}function $p(e,t){return[e,t]}function em(e){return e}function tm(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function nm(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}function rm(e,...t){let n=nm(...t);n.length>0&&e.classList.add(...n)}function im(e,...t){let n=nm(...t);n.length>0&&e.classList.remove(...n)}function am(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function om(e,t,n){return am(...Object.entries(t).map(([t,r])=>is(e,t,r,n)))}function sm(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function cm(e){let t=cf().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function lm(e){return cm(ql(e)?e:e.getParentOrThrow())}function um(e){let t=lm(e);return t!==null&&t.direction===`rtl`}function dm(e,t,n=`self`){let r=e.getStartEndPoints();if(t.isSelected(e)&&!ju(t)&&r!==null){let[i,a]=r,o=e.isBackward(),s=i.getNode(),c=a.getNode(),l=t.is(s),u=t.is(c);if(l||u){let[r,i]=Oc(e),a=s.is(c),l=t.is(o?c:s),u=t.is(o?s:c),d,f=0;a?(f=r>i?i:r,d=r>i?r:i):l?(f=o?i:r,d=void 0):u&&(f=0,d=o?r:i);let p=t.__text.slice(f,d);p!==t.__text&&(n===`clone`&&(t=_f(t)),t.__text=p)}}return t}function fm(e){if(e.type===`text`)return e.offset===e.getNode().getTextContentSize();let t=e.getNode();return W(t)||sm(177),e.offset===t.getChildrenSize()}function pm(e,t){let n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function mm(e,t,n){let r=Np(e,n);if(Up(r))return!1;for(;r;r=r.getParentCaret()){let e=r.getParentAtCaret();if(!e||r.getNodeAtCaret())return!1;if(t.is(e))return!0}return!1}function hm(e,t,n=pm){if(!e)return;let r=e.getStartEndPoints(),i=!1,a=null,o=new Map;if(r){let[t,n]=r,s=Af(t.getNode(),sf);a=Af(n.getNode(),sf);let c=e.isBackward()?`previous`:`next`;i=W(a)&&!a.is(s)&&function(e,t,n){let r=e.getNode();return(!W(r)||!r.isEmpty())&&mm(e,t,n)}(n,a,ap(c)),W(s)&&o.set(s.getKey(),s),W(a)&&!i&&o.set(a.getKey(),a)}for(let t of e.getNodes())if(W(t)&&sf(t)){if(i&&t.is(a))continue;o.set(t.getKey(),t)}else if(!r){let e=Af(t,sf);W(e)&&o.set(e.getKey(),e)}for(let e of o.values()){let r=t();n(e,r),e.replace(r,!0)}}function gm(e){let t=_m(e);return t!==null&&t.writingMode===`vertical-rl`}function _m(e){let t=e.anchor.getNode();return W(t)?cm(t):lm(t)}function vm(e,t){let n=gm(e)?!t:t;bm(e)&&(n=!n);let r=Np(e.focus,n?`previous`:`next`);if(Up(r))return!1;if(lp(r)&&!hc(r.origin)&&r.origin.isUnmergeable()){let e=r.getNodeAtCaret();if(V(e)&&!hc(e))return!0}for(let e of wp(r)){if(dp(e))return!e.origin.isInline();if(!W(e.origin)){if(Gl(e.origin))return!0;break}}return!1}function ym(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function bm(e){let t=_m(e);return t!==null&&t.direction===`rtl`}function xm(e,t,n){let r=bm(e),i;i=gm(e)||r?!n:n,ym(e,t,i,`character`)}function Sm(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Cm(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function wm(e){let t=Af(e,e=>W(e)&&!e.isInline());return W(t)||Sm(4,e.__key),t}function Tm(e){let t=U()||Jc(),n;if(H(t))n=Np(t.focus,`next`);else{if(t!=null){let e=t.getNodes(),r=e[e.length-1];r&&(n=hp(r,`next`))}n||=yp(Yu(),`previous`).getFlipped().insert(lu())}let r=Xp(e,n),i=xp(r);return Fp(Tp(dp(i)?Hp(i):r)),e.getLatest()}function Em(e,t){let n=t();return e.replace(n),n.append(e),n}function Dm(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function Om(e){let t=null;if(Dm(e,DragEvent)?t=e.dataTransfer:Dm(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];let n=t.types,r=n.includes(`Files`),i=n.includes(`text/html`)||n.includes(`text/plain`);return[r,Array.from(t.files),i]}function km(e){let t=U();if(!H(t))return!1;let n=new Set,r=t.getNodes();for(let t=0;t<r.length;t++){let i=r[t],a=i.getKey();if(n.has(a))continue;let o=Af(i,e=>W(e)&&!e.isInline());if(o===null)continue;let s=o.getKey();o.canIndent()&&!n.has(s)&&(n.add(s),e(o))}return n.size>0}var Am=!(Gr||!Hr)&&void 0;function jm(e,t=!1){let n=1;if(function(){if(Am===void 0){let e=document.createElement(`div`);e.style.position=`absolute`,e.style.opacity=`0`,e.style.width=`100px`,e.style.left=`-1000px`,document.body.appendChild(e);let t=e.getBoundingClientRect();e.style.setProperty(`zoom`,`2`),Am=e.getBoundingClientRect().width===t.width,document.body.removeChild(e)}return Am}()||t){let t=e&&e.ownerDocument.defaultView||window;for(;e;)n*=Number(t.getComputedStyle(e).getPropertyValue(`zoom`)),e=yd(e)}return n}var Mm=Symbol.for(`preact-signals`);function Nm(){if(zm>1)return void zm--;let e,t=!1;for(function(){let e=Rm;for(Rm=void 0;e!==void 0;)e.S.v===e.v&&(e.S.i=e.i),e=e.o}();Im!==void 0;){let n=Im;for(Im=void 0,Bm++;n!==void 0;){let r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&qm(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(Bm=0,zm--,t)throw e}function Pm(e){if(zm>0)return e();Hm=++Vm,zm++;try{return e()}finally{Nm()}}var Fm,Im;function Lm(e){let t=Fm;Fm=void 0;try{return e()}finally{Fm=t}}var Rm,zm=0,Bm=0,Vm=0,Hm=0,Um=0;function Wm(e){if(Fm===void 0)return;let t=e.n;return t===void 0||t.t!==Fm?(t={i:0,S:e,p:Fm.s,n:void 0,t:Fm,e:void 0,x:void 0,r:t},Fm.s!==void 0&&(Fm.s.n=t),Fm.s=t,e.n=t,32&Fm.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Fm.s,t.n=void 0,Fm.s.n=t,Fm.s=t),t):void 0}function Gm(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function Km(e,t){return new Gm(e,t)}function qm(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Jm(e){for(let t=e.s;t!==void 0;t=t.n){let n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Ym(e){let t,n=e.s;for(;n!==void 0;){let e=n.p;n.i===-1?(n.S.U(n),e!==void 0&&(e.n=n.n),n.n!==void 0&&(n.n.p=e)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=e}e.s=t}function Xm(e,t){Gm.call(this,void 0),this.x=e,this.s=void 0,this.g=Um-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function Zm(e){let t=e.m;if(e.m=void 0,typeof t==`function`){zm++;let n=Fm;Fm=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,Qm(e),t}finally{Fm=n,Nm()}}}function Qm(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Zm(e)}function $m(e){if(Fm!==this)throw Error(`Out-of-order effect`);Ym(this),Fm=e,this.f&=-2,8&this.f&&Qm(this),Nm()}function eh(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name}function th(e,t){let n=new eh(e,t);try{n.c()}catch(e){throw n.d(),e}let r=n.d.bind(n);return r[Symbol.dispose]=r,r}function nh(e,t={}){let n={};for(let r in e){let i=t[r];n[r]=Km(i===void 0?e[r]:i)}return n}Gm.prototype.brand=Mm,Gm.prototype.h=function(){return!0},Gm.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t===void 0?Lm(()=>{var e;(e=this.W)==null||e.call(this)}):t.e=e)},Gm.prototype.U=function(e){if(this.t!==void 0){let t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&Lm(()=>{var e;(e=this.Z)==null||e.call(this)}))}},Gm.prototype.subscribe=function(e){return th(()=>{let t=this.value,n=Fm;Fm=void 0;try{e(t)}finally{Fm=n}},{name:`sub`})},Gm.prototype.valueOf=function(){return this.value},Gm.prototype.toString=function(){return this.value+``},Gm.prototype.toJSON=function(){return this.value},Gm.prototype.peek=function(){let e=Fm;Fm=void 0;try{return this.value}finally{Fm=e}},Object.defineProperty(Gm.prototype,"value",{get(){let e=Wm(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(Bm>100)throw Error(`Cycle detected`);(function(e){zm!==0&&Bm===0&&e.l!==Hm&&(e.l=Hm,Rm={S:e,v:e.v,i:e.i,o:Rm})})(this),this.v=e,this.i++,Um++,zm++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Nm()}}}}),Xm.prototype=new Gm,Xm.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Um))return!0;if(this.g=Um,this.f|=1,this.i>0&&!qm(this))return this.f&=-2,!0;let e=Fm;try{Jm(this),Fm=this;let e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return Fm=e,Ym(this),this.f&=-2,!0},Xm.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}Gm.prototype.S.call(this,e)},Xm.prototype.U=function(e){if(this.t!==void 0&&(Gm.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},Xm.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Xm.prototype,"value",{get(){if(1&this.f)throw Error(`Cycle detected`);let e=Wm(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),eh.prototype.c=function(){let e=this.S();try{if(8&this.f||this.x===void 0)return;let e=this.x();typeof e==`function`&&(this.m=e)}finally{e()}},eh.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,Zm(this),Jm(this),zm++;let e=Fm;return Fm=this,$m.bind(this,e)},eh.prototype.N=function(){2&this.f||(this.f|=2,this.u=Im,Im=this)},eh.prototype.d=function(){this.f|=8,1&this.f||Qm(this)},eh.prototype.dispose=function(){this.d()};function rh(e){return(typeof e.nodes==`function`?e.nodes():e.nodes)||[]}function ih(e,t){let n;return Km(e(),{unwatched(){n&&=(n(),void 0)},watched(){this.value=e(),n=t(this)}})}function ah(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var oh;try{oh=`0.48.0+prod.esm`}catch{}var sh=oh??`"<unknown>+source"`,ch=new Set([`__proto__`,`constructor`,`prototype`]);function lh(e,t){if(e&&t&&!Array.isArray(t)&&typeof e==`object`&&typeof t==`object`){let n=e,r=t;for(let e in r)!ch.has(e)&&Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=lh(n[e],r[e]));return e}return t}var uh=0,dh=1,fh=2,ph=3,mh=4,hh=5,gh=6,_h=7;function vh(e){return e.id===uh}function yh(e){return e.id===fh}function bh(e){return function(e){return e.id===dh}(e)||ah(305,String(e.id),String(dh)),Object.assign(e,{id:fh})}var xh=new Set,Sh=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:uh}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):tm;for(let n of this.configs)e=t(e,n);return e}init(e){let t=this.state;yh(t)||ah(306,String(t.id));let n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(e,t,n){return Object.assign(e,{config:t,id:ph,registerState:n})}(t,this.mergeConfigs(),n),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,n)),this.state=function(e,t,n){return Object.assign(e,{id:mh,initResult:t,registerState:n})}(i,a,r)}build(e){let t=this.state,n;t.id!==mh&&ah(307,String(t.id),String(hh)),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));let r={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(e,t,n){return Object.assign(e,{id:hh,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;let n=this.state;n.id!==hh&&ah(308,String(n.id),String(hh));let r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:gh})}(n),()=>{let e=this.state;e.id!==_h&&ah(309,String(n.id),String(_h)),this.state=function(e){return Object.assign(e,{id:hh})}(e),r&&r()}}afterRegistration(e){let t=this.state,n;return t.id!==gh&&ah(310,String(t.id),String(gh)),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:_h})}(t),n}getSignal(){return this._signal===void 0&&ah(311),this._signal}getInitResult(){this.extension.init===void 0&&ah(312,this.extension.name);let e=this.state;return function(e){return e.id>=mh}(e)||ah(313,String(e.id),String(mh)),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(e){return e.id>=ph}(e)||ah(314,String(e.id),String(ph)),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&ah(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&ah(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(e){return e.id>=_h}(e)||ah(316,String(e.id),String(_h)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||xh}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(e){return e.id>=hh})(e)||ah(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},Ch={tag:Hs};function wh(){let e=Yu();e.isEmpty()&&e.append(lu())}var Th=Zp({config:em({setOptions:Ch,updateOptions:Ch}),init:({$initialEditorState:e=wh})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){let i=r.getInitResult();if(!i.initialized){i.initialized=!0;let{$initialEditorState:r}=i;if(Zl(r))e.setEditorState(r,n);else if(typeof r==`function`)e.update(()=>{r(e)},t);else if(r&&(typeof r==`string`||typeof r==`object`)){let t=e.parseEditorState(r);e.setEditorState(t,n)}}return()=>{}},name:`@lexical/extension/InitialState`,nodes:[Kl,nc,eu,pc,su]}),Eh=Symbol.for(`@lexical/extension/LexicalBuilder`);function Dh(...e){return Mh.fromExtensions(e).buildEditor()}function Oh(){}function kh(e){throw e}function Ah(e){return Array.isArray(e)?e:[e]}var jh=sh,Mh=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=jh,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(t){let n=[Ah(Th)];for(let e of t)n.push(Ah(e));return new e(n)}static maybeFromEditor(t){let n=t[Eh];return n&&(n.PACKAGE_VERSION!==jh&&ah(292,n.PACKAGE_VERSION,jh),n instanceof e||ah(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&ah(294),n}constructEditor(){let{$initialEditorState:e,onError:t,onWarn:n,...r}=this.buildCreateEditorArgs(),i=Object.assign(hu({...r,...t?{onError:e=>{t(e,i)}}:{},...n?{onWarn:e=>{n(e,i)}}:{}}),{[Eh]:this});for(let e of this.sortedExtensionReps())e.build(i);return i}buildEditor(){let e=Oh;function t(){try{e()}finally{e=Oh}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=am(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&ah(295,e.name),t}addEdge(e,t,n){let r=this.outgoingConfigEdges.get(e);r?r.set(t,n):this.outgoingConfigEdges.set(e,new Map([[t,n]]));let i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&ah(296);let[t]=Ah(e);typeof t.name!=`string`&&ah(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(n!==void 0&&n.extension!==t&&ah(298,t.name),!n){n=new Sh(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);typeof e==`string`&&ah(299,t.name,e);for(let e of t.conflictsWith||[])this.extensionNameMap.has(e)&&ah(299,t.name,e),this.conflicts.set(e,t.name);for(let e of t.dependencies||[]){let n=Ah(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,r)=>{let i=n.state;if(yh(i))return;let a=n.extension.name;var o;vh(i)||ah(300,a,r||`[unknown]`),vh(o=i)||ah(304,String(o.id),String(uh)),i=Object.assign(o,{id:dh}),n.state=i;let s=this.outgoingConfigEdges.get(a);if(s)for(let e of s.keys()){let n=this.extensionNameMap.get(e);n&&t(n,a)}i=bh(i),n.state=i,e.push(n)};for(let e of this.extensionNameMap.values())vh(e.state)&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);n===void 0&&ah(301,e.name);for(let e of t)n.configs.add(e)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],i=n.signal;for(let n of t){let t=n.register(e,i);t&&r.push(t)}for(let n of t){let t=n.afterRegistration(e);t&&r.push(t)}return am(...r)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,r=new Map,i={},a={},o=this.sortedExtensionReps();for(let s of o){let{extension:o}=s;if(o.onError!==void 0&&(e.onError=o.onError),o.onWarn!==void 0&&(e.onWarn=o.onWarn),o.disableEvents!==void 0&&(e.disableEvents=o.disableEvents),o.parentEditor!==void 0&&(e.parentEditor=o.parentEditor),o.editable!==void 0&&(e.editable=o.editable),o.namespace!==void 0&&(e.namespace=o.namespace),o.$initialEditorState!==void 0&&(e.$initialEditorState=o.$initialEditorState),o.nodes)for(let e of rh(o)){if(typeof e!=`function`){let t=n.get(e.replace);t&&ah(302,o.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}if(o.html){if(o.html.export)for(let[e,t]of o.html.export.entries())r.set(e,t);o.html.import&&Object.assign(i,o.html.import)}o.theme&&lh(a,o.theme)}Object.keys(a).length>0&&(e.theme=a),t.size&&(e.nodes=[...t]);let s=Object.keys(i).length>0,c=r.size>0;(s||c)&&(e.html={},s&&(e.html.import=i),c&&(e.html.export=r));for(let t of o)t.init(e);return e.onError||=kh,e}};function Nh(e,t){let n=Mh.fromEditor(e).getExtensionRep(t);return n===void 0&&ah(303,t.name),n.getExtensionDependency()}function Ph(e,t){let n=Mh.maybeFromEditor(e);if(!n)return;let r=n.extensionNameMap.get(t);return r?r.getExtensionDependency():void 0}function Fh(e){return Ph(cf(),e)}var Ih=B(`INSERT_HORIZONTAL_RULE_COMMAND`),Lh=class e extends Wl{static getType(){return`horizontalrule`}static clone(t){return new e(t.__key)}static importJSON(e){return zh().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:Rh,priority:0})}}exportDOM(){return{element:Ud().createElement(`hr`)}}createDOM(e){let t=Ud().createElement(`hr`);return rm(t,e.theme.hr),t}getTextContent(){return`
18
+ `}isInline(){return!1}updateDOM(){return!1}};function Rh(){return{node:zh()}}function zh(){return kf(Lh)}function Bh(e){return e instanceof Lh}var Vh=Zp({build:(e,t)=>nh({inheritEditableFromParent:t.inheritEditableFromParent}),config:em({$getParentEditor:function(){let e=cf();return Mh.fromEditor(e),e},inheritEditableFromParent:!1}),init:(e,t,n)=>{let r=t.$getParentEditor();e.parentEditor=r,e.theme=e.theme||r._config.theme},name:`@lexical/extension/NestedEditor`,register:(e,t,n)=>th(()=>{let t=e._parentEditor;if(t&&n.getOutput().inheritEditableFromParent.value)return e.setEditable(t.isEditable()),t.registerEditableListener(e.setEditable.bind(e))})});Date.now;function Hh(e){return e.canIndent()}function Uh(e,t,n=Hh){return am(e.registerCommand(Ro,t=>{let n=U();if(!H(n))return!1;t.preventDefault();let r=function(e){if(e.getNodes().filter(e=>Uc(e)&&e.canIndent()).length>0)return!0;let t=e.anchor,n=e.focus,r=n.isBefore(t)?n:t,i=wm(r.getNode());if(i.canIndent()){let e=i.getKey(),t=Gc();if(t.anchor.set(e,0,`element`),t.focus.set(e,0,`element`),t=sa(t),t.anchor.is(r))return!0}return!1}(n)?t.shiftKey?Vo:Bo:zo;return e.dispatchCommand(r,void 0)},0),e.registerCommand(Bo,()=>{let e=typeof t==`number`?t:t?t.peek():null;if(!H(U()))return!1;let r=typeof n==`function`?n:n.peek();return km(t=>{if(r(t)){let n=t.getIndent()+1;(!e||n<e)&&t.setIndent(n)}})},4))}function Wh(e,t,n,r,i){if(e===null||n.size===0&&r.size===0&&!i)return 0;let a=t._selection,o=e._selection;if(i)return 1;if(!(H(a)&&H(o)&&o.isCollapsed()&&a.isCollapsed()))return 0;let s=function(e,t,n){let r=e._nodeMap,i=[];for(let e of t){let t=r.get(e);t!==void 0&&i.push(t)}for(let[e,t]of n){if(!t)continue;let n=r.get(e);n===void 0||ql(n)||i.push(n)}return i}(t,n,r);if(s.length===0)return 0;if(s.length>1){let n=t._nodeMap,r=n.get(a.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&V(r)&&r.__text.length===1&&a.anchor.offset===1?2:0}let c=s[0],l=e._nodeMap.get(c.__key);if(!V(l)||!V(c)||l.__mode!==c.__mode)return 0;let u=l.__text,d=c.__text;if(u===d)return 0;let f=a.anchor,p=o.anchor;if(f.key!==p.key||f.type!==`text`)return 0;let m=f.offset,h=p.offset,g=d.length-u.length;return g===1&&h===m-1?2:g===-1&&h===m+1?3:g===-1&&h===m?4:0}function Gh(e,t,n){let r=n(),i=0,a=r,o=0,s=null;return(c,l,u,d,f,p)=>{let m=n();if(p.has(`composition-start`)&&(a=r,o=i,s=c),p.has(`historic`))return i=0,r=m,2;p.has(`composition-end`)&&s&&(r=a,i=o,c=s);let h=p.has(`paste`)||p.has(`cut`)?0:Wh(c,l,d,f,e.isComposing()),g=(()=>{let n=u===null||u.editor===e,a=p.has(Vs);if(!a&&n&&p.has(`history-merge`))return 0;if(h===1)return 2;if(c===null)return 1;let o=l._selection;if(!(d.size>0||f.size>0))return o===null?2:0;let s=typeof t==`number`?t:t.peek();return!1===a&&h!==0&&h===i&&m<r+s&&n||d.size===1&&function(e,t,n){let r=t._nodeMap.get(e),i=n._nodeMap.get(e),a=t._selection,o=n._selection;return!(H(a)&&H(o)&&a.anchor.type===`element`&&a.focus.type===`element`&&o.anchor.type===`text`&&o.focus.type===`text`||!V(r)||!V(i)||r.__parent!==i.__parent)&&JSON.stringify(t.read(()=>r.exportJSON()))===JSON.stringify(n.read(()=>i.exportJSON()))}(Array.from(d)[0],c,l)?0:1})();return r=m,i=h,g}}function Kh(e,t){e.undoStack=[],e.redoStack=[],e.current=null,t&&t(e)}function qh(e,t,n,r=Date.now,i,a=null){let o=Gh(e,n,r),s=()=>{i&&i(t)};return s(),am(e.registerCommand(wo,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(i.length!==0){let a=t.current,o=i.pop();a!==null&&(r.push(a),e.dispatchCommand(Qo,!0)),i.length===0&&e.dispatchCommand($o,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(To,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(r.length!==0){let a=t.current;a!==null&&(i.push(a),e.dispatchCommand($o,!0));let o=r.pop();r.length===0&&e.dispatchCommand(Qo,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(Xo,()=>(Kh(t,i),!1),0),e.registerCommand(Zo,()=>(Kh(t,i),e.dispatchCommand(Qo,!1),e.dispatchCommand($o,!1),!0),0),e.registerUpdateListener(({editorState:n,prevEditorState:r,dirtyLeaves:i,dirtyElements:c,tags:l})=>{let u=t.current,d=t.redoStack,f=t.undoStack,p=u===null?null:u.editorState;if(u!==null&&n===p)return;let m=o(r,n,u,i,c,l);if(m===1){if(d.length!==0&&(t.redoStack=[],e.dispatchCommand(Qo,!1)),u!==null){f.push({...u});let t=typeof a==`number`||a===null?a:a.peek();t!==null&&f.length>t&&f.splice(0,f.length-t),e.dispatchCommand($o,!0)}}else if(m===2)return;t.current={editor:e,editorState:n},s()}))}function Jh(){return{current:null,redoStack:[],undoStack:[]}}var Yh=Zp({build:(e,{delay:t,createInitialHistoryState:n,disabled:r,maxDepth:i,now:a},o)=>({...nh({delay:t,disabled:r,historyState:n(e),maxDepth:i,now:a}),...o.getInitResult()}),config:em({createInitialHistoryState:Jh,delay:300,disabled:typeof window>`u`,maxDepth:null,now:Date.now}),init:()=>({canRedo:Km(!1),canUndo:Km(!1)}),name:`@lexical/history/History`,register:(e,t,n)=>{let{canUndo:r,canRedo:i}=n.getInitResult(),a=n.getOutput(),o=e=>Pm(()=>{r.value=e!=null&&e.undoStack.length>0,i.value=e!=null&&e.redoStack.length>0});return th(()=>{if(!a.disabled.value)return qh(e,a.historyState.value,a.delay,()=>a.now.peek()(),o,a.maxDepth);o(null)})}}),Xh=Zp({build:(e,{disabled:t,parentEditor:n})=>nh({disabled:t,parentEditor:n||e._parentEditor}),config:em({disabled:!1,parentEditor:null}),dependencies:[Qp(Yh,{disabled:!0})],name:`@lexical/history/SharedHistory`,register:(e,t,n)=>th(()=>{let{disabled:e,parentEditor:t}=n.getOutput();if(!e.value){let{output:e}=n.getDependency(Yh),r=function(e){return e?Ph(e,Yh.name):null}(t.value);if(!r)return;let i=r.output;Pm(()=>{e.delay.value=i.delay.value,e.historyState.value=i.historyState.value,e.now.value=i.now.value,e.disabled.value=i.disabled.value})}})});function Zh(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Qh;function $h(e,t){let{key:n}=t;return e&&n in e?e[n]:t.defaultValue}function eg(e){return Qh&&Qh.editor===e?Qh:void 0}function tg(e,t){if(`cfg`in t){let{cfg:n,updater:r}=t;return[n,r($h(e,n))]}return t}function ng(e,t){let n=t;for(let r of e){let[e,i]=tg(n,r),a=e.key;if(n===t&&$h(n,e)===i)continue;let o=n===t||n===void 0?rg(t):n;o[a]=i,n=o}return n}function rg(e){return Object.create(e||null)}function ig(e,t){return[e,t]}function ag(e,t,n,r=cf()){let i=Qh,a=eg(r);try{return Qh={...a,editor:r,[e]:t},n()}finally{Qh=i}}function og(e,t=()=>{}){return(n,r=cf())=>i=>{let a=eg(r),o=a&&a[e],s=ng(n,o||t(r));return s&&s!==o?ag(e,s,i,r):i()}}function sg(e,t,n,r){return Object.assign(Gi(Symbol(t),{isEqual:r,parse:n}),{[e]:!0})}function cg(e){if(!Nu(e))return;let t=e;if(t.querySelector(`style`)===null)return;let n=new Map;function r(e){let t=n.get(e);if(t===void 0){t=new Set;for(let n=0;n<e.style.length;n++)t.add(e.style[n]);n.set(e,t)}return t}try{for(let e of Array.from(t.styleSheets)){let n;try{n=e.cssRules}catch{continue}for(let e of Array.from(n)){if(!Dm(e,CSSStyleRule))continue;let n;try{n=t.querySelectorAll(e.selectorText)}catch{continue}for(let t of Array.from(n)){if(!K(t))continue;let n=r(t);for(let r=0;r<e.style.length;r++){let i=e.style[r];n.has(i)||t.style.setProperty(i,e.style.getPropertyValue(i),e.style.getPropertyPriority(i))}}}}}catch{}}var lg=`@lexical/html/DOM`,ug=Symbol.for(`@lexical/html/DOMExportContext`);function dg(e,t,n){return sg(ug,e,t,n)}var fg=dg(`isExport`,Boolean);function pg(e){let t=Ph(e,lg);return t?t.output.defaults:void 0}function mg(e){let t=Ph(e,lg);return t?t.output.runtime:void 0}function hg(e=cf()){let t=mg(e);return t?t.getSessionConfig():lf(e)}var gg=og(ug,pg),_g=Symbol.for(`@lexical/html/SelectorImpl`);function vg(e,t){let n={kind:`element`,predicate:(r=t,r.length===0?K:r.length===1?r[0]:(e,t)=>{for(let n of r)if(!n(e,t))return!1;return!0}),tags:e};var r;let i=n=>vg(e,[...t,n]);return{[_g]:n,attr:(e,t,n)=>i(xg(e,t,n)),classAll:(...e)=>i(bg(e)),classAny:(...e)=>i(function(e){let t=yg(e);return t.length===0?()=>!1:e=>{if(!K(e))return!1;let n=e.classList;for(let e of t)if(n.contains(e))return!0;return!1}}(e)),styleAny:(e,t,n)=>i(function(e,t,n){if(typeof t==`string`)return n=>K(n)&&n.style.getPropertyValue(e)===t;if(t instanceof RegExp){let r=n&&n.capture,i=t;return(t,n)=>{if(!K(t))return!1;let a=t.style.getPropertyValue(e);if(!a)return!1;let o=a.match(i);return o!==null&&(r!==void 0&&(n[r]=o),!0)}}Zh(362,JSON.stringify(e))}(e,t,n))}}function yg(e){let t=[];for(let n of e)n&&t.push(n);return t}function bg(e){let t=yg(e);return t.length===0?()=>!0:e=>{if(!K(e))return!1;let n=e.classList;for(let e of t)if(!n.contains(e))return!1;return!0}}function xg(e,t,n){if(!0===t)return t=>K(t)&&t.hasAttribute(e);if(typeof t==`string`)return n=>K(n)&&n.getAttribute(e)===t;if(t instanceof RegExp){let r=n&&n.capture,i=t;return(t,n)=>{if(!K(t))return!1;let a=t.getAttribute(e);if(a==null)return!1;let o=a.match(i);return o!==null&&(r!==void 0&&(n[r]=o),!0)}}Zh(361,JSON.stringify(e))}var Sg={kind:`text`,predicate:Mu,tags:new Set},Cg={[_g]:Sg},wg={kind:`comment`,predicate:e=>e.nodeType===8,tags:new Set},Tg={[_g]:wg},Eg={any:()=>vg(new Set,[]),comment:()=>Tg,tag(...e){e.length>0||Zh(363);let t=new Set;for(let n of e)t.add(n.toUpperCase());return vg(t,[])},text:()=>Cg},Dg=/[A-Za-z0-9_-]/,Og=class{constructor(e,t){this.source=e,this.pos=t}peek(e=0){return this.source[this.pos+e]||``}consume(){return this.source[this.pos++]||``}eof(){return this.pos>=this.source.length}skipWhitespace(){for(;!this.eof()&&/\s/.test(this.peek());)this.pos++}readIdent(){let e=this.pos;for(;!this.eof()&&Dg.test(this.peek());)this.pos++;return this.source.slice(e,this.pos)}readQuoted(){let e=this.consume();this.assert(e===`"`||e===`'`,`expected quote`);let t=this.pos;for(;!this.eof()&&this.peek()!==e;)this.peek()===`\\`?this.pos+=2:this.pos++;this.assert(!this.eof(),`unterminated string`);let n=this.source.slice(t,this.pos);return this.pos++,n.replace(/\\(.)/g,`$1`)}assert(e,t){e||Zh(364,String(this.pos+1),t,this.source)}};function kg(e){let t=new Set,n=[],r=[];if(e.skipWhitespace(),e.peek()===`*`)e.consume();else if(Dg.test(e.peek())){let n=e.readIdent();n&&t.add(n.toUpperCase())}for(;!e.eof();){let t=e.peek();if(t===`.`){e.consume();let t=e.readIdent();e.assert(t!==``,`expected class name after "."`),r.push(t)}else if(t===`#`){e.consume();let t=e.readIdent();e.assert(t!==``,`expected id after "#"`),n.push(xg(`id`,t))}else{if(t!==`[`)break;{e.consume(),e.skipWhitespace();let t=e.readIdent();e.assert(t!==``,`expected attribute name after "["`),e.skipWhitespace();let r=!0;if(e.peek()===`=`){e.consume(),e.skipWhitespace();let t=e.peek();t===`"`||t===`'`?r=e.readQuoted():(r=e.readIdent(),e.assert(r!==``,`expected attribute value`)),e.skipWhitespace()}e.assert(e.peek()===`]`,`expected "]"`),e.consume(),n.push(xg(t,r))}}}return r.length>0&&n.push(bg(r)),{predicates:n,tags:t}}function Ag(e){let t=new Og(e,0),n=[];for(;;){let e=kg(t);if(n.push(e),t.skipWhitespace(),t.eof())break;t.assert(t.peek()===`,`,`expected "," (selector lists are the only supported combinator)`),t.consume(),t.skipWhitespace()}if(n.length===1)return vg(n[0].tags,n[0].predicates);let r=new Set;for(let e of n)for(let t of e.tags)r.add(t);return vg(r,[(e,t)=>{for(let r of n){let n=e.nodeName;if(r.tags.size>0&&!r.tags.has(n))continue;let i=!0;for(let n of r.predicates)if(!n(e,t)){i=!1;break}if(i)return!0}return!1}])}var jg=Eg;jg.tag(`b`,`strong`,`em`,`i`,`code`,`mark`,`s`,`sub`,`sup`,`u`,`span`),jg.text(),jg.tag(`script`,`style`),jg.tag(`br`),jg.tag(`p`),jg.tag(`hr`),jg.any(),Object.freeze([]),Object.freeze({}),Eg.any();var Mg={any:Eg.any,comment:Eg.comment,css:Ag,tag:Eg.tag,text:Eg.text},Ng=new Set([`STYLE`,`SCRIPT`]);function Pg(e,t){cg(t);let n=Nu(t)?t.body.childNodes:t.childNodes,r=[],i=[];for(let t of n)if(!Ng.has(t.nodeName)){let n=Rg(t,e,i,!1);if(n!==null)for(let e of n)r.push(e)}return function(e){for(let t of e)t.getParent()&&t.getNextSibling()instanceof $l&&t.insertAfter(nu());for(let t of e){let e=t.getParent();e&&e.splice(t.getIndexWithinParent(),1,t.getChildren())}}(i),r}function Fg(e,t=null,n=cf()){return gg([ig(fg,!0)],n)(()=>{let r=Yu(),i=hg(n),a=H(t)?zf(t.anchor.getNode()):null,o=e.append.bind(e);for(let e of(W(a)?a:r).getChildren())Lg(n,e,o,t,i);return e})}function Ig(e,t=null){return(typeof document>`u`||typeof window>`u`&&global.window===void 0)&&Zh(338),Cl(e),Fg(Ud().createElement(`div`),t,e).innerHTML}function Lg(e,t,n,r=null,i=lf(e)){let a=i.$shouldInclude(t,r,e),o=i.$shouldExclude(t,r,e),s=t;r!==null&&V(t)&&(s=dm(r,t,`clone`));let{element:c,after:l,append:u,$getChildNodes:d}=i.$exportDOM(s,e);if(!c)return!1;let f=Ud().createDocumentFragment(),p=d?d():W(s)?s.getChildren():[],m=a&&Cc(r)&&W(t)?null:r,h=f.append.bind(f);for(let n of p){let o=Lg(e,n,h,m,i);!a&&o&&i.$extractWithChild(t,n,r,`html`,e)&&(a=!0)}if(a&&!o){if((K(c)||tf(c))&&(u?u(f):c.append(f)),n(c),l){let e=l.call(s,c);e&&(tf(c)?c.replaceChildren(e):c.replaceWith(e))}}else n(f);return a}function Rg(e,t,n,r,i=new Map,a){let o=[];if(Ng.has(e.nodeName))return o;let s=null,c=function(e,t){let{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase()),i=null;if(r!==void 0)for(let t of r){let n=t(e);n!==null&&(i===null||(i.priority||0)<=(n.priority||0))&&(i=n)}return i===null?null:i.conversion}(e,t),l=c?c(e):null,u=null;if(l!==null){u=l.after;let t=l.node;if(s=Array.isArray(t)?t[t.length-1]:t,s!==null){for(let[,e]of i)if(s=e(s,a),!s)break;s&&o.push(...Array.isArray(t)?t:[s])}l.forChild!=null&&i.set(e.nodeName,l.forChild)}let d=e.childNodes,f=[],p=(s==null||!kd(s))&&(s!=null&&Uc(s)||r);for(let e=0;e<d.length;e++)f.push(...Rg(d[e],t,n,p,new Map(i),s));if(u!=null&&(f=u(f)),of(e)&&(f=zg(e,f,p?()=>{let e=new $l;return n.push(e),e}:lu)),s==null){if(f.length>0)for(let e of f)o.push(e);else of(e)&&function(e){return e.nextSibling==null||e.previousSibling==null?!1:rf(e.nextSibling)&&rf(e.previousSibling)}(e)&&o.push(nu())}else W(s)&&s.append(...f);return o}function zg(e,t,n){let r=e.style.textAlign,i=[],a=[];for(let e=0;e<t.length;e++){let o=t[e];if(Uc(o))r&&!o.getFormat()&&o.setFormat(r),i.push(o);else if(a.push(o),e===t.length-1||e<t.length-1&&Uc(t[e+1])){let e=n();e.setFormat(r),e.append(...a),i.push(e),a=[]}}return i}function Bg(e,t,n=null){let r=Hd(n),i=n?Bd(n):[],a=n!==null&&i.length>0;if(a&&typeof r.caretPositionFromPoint==`function`){let a=r.caretPositionFromPoint(e,t,{shadowRoots:i});if(a!==null&&function(e,t){for(let n=e;n!==null;){if(n===t)return!0;n=yd(n)}return!1}(a.offsetNode,n))return{node:a.offsetNode,offset:a.offset}}if(a){let i=n.getRootNode();if(Rd(i)){let a=i.elementFromPoint(e,t);if(a!==null&&n.contains(a)){let n=function(e,t,n,r){let i=r.createRange(),a=e=>t<e.top?e.top-t:t>e.bottom?t-e.bottom:0,o=t=>e<t.left?t.left-e:e>t.right?e-t.right:0,s=r.createTreeWalker(n,NodeFilter.SHOW_TEXT),c=null,l=1/0,u=1/0;for(let e=s.nextNode();e;e=s.nextNode()){i.selectNodeContents(e);for(let t of i.getClientRects()){let n=a(t),r=o(t);(n<l||n===l&&r<u)&&(l=n,u=r,c=e)}}if(c===null)return null;let d=0,f=1/0,p=1/0;for(let t=0;t<=c.length;t++){i.setStart(c,t),i.collapse(!0);let n=i.getBoundingClientRect(),r=a(n),o=Math.abs(e-n.left);(r<f||r===f&&o<p)&&(f=r,p=o,d=t)}return{node:c,offset:d}}(e,t,a,r);if(n!==null)return n}}}if(typeof r.caretRangeFromPoint==`function`){let n=r.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(typeof r.caretPositionFromPoint==`function`){let n=r.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}function Vg(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Hg={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};function Ug(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy(`lexical`,{createHTML:e=>e}).createHTML(e):e}var Wg=(e,t)=>{if(!H(t))return t.insertRawText(e),!0;let n=e=>{let t=U();H(t)&&e(t)};return rl(e,{linebreak:()=>n(e=>e.insertParagraph()),tab:()=>n(e=>e.insertNodes([mc()])),text:e=>n(t=>t.insertText(e))}),!0},Gg={"application/x-lexical-editor":[(e,t,n)=>{try{let n=cf(),r=JSON.parse(e);if(r&&r.namespace===n._config.namespace&&Array.isArray(r.nodes))return r_(n,o_(r.nodes),t),!0}catch(e){console.error(e)}return n()}],"text/html":[(e,t,n)=>{try{let n=cf();return r_(n,Pg(n,new DOMParser().parseFromString(Ug(e),`text/html`)),t),!0}catch(e){return console.error(e),n()}}],"text/plain":[Wg],"text/uri-list":[Wg]};function Kg(e,t,n,r){if(!e)return!1;let i=a=>!!e[a]&&e[a](t,n,i.bind(null,a-1),r);return i(e.length-1)}function qg(e,t,n){let r=t.getData(`text/plain`);for(let i of function(e){return Object.keys(e.$importMimeType).filter(t=>e.$importMimeType[t]!==void 0).sort((t,n)=>{let r=e.priority[t],i=e.priority[n];return r===void 0&&i===void 0?t<n?-1:+(t>n):r===void 0?1:i===void 0?-1:r-i})}(e)){let a=t.getData(i);if(a&&(i!==`text/html`||a!==r)&&Kg(e.$importMimeType[i],a,n,t))return!0}return!1}var Jg={$importMimeType:Gg,$insertDataTransfer:(e,t)=>qg({$importMimeType:Gg,priority:Hg},e,t),priority:Hg},Yg=Zp({build:(e,t)=>({$importMimeType:t.$importMimeType,$insertDataTransfer:(e,n)=>qg(t,e,n),priority:t.priority}),config:em({$importMimeType:Gg,priority:Hg}),mergeConfig(e,t){let n=tm(e,t);if(t.$importMimeType){let r={...e.$importMimeType};for(let[e,n]of Object.entries(t.$importMimeType))if(n){let t=r[e];r[e]=t?[...t,...n]:n}n.$importMimeType=r}return t.priority&&(n.priority={...e.priority,...t.priority}),n},name:`@lexical/clipboard/Import`});function Xg(e,t=U()){return t??Vg(166),H(t)&&t.isCollapsed()||t.getNodes().length===0?``:Ig(e,t)}function Zg(e,t=U()){return t??Vg(166),H(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(a_(e,t))}function Qg(e,t,n){(function(){let e=Fh(Yg.name);return e?e.output:Jg})().$insertDataTransfer(e,t)}var $g=`application/x-lexical-drag`;function e_(e,t){let n={editorKey:t.getKey()};e.setData($g,JSON.stringify(n))}function t_(e,t,n){let r=e.dataTransfer;if(r===null)return!1;let i=function(e){let t=e.getData($g);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}return(r=n)!==null&&typeof r==`object`&&`editorKey`in r&&typeof r.editorKey==`string`?n:null;var r}(r);if(i===null)return!1;let a=function(e,t){let n=Bg(e.clientX,e.clientY,t.getRootElement());if(n===null)return null;let r=Ku(n.node);if(r===null)return null;if(V(r))return gp(r,`next`,n.offset);if(W(r))return Kp(r,n.offset,`next`);let i=r.getParent();return i===null?null:Kp(i,r.getIndexWithinParent()+1,`next`)}(e,t);if(a===null)return!1;let o=Yp(a);if(o===null)return!1;let s=i.editorKey===t.getKey(),c=U();if(s){if(!H(c)||c.isCollapsed())return!1;if(function(e,t){let{anchor:n,focus:r}=Gp(Lp(t),`next`);return Op(n,e)<0&&Op(e,r)<0}(a,c))return e.preventDefault(),!0;c.removeText()}if(!o.origin.isAttached())return e.preventDefault(),!0;if(n(r,Fp(Tp(o)),t),!s){let e=t.getRootElement(),n=e?e.ownerDocument:null,r=n?function(e,t){for(let n of Vd(t)){let t=ku(n);if(Du(t)&&t.getKey()===e&&K(n))return n}return null}(i.editorKey,n):null;r!==null&&r.dispatchEvent(new InputEvent(`beforeinput`,{bubbles:!0,cancelable:!0,inputType:`deleteByDrag`}))}return e.preventDefault(),!0}function n_(e,t){return t_(e,t,Qg)}function r_(e,t,n){e.dispatchCommand(so,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if(H(e)&&e.isCollapsed()){let t=e.anchor,n=null,r=Np(t,`previous`);if(r){if(lp(r))n=r.origin;else{let e=Ep(r,yp(Yu(),`next`).getFlipped());for(let t of e){if(V(t.origin)){n=t.origin;break}if(W(t.origin)&&!t.origin.isInline())break}}}if(n&&V(n)){let t=n.getFormat(),r=n.getStyle();e.format===t&&e.style===r||(e.format=t,e.style=r,e.dirty=!0)}}}(n))}function i_(e,t,n,r=[]){let i=t===null||n.isSelected(t),a=W(n)&&n.excludeFromCopy(`html`),o=n;t!==null&&V(o)&&(o=dm(t,o,`clone`));let s=W(o)?o.getChildren():[],c=function(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&Vg(58,n.name),W(e)){let e=t.children;Array.isArray(e)||Vg(59,n.name)}return t}(o);V(o)&&o.getTextContentSize()===0&&(i=!1);let l=i&&Cc(t)&&W(n)?null:t;for(let r=0;r<s.length;r++){let a=s[r],o=i_(e,l,a,c.children);!i&&W(n)&&o&&n.extractWithChild(a,t,`clone`)&&(i=!0)}if(i&&!a){let t=Vf(o);if(t.length>0){let n={};for(let r of t){let t=Hf(o,r);t===null&&Vg(366,o.constructor.name,r);let i=[];i_(e,null,t,i),i.length===1&&i[0].type===t.getType()||Vg(385,r,o.constructor.name,String(i.length),String(i.length>0?i[0].type:`none`)),n[r]=i[0]}c.$slots=n}}if(i&&!a)r.push(c);else if(Array.isArray(c.children))for(let e=0;e<c.children.length;e++){let t=c.children[e];r.push(t)}return i}function a_(e,t){let n=[],r=Yu(),i=H(t)?t.anchor.getNode():Cc(t)?t.getNodes()[0]??null:null,a=i===null?null:zf(i),o=(W(a)?a:r).getChildren();for(let r=0;r<o.length;r++)i_(e,t,o[r],n);return{namespace:e._config.namespace,nodes:n}}function o_(e){let t=[];for(let n of e)t.push(jl(n));return t}var s_=null;async function c_(e,t,n){if(s_!==null)return!1;if(t!==null)return new Promise((r,i)=>{e.update(()=>{r(l_(e,t,n))})});let r=e.getRootElement(),i=e._window||window,a=i.document,o=Id(i);if(r===null||o===null)return!1;let s=a.createElement(`span`);s.style.position=`fixed`,s.style.top=`-1000px`,s.append(a.createTextNode(`#`)),r.append(s);let c=a.createRange();return c.setStart(s,0),c.setEnd(s,1),o.removeAllRanges(),o.addRange(c),new Promise((t,r)=>{let o=e.registerCommand(qo,r=>(Dm(r,ClipboardEvent)&&(o(),s_!==null&&(i.clearTimeout(s_),s_=null),t(l_(e,r,n))),!0),4);s_=i.setTimeout(()=>{o(),s_=null,t(!1)},50),a.execCommand(`copy`),s.remove()})}function l_(e,t,n){if(n===void 0){let t=Id(e._window),r=U();if(!r||r.isCollapsed()||!t)return!1;let i=Kd(t,e.getRootElement()),a=i.anchorNode,o=i.focusNode;if(a!==null&&o!==null&&!Eu(e,a,o))return!1;n=d_(r)}t.preventDefault();let r=t.clipboardData;return r!==null&&(f_(r,n),!0)}var u_=[[`text/html`,Xg],[`application/x-lexical-editor`,Zg]];function d_(e=U()){return function(e,t){let n={"text/plain":``};for(let[r,i]of Object.entries(e))if(i){let e=h_(i,t);e!==null&&(n[r]=e)}return n}(p_(),e)}function f_(e,t){for(let[n]of u_)t[n]===void 0&&e.setData(n,``);for(let n in t){let r=t[n];r!==void 0&&e.setData(n,r)}}function p_(e=cf()){let t=Ph(e,g_.name);return t?t.output:m_}var m_={"application/x-lexical-editor":[(e,t)=>e?Zg(cf(),e):t()],"text/html":[(e,t)=>e?Xg(cf(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]};function h_(e,t){let n=r=>e[r]?e[r](t,n.bind(null,r-1)):null;return n(e.length-1)}var g_=Zp({build:(e,t,n)=>t.$exportMimeType,config:em({$exportMimeType:m_}),mergeConfig(e,t){let n=tm(e,t);if(t.$exportMimeType){let r={...e.$exportMimeType};for(let[e,n]of Object.entries(t.$exportMimeType))if(n){let t=r[e];r[e]=t?[...t,...n]:n}n.$exportMimeType=r}return n},name:`@lexical/clipboard/GetClipboardData`}),__={bold:`bold`,italic:`italic`,strikeThrough:`strikethrough`,subscript:`subscript`,superscript:`superscript`,underline:`underline`},v_=Symbol.for(`@lexical/dragon/WindowState`);function y_(e,t,n){let r=function(e){let t=e[v_];return t===void 0&&(t={dispose:()=>{},editors:new Map,installs:new Set},e[v_]=t),t}(e);if(r.installs.size===0){let t=C_.bind(e);e.addEventListener(`message`,t,!0),r.dispose=()=>{e.removeEventListener(`message`,t,!0)}}if(r.installs.add(t),n){let e=r.editors.get(n)||new Set;e.add(t),r.editors.set(n,e)}return b_.bind(null,e,r,t,n)}function b_(e,t,n,r){if(r){let e=t.editors.get(r);e&&e.delete(n)&&e.size===0&&t.editors.delete(r)}t.installs.delete(n)&&t.installs.size===0&&(t.dispose(),delete e[v_])}function x_(e){return e&&e.ownerDocument.defaultView}function S_(e){let t=ih(()=>x_(e.getRootElement()),t=>e.registerRootListener(e=>{t.value=x_(e)}));return th(()=>{let n=t.value;if(n)return y_(n,Symbol(`@lexical/dragon/editorInstall`),e)})}function C_(e){if(e.origin!==this.location.origin)return;let t=function(e){let t=e[v_];if(t===void 0)return null;let n=ku(Zd(e.document));return Du(n)&&t.editors.has(n)?n:null}(this);if(t===null)return;let n=e.data;if(typeof n==`string`){let r;try{r=JSON.parse(n)}catch{return}if(r&&r.protocol===`nuanria_messaging`&&r.type===`request`){let n=r.payload;if(n&&n.functionId===`makeChanges`){let r=n.args;if(Array.isArray(r)){let[n,i,a,o,s,c]=r;if(![n,i,o,s].every(Number.isFinite)||typeof a!=`string`&&a!==-1)return;t.update(()=>{let t=U();if(H(t)){let r=t.anchor,l=r.getNode(),u=0,d=0;if(V(l)&&n>=0&&i>=0&&(u=n,d=n+i,t.setTextNodeRange(l,u,l,d)),typeof a!=`string`||u===d&&a===``||(t.insertRawText(a),l=r.getNode()),V(l)){let e=l.getTextContentSize();u=Math.min(Math.max(o,0),e),d=o<0||s<0?u:Math.min(o+s,e),t.setTextNodeRange(l,u,l,d)}if(typeof c==`string`&&s>0&&!t.isCollapsed()){let e=__[c];e!==void 0&&t.formatText(e)}e.stopImmediatePropagation()}})}}}}}Mg.tag(`h1`,`h2`,`h3`,`h4`,`h5`,`h6`),Mg.tag(`blockquote`),Mg.tag(`blockquote`),Mg.tag(`p`),Mg.tag(`span`);var w_=B(`DRAG_DROP_PASTE_FILE`),T_=Gi(`shadowRoot`,{parse:Boolean}),E_=class e extends Hl{static getType(){return`quote`}static clone(t){return new e(t.__key)}$config(){return this.config(`quote`,{extends:Hl,stateConfigs:[{flat:!0,stateConfig:T_}]})}isShadowRoot(){return Ki(this,T_)}setIsShadowRoot(e){return qi(this,T_,e)}createDOM(e){let t=Ud().createElement(`blockquote`);return rm(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:M_,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(K(t)){this.isEmpty()&&t.append(Ud().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return D_().updateFromJSON(e)}exportJSON(){return super.exportJSON()}insertNewAfter(e,t){let n=lu(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){if(this.isShadowRoot()){for(let e of this.getChildren())this.insertBefore(e);return this.remove(),!0}let e=lu();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function D_(e){let t=jd(new E_);return e&&e.shadowRoot?t.setIsShadowRoot(!0):t}function O_(e){return e instanceof E_}var k_=class e extends Hl{__tag;static getType(){return`heading`}static clone(t){return new e(t.__tag,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__tag=e.__tag}constructor(e=`h1`,t){super(t),this.__tag=e}getTag(){return this.getLatest().__tag}setTag(e){let t=this.getWritable();return t.__tag=e,t}createDOM(e){let t=this.__tag,n=Ud().createElement(t),r=e.theme.heading;if(r!==void 0){let e=r[t];rm(n,e)}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:j_,priority:0}),h2:e=>({conversion:j_,priority:0}),h3:e=>({conversion:j_,priority:0}),h4:e=>({conversion:j_,priority:0}),h5:e=>({conversion:j_,priority:0}),h6:e=>({conversion:j_,priority:0}),p:e=>{let t=e.firstChild;return t!==null&&A_(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>A_(e)?{conversion:e=>({node:N_(`h1`)}),priority:3}:null}}exportDOM(e){let{element:t}=super.exportDOM(e);if(K(t)){this.isEmpty()&&t.append(Ud().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return N_(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){let n=e?e.anchor.offset:0,r=this.getLastDescendant(),i=!r||e&&e.anchor.key===r.getKey()&&n===r.getTextContentSize()||!e?lu():N_(this.getTag()),a=this.getDirection();if(i.setDirection(a),this.insertAfter(i,t),n===0&&!this.isEmpty()&&e){let e=lu();e.select(),this.replace(e,!0)}return i}collapseAtStart(){if(this.isEmpty()){let e=lu();this.getChildren().forEach(t=>e.append(t)),this.replace(e)}return!0}extractWithChild(){return!0}};function A_(e){return e.nodeName.toLowerCase()===`span`&&e.style.fontSize===`26pt`}function j_(e){let t=e.nodeName.toLowerCase(),n=null;return t!==`h1`&&t!==`h2`&&t!==`h3`&&t!==`h4`&&t!==`h5`&&t!==`h6`||(n=N_(t),vf(e,n),bf(n,e),yf(n,e)),{node:n}}function M_(e){let t=D_();return bf(t,e),vf(e,t),yf(t,e),{node:t}}function N_(e=`h1`){return jd(new k_(e))}function P_(e){return e instanceof k_}function F_(e){return Gl(Ku(e))}function I_(e,t,n,r){let i=!1,a=null;if(e.isCollapsed()&&e.anchor.type===`text`){let t=e.anchor.getNode();if(V(t)){a=t;let r=e.anchor.offset,o=r===t.getTextContentSize()&&t.getNextSibling()===null,s=r===0&&t.getPreviousSibling()===null;i=n===`end`&&o||n===`start`&&s||n===`both`&&(o||s)}}let o=!1;for(let[n,s]of Object.entries(r)){if(s==null||!s[t])continue;let r=n;if(s.onlyAtBoundary){if(!(i&&a&&V(a)&&a.hasFormat(r)))continue;o=!0}e.hasFormat(r)&&e.toggleFormat(r)}o&&e.setStyle(``)}var L_={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function R_(e,t){return function(e,t){if(!e.isCollapsed())return!1;let n=Np(e.focus,t),r=Af(n.origin,Od);if(!r)return!1;let i=e.focus.getNode();if(!r.is(i)&&!Cd(i,r))return!1;let a=Ep(n,hp(r,t));if(a.getTextSlices().some(e=>e&&e.getTextContentSize()>0))return!1;let o=Ep(a.anchor.getSiblingCaret(),a.focus),s=o.anchor.origin;for(let e of o){if(!up(e)||!e.origin.is(s.getParent()))return!1;s=e.origin}let c=r;for(let e of wp(hp(r,t))){if(!e.origin.is(c.getParent())){if(Pd(e.origin)){let e=hp(c,t);return Fp(Ep(e,e)),!0}break}if(!Od(e.origin))break;c=e.origin}return!1}(e,t)||function(e,t){if(!e.isCollapsed()||e.anchor.type!==`element`)return!1;let n=Np(e.anchor,t).getNodeAtCaret();return!(!Od(n)||n.isInline()||(Fp(Tp(Hp(yp(n,t)))),0))}(e,t)}function z_(e){return Gl(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function B_(e){let t=Kc();t.add(e),Xu(t)}function V_(e,t){if(!e.isCollapsed())return!1;let n=e.focus,r=n.getNode(),i=t?`previous`:`next`,a=Np(n,i);if(n.type===`element`&&W(r)&&(ql(r)||Od(r))){let e=a.getNodeAtCaret();return!(e===null||!z_(e))&&(B_(e.__key),!0)}let o=Af(W(r)?r:r.getParentOrThrow(),e=>W(e)&&!e.isInline()&&kd(e.getParent()));if(o===null)return!1;let s=hp(o,i).getNodeAtCaret();if(s===null||!z_(s))return!1;if(o.getTextContentSize()===0)return B_(s.__key),!0;let c=cf().getRootElement();if(c===null)return!1;let l=Id(c.ownerDocument.defaultView);if(l===null||l.rangeCount===0)return!1;let u=l.anchorNode,d=l.anchorOffset,f=l.focusNode,p=l.focusOffset;l.modify(`move`,t?`backward`:`forward`,`line`);let m=l.anchorNode,h=l.anchorOffset;if(m===null)return H_(l,u,d,f,p),!1;let g=Ku(m);return H_(l,u,d,f,p),g!==null&&(m===u&&h===d||!g.is(o)&&!Cd(g,o))&&(B_(s.__key),!0)}function H_(e,t,n,r,i){t!==null&&r!==null&&e.setBaseAndExtent(t,n,r,i)}function U_(e,t){if(!e.isCollapsed())return!1;let n=e.focus.getNode(),r=Af(W(n)?n:n.getParentOrThrow(),e=>W(e)&&!e.isInline());if(r===null)return!1;let i=cf(),a=i.getRootElement();if(a===null)return!1;let o=a.ownerDocument.defaultView;if(o===null)return!1;let s=!1;for(let e of r.getChildren())if(W(e)&&e.isInline()){let t=i.getElementByKey(e.getKey());if(t!==null){let e=o.getComputedStyle(t).display;if(e===`inline-grid`||e===`inline-flex`){s=!0;break}}}if(!s)return!1;let c=hp(r,t?`previous`:`next`).getNodeAtCaret();if(c===null||!W(c)){if(t){let e=r.getFirstDescendant();V(e)?e.select(0,0):r.select(0,0)}else{let e=r.getLastDescendant();if(V(e)){let t=e.getTextContentSize();e.select(t,t)}else{let e=r.getChildrenSize();r.select(e,e)}}return!0}let l=i.getElementByKey(c.getKey());if(l===null)return!1;let u=Id(o);if(u===null||u.rangeCount===0)return!1;let d=u.getRangeAt(0).cloneRange();d.collapse(!0);let f=d.getBoundingClientRect(),p=l.getBoundingClientRect(),m=p.top+p.height/2;if(f.height>0){let t=Bg(f.left,m,a);if(t!==null&&l.contains(t.node)){let n=a.ownerDocument.createRange();return n.setStart(t.node,t.offset),n.collapse(!0),e.applyDOMRange(n),e.dirty=!0,!0}}let h=t?c.getLastDescendant():c.getFirstDescendant();if(V(h)){let e=t?h.getTextContentSize():0;h.select(e,e)}else{let e=c.getChildrenSize();c.select(t?e:0,t?e:0)}return!0}function W_(e,t){let n=hp(e,t),r=n.getAdjacentCaret();r!==null&&W(r.origin)&&!r.origin.isInline()&&r.origin.isShadowRoot()?Fp(Tp(n)):t===`next`?e.selectNext(0,0):e.selectPrevious()}function G_(e,t,n){n.preventDefault(),n.stopPropagation();let r=e.getNodes();if(r.length===0)return!0;let i=r.map(e=>hp(e,`next`)).sort(Op),a=(t?i[0]:i[i.length-1]).origin,o=Af(a,e=>e!==a&&W(e)&&!e.isInline())??Yu(),s=t?0:o.getChildrenSize();return o.select(s,s),!0}function K_(e,t=Km(L_)){return am(e.registerCommand(co,()=>{let e=U();return Cc(e)?(e.clear(),!0):(H(e)&&I_(e,`click`,`both`,t.peek()),!1)},0),e.registerCommand(mo,e=>{let t=U();return H(t)?(t.deleteCharacter(e),!0):!!Cc(t)&&(t.deleteNodes(),!0)},0),e.registerCommand(bo,e=>{let t=U();return!!H(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(xo,e=>{let t=U();return!!H(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(_o,t=>{let n=U();if(typeof t==`string`)n!==null&&n.insertText(t);else{if(n===null)return!1;let r=t.dataTransfer;if(r!=null)Qg(r,n,e);else if(H(n)){let e=t.data;return e&&n.insertText(e),!0}}return!0},0),e.registerCommand(yo,()=>{let e=U();return!!H(e)&&(e.removeText(),!0)},0),e.registerCommand(So,e=>{let t=U();return!(!H(t)&&!Cc(t))&&(Ec(t,e),!0)},0),e.registerCommand(Co,e=>{let t=U();return!(!H(t)&&!Cc(t))&&(Tc(t,e),!0)},0),e.registerCommand(Uo,e=>{let t=U();if(!H(t)&&!Cc(t))return!1;let n=t.getNodes();for(let t of n){let n=Af(t,e=>W(e)&&!e.isInline());n!==null&&n.setFormat(e)}return!0},0),e.registerCommand(ho,e=>{let t=U();return!!H(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(go,()=>{let e=U();return!!H(e)&&(e.insertParagraph(),!0)},0),e.registerCommand(zo,()=>{let e=mc(),t=U();return H(t)&&(e.setFormat(t.format),e.setStyle(t.style)),nl([e]),!0},0),e.registerCommand(Bo,()=>km(e=>{let t=e.getIndent();e.setIndent(t+1)}),0),e.registerCommand(Vo,()=>km(e=>{let t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),0),e.registerCommand(jo,e=>{let t=U();if(Cc(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),W_(n[0],`previous`),!0}else if(H(t)&&(!e.shiftKey&&R_(t,`previous`)||!e.shiftKey&&V_(t,!0)||!e.shiftKey&&U_(t,!0)))return e.preventDefault(),!0;return!1},0),e.registerCommand(Mo,e=>{let t=U();if(Cc(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),W_(n[0],`next`),!0}else if(H(t)&&(function(e){let t=e.focus;return t.key===`root`&&t.offset===Yu().getChildrenSize()}(t)||!e.shiftKey&&R_(t,`next`)||!e.shiftKey&&V_(t,!1)||!e.shiftKey&&U_(t,!1)))return e.preventDefault(),!0;return!1},0),e.registerCommand(ko,e=>{let n=U();if(Cc(n)){let t=n.getNodes();if(t.length>0)return e.preventDefault(),W_(t[0],um(t[0])?`next`:`previous`),!0}if(!H(n))return!1;if(!e.shiftKey&&R_(n,um(n.anchor.getNode())?`next`:`previous`))return e.preventDefault(),!0;if(e.shiftKey||I_(n,`arrow`,`start`,t.peek()),vm(n,!0)){let t=e.shiftKey;return e.preventDefault(),xm(n,t,!0),!0}return!1},0),e.registerCommand(Do,e=>{let n=U();if(Cc(n)){let t=n.getNodes();if(t.length>0)return e.preventDefault(),W_(t[0],um(t[0])?`previous`:`next`),!0}if(!H(n))return!1;if(!e.shiftKey&&R_(n,um(n.anchor.getNode())?`previous`:`next`))return e.preventDefault(),!0;if(e.shiftKey||I_(n,`arrow`,`end`,t.peek()),vm(n,!1)){let t=e.shiftKey;return e.preventDefault(),xm(n,t,!1),!0}return!1},0),e.registerCommand(Fo,t=>{let n=U();if(!Cc(n)&&F_(t.target))return!1;if(H(n)){if(function(e){if(!e.isCollapsed())return!1;let{anchor:t}=e;if(t.offset!==0)return!1;let n=t.getNode();if(ql(n))return!1;let r=wm(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(Vo,void 0);if(qr&&Kr)return!1}else if(!Cc(n))return!1;return t.preventDefault(),e.dispatchCommand(mo,!0)},0),e.registerCommand(Lo,t=>{let n=U();return!(!Cc(n)&&F_(t.target))&&!(!H(n)&&!Cc(n))&&(t.preventDefault(),e.dispatchCommand(mo,!1))},0),e.registerCommand(No,n=>{let r=U();if(Cc(r)){let e=r.getNodes();e.length===1&&Gl(e[0])&&!e[0].isInline()&&(r=e[0].selectNext())}if(!H(r))return!1;if(I_(r,`enter`,`both`,t.peek()),n!==null){if((qr||Yr||Qr)&&Kr)return!1;if(n.preventDefault(),n.shiftKey)return e.dispatchCommand(ho,!1)}return e.dispatchCommand(go,void 0)},0),e.registerCommand(Io,()=>!!H(U())&&(e.blur(),!0),0),e.registerCommand(Ho,t=>{let[,n]=Om(t);if(n.length>0){let r=t.clientX,i=t.clientY,a=Bg(r,i,e.getRootElement());if(a!==null){let{offset:t,node:r}=a,i=Ku(r);if(i!==null){let e=Gc();if(V(i))e.anchor.set(i.getKey(),t,`text`),e.focus.set(i.getKey(),t,`text`);else{let t=i.getParentOrThrow().getKey(),n=i.getIndexWithinParent()+1;e.anchor.set(t,n,`element`),e.focus.set(t,n,`element`)}Xu(sa(e))}e.dispatchCommand(w_,n)}return t.preventDefault(),!0}return n_(t,e)},0),e.registerCommand(Wo,t=>{let[n]=Om(t),r=U();return!(n&&!H(r))&&(H(r)&&!r.isCollapsed()&&t.dataTransfer!==null&&(f_(t.dataTransfer,d_(r)),e_(t.dataTransfer,e)),!0)},0),e.registerCommand(Go,t=>{let[n]=Om(t),r=U();if(n&&!H(r))return!1;let i=t.clientX,a=t.clientY,o=Bg(i,a,e.getRootElement());return o!==null&&Gl(Ku(o.node))&&t.preventDefault(),!0},0),e.registerCommand(Yo,()=>{let e=U();return fd(H(e)&&zf(e.anchor.getNode())!==null?e:null),!0},0),e.registerCommand(qo,t=>(c_(e,Dm(t,ClipboardEvent)?t:null),!0),0),e.registerCommand(Jo,t=>(async function(e,t){await c_(t,Dm(e,ClipboardEvent)?e:null),t.update(()=>{let e=U();H(e)?e.removeText():Cc(e)&&e.getNodes().forEach(e=>e.remove())},{tag:`cut`})}(t,e),!0),0),e.registerCommand(vo,t=>{let[,n,r]=Om(t);return n.length>0&&!r?(e.dispatchCommand(w_,n),!0):ef(t.target)&&Tu(t.target)?!1:U()!==null&&(function(e,t){e.preventDefault(),t.update(()=>{let n=U(),r=Dm(e,InputEvent)||Dm(e,KeyboardEvent)?null:e.clipboardData;r!=null&&n!==null&&Qg(r,n,t)},{tag:`paste`})}(t,e),!0)},0),e.registerCommand(Po,()=>{let e=U();return H(e)&&I_(e,`space`,`both`,t.peek()),!1},0),e.registerCommand(Ro,()=>{let e=U();return H(e)&&I_(e,`tab`,`both`,t.peek()),!1},0),e.registerCommand(Oo,e=>{let t=U();if(Cc(t))return G_(t,!1,e);if(!H(t))return!1;let{anchor:n}=t;if(n.type!==`element`||n.offset!==0)return!1;let r=n.getNode();if(!W(r))return!1;let i=r.getFirstChild();if(!Gl(i)||!i.isInline())return!1;let a=r.getKey(),o=r.selectEnd();return e.shiftKey&&o.anchor.set(a,0,`element`),e.preventDefault(),e.stopPropagation(),!0},0),e.registerCommand(Ao,e=>{let t=U();if(Cc(t))return G_(t,!0,e);if(!H(t))return!1;let{anchor:n,focus:r}=t,i=Af(r.getNode(),e=>W(e)&&!e.isInline());if(i===null)return!1;let a=i.getFirstChild();if(!Gl(a)||!a.isInline()||Af(n.getNode(),e=>W(e)&&!e.isInline())!==i)return!1;let o=i.getKey();return(r.type!==`element`||r.key!==o||r.offset!==0)&&(t.focus.set(o,0,`element`),e.shiftKey||t.anchor.set(o,0,`element`),e.preventDefault(),e.stopPropagation(),!0)},0))}function q_(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function J_(e,t){return e.length>0?(q_(e,e.length,0,t),e):t}var Y_=ov(/[A-Za-z]/),X_=ov(/[\dA-Za-z]/),Z_=ov(/[#-'*+\--9=?A-Z^-~]/);function Q_(e){return e!==null&&(e<32||e===127)}var $_=ov(/\d/),ev=ov(/[\dA-Fa-f]/),tv=ov(/[!-/:-@[-`{-~]/);function q(e){return e!==null&&e<-2}function nv(e){return e!==null&&(e<0||e===32)}function rv(e){return e===-2||e===-1||e===32}var iv=ov(/\p{P}|\p{S}/u),av=ov(/\s/);function ov(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function sv(e){if(e===null||nv(e)||av(e))return 1;if(iv(e))return 2}function cv(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}function lv(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&q_(o,o.length,0,cv(s,e.slice(r+1,n),t)),q_(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),q_(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=sv(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=sv(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var uv=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];hv.peek=gv;function dv(){return{canContainEols:[`delete`],enter:{strikethrough:pv},exit:{strikethrough:mv}}}function fv(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:uv}],handlers:{delete:hv}}}function pv(e){this.enter({type:`delete`,children:[]},e)}function mv(e){this.exit(e)}function hv(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function gv(){return`~`}Sv.peek=Cv;var _v=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],vv={canContainEols:[`highlight`],enter:{highlight:yv},exit:{highlight:bv}};function yv(e){this.enter({type:`highlight`,children:[]},e)}function bv(e){this.exit(e)}var xv={unsafe:[{character:`=`,inConstruct:`phrasing`,notInConstruct:_v}],handlers:{highlight:Sv}};function Sv(e,t,n,r){let i=n.createTracker(r),a=n.enter(`highlight`),o=i.move(`==`);return o+=i.move(n.containerPhrasing(e,{before:o,after:`=`,...i.current()})),o+=i.move(`==`),a(),o}function Cv(){return`=`}function wv(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var Tv=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),Ev={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function Dv(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function Ov(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function kv(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function Av(e){return kv(e)||Dv(e)}var jv=document.createElement(`i`);function Mv(e){let t=`&`+e+`;`;jv.innerHTML=t;let n=jv.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}var Nv=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function Pv(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?Av:u===`decimal`?Dv:Ov;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&Tv.includes(y)&&(_=y,v=Mv(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`&&Mv(y);e&&(_=y,v=e)}let S=1+l-o,C=``;if(x||n.nonTerminated!==!1){if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):Av(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(Fv(e))h(7,S),C=`�`;else if(e in Ev)h(6,S),C=Ev[e];else{let t=``;Iv(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,Nv[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function Fv(e){return e>=55296&&e<=57343||e>1114111}function Iv(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var Lv=/["&'<>`]/g,Rv=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,zv=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Bv=/[|\\{}()[\]^$+*?.]/g,Vv=new WeakMap;function Hv(e,t){if(e=e.replace(t.subset?Uv(t.subset):Lv,r),t.subset||t.escapeOnly)return e;return e.replace(Rv,n).replace(zv,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Uv(e){let t=Vv.get(e);return t||(t=Wv(e),Vv.set(e,t)),t}function Wv(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Bv,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}function Gv(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Kv(e,t){return Hv(e,Object.assign({format:Gv},t))}function qv(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Yv(e.position):`start`in e||`end`in e?Yv(e):`line`in e||`column`in e?Jv(e):``}function Jv(e){return Xv(e&&e.line)+`:`+Xv(e&&e.column)}function Yv(e){return Jv(e&&e.start)+`-`+Jv(e&&e.end)}function Xv(e){return e&&typeof e==`number`?e:1}var Zv=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=qv(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Zv.prototype.file=``,Zv.prototype.name=``,Zv.prototype.reason=``,Zv.prototype.message=``,Zv.prototype.stack=``,Zv.prototype.column=void 0,Zv.prototype.line=void 0,Zv.prototype.ancestors=void 0,Zv.prototype.cause=void 0,Zv.prototype.fatal=void 0,Zv.prototype.place=void 0,Zv.prototype.ruleId=void 0,Zv.prototype.source=void 0;var Qv=` `;function $v(){return{canContainEols:[`mdxJsxTextElement`],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:d,mdxJsxFlowTagExpressionAttribute:f,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:d,mdxJsxTextTagExpressionAttribute:f,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:s,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:l,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:m,mdxJsxFlowTagAttributeNameLocal:h,mdxJsxFlowTagAttributeValueLiteral:g,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:_,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:v,mdxJsxFlowTag:y,mdxJsxTextTagClosingMarker:s,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:l,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:m,mdxJsxTextTagAttributeNameLocal:h,mdxJsxTextTagAttributeValueLiteral:g,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:_,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:v,mdxJsxTextTag:y}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function r(e){let t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function i(e){if(this.data.mdxJsxTagStack.length===0)throw new Zv("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-closing-slash`)}function a(e){if(this.data.mdxJsxTag.close)throw new Zv(`Unexpected attribute in closing tag, expected the end of the tag`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-attribute`)}function o(e){if(this.data.mdxJsxTag.close)throw new Zv("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-self-closing-slash`)}function s(){let e=this.data.mdxJsxTag;e.close=!0}function c(e){let t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function l(e){let t=this.data.mdxJsxTag;t.name+=`.`+this.sliceSerialize(e)}function u(e){let t=this.data.mdxJsxTag;t.name+=`:`+this.sliceSerialize(e)}function d(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxAttribute`,name:``,value:null,position:{start:t(e.start),end:void 0}})}function f(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxExpressionAttribute`,value:``,position:{start:t(e.start),end:void 0}}),this.buffer()}function p(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i=e.estree;r.value=this.resume(),r.position,r.position.end=t(e.end),i&&(r.data={estree:i})}function m(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function h(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=`:`+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=Pv(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function _(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i={type:`mdxJsxAttributeValueExpression`,value:this.resume()},a=e.estree;a&&(i.data={estree:a}),r.value=i,r.position,r.position.end=t(e.end)}function v(){let e=this.data.mdxJsxTag;e.selfClosing=!0}function y(e){let t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,r=n[n.length-1];if(t.close&&r.name!==t.name)throw new Zv("Unexpected closing tag `"+S(t)+"`, expected corresponding closing tag for `"+S(r)+"` ("+qv(r)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`);this.resume(),t.close?n.pop():this.enter({type:e.type===`mdxJsxTextTag`?`mdxJsxTextElement`:`mdxJsxFlowElement`,name:t.name||null,attributes:t.attributes,children:[]},e,b),t.selfClosing||t.close?this.exit(e,x):n.push(t)}function b(e,t){let n=this.data.mdxJsxTagStack,r=n[n.length-1],i=e?" before the end of `"+e.type+"`":``,a=e?{start:e.start,end:e.end}:void 0;throw new Zv("Expected a closing tag for `"+S(r)+"` ("+qv({start:t.start,end:t.end})+`)`+i,a,`mdast-util-mdx-jsx:end-tag-mismatch`)}function x(e,t){let n=this.data.mdxJsxTag;throw new Zv("Expected the closing tag `"+S(n)+"` either after the end of `"+t.type+"` ("+qv(t.end)+") or another opening tag after the start of `"+t.type+"` ("+qv(t.start)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`)}function S(e){return`<`+(e.close?`/`:``)+(e.name||``)+`>`}}function ey(e){let t=e||{},n=t.quote||`"`,r=t.quoteSmart||!1,i=t.tightSelfClosing||!1,a=t.printWidth||1/0,o=n===`"`?`'`:`"`;if(n!==`"`&&n!==`'`)throw Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return s.peek=iy,{handlers:{mdxJsxFlowElement:s,mdxJsxTextElement:s},unsafe:[{character:`<`,inConstruct:[`phrasing`]},{atBreak:!0,character:`<`}],fences:!0,resourceLink:!0};function s(e,t,s,c){let l=e.type===`mdxJsxFlowElement`,u=e.name?!e.children||e.children.length===0:!1,d=ry(ny(s)),f=s.createTracker(c),p=s.createTracker(c),m=[],h=(l?d:``)+`<`+(e.name||``),g=s.enter(e.type);if(f.move(h),p.move(h),e.attributes&&e.attributes.length>0){if(!e.name)throw Error(`Cannot serialize fragment w/ attributes`);let t=-1;for(;++t<e.attributes.length;){let i=e.attributes[t],a;if(i.type===`mdxJsxExpressionAttribute`)a=`{`+(i.value||``)+`}`;else{if(!i.name)throw Error(`Cannot serialize attribute w/o name`);let e=i.value,t=i.name,s=``;if(e!=null){if(typeof e==`object`)s=`{`+(e.value||``)+`}`;else{let t=r&&wv(e,n)>wv(e,o)?o:n;s=t+Kv(e,{subset:[t]})+t}}a=t+(s?`=`:``)+s}m.push(a)}}let _=!1,v=m.join(` `);l&&(/\r?\n|\r/.test(v)||f.current().now.column+v.length+(u?i?2:3:1)>a)&&(_=!0);let y=f,b=h;if(_){y=p;let e=-1;for(;++e<m.length;)m[e]=d+Qv+m[e];b+=y.move(`
19
+ `+m.join(`
20
+ `)+`
21
+ `+d)}else v&&(b+=y.move(` `+v));return u&&(b+=y.move((i||_?``:` `)+`/`)),b+=y.move(`>`),e.children&&e.children.length>0&&(e.type===`mdxJsxTextElement`?b+=y.move(s.containerPhrasing(e,{...y.current(),before:`>`,after:`<`})):(y.shift(2),b+=y.move(`
22
+ `),b+=y.move(ty(e,s,y.current())),b+=y.move(`
23
+ `))),u||(b+=y.move((l?d:``)+`</`+(e.name||``)+`>`)),g(),b}}function ty(e,t,n){let r=t.indexStack,i=e.children,a=t.createTracker(n),o=ry(ny(t)),s=[],c=-1;for(r.push(-1);++c<i.length;){let n=i[c];r[r.length-1]=c;let l={before:`
24
+ `,after:`
25
+ `,...a.current()},u=t.handle(n,e,t,l),d=n.type===`mdxJsxFlowElement`?u:t.indentLines(u,function(e,t,n){return(n?``:o)+e});s.push(a.move(d)),n.type!==`list`&&(t.bulletLastUsed=void 0),c<i.length-1&&s.push(a.move(`
26
+
27
+ `))}return r.pop(),s.join(``)}function ny(e){let t=0,n=e.stack.length;for(;--n>-1;){let r=e.stack[n];if(r===`blockquote`||r===`listItem`)break;r===`mdxJsxFlowElement`&&t++}return t}function ry(e){return Qv.repeat(e)}function iy(){return`<`}var ay=Object.prototype.hasOwnProperty;function oy(e,t,n){for(n of e.keys())if(sy(n,t))return n}function sy(e,t){var n,r,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&sy(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(i=r,i&&typeof i==`object`&&(i=oy(t,i),!i)||!t.has(i))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(i=r[0],i&&typeof i==`object`&&(i=oy(t,i),!i)||!sy(r[1],t.get(i)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e==`object`){for(n in r=0,e)if(ay.call(e,n)&&++r&&!ay.call(t,n)||!(n in t)||!sy(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}var cy,ly,uy,dy,fy=!0;typeof process<`u`&&({FORCE_COLOR:cy,NODE_DISABLE_COLORS:ly,NO_COLOR:uy,TERM:dy}={},fy=process.stdout&&process.stdout.isTTY);var py={enabled:!ly&&uy==null&&dy!==`dumb`&&(cy!=null&&cy!==`0`||fy),reset:gy(0,0),bold:gy(1,22),dim:gy(2,22),italic:gy(3,23),underline:gy(4,24),inverse:gy(7,27),hidden:gy(8,28),strikethrough:gy(9,29),black:gy(30,39),red:gy(31,39),green:gy(32,39),yellow:gy(33,39),blue:gy(34,39),magenta:gy(35,39),cyan:gy(36,39),white:gy(37,39),gray:gy(90,39),grey:gy(90,39),bgBlack:gy(40,49),bgRed:gy(41,49),bgGreen:gy(42,49),bgYellow:gy(43,49),bgBlue:gy(44,49),bgMagenta:gy(45,49),bgCyan:gy(46,49),bgWhite:gy(47,49)};function my(e,t){let n=0,r,i=``,a=``;for(;n<e.length;n++)r=e[n],i+=r.open,a+=r.close,~t.indexOf(r.close)&&(t=t.replace(r.rgx,r.close+r.open));return i+t+a}function hy(e,t){let n={has:e,keys:t};return n.reset=py.reset.bind(n),n.bold=py.bold.bind(n),n.dim=py.dim.bind(n),n.italic=py.italic.bind(n),n.underline=py.underline.bind(n),n.inverse=py.inverse.bind(n),n.hidden=py.hidden.bind(n),n.strikethrough=py.strikethrough.bind(n),n.black=py.black.bind(n),n.red=py.red.bind(n),n.green=py.green.bind(n),n.yellow=py.yellow.bind(n),n.blue=py.blue.bind(n),n.magenta=py.magenta.bind(n),n.cyan=py.cyan.bind(n),n.white=py.white.bind(n),n.gray=py.gray.bind(n),n.grey=py.grey.bind(n),n.bgBlack=py.bgBlack.bind(n),n.bgRed=py.bgRed.bind(n),n.bgGreen=py.bgGreen.bind(n),n.bgYellow=py.bgYellow.bind(n),n.bgBlue=py.bgBlue.bind(n),n.bgMagenta=py.bgMagenta.bind(n),n.bgCyan=py.bgCyan.bind(n),n.bgWhite=py.bgWhite.bind(n),n}function gy(e,t){let n={open:`\x1b[${e}m`,close:`\x1b[${t}m`,rgx:RegExp(`\\x1b\\[${t}m`,`g`)};return function(t){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(e)||(this.has.push(e),this.keys.push(n)),t===void 0?this:py.enabled?my(this.keys,t+``):t+``):t===void 0?hy([e],[n]):py.enabled?my([n],t+``):t+``}}function _y(){}_y.prototype={diff:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.callback;typeof n==`function`&&(r=n,n={}),this.options=n;var i=this;function a(e){return r?(setTimeout(function(){r(void 0,e)},0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e)),t=this.removeEmpty(this.tokenize(t));var o=t.length,s=e.length,c=1,l=o+s;n.maxEditLength&&(l=Math.min(l,n.maxEditLength));var u=n.timeout??1/0,d=Date.now()+u,f=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(f[0],t,e,0);if(f[0].oldPos+1>=s&&p+1>=o)return a([{value:this.join(t),count:t.length}]);var m=-1/0,h=1/0;function g(){for(var n=Math.max(m,-c);n<=Math.min(h,c);n+=2){var r=void 0,l=f[n-1],u=f[n+1];l&&(f[n-1]=void 0);var d=!1;if(u){var g=u.oldPos-n;d=u&&0<=g&&g<o}var _=l&&l.oldPos+1<s;if(!d&&!_){f[n]=void 0;continue}if(r=!_||d&&l.oldPos+1<u.oldPos?i.addToPath(u,!0,void 0,0):i.addToPath(l,void 0,!0,1),p=i.extractCommon(r,t,e,n),r.oldPos+1>=s&&p+1>=o)return a(vy(i,r.lastComponent,t,e,i.useLongestToken));f[n]=r,r.oldPos+1>=s&&(h=Math.min(h,n-1)),p+1>=o&&(m=Math.max(m,n+1))}c++}if(r)(function e(){setTimeout(function(){if(c>l||Date.now()>d)return r();g()||e()},0)})();else for(;c<=l&&Date.now()<=d;){var _=g();if(_)return _}},addToPath:function(e,t,n,r){var i=e.lastComponent;return i&&i.added===t&&i.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:i.count+1,added:t,removed:n,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:i}}},extractCommon:function(e,t,n,r){for(var i=t.length,a=n.length,o=e.oldPos,s=o-r,c=0;s+1<i&&o+1<a&&this.equals(t[s+1],n[o+1]);)s++,o++,c++;return c&&(e.lastComponent={count:c,previousComponent:e.lastComponent}),e.oldPos=o,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split(``)},join:function(e){return e.join(``)}};function vy(e,t,n,r,i){for(var a=[],o;t;)a.push(t),o=t.previousComponent,delete t.previousComponent,t=o;a.reverse();for(var s=0,c=a.length,l=0,u=0;s<c;s++){var d=a[s];if(!d.removed){if(!d.added&&i){var f=n.slice(l,l+d.count);f=f.map(function(e,t){var n=r[u+t];return n.length>e.length?n:e}),d.value=e.join(f)}else d.value=e.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}else if(d.value=e.join(r.slice(u,u+d.count)),u+=d.count,s&&a[s-1].added){var p=a[s-1];a[s-1]=a[s],a[s]=p}}var m=a[c-1];return c>1&&typeof m.value==`string`&&(m.added||m.removed)&&e.equals(``,m.value)&&(a[c-2].value+=m.value,a.pop()),a}new _y;var yy=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,by=/\S/,xy=new _y;xy.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!by.test(e)&&!by.test(t)},xy.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&yy.test(t[n])&&yy.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var Sy=new _y;Sy.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
28
+ `));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var i=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),t.push(i))}return t};var Cy=new _y;Cy.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var wy=new _y;wy.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Ty(e){"@babel/helpers - typeof";return Ty=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Ty(e)}var Ey=Object.prototype.toString,Dy=new _y;Dy.useLongestToken=!0,Dy.tokenize=Sy.tokenize,Dy.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,i=r===void 0?function(e,t){return t===void 0?n:t}:r;return typeof e==`string`?e:JSON.stringify(Oy(e,null,null,i),i,` `)},Dy.equals=function(e,t){return _y.prototype.equals.call(Dy,e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`))};function Oy(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i,e));for(var a=0;a<t.length;a+=1)if(t[a]===e)return n[a];var o;if(Ey.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=Oy(e[a],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),Ty(e)===`object`&&e!==null){t.push(e),o={},n.push(o);var s=[],c;for(c in e)e.hasOwnProperty(c)&&s.push(c);for(s.sort(),a=0;a<s.length;a+=1)c=s[a],o[c]=Oy(e[c],t,n,r,c);t.pop(),n.pop()}else o=e;return o}var ky=new _y;ky.tokenize=function(e){return e.slice()},ky.join=ky.removeEmpty=function(e){return e},py.red,py.grey,py.green,py.dim().italic,py.dim(`→`),py.dim(`·`),py.dim(`↵`);function Ay(e){e=e.replace(/\r?\n/g,`
29
+ `);let t=e.match(/^[ \t]*(?=\S)/gm),n=0,r=1/0,i=(t||[]).length;for(;n<i;n++)r=Math.min(r,t[n].length);return i&&r?e.replace(RegExp(`^[ \\t]{${r}}`,`gm`),``):e}var jy=class extends Error{constructor(e={}){super(e.message),this.name=`Assertion`,this.code=`ERR_ASSERTION`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.details=e.details||!1,this.generated=!!e.generated,this.operator=e.operator,this.expects=e.expects,this.actual=e.actual}};function My(e,t,n,r,i,a,o){if(e)return;let s=o||a;throw o instanceof Error?o:new jy({actual:t,expects:n,operator:r,message:s,details:i&&i(t,n),generated:!o})}function Ny(e,t){My(!!e,!1,!0,`ok`,!1,`Expected value to be truthy`,t)}function Py(e,t){My(!e,!0,!1,`not`,!1,`Expected value to be falsey`,t)}Py.ok=Py,Py.equal=function(e,t,n){My(!sy(e,t),e,t,`not.equal`,!1,`Expected values not to be deeply equal`,n)},Py.type=function(e,t,n){let r=typeof e;My(r!==t,r,t,`not.type`,!1,`Expected "${r}" not to be "${t}"`,n)},Py.instance=function(e,t,n){let r="`"+(t.name||t.constructor.name)+"`";My(!(e instanceof t),e,t,`not.instance`,!1,`Expected value not to be an instance of ${r}`,n)},Py.snapshot=function(e,t,n){e=Ay(e),t=Ay(t),My(e!==t,e,t,`not.snapshot`,!1,`Expected value not to match snapshot`,n)},Py.fixture=function(e,t,n){e=Ay(e),t=Ay(t),My(e!==t,e,t,`not.fixture`,!1,`Expected value not to match fixture`,n)},Py.match=function(e,t,n){typeof t==`string`?My(!e.includes(t),e,t,`not.match`,!1,`Expected value not to include "${t}" substring`,n):My(!t.test(e),e,t,`not.match`,!1,`Expected value not to match \`${String(t)}\` pattern`,n)},Py.throws=function(e,t,n){!n&&typeof t==`string`&&(n=t,t=null);try{e()}catch(e){typeof t==`function`?My(!t(e),!0,!1,`not.throws`,!1,`Expected function not to throw matching exception`,n):t instanceof RegExp?My(!t.test(e.message),!0,!1,`not.throws`,!1,`Expected function not to throw exception matching \`${String(t)}\` pattern`,n):t||My(!1,!0,!1,`not.throws`,!1,`Expected function not to throw`,n)}};var Fy={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533},Iy={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:`CDATA[`,characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:`content`,contentTypeDocument:`document`,contentTypeFlow:`flow`,contentTypeString:`string`,contentTypeText:`text`,hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4},Ly={data:`data`,whitespace:`whitespace`,lineEnding:`lineEnding`,lineEndingBlank:`lineEndingBlank`,linePrefix:`linePrefix`,lineSuffix:`lineSuffix`,atxHeading:`atxHeading`,atxHeadingSequence:`atxHeadingSequence`,atxHeadingText:`atxHeadingText`,autolink:`autolink`,autolinkEmail:`autolinkEmail`,autolinkMarker:`autolinkMarker`,autolinkProtocol:`autolinkProtocol`,characterEscape:`characterEscape`,characterEscapeValue:`characterEscapeValue`,characterReference:`characterReference`,characterReferenceMarker:`characterReferenceMarker`,characterReferenceMarkerNumeric:`characterReferenceMarkerNumeric`,characterReferenceMarkerHexadecimal:`characterReferenceMarkerHexadecimal`,characterReferenceValue:`characterReferenceValue`,codeFenced:`codeFenced`,codeFencedFence:`codeFencedFence`,codeFencedFenceSequence:`codeFencedFenceSequence`,codeFencedFenceInfo:`codeFencedFenceInfo`,codeFencedFenceMeta:`codeFencedFenceMeta`,codeFlowValue:`codeFlowValue`,codeIndented:`codeIndented`,codeText:`codeText`,codeTextData:`codeTextData`,codeTextPadding:`codeTextPadding`,codeTextSequence:`codeTextSequence`,content:`content`,definition:`definition`,definitionDestination:`definitionDestination`,definitionDestinationLiteral:`definitionDestinationLiteral`,definitionDestinationLiteralMarker:`definitionDestinationLiteralMarker`,definitionDestinationRaw:`definitionDestinationRaw`,definitionDestinationString:`definitionDestinationString`,definitionLabel:`definitionLabel`,definitionLabelMarker:`definitionLabelMarker`,definitionLabelString:`definitionLabelString`,definitionMarker:`definitionMarker`,definitionTitle:`definitionTitle`,definitionTitleMarker:`definitionTitleMarker`,definitionTitleString:`definitionTitleString`,emphasis:`emphasis`,emphasisSequence:`emphasisSequence`,emphasisText:`emphasisText`,escapeMarker:`escapeMarker`,hardBreakEscape:`hardBreakEscape`,hardBreakTrailing:`hardBreakTrailing`,htmlFlow:`htmlFlow`,htmlFlowData:`htmlFlowData`,htmlText:`htmlText`,htmlTextData:`htmlTextData`,image:`image`,label:`label`,labelText:`labelText`,labelLink:`labelLink`,labelImage:`labelImage`,labelMarker:`labelMarker`,labelImageMarker:`labelImageMarker`,labelEnd:`labelEnd`,link:`link`,paragraph:`paragraph`,reference:`reference`,referenceMarker:`referenceMarker`,referenceString:`referenceString`,resource:`resource`,resourceDestination:`resourceDestination`,resourceDestinationLiteral:`resourceDestinationLiteral`,resourceDestinationLiteralMarker:`resourceDestinationLiteralMarker`,resourceDestinationRaw:`resourceDestinationRaw`,resourceDestinationString:`resourceDestinationString`,resourceMarker:`resourceMarker`,resourceTitle:`resourceTitle`,resourceTitleMarker:`resourceTitleMarker`,resourceTitleString:`resourceTitleString`,setextHeading:`setextHeading`,setextHeadingText:`setextHeadingText`,setextHeadingLine:`setextHeadingLine`,setextHeadingLineSequence:`setextHeadingLineSequence`,strong:`strong`,strongSequence:`strongSequence`,strongText:`strongText`,thematicBreak:`thematicBreak`,thematicBreakSequence:`thematicBreakSequence`,blockQuote:`blockQuote`,blockQuotePrefix:`blockQuotePrefix`,blockQuoteMarker:`blockQuoteMarker`,blockQuotePrefixWhitespace:`blockQuotePrefixWhitespace`,listOrdered:`listOrdered`,listUnordered:`listUnordered`,listItemIndent:`listItemIndent`,listItemMarker:`listItemMarker`,listItemPrefix:`listItemPrefix`,listItemPrefixWhitespace:`listItemPrefixWhitespace`,listItemValue:`listItemValue`,chunkDocument:`chunkDocument`,chunkContent:`chunkContent`,chunkFlow:`chunkFlow`,chunkText:`chunkText`,chunkString:`chunkString`},Ry=`highlightSequenceTemporary`,zy=`highlightSequence`,By=`highlight`,Vy=`highlightText`;function Hy(){let e={name:`highlight`,tokenize:n,resolveAll:t};return{text:{[Fy.equalsTo]:e},insideSpan:{null:[e]},attentionMarkers:{null:[Fy.equalsTo]}};function t(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===Ry&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===Ry&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=zy,e[r][1].type=zy;let i={type:By,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:Vy,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&q_(o,o.length,0,cv(s,e.slice(r+1,n),t)),q_(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),q_(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===Ry&&(e[n][1].type=Ly.data);return e}function n(e,t,n){let r=this.previous,i=this.events,a=0;return o;function o(t){return Ny(t===Fy.equalsTo,"expected `=`"),r===Fy.equalsTo&&i[i.length-1][1].type!==Ly.characterEscape?n(t):(e.enter(Ry),s(t))}function s(i){let o=sv(r);if(i===Fy.equalsTo)return a>1?n(i):(e.consume(i),a++,s);if(a<2)return n(i);let c=e.exit(Ry),l=sv(i);return c._open=!l||l===Iy.attentionSideAfter&&!!o,c._close=!o||o===Iy.attentionSideAfter&&!!l,t(i)}}}var Uy=/[$_\p{ID_Start}]/u,Wy=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,Gy=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,Ky={};function qy(e){return e?Uy.test(String.fromCodePoint(e)):!1}function Jy(e,t){let n=(t||Ky).jsx?Gy:Wy;return e?n.test(String.fromCodePoint(e)):!1}function Yy(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return rv(r)?(e.enter(n),s(r)):t(r)}function s(r){return rv(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function Xy(e){return e}var Zy={}.hasOwnProperty,Qy=Symbol(`continue`),$y=Symbol(`exit`),eb=Symbol(`skip`);function tb(e,t){let n,r;typeof t==`function`?n=t:t&&typeof t==`object`&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(e,t,a,o){return rb(e)&&(s.displayName=`node (`+Xy(e.type)+`)`),s;function s(){let s=n?nb(n(e,t,a,o)):[];if(s[0]===$y)return s;if(s[0]!==eb){let t;for(t in e)if(Zy.call(e,t)&&e[t]&&typeof e[t]==`object`&&t!==`data`&&t!==`position`){let n=o.concat(e),r=e[t];if(Array.isArray(r)){let e=r,a=0;for(;a>-1&&a<e.length;){let r=e[a];if(rb(r)){let e=i(r,t,a,n)();if(e[0]===$y)return e;a=typeof e[1]==`number`?e[1]:a+1}else a++}}else if(rb(r)){let e=i(r,t,void 0,n)();if(e[0]===$y)return e}}}return r?nb(r(e,t,a,o)):s}}}function nb(e){return Array.isArray(e)?e:typeof e==`number`?[Qy,e]:[e]}function rb(e){return!!(e&&typeof e==`object`&&`type`in e&&typeof e.type==`string`&&e.type.length>0)}function ib(e,t){let n=t.prefix||``,r=t.suffix||``,i=Object.assign({},t.acornOptions),a=[],o=[],s=i.onComment,c=i.onToken,l=!1,u,d,f=Object.assign({},i,{onComment:a,preserveParens:!0});c&&(f.onToken=o);let p=ob(e,t.tokenTypes),m=p.value,h=n+m+r,g=t.expression&&ab(m);if(g&&!t.allowEmpty)throw new Zv(`Unexpected empty expression`,{place:v(0),ruleId:`unexpected-empty-expression`,source:`micromark-extension-mdx-expression`});try{u=t.expression&&!g?t.acorn.parseExpressionAt(h,0,f):t.acorn.parse(h,f)}catch(e){let t=e,r=v(t.pos);t.message=String(t.message).replace(/ \(\d+:\d+\)$/,``),t.pos=r.offset,t.loc={line:r.line,column:r.column-1},d=t,l=t.raisedAt>=n.length+m.length||t.message===`Unterminated comment`}if(u&&t.expression&&!g){if(ab(h.slice(u.end,h.length-r.length)))u={type:`Program`,start:0,end:n.length+m.length,body:[{type:`ExpressionStatement`,expression:u,start:0,end:n.length+m.length}],sourceType:`module`,comments:[]};else{let e=v(u.end),t=Error(`Unexpected content after expression`);t.pos=e.offset,t.loc={line:e.line,column:e.column-1},d=t,u=void 0}}if(u){if(u.comments=a,tb(u,function(e,t,n,r){let i=r[r.length-1],a=t;e.type===`ParenthesizedExpression`&&i&&a&&(typeof n==`number`&&(i=i[a],a=n),i[a]=e.expression),_(e)}),Array.isArray(s))s.push(...a);else if(typeof s==`function`)for(let e of a)s(e.type===`Block`,e.value,e.start,e.end,e.loc.start,e.loc.end);for(let e of o)e.end<=n.length||e.start-n.length>=m.length||(_(e),Array.isArray(c)?c.push(e):c(e))}return{estree:u,error:d,swallow:l};function _(e){let t=v(e.start),n=v(e.end);e.start=t.offset,e.end=n.offset,e.loc={start:{line:t.line,column:t.column-1,offset:t.offset},end:{line:n.line,column:n.column-1,offset:n.offset}},e.range=[e.start,e.end]}function v(e){let r=e-n.length;r<0?r=0:r>m.length&&(r=m.length);let i=sb(p.stops,r);return i||={line:t.start.line,column:t.start.column,offset:t.start.offset},i}}function ab(e){return/^\s*$/.test(e.replace(/\/\*[\s\S]*?\*\//g,``).replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,``))}function ob(e,t){let n={value:``,stops:[]},r=-1;for(;++r<e.length;){let i=e[r];if(i[0]===`enter`){let e=i[1].type;if(e===`lineEnding`||t.includes(e)){let e=i[2].sliceStream(i[1]);for(;e.length>0&&e[0]===-1;)e.shift();let t=cb(e);n.stops.push([n.value.length,i[1].start]),n.value+=t,n.stops.push([n.value.length,i[1].end])}}}return n}function sb(e,t){let n=0;for(;n<e.length&&e[n][0]<=t;)n+=1;if(n===0)return;let[r,i]=e[n-1],a=t-r;return{line:i.line,column:i.column+a,offset:i.offset+a}}function cb(e){let t=-1,n=[],r;for(;++t<e.length;){let i=e[t],a;if(typeof i==`string`)a=i;else switch(i){case-5:a=`\r`;break;case-4:a=`
30
+ `;break;case-3:a=`\r
31
+ `;break;case-2:a=` `;break;case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function lb(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=ub(n.start,r[0]||t.start),a=ub(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function ub(e,t){if(e&&typeof e==`object`){let n=`line`in e?db(e.line):void 0,r=`column`in e?db(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:db(t)}}}function db(e){return typeof e==`number`&&e>-1?e:void 0}var fb=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,pb=`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,mb=`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,hb=`#unexpected-type-in-code-expected-an-object-spread-spread`,gb=`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,_b=`#could-not-parse-expression-with-acorn`;function vb(e,t,n,r,i,a,o,s,c,l,u){let d=this,f=this.events.length+3,p=0,m,h;return g;function g(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),m=d.now(),_}function _(u){if(u===null){if(h)throw h;let e=new Zv("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:d.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=fb+pb,e}if(q(u))return e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),y;if(u===125&&p===0){let p=a?yb.call(d,a,o,i,f,m,l||!1,c||!1):{type:`ok`,estree:void 0};if(p.type===`ok`){e.enter(r),e.consume(u),e.exit(r);let i=e.exit(n);return s&&p.estree&&Object.assign(i,{estree:p.estree}),t}return h=p.message,e.enter(i),e.consume(u),v}return e.enter(i),v(u)}function v(t){return t===125&&p===0||t===null||q(t)?(e.exit(i),_(t)):(t===123&&!a?p+=1:t===125&&--p,e.consume(t),v)}function y(t){let n=d.now();if(n.line!==m.line&&!u&&d.parser.lazy[n.line]){let e=new Zv("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:d.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=fb+mb,e}return rv(t)?Yy(e,_,`linePrefix`,3)(t):_(t)}}function yb(e,t,n,r,i,a,o){let s=ib(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:a,prefix:o?`({`:``,suffix:o?`})`:``}),c=s.estree;if(o&&c){let e=c.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=lb(e),n=new Zv("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=fb+hb,n}if(e.expression.properties[1]){let t=new Zv(`Unexpected extra content in spread: only a single spread is supported`,{place:lb(e.expression.properties[1]).start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw t.url=fb+gb,t}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=lb(e.expression.properties[0]),n=new Zv("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=fb+hb,n}}if(s.error){let e=new Zv(`Could not parse expression with acorn`,{cause:s.error,place:{line:s.error.loc.line,column:s.error.loc.column+1,offset:s.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=fb+_b,{type:`nok`,message:e}}return{type:`ok`,estree:c}}var bb=`https://github.com/micromark/micromark-extension-mdx-jsx`;function xb(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,ee,D,O,te,ne){let k=this,A,re;return j;function j(t){return e.enter(s),e.enter(c),e.consume(t),e.exit(c),ie}function ie(e){return nv(e)?n(e):(A=ae,De(e))}function ae(t){if(t===47)return e.enter(l),e.consume(t),e.exit(l),A=oe,De;if(t===62)return Ee(t);if(t!==null&&t>=0&&qy(t))return e.enter(d),e.enter(f),e.consume(t),se;Ae(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function oe(t){if(t===62)return Ee(t);if(t!==null&&t>=0&&qy(t))return e.enter(d),e.enter(f),e.consume(t),se;Ae(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function se(t){if(t!==null&&t>=0&&Jy(t,{jsx:!0}))return e.consume(t),se;if(t===46||t===47||t===58||t===62||t===123||nv(t)||av(t))return e.exit(f),A=ce,De(t);Ae(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function ce(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),A=le,De;if(t===58)return e.enter(h),e.consume(t),e.exit(h),A=de,De;if(t===47||t===62||t===123||t!==null&&t>=0&&qy(t))return e.exit(d),me(t);Ae(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function le(t){if(t!==null&&t>=0&&qy(t))return e.enter(m),e.consume(t),M;Ae(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function M(t){if(t!==null&&t>=0&&Jy(t,{jsx:!0}))return e.consume(t),M;if(t===46||t===47||t===62||t===123||nv(t)||av(t))return e.exit(m),A=ue,De(t);Ae(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function ue(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),A=le,De;if(t===47||t===62||t===123||t!==null&&t>=0&&qy(t))return e.exit(d),me(t);Ae(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function de(t){if(t!==null&&t>=0&&qy(t))return e.enter(g),e.consume(t),fe;Ae(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function fe(t){if(t!==null&&t>=0&&Jy(t,{jsx:!0}))return e.consume(t),fe;if(t===47||t===62||t===123||nv(t)||av(t))return e.exit(g),A=pe,De(t);Ae(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function pe(t){if(t===47||t===62||t===123||t!==null&&t>=0&&qy(t))return e.exit(d),me(t);Ae(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function me(t){if(t===47)return e.enter(u),e.consume(t),e.exit(u),A=Te,De;if(t===62)return Ee(t);if(t===123)return vb.call(k,e,he,_,v,y,r,i,a,!0,!1,o)(t);if(t!==null&&t>=0&&qy(t))return e.enter(b),e.enter(x),e.enter(S),e.consume(t),ge;Ae(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function he(e){return A=me,De(e)}function ge(t){if(t!==null&&t>=0&&Jy(t,{jsx:!0}))return e.consume(t),ge;if(t===47||t===58||t===61||t===62||t===123||nv(t)||av(t))return e.exit(S),A=_e,De(t);Ae(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function _e(t){if(t===58)return e.enter(C),e.consume(t),e.exit(C),A=ve,De;if(t===61)return e.exit(x),e.enter(T),e.consume(t),e.exit(T),A=xe,De;if(t===47||t===62||t===123||nv(t)||av(t)||t!==null&&t>=0&&qy(t))return e.exit(x),e.exit(b),A=me,De(t);Ae(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function ve(t){if(t!==null&&t>=0&&qy(t))return e.enter(w),e.consume(t),ye;Ae(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function ye(t){if(t!==null&&t>=0&&Jy(t,{jsx:!0}))return e.consume(t),ye;if(t===47||t===61||t===62||t===123||nv(t)||av(t))return e.exit(w),e.exit(x),A=be,De(t);Ae(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function be(t){if(t===61)return e.enter(T),e.consume(t),e.exit(T),A=xe,De;if(t===47||t===62||t===123||t!==null&&t>=0&&qy(t))return e.exit(b),me(t);Ae(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function xe(t){if(t===34||t===39)return e.enter(E),e.enter(ee),e.consume(t),e.exit(ee),re=t,Ce;if(t===123)return vb.call(k,e,Se,O,te,ne,r,i,a,!1,!1,o)(t);Ae(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function Se(t){return e.exit(b),A=me,De(t)}function Ce(t){return t===null&&Ae(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(re)+"`"),t===re?(e.enter(ee),e.consume(t),e.exit(ee),e.exit(E),e.exit(b),re=void 0,A=me,De):q(t)?(A=Ce,De(t)):(e.enter(D),we(t))}function we(t){return t===null||t===re||q(t)?(e.exit(D),Ce(t)):(e.consume(t),we)}function Te(e){if(e===62)return Ee(e);Ae(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function Ee(n){return e.enter(c),e.consume(n),e.exit(c),e.exit(s),t}function De(t){return q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ke):rv(t)||av(t)?(e.enter(`esWhitespace`),Oe(t)):A(t)}function Oe(t){return q(t)?(e.exit(`esWhitespace`),De(t)):rv(t)||av(t)?(e.consume(t),Oe):(e.exit(`esWhitespace`),A(t))}function ke(e){if(!o&&k.parser.lazy[k.now().line]){let e=new Zv("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",k.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=bb+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return De(e)}function Ae(e,t,n){let r=new Zv(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+Sb(e)+`)`)+` `+t+`, expected `+n,k.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw r.url=bb+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),r}}function Sb(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function Cb(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return xb.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function wb(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let a=this;return o;function o(e){return s(e)}function s(r){return xb.call(a,n,c,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function c(e){return rv(e)?Yy(n,l,`whitespace`)(e):l(e)}function l(e){let t=a.parser.constructs.flow[123],s=Array.isArray(t)?t:t?[t]:[],c;for(let e of s)if(e.name===`mdxFlowExpression`){c=e;break}return e===60?o(e):e===123&&c?n.attempt(c,l,i)(e):e===null||q(e)?r(e):i(e)}}}function Tb(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:wb(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:Cb(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}function Eb(){return{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}}var Db={}.hasOwnProperty;function Ob(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&Db.call(t,e)){let n=String(t[e]);i=Db.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var kb={}.hasOwnProperty;function Ab(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)Ab(e,t.extensions[n]);for(r in t)if(kb.call(t,r))switch(r){case`extensions`:break;case`unsafe`:jb(e[r],t[r]);break;case`join`:jb(e[r],t[r]);break;case`handlers`:Mb(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function jb(e,t){t&&e.push(...t)}function Mb(e,t){t&&Object.assign(e,t)}function Nb(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Pb);return i(),o}function Pb(e,t,n){return`>`+(n?``:` `)+e}function Fb(e,t){return Ib(e,t.inConstruct,!0)&&!Ib(e,t.notInConstruct,!1)}function Ib(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Lb(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
32
+ `&&Fb(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
33
+ `}function Rb(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function zb(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^ \r\n]/.test(e.value)||/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Bb(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Vb(e,t,n,r){let i=Bb(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(zb(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Hb);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Rb(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
34
+ `,encode:["`"],...s.current()})),t()}return u+=s.move(`
35
+ `),a&&(u+=s.move(a+`
36
+ `)),u+=s.move(c),l(),u}function Hb(e,t,n){return(n?``:` `)+e}function Ub(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Wb(e,t,n,r){let i=Ub(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
37
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Gb(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Kb(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function qb(e,t,n){let r=sv(e),i=sv(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Jb.peek=Yb;function Jb(e,t,n,r){let i=Gb(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=qb(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Kb(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=qb(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Kb(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Yb(e,t,n){return n.options.emphasis||`*`}var Xb=(function(e){if(e==null)return tx;if(typeof e==`function`)return ex(e);if(typeof e==`object`)return Array.isArray(e)?Zb(e):Qb(e);if(typeof e==`string`)return $b(e);throw Error(`Expected function, string, or object as test`)});function Zb(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Xb(e[n]);return ex(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Qb(e){let t=e;return ex(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function $b(e){return ex(t);function t(t){return t&&t.type===e}}function ex(e){return t;function t(t,n,r){return!!(nx(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function tx(){return!0}function nx(e){return typeof e==`object`&&!!e&&`type`in e}function rx(e){return e}var ix=[];function ax(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Xb(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+rx(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=ix,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=ox(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function ox(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?ix:[e]}function sx(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),ax(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var cx={};function lx(e,t){let n=t||cx;return ux(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function ux(e,t,n){if(fx(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return dx(e.children,t,n)}return Array.isArray(e)?dx(e,t,n):``}function dx(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=ux(e[i],t,n);return r.join(``)}function fx(e){return!!(e&&typeof e==`object`)}function px(e,t){let n=!1;return sx(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&lx(e)&&(t.options.setext||n))}function mx(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(px(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
38
+ `,after:`
39
+ `});return r(),t(),o+`
40
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
41
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
42
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=Kb(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}hx.peek=gx;function hx(e){return e.value||``}function gx(){return`<`}_x.peek=vx;function _x(e,t,n,r){let i=Ub(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function vx(){return`!`}yx.peek=bx;function yx(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function bx(){return`!`}xx.peek=Sx;function xx(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Sx(){return"`"}function Cx(e,t){let n=lx(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][a-z+.-]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}wx.peek=Tx;function wx(e,t,n,r){let i=Ub(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(Cx(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Tx(e,t,n){return Cx(e,n)?`<`:`[`}Ex.peek=Dx;function Ex(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Dx(){return`[`}function Ox(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function kx(e){let t=Ox(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Ax(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function jx(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Mx(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Ax(n):Ox(n),s=e.ordered?o===`.`?`)`:`.`:kx(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),jx(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Nx(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Px(e,t,n,r){let i=Nx(n),a=n.bulletCurrent||Ox(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function Fx(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var Ix=Xb([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Lx(e,t,n,r){return(e.children.some(function(e){return Ix(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Rx(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}zx.peek=Bx;function zx(e,t,n,r){let i=Rx(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=qb(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Kb(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=qb(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Kb(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Bx(e,t,n){return n.options.strong||`*`}function Vx(e,t,n,r){return n.safe(e.value,r)}function Hx(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Ux(e,t,n){let r=(jx(n)+(n.options.ruleSpaces?` `:``)).repeat(Hx(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Wx={blockquote:Nb,break:Lb,code:Vb,definition:Wb,emphasis:Jb,hardBreak:Lb,heading:mx,html:hx,image:_x,imageReference:yx,inlineCode:xx,link:wx,linkReference:Ex,list:Mx,listItem:Px,paragraph:Fx,root:Lx,strong:zx,text:Vx,thematicBreak:Ux},Gx=[Kx];function Kx(e,t,n,r){if(t.type===`code`&&zb(t,r)&&(e.type===`list`||e.type===t.type&&zb(e,r)))return!1;if(`spread`in n&&typeof n.spread==`boolean`)return e.type===`paragraph`&&(e.type===t.type||t.type===`definition`||t.type===`heading`&&px(t,r))?void 0:+!!n.spread}var qx=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],Jx=[{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`\r`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:`
43
+ `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`!`,after:`\\[`,inConstruct:`phrasing`,notInConstruct:qx},{character:`"`,inConstruct:`titleQuote`},{atBreak:!0,character:`#`},{character:`#`,inConstruct:`headingAtx`,after:`(?:[\r
44
+ ]|$)`},{character:`&`,after:`[#A-Za-z]`,inConstruct:`phrasing`},{character:`'`,inConstruct:`titleApostrophe`},{character:`(`,inConstruct:`destinationRaw`},{before:`\\]`,character:`(`,inConstruct:`phrasing`,notInConstruct:qx},{atBreak:!0,before:`\\d+`,character:`)`},{character:`)`,inConstruct:`destinationRaw`},{atBreak:!0,character:`*`,after:`(?:[ \r
45
+ *])`},{character:`*`,inConstruct:`phrasing`,notInConstruct:qx},{atBreak:!0,character:`+`,after:`(?:[ \r
46
+ ])`},{atBreak:!0,character:`-`,after:`(?:[ \r
47
+ -])`},{atBreak:!0,before:`\\d+`,character:`.`,after:`(?:[ \r
48
+ ]|$)`},{atBreak:!0,character:`<`,after:`[!/?A-Za-z]`},{character:`<`,after:`[!/?A-Za-z]`,inConstruct:`phrasing`,notInConstruct:qx},{character:`<`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`=`},{atBreak:!0,character:`>`},{character:`>`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`[`},{character:`[`,inConstruct:`phrasing`,notInConstruct:qx},{character:`[`,inConstruct:[`label`,`reference`]},{character:`\\`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:`]`,inConstruct:[`label`,`reference`]},{atBreak:!0,character:`_`},{character:`_`,inConstruct:`phrasing`,notInConstruct:qx},{atBreak:!0,character:"`"},{character:"`",inConstruct:[`codeFencedLangGraveAccent`,`codeFencedMetaGraveAccent`]},{character:"`",inConstruct:`phrasing`,notInConstruct:qx},{atBreak:!0,character:`~`}];function Yx(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}var Xx=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Zx(e){return e.replace(Xx,Qx)}function Qx(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Yx(n.slice(t?2:1),t?16:10)}return Mv(n)||e}function $x(e){return e.label||!e.identifier?e.label||``:Zx(e.identifier)}function eS(e){if(!e._compiled){let t=(e.atBreak?`[\\r\\n][\\t ]*`:``)+(e.before?`(?:`+e.before+`)`:``);e._compiled=RegExp((t?`(`+t+`)`:``)+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?`\\`:``)+e.character+(e.after?`(?:`+e.after+`)`:``),`g`)}return e._compiled}function tS(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before,c;r.push(-1);let l=t.createTracker(n);for(;++o<i.length;){let u=i[o],d;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),d=n?n(i[o+1],e,t,{before:``,after:``,...l.current()}).charAt(0):``}else d=n.after;a.length>0&&(s===`\r`||s===`
49
+ `)&&u.type===`html`&&(a[a.length-1]=a[a.length-1].replace(/(\r?\n|\r)$/,` `),s=` `,l=t.createTracker(n),l.move(a.join(``)));let f=t.handle(u,e,t,{...l.current(),after:d,before:s});c&&c===f.slice(0,1)&&(f=Kb(c.charCodeAt(0))+f.slice(1));let p=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,c=void 0,p&&(a.length>0&&p.before&&s===a[a.length-1].slice(-1)&&(a[a.length-1]=a[a.length-1].slice(0,-1)+Kb(s.charCodeAt(0))),p.after&&(c=d)),l.move(f),a.push(f),s=f.slice(-1)}return r.pop(),a.join(``)}function nS(e,t,n){let r=t.indexStack,i=e.children||[],a=t.createTracker(n),o=[],s=-1;for(r.push(-1);++s<i.length;){let n=i[s];r[r.length-1]=s,o.push(a.move(t.handle(n,e,t,{before:`
50
+ `,after:`
51
+ `,...a.current()}))),n.type!==`list`&&(t.bulletLastUsed=void 0),s<i.length-1&&o.push(a.move(rS(n,i[s+1],e,t)))}return r.pop(),o.join(``)}function rS(e,t,n,r){let i=r.join.length;for(;i--;){let a=r.join[i](e,t,n,r);if(a===!0||a===1)break;if(typeof a==`number`)return`
52
+ `.repeat(1+a);if(a===!1)return`
53
+
54
+ <!---->
55
+
56
+ `}return`
57
+
58
+ `}var iS=/\r?\n|\r/g;function aS(e,t){let n=[],r=0,i=0,a;for(;a=iS.exec(e);)o(e.slice(r,a.index)),n.push(a[0]),r=a.index+a[0].length,i++;return o(e.slice(r)),n.join(``);function o(e){n.push(t(e,i,!e))}}function oS(e,t,n){let r=(n.before||``)+(t||``)+(n.after||``),i=[],a=[],o={},s=-1;for(;++s<e.unsafe.length;){let t=e.unsafe[s];if(!Fb(e.stack,t))continue;let n=e.compilePattern(t),a;for(;a=n.exec(r);){let e=`before`in t||!!t.atBreak,n=`after`in t,r=a.index+(e?a[1].length:0);i.includes(r)?(o[r].before&&!e&&(o[r].before=!1),o[r].after&&!n&&(o[r].after=!1)):(i.push(r),o[r]={before:e,after:n})}}i.sort(sS);let c=n.before?n.before.length:0,l=r.length-(n.after?n.after.length:0);for(s=-1;++s<i.length;){let e=i[s];e<c||e>=l||e+1<l&&i[s+1]===e+1&&o[e].after&&!o[e+1].before&&!o[e+1].after||i[s-1]===e-1&&o[e].before&&!o[e-1].before&&!o[e-1].after||(c!==e&&a.push(cS(r.slice(c,e),`\\`)),c=e,/[!-/:-@[-`{-~]/.test(r.charAt(e))&&(!n.encode||!n.encode.includes(r.charAt(e)))?a.push(`\\`):(a.push(Kb(r.charCodeAt(e))),c++))}return a.push(cS(r.slice(c,l),n.after)),a.join(``)}function sS(e,t){return e-t}function cS(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],a=e+t,o=-1,s=0,c;for(;c=n.exec(a);)r.push(c.index);for(;++o<r.length;)s!==r[o]&&i.push(e.slice(s,r[o])),i.push(`\\`),s=r[o];return i.push(e.slice(s)),i.join(``)}function lS(e){let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,a=n.column||1;return{move:c,current:o,shift:s};function o(){return{now:{line:i,column:a},lineShift:r}}function s(e){r+=e}function c(e){let t=e||``,n=t.split(/\r?\n|\r/g),o=n[n.length-1];return i+=n.length-1,a=n.length===1?a+o.length:1+o.length+r,t}}function uS(e,t){let n=t||{},r={associationId:$x,containerPhrasing:mS,containerFlow:hS,createTracker:lS,compilePattern:eS,enter:a,handlers:{...Wx},handle:void 0,indentLines:aS,indexStack:[],join:[...Gx],options:{},safe:gS,stack:[],unsafe:[...Jx]};Ab(r,n),r.options.tightDefinitions&&r.join.push(pS),r.handle=Ob(`type`,{invalid:dS,unknown:fS,handlers:r.handlers});let i=r.handle(e,void 0,r,{before:`
59
+ `,after:`
60
+ `,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
61
+ `),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function dS(e){throw Error("Cannot handle value `"+e+"`, expected node")}function fS(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function pS(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function mS(e,t){return tS(e,this,t)}function hS(e,t){return nS(e,this,t)}function gS(e,t){return oS(this,e,t)}var _S=[`mdxJsxTextElement`,`mdxJsxFlowElement`];function vS(e){return _S.includes(e.type)&&yS.includes(e.name)}var yS=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.input.ins.kbd.label.legend.li.link.main.map.mark.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.param.picture.pre.progress.q.rp.rt.ruby.s.samp.script.section.select.small.source.span.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr`.split(`.`);function bS(e,t){let n=xS(e),r=xS(t);return SS({...n,...r})}function xS(e){let t={};return e.split(`;`).filter(e=>e.trim()!==``).forEach(e=>{let[n,r]=e.split(`:`).map(e=>e.trim());t[n]=r}),t}function SS(e){return Object.entries(e).map(([e,t])=>`${e}: ${t}`).join(`; `)}function CS(e){return e.children instanceof Array}function wS({root:e,visitors:t,jsxComponentDescriptors:n,jsxIsAvailable:r,addImportStatements:i=!0}){let a=null,o=new Set,s=new Map;t=[...t].sort((e,t)=>(t.priority??0)-(e.priority??0)),d(e,null);function c(e,t){o.add(e),t&&s.set(e,{...t})}function l(e,n){if(a===null)return a=n,a;if(!CS(e))throw Error(`Attempting to append children to a non-parent`);let r=e.children,i=r.at(-1);if(i){let e=t.find(e=>e.shouldJoin?.call(e,i,n));if(e){let t=e.join(i,n);return r.splice(r.length-1,1,t),t}}return r.push(n),n}function u(e,t){e.getChildren().forEach(e=>{d(e,t)})}function d(e,n,r=null){var i;let a=t.find((t,n)=>!r?.has(n)&&t.testLexicalNode?.call(t,e));if(!a)throw Error(`no lexical visitor found for ${e.getType()}`,{cause:e});(i=a.visitLexicalNode)==null||i.call(a,{lexicalNode:e,mdastParent:n,actions:{addAndStepInto(t,r={},i=!0){let a={type:t,...r,...i?{children:[]}:{}};l(n,a),W(e)&&i&&u(e,a)},appendToParent:l,visitChildren:u,visit:d,registerReferredComponent:c,nextVisitor(){d(e,n,(r??new Set).add(t.indexOf(a)))}}})}if(a===null)throw Error(`traversal ended with no root element`);let f=new Map,p=new Map;for(let e of o){let t=n.find(t=>t.name===e)??s.get(e)??n.find(e=>e.name===`*`);if(!t)throw Error(`Component ${e} is used but not imported`);if(t.source){if(t.defaultExport)p.set(e,t.source);else{let{source:n}=t,r=f.get(n);r?r.push(e):f.set(n,[e])}}}if(!i){for(let[e,t]of f.entries()){let n=t.filter(e=>s.has(e));n.length>0?f.set(e,n):f.delete(e)}for(let e of p.keys())s.has(e)||p.delete(e)}let m=Array.from(f).map(([e,t])=>({type:`mdxjsEsm`,value:`import { ${t.join(`, `)} } from '${e}'`}));m.push(...Array.from(p).map(([e,t])=>({type:`mdxjsEsm`,value:`import ${e} from '${t}'`})));let h=a,g=h.children.find(e=>e.type===`yaml`);return g?h.children.splice(h.children.indexOf(g)+1,0,...m):h.children.unshift(...m),kS(h,[]),TS(h),r||ES(h),h}function TS(e){if(`children`in e&&e.children.length>0){if(vS(e)&&e.children.length===1){let t=e.children[0];t.type===`mdxJsxTextElement`&&t.name===`span`&&(t.attributes.forEach(t=>{if(t.type===`mdxJsxAttribute`){let n=e.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===t.name);if(n){if(t.name===`className`){let e=new Set([...n.value.split(` `),...t.value.split(` `)]);n.value=Array.from(e).join(` `)}else t.name===`style`&&(n.value=bS(n.value,t.value))}else e.attributes.push(t)}}),e.children=t.children)}e.children.forEach(e=>{TS(e)})}}function ES(e){if(Object.hasOwn(e,`children`)){let t=e,n=[];t.children.forEach(e=>{e.type===`mdxJsxTextElement`&&e.name===`u`?n.push({type:`html`,value:`<u>`},...e.children,{type:`html`,value:`</u>`}):(n.push(e),ES(e))}),t.children=n}}var DS=/\s+$/,OS=/^\s+/;function kS(e,t){if(e.type===`strong`||e.type===`emphasis`){let n=e.children.at(-1);if(n?.type===`text`){let r=DS.exec(n.value);if(r){n.value=n.value.replace(DS,``);let i=t.at(-1);i&&(i.children.splice(i.children.indexOf(e)+1,0,{type:`text`,value:r[0]}),kS(i,t.slice(0,-1)))}}let r=e.children.at(0);if(r?.type===`text`){let n=OS.exec(r.value);if(n){r.value=r.value.replace(OS,``);let i=t.at(-1);i&&(i.children.splice(i.children.indexOf(e),0,{type:`text`,value:n[0]}),kS(i,t.slice(0,-1)))}}}if(`children`in e&&e.children.length>0){let n=e;n.children.forEach(e=>{kS(e,[...t,n])})}}function AS({root:e,toMarkdownOptions:t,toMarkdownExtensions:n,visitors:r,jsxComponentDescriptors:i,jsxIsAvailable:a}){return uS(wS({root:e,visitors:r,jsxComponentDescriptors:i,jsxIsAvailable:a}),{extensions:n,...t})+`
62
+ `}var jS={}.hasOwnProperty;function MS(e){let t={},n=-1;for(;++n<e.length;)NS(t,e[n]);return t}function NS(e,t){let n;for(n in t){let r=(jS.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){jS.call(r,a)||(r[a]=[]);let e=i[a];PS(r[a],Array.isArray(e)?e:e?[e]:[])}}}function PS(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);q_(e,0,0,r)}function FS(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var IS={tokenize:LS};function LS(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Yy(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return q(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var RS={tokenize:BS},zS={tokenize:VS};function BS(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return q_(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(zS,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(zS,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return q(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;q_(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function VS(e,t,n){return Yy(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var HS={name:`attention`,resolveAll:US,tokenize:WS};function US(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};GS(d,-c),GS(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=J_(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=J_(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=J_(l,cv(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=J_(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=J_(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,q_(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function WS(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=sv(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=sv(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function GS(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var KS={name:`autolink`,tokenize:qS};function qS(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return Y_(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||X_(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||X_(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Q_(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Z_(t)?(e.consume(t),l):n(t)}function u(e){return X_(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||X_(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var JS={partial:!0,tokenize:YS};function YS(e,t,n){return r;function r(t){return rv(t)?Yy(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||q(e)?t(e):n(e)}}var XS={continuation:{tokenize:QS},exit:$S,name:`blockQuote`,tokenize:ZS};function ZS(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return rv(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function QS(e,t,n){let r=this;return i;function i(t){return rv(t)?Yy(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(XS,t,n)(r)}}function $S(e){e.exit(`blockQuote`)}var eC={name:`characterEscape`,tokenize:tC};function tC(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return tv(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var nC={name:`characterReference`,tokenize:rC};function rC(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=X_,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=ev,u):(e.enter(`characterReferenceValue`),a=7,o=$_,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===X_&&!Mv(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var iC={partial:!0,tokenize:sC},aC={concrete:!0,name:`codeFenced`,tokenize:oC};function oC(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),rv(t)?Yy(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||q(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(iC,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):rv(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Yy(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||q(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&rv(t)?Yy(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||q(t)?e.check(iC,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||q(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),rv(t)?Yy(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),rv(t)?Yy(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||q(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function sC(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var cC={name:`codeIndented`,tokenize:uC},lC={partial:!0,tokenize:dC};function uC(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Yy(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):q(t)?e.attempt(lC,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||q(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function dC(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Yy(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):q(e)?i(e):n(e)}}var fC={name:`codeText`,previous:mC,resolve:pC,tokenize:hC};function pC(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function mC(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function hC(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||q(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var gC=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&_C(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),_C(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),_C(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);_C(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);_C(this.left,t.reverse())}}}};function _C(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function vC(e){let t={},n=-1,r,i,a,o,s,c,l,u=new gC(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,yC(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return q_(e,0,1/0,u.slice(0)),!l}function yC(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var bC={resolve:SC,tokenize:CC},xC={partial:!0,tokenize:wC};function SC(e){return vC(e),e}function CC(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):q(t)?e.check(xC,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function wC(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Yy(e,a,`linePrefix`)}function a(i){if(i===null||q(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function TC(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Q_(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||q(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||nv(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Q_(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function EC(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):q(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||q(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!rv(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function DC(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Yy(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||q(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function OC(e,t){let n;return r;function r(i){return q(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):rv(i)?Yy(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var kC={name:`definition`,tokenize:jC},AC={partial:!0,tokenize:MC};function jC(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return EC.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=FS(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return nv(t)?OC(e,l)(t):l(t)}function l(t){return TC(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(AC,d,d)(t)}function d(t){return rv(t)?Yy(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||q(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function MC(e,t,n){return r;function r(t){return nv(t)?OC(e,i)(t):n(t)}function i(t){return DC(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return rv(t)?Yy(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||q(e)?t(e):n(e)}}var NC={name:`hardBreakEscape`,tokenize:PC};function PC(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return q(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var FC={name:`headingAtx`,resolve:IC,tokenize:LC};function IC(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},q_(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function LC(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||nv(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||q(n)?(e.exit(`atxHeading`),t(n)):rv(n)?Yy(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||nv(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var RC=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),zC=[`pre`,`script`,`style`,`textarea`],BC={concrete:!0,name:`htmlFlow`,resolveTo:UC,tokenize:WC},VC={partial:!0,tokenize:KC},HC={partial:!0,tokenize:GC};function UC(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function WC(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:ie):Y_(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Y_(a)?(e.consume(a),i=4,r.interrupt?t:ie):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:ie):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:D:m):n(i)}function h(t){return Y_(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||nv(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&zC.includes(l)?(i=1,r.interrupt?t(s):D(s)):RC.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):D(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||X_(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:D):n(i)}function v(t){return rv(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Y_(t)?(e.consume(t),b):rv(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||X_(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):rv(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):rv(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||q(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||nv(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||rv(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),ee):n(t)}function ee(t){return t===null||q(t)?D(t):rv(t)?(e.consume(t),ee):n(t)}function D(t){return t===45&&i===2?(e.consume(t),k):t===60&&i===1?(e.consume(t),A):t===62&&i===4?(e.consume(t),ae):t===63&&i===3?(e.consume(t),ie):t===93&&i===5?(e.consume(t),j):q(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(VC,oe,O)(t)):t===null||q(t)?(e.exit(`htmlFlowData`),O(t)):(e.consume(t),D)}function O(t){return e.check(HC,te,oe)(t)}function te(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ne}function ne(t){return t===null||q(t)?O(t):(e.enter(`htmlFlowData`),D(t))}function k(t){return t===45?(e.consume(t),ie):D(t)}function A(t){return t===47?(e.consume(t),o=``,re):D(t)}function re(t){if(t===62){let n=o.toLowerCase();return zC.includes(n)?(e.consume(t),ae):D(t)}return Y_(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),re):D(t)}function j(t){return t===93?(e.consume(t),ie):D(t)}function ie(t){return t===62?(e.consume(t),ae):t===45&&i===2?(e.consume(t),ie):D(t)}function ae(t){return t===null||q(t)?(e.exit(`htmlFlowData`),oe(t)):(e.consume(t),ae)}function oe(n){return e.exit(`htmlFlow`),t(n)}}function GC(e,t,n){let r=this;return i;function i(t){return q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function KC(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(JS,t,n)}}var qC={name:`htmlText`,tokenize:JC};function JC(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Y_(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Y_(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):q(t)?(o=d,A(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?k(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):q(t)?(o=h,A(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?k(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?k(t):q(t)?(o=v,A(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):q(t)?(o=y,A(t)):(e.consume(t),y)}function b(e){return e===62?k(e):y(e)}function x(t){return Y_(t)?(e.consume(t),S):n(t)}function S(t){return t===45||X_(t)?(e.consume(t),S):C(t)}function C(t){return q(t)?(o=C,A(t)):rv(t)?(e.consume(t),C):k(t)}function w(t){return t===45||X_(t)?(e.consume(t),w):t===47||t===62||nv(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),k):t===58||t===95||Y_(t)?(e.consume(t),E):q(t)?(o=T,A(t)):rv(t)?(e.consume(t),T):k(t)}function E(t){return t===45||t===46||t===58||t===95||X_(t)?(e.consume(t),E):ee(t)}function ee(t){return t===61?(e.consume(t),D):q(t)?(o=ee,A(t)):rv(t)?(e.consume(t),ee):T(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,O):q(t)?(o=D,A(t)):rv(t)?(e.consume(t),D):(e.consume(t),te)}function O(t){return t===i?(e.consume(t),i=void 0,ne):t===null?n(t):q(t)?(o=O,A(t)):(e.consume(t),O)}function te(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||nv(t)?T(t):(e.consume(t),te)}function ne(e){return e===47||e===62||nv(e)?T(e):n(e)}function k(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function A(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return rv(t)?Yy(e,j,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):j(t)}function j(t){return e.enter(`htmlTextData`),o(t)}}var YC={name:`labelEnd`,resolveAll:$C,resolveTo:ew,tokenize:tw},XC={tokenize:nw},ZC={tokenize:rw},QC={tokenize:iw};function $C(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&q_(e,0,e.length,n),e}function ew(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=J_(s,e.slice(a+1,a+r+3)),s=J_(s,[[`enter`,u,t]]),s=J_(s,cv(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=J_(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=J_(s,e.slice(o+1)),s=J_(s,[[`exit`,c,t]]),q_(e,a,e.length,s),e}function tw(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(FS(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(XC,u,o?u:d)(t):t===91?e.attempt(ZC,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(QC,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function nw(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return nv(t)?OC(e,a)(t):a(t)}function a(t){return t===41?u(t):TC(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return nv(t)?OC(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?DC(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return nv(t)?OC(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function rw(e,t,n){let r=this;return i;function i(t){return EC.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(FS(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function iw(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var aw={name:`labelStartImage`,resolveAll:YC.resolveAll,tokenize:ow};function ow(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var sw={name:`labelStartLink`,resolveAll:YC.resolveAll,tokenize:cw};function cw(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var lw={name:`lineEnding`,tokenize:uw};function uw(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Yy(e,t,`linePrefix`)}}var dw={name:`thematicBreak`,tokenize:fw};function fw(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||q(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),rv(t)?Yy(e,s,`whitespace`)(t):s(t))}}var pw={continuation:{tokenize:_w},exit:yw,name:`list`,tokenize:gw},mw={partial:!0,tokenize:bw},hw={partial:!0,tokenize:vw};function gw(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:$_(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(dw,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return $_(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(JS,r.interrupt?n:u,e.attempt(mw,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return rv(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function _w(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(JS,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Yy(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!rv(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(hw,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Yy(e,e.attempt(pw,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function vw(e,t,n){let r=this;return Yy(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function yw(e){e.exit(this.containerState.type)}function bw(e,t,n){let r=this;return Yy(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!rv(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var xw={name:`setextUnderline`,resolveTo:Sw,tokenize:Cw};function Sw(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function Cw(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),rv(t)?Yy(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||q(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var ww={tokenize:Tw};function Tw(e){let t=this,n=e.attempt(JS,r,e.attempt(this.parser.constructs.flowInitial,i,Yy(e,e.attempt(this.parser.constructs.flow,i,e.attempt(bC,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Ew={resolveAll:Aw()},Dw=kw(`string`),Ow=kw(`text`);function kw(e){return{resolveAll:Aw(e===`text`?jw:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Aw(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function jw(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Mw=r({attentionMarkers:()=>Bw,contentInitial:()=>Pw,disable:()=>Vw,document:()=>Nw,flow:()=>Iw,flowInitial:()=>Fw,insideSpan:()=>zw,string:()=>Lw,text:()=>Rw}),Nw={42:pw,43:pw,45:pw,48:pw,49:pw,50:pw,51:pw,52:pw,53:pw,54:pw,55:pw,56:pw,57:pw,62:XS},Pw={91:kC},Fw={[-2]:cC,[-1]:cC,32:cC},Iw={35:FC,42:dw,45:[xw,dw],60:BC,61:xw,95:dw,96:aC,126:aC},Lw={38:nC,92:eC},Rw={[-5]:lw,[-4]:lw,[-3]:lw,33:aw,38:nC,42:HS,60:[KS,qC],91:sw,92:[NC,eC],93:YC,95:HS,96:fC},zw={null:[HS,Ew]},Bw={null:[42,95]},Vw={null:[]};function Hw(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=J_(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=cv(a,l.events,l),l.events):[]}function f(e,t){return Ww(p(e),t)}function p(e){return Uw(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){q(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&q_(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Uw(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Ww(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
63
+ `;break;case-3:o=`\r
64
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Gw(e){let t={constructs:MS([Mw,...(e||{}).extensions||[]]),content:n(IS),defined:[],document:n(RS),flow:n(ww),lazy:{},string:n(Dw),text:n(Ow)};return t;function n(e){return n;function n(n){return Hw(t,e,n)}}}function Kw(e){for(;!vC(e););return e}var qw=/[\0\t\n\r]/g;function Jw(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(qw.lastIndex=u,c=qw.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Yw={}.hasOwnProperty;function Xw(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Zw(n)(Kw(Gw(n).document().write(Jw()(e,t,!0))))}function Zw(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Se),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ve),blockQuote:a(pe),characterEscape:T,characterReference:T,codeFenced:a(me),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(me,o),codeText:a(he,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ge),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(_e),hardBreakEscape:a(ye),hardBreakTrailing:a(ye),htmlFlow:a(be,o),htmlFlowData:T,htmlText:a(be,o),htmlTextData:T,image:a(xe),label:o,link:a(Se),listItem:a(we),listItemValue:f,listOrdered:a(Ce,d),listUnordered:a(Ce),paragraph:a(Te),reference:se,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ve),strong:a(Ee),thematicBreak:a(Oe)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:fe,autolinkProtocol:de,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:M,characterReference:ue,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ne),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(D),hardBreakTrailing:c(D),htmlFlow:c(O),htmlFlowData:E,htmlText:c(te),htmlTextData:E,image:c(A),label:j,labelText:re,lineEnding:ee,link:c(k),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ce,resourceDestinationString:ie,resourceTitleString:ae,resource:oe,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};$w(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];Yw.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||tT).call(a,void 0,e[0])}for(r.position={start:Qw(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Qw(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Qw(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||tT).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+qv({start:e.start,end:e.end})+`): it’s not open`);n.position.end=Qw(e.end)}function u(){return lx(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=FS(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=De(),n.position={start:Qw(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Qw(e.end)}function ee(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Qw(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function D(){this.data.atHardBreak=!0}function O(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function k(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function A(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function re(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Zx(t),n.identifier=FS(t).toLowerCase()}function j(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ie(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ae(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function oe(){this.data.inReference=void 0}function se(){this.data.referenceType=`collapsed`}function ce(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=FS(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function le(e){this.data.characterReferenceType=e.type}function M(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Yx(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Mv(t);let i=this.stack[this.stack.length-1];i.value+=r}function ue(e){let t=this.stack.pop();t.position.end=Qw(e.end)}function de(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function fe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function pe(){return{type:`blockquote`,children:[]}}function me(){return{type:`code`,lang:null,meta:null,value:``}}function he(){return{type:`inlineCode`,value:``}}function ge(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function _e(){return{type:`emphasis`,children:[]}}function ve(){return{type:`heading`,depth:0,children:[]}}function ye(){return{type:`break`}}function be(){return{type:`html`,value:``}}function xe(){return{type:`image`,title:null,url:``,alt:null}}function Se(){return{type:`link`,title:null,url:``,children:[]}}function Ce(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function we(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Te(){return{type:`paragraph`,children:[]}}function Ee(){return{type:`strong`,children:[]}}function De(){return{type:`text`,value:``}}function Oe(){return{type:`thematicBreak`}}}function Qw(e){return{line:e.line,column:e.column,offset:e.offset}}function $w(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?$w(e,r):eT(e,r)}}function eT(e,t){let n;for(n in t)if(Yw.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function tT(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+qv({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+qv({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+qv({start:t.start,end:t.end})+`) is still open`)}var nT=class extends Error{constructor(e,t,n,r){let i=e.name??`Fragment`,a=e.type===`mdxJsxFlowElement`?`flow`:`text`,o=r?` ${r}`:``;super(`JSX component "${i}" was parsed as ${a} but is declared as ${t.kind} (kindMismatchPolicy: "${n}").${o}`),this.name=`JsxKindMismatchError`}},rT=new Set([`paragraph`,`heading`,`emphasis`,`strong`,`delete`,`link`,`linkReference`,`tableCell`,`footnote`,`mdxJsxTextElement`,`textDirective`,`leafDirective`]),iT=new Set([`root`,`blockquote`,`listItem`,`footnoteDefinition`,`mdxJsxFlowElement`,`containerDirective`]);function aT(e){return e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`}function oT(e,t){return t.find(t=>t.name===e.name)??t.find(e=>e.name===`*`)}function sT(e,t){return(e.type===`mdxJsxFlowElement`?`flow`:`text`)!==t.kind}function cT(e,t,n){if(aT(e)){let r=oT(e,t);if(r&&n(e)&&sT(e,r))throw new nT(e,r,`error`)}`children`in e&&e.children.forEach(e=>{cT(e,t,n)})}function lT(e,t,n){let r=e=>n(e)?oT(e,t):void 0;function i(e){let t=rT.has(e.type)?`phrasing`:iT.has(e.type)?`flow`:`structural`;return e.children=t===`phrasing`?e.children.flatMap(t=>s(t,e.type)):t===`flow`?e.children.flatMap(e=>l(e)):e.children.map(t=>o(t,e.type)),e}function a(e){return`children`in e&&i(e),e}function o(e,t){if(aT(e)){let n=r(e);if(n&&sT(e,n))throw new nT(e,n,`normalize`,`The ${t} parent does not declare whether its children are flow or phrasing content.`)}return a(e)}function s(e,t){if(!aT(e))return[a(e)];let n=r(e);if(!n||!sT(e,n))return[a(e)];if(e.type===`mdxJsxTextElement`)throw new nT(e,n,`normalize`,`It cannot be lifted from ${t} without changing surrounding phrasing content.`);return[a(u(e,n))]}function c(e){let t=e.children.find(e=>e.type===`mdxJsxTextElement`&&r(e)?.kind===`flow`);if(!t)return[i(e)];let n=r(t);if(e.children.length!==1)throw new nT(t,n,`normalize`,`It has surrounding phrasing content, and normalization would need to split the paragraph.`);return[a({...t,type:`mdxJsxFlowElement`,children:t.children.length===0?[]:[{type:`paragraph`,children:t.children}]})]}function l(e){if(e.type===`paragraph`)return c(e);if(!aT(e))return[a(e)];let t=r(e);if(!t||!sT(e,t))return[a(e)];if(e.type===`mdxJsxTextElement`)throw new nT(e,t,`normalize`,`A text JSX node can be normalized to flow only when it is the sole child of a paragraph.`);return[{type:`paragraph`,children:[a(u(e,t))]}]}function u(e,t){if(e.children.length===0)return{...e,type:`mdxJsxTextElement`,children:[]};if(e.children.length!==1||e.children[0].type!==`paragraph`)throw new nT(e,t,`normalize`,`Its block children cannot be represented as one phrasing-content sequence without data loss.`);return{...e,type:`mdxJsxTextElement`,children:e.children[0].children}}return i(e)}function uT(e,t,n,r=()=>!0){return n===`source`?e:n===`error`?(cT(e,t,r),e):lT(structuredClone(e),t,r)}function dT(e){return e.children instanceof Array}var fT=class extends Error{constructor(e,t){super(e),this.name=`MarkdownParseError`,this.cause=t}},pT=class extends Error{constructor(e){super(e),this.name=`UnrecognizedMarkdownConstructError`}};function mT(e){let t=new Map;return e.type===`root`?(e.children.filter(e=>e.type===`mdxjsEsm`).filter(e=>e.value.startsWith(`import `)).forEach(e=>{(e.data?.estree?.body??[]).forEach(e=>{e.type===`ImportDeclaration`&&e.specifiers.forEach(n=>{t.set(n.local.name,{source:`${e.source.value}`,defaultExport:n.type===`ImportDefaultSpecifier`})})})}),{importDeclarations:Object.fromEntries(t.entries())}):{importDeclarations:{}}}function hT({root:e,markdown:t,visitors:n,syntaxExtensions:r,mdastExtensions:i,...a}){let o;try{o=Xw(t,{extensions:r,mdastExtensions:i})}catch(e){throw e instanceof Error?new fT(`Error parsing markdown: ${e.message}`,e):new fT(`Error parsing markdown: ${e}`,e)}o.children.length===0&&o.children.push({type:`paragraph`,children:[]}),o.children.at(-1)?.type!==`paragraph`&&o.children.push({type:`paragraph`,children:[]}),gT({root:e,mdastRoot:o,visitors:n,...a})}function gT({root:e,mdastRoot:t,visitors:n,...r}){n=n.sort((e,t)=>(t.priority??0)-(e.priority??0));function i(e,t=null){return n.find((n,i)=>t?.has(i)?!1:typeof n.testNode==`string`?n.testNode===e.type:n.testNode(e,r))}t=uT(t,r.jsxComponentDescriptors,r.jsxKindMismatchPolicy??`source`,e=>i(e)?.jsxKindReconciliationOwner===!0);let a=new WeakMap,o=new WeakMap,s=mT(t);function c(e,t){if(!dT(e))throw Error(`Attempting to visit children of a non-parent`);e.children.forEach(n=>{l(n,t,e)})}function l(e,t,u,d=null){let f=i(e,d);if(!f)try{throw new pT(`Unsupported markdown syntax: ${uS(e)}`)}catch{throw new pT(`Parsing of the following markdown structure failed: ${JSON.stringify({type:e.type,name:`name`in e?e.name:`N/A`})}`)}f.visitNode({mdastNode:e,lexicalParent:t,mdastParent:u,descriptors:r,metaData:s,actions:{visitChildren:c,nextVisitor(){l(e,t,u,(d??new Set).add(n.indexOf(f)))},addAndStepInto(n){t.append(n),dT(e)&&c(e,n)},addFormatting(t,n){n||dT(e)&&(n=e),n&&a.set(n,t|(a.get(u)??0))},removeFormatting(t,n){n||dT(e)&&(n=e),n&&a.set(n,t^(a.get(u)??0))},getParentFormatting(){return a.get(u)??0},addStyle(t,n){n||dT(e)&&(n=e),n&&o.set(n,t)},getParentStyle(){return o.get(u)??``}}})}l(t,e,null)}function _T(){}var vT=Object.defineProperty,yT=(e,t,n)=>t in e?vT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bT=(e,t,n)=>yT(e,typeof t==`symbol`?t:t+``,n),xT=`generic-html`,ST=class e extends Hl{constructor(e,t,n,r){super(r),bT(this,`__tag`),bT(this,`__nodeType`),bT(this,`__attributes`),this.__tag=e,this.__nodeType=t,this.__attributes=n}static getType(){return xT}static clone(t){return new e(t.__tag,t.__nodeType,t.__attributes,t.__key)}getTag(){return this.__tag}getNodeType(){return this.__nodeType}getAttributes(){return this.__attributes}updateAttributes(e){let t=this.getWritable();t.__attributes=e}getStyle(){return this.__attributes.find(e=>e.name===`style`)?.value}createDOM(){let e=this.__tag,t=document.createElement(e);return this.__attributes.forEach(e=>{t.setAttribute(e.name,e.value)}),t}updateDOM(){return!1}static importDOM(){return{}}exportDOM(e){let{element:t}=super.exportDOM(e);return{element:t}}static importJSON(e){let t=CT(e.tag,e.mdxType,e.attributes);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),attributes:this.__attributes,mdxType:this.__nodeType,type:xT,version:1}}extractWithChild(){return!0}isInline(){return this.__nodeType===`mdxJsxTextElement`}};function CT(e,t,n){return jd(new ST(e,t,n))}function wT(e){return e instanceof ST}var TT={testLexicalNode:wT,visitLexicalNode({actions:e,lexicalNode:t}){e.addAndStepInto(`mdxJsxTextElement`,{name:t.getTag(),type:t.getNodeType(),attributes:t.getAttributes()})},priority:-100},ET={testLexicalNode:ru,visitLexicalNode:({mdastParent:e,actions:t})=>{t.appendToParent(e,{type:`text`,value:`
65
+ `})}},DT={testLexicalNode:uu,visitLexicalNode:({actions:e})=>{e.addAndStepInto(`paragraph`)}},OT={testLexicalNode:ql,visitLexicalNode:({actions:e})=>{e.addAndStepInto(`root`)}};function kT(e){return e.type===`text`}var AT=[`u`,`span`,`sub`,`sup`],jT={shouldJoin:(e,t)=>{if([`text`,`emphasis`,`strong`,`highlight`].includes(e.type))return e.type===t.type;if(e.type===`mdxJsxTextElement`&&t.type===`mdxJsxTextElement`&&AT.includes(t.name)){let n=t;return e.name===n.name&&JSON.stringify(e.attributes)===JSON.stringify(n.attributes)}return!1},join(e,t){return kT(e)&&kT(t)?{type:`text`,value:e.value+t.value}:{...e,children:[...e.children,...t.children]}},testLexicalNode:V,visitLexicalNode:({lexicalNode:e,mdastParent:t,actions:n})=>{let r=e.getPreviousSibling(),i=V(r)?r.getFormat():0,a=e.getTextContent(),o=e.getFormat(),s=e.getStyle(),c=t;if(s&&(c=n.appendToParent(c,{type:`mdxJsxTextElement`,name:`span`,children:[],attributes:[{type:`mdxJsxAttribute`,name:`style`,value:s}]})),i&o&8&&(c=n.appendToParent(c,{type:`mdxJsxTextElement`,name:`u`,children:[],attributes:[]})),i&o&64&&(c=n.appendToParent(c,{type:`mdxJsxTextElement`,name:`sup`,children:[],attributes:[]})),i&o&32&&(c=n.appendToParent(c,{type:`mdxJsxTextElement`,name:`sub`,children:[],attributes:[]})),i&o&2&&(c=n.appendToParent(c,{type:`emphasis`,children:[]})),i&o&1&&(c=n.appendToParent(c,{type:`strong`,children:[]})),i&o&4&&(c=n.appendToParent(c,{type:`delete`,children:[]})),i&o&128&&(c=n.appendToParent(c,{type:`highlight`,children:[]})),o&8&&!(i&8)&&(c=n.appendToParent(c,{type:`mdxJsxTextElement`,name:`u`,children:[],attributes:[]})),o&64&&!(i&64)&&(c=n.appendToParent(c,{type:`mdxJsxTextElement`,name:`sup`,children:[],attributes:[]})),o&32&&!(i&32)&&(c=n.appendToParent(c,{type:`mdxJsxTextElement`,name:`sub`,children:[],attributes:[]})),o&2&&!(i&2)&&(c=n.appendToParent(c,{type:`emphasis`,children:[]})),o&1&&!(i&1)&&(c=n.appendToParent(c,{type:`strong`,children:[]})),o&4&&!(i&4)&&(c=n.appendToParent(c,{type:`delete`,children:[]})),o&128&&!(i&128)&&(c=n.appendToParent(c,{type:`highlight`,children:[]})),o&16){n.appendToParent(c,{type:`inlineCode`,value:a});return}n.appendToParent(c,{type:`text`,value:a})}},MT={testNode:`break`,visitNode:function({lexicalParent:e}){e.append(nu())}};function NT(e,t){return[{testNode:t=>t.type===`mdxJsxTextElement`&&t.name===e,visitNode({actions:e,mdastNode:n,lexicalParent:r}){e.addFormatting(t),e.visitChildren(n,r)}},{testNode:t=>t.type===`html`&&t.value===`<${e}>`,visitNode({actions:e,mdastParent:n}){e.addFormatting(t,n)}},{testNode:t=>t.type===`html`&&t.value===`</${e}>`,visitNode({actions:e,mdastParent:n}){e.removeFormatting(t,n)}}]}var PT={testNode:`delete`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(4),t.visitChildren(e,n)}},FT={testNode:`highlight`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(128),t.visitChildren(e,n)}},IT={testNode:`inlineCode`,visitNode({mdastNode:e,actions:t}){t.addAndStepInto(dc(e.value).setFormat(t.getParentFormatting()|16))}},LT=[{testNode:`emphasis`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(2),t.visitChildren(e,n)}},{testNode:`strong`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(1),t.visitChildren(e,n)}},...NT(`u`,8),...NT(`code`,16),IT,PT,FT,...NT(`sup`,64),...NT(`sub`,32)],RT={testNode:vS,visitNode:function({mdastNode:e,actions:t,lexicalParent:n}){e.name===`span`&&e.attributes.length===1&&e.attributes[0].type===`mdxJsxAttribute`&&e.attributes[0].name===`style`?(t.addStyle(e.attributes[0].value,e),t.visitChildren(e,n)):t.addAndStepInto(CT(e.name,e.type,e.attributes))},priority:-100},zT=[`listitem`,`admonition`],BT={testNode:`paragraph`,visitNode:function({mdastNode:e,mdastParent:t,lexicalParent:n,actions:r}){let i=n.getType();if(zT.includes(i)){let a=t?.children.indexOf(e)??-1,o=a>0?t?.children.at(a-1):void 0;i===`listitem`&&o?.type===`paragraph`&&n.append(nu(),nu()),r.visitChildren(e,n)}else r.addAndStepInto(lu())}},VT={testNode:`root`,visitNode({actions:e,mdastNode:t,lexicalParent:n}){e.visitChildren(t,n)}},HT={testNode:`text`,visitNode({mdastNode:e,actions:t}){let n=dc(e.value);n.setFormat(t.getParentFormatting());let r=t.getParentStyle();r!==``&&n.setStyle(r),t.addAndStepInto(n)}},UT={dash:45,eof:null,exclamationMark:33,greaterThan:62},WT={data:`data`,lineEnding:`lineEnding`,linePrefix:`linePrefix`};function GT(e){return{canContainEols:[`comment`],enter:{comment(e){this.buffer()}},exit:{comment(e){this.resume()}}}}var KT=(e,t,n)=>{return r;function r(t){return e.enter(`comment`),e.consume(t),i}function i(t){return t===UT.exclamationMark?(e.consume(t),a):n(t)}function a(t){return t===UT.dash?(e.consume(t),o):n(t)}function o(t){return t===UT.dash?(e.consume(t),s):n(t)}function s(t){return t===UT.greaterThan?n(t):q(t)?u(t):(e.enter(WT.data),t===UT.dash?(e.consume(t),c):l(t))}function c(e){return e===UT.greaterThan?n(e):l(e)}function l(t){return t===UT.eof?n(t):t===UT.dash?(e.consume(t),f):q(t)?(e.exit(WT.data),u(t)):(e.consume(t),l)}function u(t){return e.enter(WT.lineEnding),e.consume(t),e.exit(WT.lineEnding),Yy(e,d,WT.linePrefix)}function d(t){return q(t)?u(t):(e.enter(WT.data),l(t))}function f(t){return t===UT.dash?(e.consume(t),p):l(t)}function p(n){return n===UT.greaterThan?(e.exit(WT.data),e.enter(`commentEnd`),e.consume(n),e.exit(`commentEnd`),e.exit(`comment`),t(n)):n===UT.dash?(e.consume(n),p):l(n)}},qT={flow:{60:{tokenize:KT,concrete:!0}},text:{60:{tokenize:KT}}},JT={bold:`_bold_6j9u9_10`,italic:`_italic_6j9u9_14`,underline:`_underline_6j9u9_18`,strikethrough:`_strikethrough_6j9u9_34`,underlineStrikethrough:`_underlineStrikethrough_6j9u9_38`,subscript:`_subscript_6j9u9_42`,superscript:`_superscript_6j9u9_47`,code:`_code_6j9u9_52`,quote:`_quote_6j9u9_59`,nestedListItem:`_nestedListItem_6j9u9_66`,listitem:`_listitem_6j9u9_76`,listItemChecked:`_listItemChecked_6j9u9_80`,listItemUnchecked:`_listItemUnchecked_6j9u9_81`,admonitionDanger:`_admonitionDanger_6j9u9_158`,admonitionInfo:`_admonitionInfo_6j9u9_159`,admonitionNote:`_admonitionNote_6j9u9_160`,admonitionTip:`_admonitionTip_6j9u9_161`,admonitionCaution:`_admonitionCaution_6j9u9_162`,mdxExpression:`_mdxExpression_6j9u9_195`},YT={quote:JT.quote,text:{bold:JT.bold,italic:JT.italic,underline:JT.underline,code:JT.code,strikethrough:JT.strikethrough,subscript:JT.subscript,superscript:JT.superscript,underlineStrikethrough:JT.underlineStrikethrough},list:{listitem:JT.listitem,listitemChecked:JT.listItemChecked,listitemUnchecked:JT.listItemUnchecked,nested:{listitem:JT.nestedListItem}},admonition:{danger:JT.admonitionDanger,info:JT.admonitionInfo,note:JT.admonitionNote,tip:JT.admonitionTip,caution:JT.admonitionCaution}},XT=(0,I.createContext)(null);function ZT(){let e=(0,I.useContext)(XT);return e??function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),e}function QT(){return Yu().getTextContent()}function $T(e,t=!0){if(e)return!1;let n=QT();return t&&(n=n.trim()),n===``}function eE(e){if(!$T(e,!1))return!1;let t=Yu().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){let n=t[e];if(Gl(n))return!1;if(W(n)){if(!uu(n)||n.__indent!==0)return!1;let t=n.getChildren(),r=t.length;for(let n=0;n<r;n++){let n=t[e];if(!V(n))return!1}}}return!0}function tE(e){return()=>eE(e)}var nE=Hr?I.useLayoutEffect:I.useEffect;function rE({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:i,ariaErrorMessage:a,ariaExpanded:o,ariaInvalid:s,ariaLabel:c,ariaLabelledBy:l,ariaMultiline:u,ariaOwns:d,ariaRequired:f,autoCapitalize:p,className:m,id:h,role:g=`textbox`,spellCheck:_=!0,style:v,tabIndex:y,"data-testid":b,...x},S){let[C,w]=(0,I.useState)(e.isEditable()),T=(0,I.useCallback)(t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)},[e]),E=(0,I.useMemo)(()=>function(...e){return t=>{for(let n of e)typeof n==`function`?n(t):n!=null&&(n.current=t)}}(S,T),[T,S]);return nE(()=>(w(e.isEditable()),e.registerEditableListener(e=>{w(e)})),[e]),(0,L.jsx)(`div`,{"aria-activedescendant":C?t:void 0,"aria-autocomplete":C?n:`none`,"aria-controls":C?r:void 0,"aria-describedby":i,...a==null?{}:{"aria-errormessage":a},"aria-expanded":C&&g===`combobox`?!!o:void 0,...s==null?{}:{"aria-invalid":s},"aria-label":c,"aria-labelledby":l,"aria-multiline":u,"aria-owns":C?d:void 0,"aria-readonly":!C||void 0,"aria-required":f,autoCapitalize:p,className:m,contentEditable:C,"data-testid":b,id:h,ref:E,role:g,spellCheck:_,style:v,tabIndex:y??(C?void 0:-1),...x})}var iE=(0,I.forwardRef)(rE);function aE(e){return e.read(`latest`,tE(e.isComposing()))}var oE=(0,I.forwardRef)(sE);function sE(e,t){let{placeholder:n,...r}=e,[i]=ZT();return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(iE,{editor:i,...r,ref:t}),n!=null&&(0,L.jsx)(cE,{editor:i,content:n})]})}function cE({content:e,editor:t}){let n=function(e){let[t,n]=(0,I.useState)(()=>aE(e));return nE(()=>{function t(){let t=aE(e);n(t)}return t(),am(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),t}(t),[r,i]=(0,I.useState)(t.isEditable());if((0,I.useLayoutEffect)(()=>(i(t.isEditable()),t.registerEditableListener(e=>{i(e)})),[t]),!n)return null;let a=null;return typeof e==`function`?a=e(r):e!==null&&(a=e),a===null?null:(0,L.jsx)(`div`,{"aria-hidden":!0,children:a})}var lE=class extends I.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){this.props.onError(e instanceof Error?e:Error(String(e),{cause:e}),t)}render(){return this.state.hasError?this.props.fallback:this.props.children}};function uE({children:e,fallback:t,onError:n}){return(0,L.jsx)(lE,{fallback:t===void 0?(0,L.jsx)(`div`,{style:{border:`1px solid #f00`,color:`#f00`,padding:`8px`},children:`An error was thrown.`}):t,onError:n,children:e})}var dE=Zp({name:`@lexical/react/ReactProvider`}),fE=a(i(),1);function pE(e,t){let[n]=t,r=e.decorators.map(e=>typeof e==`function`?(0,L.jsx)(e,{context:t}):e);return function(i){let{EditorChildrenComponent:a=e.EditorChildrenComponent,ErrorBoundary:o=e.ErrorBoundary,contentEditable:s=e.contentEditable,children:c}=i,l=function(e,t){let[n,r]=(0,I.useMemo)(()=>[t=>e.registerDecoratorListener(t),()=>e.getDecorators()],[e]),i=(0,I.useSyncExternalStore)(n,r,r);return(0,I.useMemo)(()=>{let n=[];for(let r in i){let a=e.getElementByKey(r);if(a!==null){let o=(0,L.jsx)(t,{onError:t=>{e._onError(t)},children:(0,L.jsx)(I.Suspense,{fallback:null,children:i[r]})});n.push((0,fE.createPortal)(o,a,r))}}return n},[t,i,e])}(n,o),u=(0,I.useMemo)(()=>r.map((e,t)=>(0,L.jsx)(o,{onError:e=>{n._onError(e)},children:(0,L.jsx)(I.Suspense,{fallback:null,children:e})},t)),[o]);return(0,L.jsx)(XT.Provider,{value:t,children:(0,L.jsxs)(a,{context:t,contentEditable:s,children:[c,u,l]})})}}function mE({contentEditable:e,children:t}){return(0,L.jsxs)(L.Fragment,{children:[e,t]})}var hE=Zp({build(e,t,n){n.getPeer(dE.name)||function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(321,[...n.getDirectDependentNames()].join(` `));let r=[e,{getTheme:()=>e._config.theme}];return{Component:pE(t,r),context:r}},config:{EditorChildrenComponent:mE,ErrorBoundary:uE,contentEditable:(0,L.jsx)(oE,{}),decorators:[]},mergeConfig(e,t){let n=tm(e,t);return t.decorators&&(n.decorators=t.decorators.length>0?[...e.decorators,...t.decorators]:e.decorators),n},name:`@lexical/react/React`,peerDependencies:[$p(dE.name)]}),gE=new WeakSet,_E=new WeakMap,vE=new Set([Kl,nc,eu,pc,su]),yE=new WeakMap;function bE(e){return Qp(Yh,{createInitialHistoryState:()=>e,disabled:!1})}function xE({name:e,namespace:t,nodes:n,theme:r,editable:i=!0,parentEditor:a,historyMode:o,historyState:s,initialEditorState:c,onError:l=e=>{throw e}}){let u=[dE,Qp(hE,{contentEditable:null}),Qp(Th,{setOptions:{tag:Bs},updateOptions:{tag:Bs}})];if(a&&u.push(Qp(Vh,{$getParentEditor:()=>a,inheritEditableFromParent:!0})),o===`nested-shared`)u.push(Xh);else if(o===`root-shared`||o===`nested-external`){if(!s)throw Error(`${o} requires a historyState`);u.push(bE(s))}else o===`table-local`&&u.push(Qp(Yh,{disabled:!1}));let d=Dh(Zp({name:e,namespace:t,nodes:n?.filter(e=>!vE.has(e)),theme:r,editable:i,$initialEditorState:c,onError:l,dependencies:u})),f=Ph(d,Yh.name)?.output.historyState.value;f&&_E.set(d,f),f&&(yE.has(f)||yE.set(f,f.current));let p=f?d.registerUpdateListener(({dirtyElements:e,dirtyLeaves:t,tags:n})=>{let r=f.current;if(n.has(`historic`)){yE.set(f,r);return}if(e.size>0||t.size>0){yE.set(f,r);return}let i=yE.get(f);r?.editor===d&&i&&i.editor!==d?(f.undoStack.push({...i}),f.redoStack=[],d.dispatchCommand($o,!0),d.dispatchCommand(Qo,!1),yE.set(f,r)):yE.set(f,r)}):()=>void 0,m=new Set,h=f?d.registerCommand(es,()=>{let e=setTimeout(()=>{m.delete(e),d.dispatchCommand($o,f.undoStack.length>0),d.dispatchCommand(Qo,f.redoStack.length>0)});return m.add(e),!1},1):()=>void 0,g=d.dispose.bind(d),_=!1;return d.dispose=()=>{_||(_=!0,m.forEach(clearTimeout),m.clear(),h(),p(),g())},o===`root-shared`&&gE.add(d),d}var SE=B(`NESTED_EDITOR_UPDATED_COMMAND`),CE=R(null),wE=R(null),TE=R(``),EE=R(!0),DE=R(!1,e=>{e.sub(e.pipe(DE,Nr(CE)),([e,t])=>{t?.setEditable(!e)})}),OE=R(``),kE=R(!1),AE=R(!1),jE=R(0),ME=R(null),NE=Tr(e=>{e.link(e.pipe(ME,Pr(e=>e!==null)),NE)}),PE=Tr(e=>{e.sub(e.pipe(PE,Nr(wE)),([e,t])=>{t?.dispatchCommand(So,e)})}),FE=R(null,e=>{e.sub(e.pipe(FE,Nr(wE)),([t,n])=>{if(!t||!n)return;let r=t.anchor.getNode(),i=r.getKey()===`root`?r:Af(r,e=>{let t=e.getParent();return t!==null&&kd(t)});i??=r.getTopLevelElementOrThrow();let a=i.getKey();if(n.getElementByKey(a)!==null){let t=P_(i)?i.getTag():i.getType();e.pub(LD,t)}})}),IE=R(``),LE=R(``),RE=R(!1),zE=Tr(e=>{e.link(LE,zE),e.sub(IE,t=>{e.pubIn({[RE]:!0,[LE]:t})})}),BE=Tr(e=>{e.link(e.pipe(zE,Nr(lD),Pr(([,e])=>!e),Mr(([e])=>e)),BE)},!0),VE=R([]),HE=R([]),UE=R([]),WE=R([]),GE=R([]),KE=R([]),qE=R({}),JE=R(!1),YE=R([]),XE=R(`source`),ZE=R([]),QE=R([]),$E=R(``),eD=R(null),tD=R(null),nD=R(null),rD=yD(HE),iD=yD(VE),aD=yD(UE),oD=yD(WE),sD=yD(GE),cD=yD(KE),lD=R(!1),uD=Tr(e=>{e.sub(e.pipe(uD,Nr(LE,CE,AE),Pr(([e,t])=>e.trim()!==t.trim())),([t,,n,r])=>{e.pub(lD,!0),n?.update(()=>{Yu().clear(),CD(e,Yu(),t),r?n.focus():Xu(null)},{onUpdate:()=>{e.pub(lD,!1)}})})}),dD=Tr(e=>{e.sub(e.pipe(dD,Nr(wE,AE)),([t,n,r])=>{n?.update(()=>{let i=U();if(i!==null){let n={children:[],append(e){this.children.push(e)},getType(){return i.getNodes()[0].getType()}};CD(e,n,t),nl(n.children)}r?n.focus():Xu(null)})})});function fD(){return Fr((e,[t,n])=>(e.forEach(e=>{if(!e)throw Error(`You have a subscription that does not return a teardown`);e()}),n?t.map(e=>e(n)):[]),[])}var pD=R(null),mD=R([],e=>{e.pipe(e.combine(mD,wE),fD())}),hD=R([],e=>{e.pipe(e.combine(hD,CE),fD())}),gD=R(null,_T,(e,t)=>!!(e&&t&&e.editorRef===t.editorRef)),_D=Tr(),vD=R(e=>{throw Error(`No icon component for ${e}`)});function yD(e,t){return Tr((n,r)=>{n.changeWith(e,r,(e,t)=>{Array.isArray(t)||(t=[t]);let n=e;for(let r of t)e.includes(r)||(n=[...n,r]);return n}),t?.(n,r)})}function bD(e){let t=U();H(t)&&e.pubIn({[FE]:t,[jE]:t.format})}var xD=yD(hD,(e,t)=>{e.pub(t,[t=>t.registerCommand(oo,(t,n)=>(e.pubIn({[wE]:n,[AE]:!0}),n._parentEditor===null&&n.getEditorState().read(()=>{e.pub(gD,{rootNode:Yu(),editorType:`lexical`,editorRef:n})}),bD(e),!1),4),t=>t.registerUpdateListener(({dirtyElements:n,dirtyLeaves:r,editorState:i})=>{if(e.getValue(ME)!==null||n.size===0&&r.size===0)return;let a;i.read(()=>{Yu().getLastChild()instanceof Wl&&t.update(()=>{Yu().append(lu())},{discrete:!0}),a=AS({root:Yu(),visitors:e.getValue(GE),jsxComponentDescriptors:e.getValue(YE),toMarkdownExtensions:e.getValue(KE),toMarkdownOptions:e.getValue(qE),jsxIsAvailable:e.getValue(JE)})}),e.pub(LE,a.trim()),e.pub(RE,!1)}),t=>t.registerCommand(es,()=>(e.pub(AE,!0),!1),4)])}),SD=yD(mD,(e,t)=>{e.pub(t,[t=>t.registerUpdateListener(({editorState:t})=>{t.read(()=>{bD(e)})}),t=>t.registerCommand(ts,t=>{let n=e.getValue(CE);return n&&(n.getRootElement()?.contains(t.relatedTarget)||e.pubIn({[AE]:!1,[_D]:t})),!1},4)])});function CD(e,t,n){try{hT({root:t,visitors:e.getValue(VE),mdastExtensions:e.getValue(WE),markdown:n,syntaxExtensions:e.getValue(UE),jsxComponentDescriptors:e.getValue(YE),jsxKindMismatchPolicy:e.getValue(XE),directiveDescriptors:e.getValue(ZE),codeBlockEditorDescriptors:e.getValue(QE),defaultCodeBlockLanguage:e.getValue($E)}),e.pub(ME,null)}catch(t){if(t instanceof fT||t instanceof pT||t instanceof nT)e.pubIn({[LE]:n,[ME]:{error:t.message,source:n}});else throw t}}var wD=R([]),TD=yD(wD),ED=R([]),DD=yD(ED),OD=R([]),kD=yD(OD),AD=R([]),jD=yD(AD),MD=yD(R([])),ND=R([]),PD=yD(ND),FD=R(!1,e=>{e.link(e.pipe(wE,Mr(e=>[`td`,`th`].includes((e?.getRootElement()?.parentNode)?.nodeName.toLowerCase()??``))),FD)}),ID=R(Jh()),LD=R(``);Tr();var RD=Tr(e=>{e.sub(e.pipe(RD,Nr(wE)),([e,t])=>{t?.update(()=>{let n=U();H(n)&&(hm(n,e),setTimeout(()=>{t.focus()}))})})}),zD=Tr(e=>{e.sub(e.pipe(zD,Nr(wE)),([e,t])=>{t?.focus(()=>{t.getEditorState().read(()=>{H(U())&&(t.update(()=>{let t=e();t.isInline()?(nl([t]),kd(t.getParentOrThrow())&&Em(t,lu).selectEnd()):Tm(t),setTimeout(()=>{`select`in t&&typeof t.select==`function`&&t.select()})}),setTimeout(()=>{t.dispatchCommand(SE,void 0)}))})},{defaultSelection:`rootEnd`})})}),BD=R(`rich-text`,e=>{function t(){return Fr((e,t)=>({current:e.next,next:t}),{current:`rich-text`,next:`rich-text`})}e.sub(e.pipe(BD,t(),Nr(VD)),([{current:t},n])=>{(t===`source`||t===`diff`)&&e.pub(uD,n)}),e.sub(e.pipe(BD,t(),Pr(e=>e.current===`rich-text`),Nr(wE)),([,e])=>{e?.dispatchCommand(SE,void 0)})}),VD=R(``,e=>{e.link(LE,VD),e.link(VD,zE)},!0),HD=R([]),UD=yD(HD),WD=R(()=>{throw Error(`No translation function provided`)}),GD=R(YT),KD=zr({init(e,t){let n=t?.initialMarkdown??``;e.register(xD),e.register(SD),e.register(zE),e.register(VD),e.pubIn({[IE]:t?.trim?n.trim():n,[vD]:t?.iconComponentFor,[iD]:[VT,BT,HT,MT,...LT],[rD]:[su,nc,ST],[sD]:[OT,DT,jT,ET,TT],[TE]:t?.contentEditableClassName,[EE]:t?.spellCheck,[qE]:t?.toMarkdownOptions,[kE]:t?.autoFocus,[OE]:t?.placeholder,[DE]:t?.readOnly,[WD]:t?.translation,[ID]:Jh(),[oD]:[dv(),vv],[aD]:[lv(),Hy()],[cD]:[ey(),fv(),xv],[GD]:t?.lexicalTheme??YT}),e.singletonSub(NE,t?.onError),e.singletonSub(BE,n=>{t?.onChange(n,e.getValue(RE))}),e.singletonSub(_D,t?.onBlur),t?.suppressHtmlProcessing||e.pubIn({[oD]:[$v(),GT()],[aD]:[Tb(),Eb(),qT],[iD]:RT})},postInit(e,t){let n=xE({name:`@mdxeditor/root`,editable:t?.readOnly!==!0,namespace:t?.lexicalEditorNamespace??`MDXEditor`,nodes:[...e.getValue(HE),...t?.additionalLexicalNodes??[]],theme:e.getValue(GD),historyMode:t?.suppressSharedHistory?`none`:`root-shared`,historyState:e.getValue(ID),initialEditorState:t?.editorState===null?null:()=>{let n=t?.initialMarkdown.trim()??``;CD(e,Yu(),n)}});Lr(e,()=>{n.dispose()});let r=t?.autoFocus;if(t?.editorState!==null&&r){let t=setTimeout(()=>{n.focus(_T,{defaultSelection:r===!0?`rootStart`:r.defaultSelection??`rootStart`})});Lr(e,()=>{clearTimeout(t)})}e.pub(CE,n),e.pub(wE,n)},update(e,t){e.pubIn({[TE]:t?.contentEditableClassName,[EE]:t?.spellCheck,[qE]:t?.toMarkdownOptions,[kE]:t?.autoFocus,[OE]:t?.placeholder,[DE]:t?.readOnly}),e.singletonSub(BE,n=>{t?.onChange(n,e.getValue(RE))}),e.singletonSub(_D,t?.onBlur),e.singletonSub(NE,t?.onError)}});function qD(){return kr(WD)}function JD({initialEditor:e,children:t}){let{Component:n}=Nh(e,hE).output;return(0,L.jsx)(n,{children:t})}var YD=Hr?I.useLayoutEffect:I.useEffect;function XD(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function ZD(){return function(e){let[t]=ZT(),n=(0,I.useMemo)(()=>e(t),[t,e]),[r,i]=(0,I.useState)(()=>n.initialValueFn()),a=(0,I.useRef)(r);return YD(()=>{let{initialValueFn:e,subscribe:t}=n,r=e();return a.current!==r&&(a.current=r,i(r)),t(e=>{a.current=e,i(e)})},[n,e]),r}(XD)}function QD(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var $D=Hr?I.useLayoutEffect:I.useEffect;function eO({editor:e,ErrorBoundary:t}){return function(e,t){let[n,r]=(0,I.useState)(()=>e.getDecorators());return $D(()=>e.registerDecoratorListener(e=>{(0,fE.flushSync)(()=>{r(e)})}),[e]),(0,I.useEffect)(()=>{r(e.getDecorators())},[e]),(0,I.useMemo)(()=>{let r=[],i=Object.keys(n);for(let a=0;a<i.length;a++){let o=i[a],s=(0,L.jsx)(t,{onError:t=>e._onError(t),children:(0,L.jsx)(I.Suspense,{fallback:null,children:n[o]})}),c=e.getElementByKey(o);c!==null&&r.push((0,fE.createPortal)(s,c,o))}return r},[t,n,e])}(e,t)}function tO({editor:e,ErrorBoundary:t}){return function(e){let t=Mh.maybeFromEditor(e);if(t&&t.hasExtensionByName(dE.name)){for(let e of[`@lexical/plain-text`,`@lexical/rich-text`])t.hasExtensionByName(e)&&QD(320,e);return!0}return!1}(e)?null:(0,L.jsx)(eO,{editor:e,ErrorBoundary:t})}function nO(e){return e.read(`latest`,tE(e.isComposing()))}function rO({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){let[r]=ZT();return function(e){$D(()=>am(K_(e),S_(e)),[e])}(r),(0,L.jsxs)(L.Fragment,{children:[e,(0,L.jsx)(iO,{content:t}),(0,L.jsx)(tO,{editor:r,ErrorBoundary:n})]})}function iO({content:e}){let[t]=ZT(),n=function(e){let[t,n]=(0,I.useState)(()=>nO(e));return $D(()=>{function t(){let t=nO(e);n(t)}return t(),am(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),t}(t),r=ZD();return n?typeof e==`function`?e(r):e:null}var aO=e(((e,t)=>{(function(){var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()})),oO={undo:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M7.202 18.5V17H14.3788C15.4224 17 16.3205 16.6554 17.073 15.9663C17.8257 15.2773 18.202 14.4263 18.202 13.4135C18.202 12.4007 17.8257 11.5512 17.073 10.8652C16.3205 10.1794 15.4224 9.8365 14.3788 9.8365H7.35775L10.1402 12.6193L9.0865 13.673L4.5 9.0865L9.0865 4.5L10.1402 5.55375L7.35775 8.3365H14.3788C15.8416 8.3365 17.0945 8.82467 18.1375 9.801C19.1805 10.7773 19.702 11.9815 19.702 13.4135C19.702 14.8455 19.1805 16.0513 18.1375 17.0308C17.0945 18.0103 15.8416 18.5 14.3788 18.5H7.202Z`,fill:`currentColor`})),redo:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M9.6211 18.5C8.15827 18.5 6.90535 18.0103 5.86235 17.0308C4.81935 16.0513 4.29785 14.8455 4.29785 13.4135C4.29785 11.9815 4.81935 10.7773 5.86235 9.801C6.90535 8.82467 8.15827 8.3365 9.6211 8.3365H16.6421L13.8596 5.55375L14.9134 4.5L19.4999 9.0865L14.9134 13.673L13.8596 12.6193L16.6421 9.8365H9.6211C8.57744 9.8365 7.67935 10.1794 6.92685 10.8652C6.17418 11.5512 5.79785 12.4007 5.79785 13.4135C5.79785 14.4263 6.17418 15.2773 6.92685 15.9663C7.67935 16.6554 8.57744 17 9.6211 17H16.7979V18.5H9.6211Z`,fill:`currentColor`})),format_bold:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M7.33838 18.625V5.375H12.1999C13.219 5.375 14.1405 5.69233 14.9644 6.327C15.788 6.9615 16.1999 7.816 16.1999 8.8905C16.1999 9.63783 16.0194 10.2471 15.6584 10.7182C15.2975 11.1894 14.9088 11.5314 14.4921 11.7442C15.005 11.9211 15.4947 12.2708 15.9614 12.7933C16.428 13.3158 16.6614 14.0193 16.6614 14.9038C16.6614 16.1819 16.1902 17.1217 15.2479 17.723C14.3055 18.3243 13.3562 18.625 12.3999 18.625H7.33838ZM9.48838 16.6328H12.3191C13.1063 16.6328 13.6627 16.4142 13.9884 15.977C14.314 15.5398 14.4769 15.1206 14.4769 14.7192C14.4769 14.3179 14.314 13.8987 13.9884 13.4615C13.6627 13.0243 13.0909 12.8058 12.2729 12.8058H9.48838V16.6328ZM9.48838 10.875H12.0826C12.6903 10.875 13.172 10.7013 13.5279 10.3538C13.8835 10.0064 14.0614 9.59042 14.0614 9.10575C14.0614 8.59042 13.8733 8.16925 13.4971 7.84225C13.1208 7.51542 12.6595 7.352 12.1134 7.352H9.48838V10.875Z`,fill:`currentColor`})),format_italic:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M5.39404 18.625V16.8173H9.21129L12.4518 7.18275H8.63454V5.375H17.7883V7.18275H14.2785L11.0383 16.8173H14.5478V18.625H5.39404Z`,fill:`currentColor`})),format_underlined:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M5.34619 22.125V20.625H18.6537V22.125H5.34619ZM11.9999 18.5287C10.4448 18.5287 9.23102 18.0566 8.35869 17.1125C7.48619 16.1683 7.04994 14.9032 7.04994 13.3172V5.41345H8.90369V13.4095C8.90369 14.4198 9.17228 15.2295 9.70944 15.8385C10.2466 16.4475 11.0101 16.752 11.9999 16.752C12.9898 16.752 13.7533 16.4475 14.2904 15.8385C14.8276 15.2295 15.0962 14.4198 15.0962 13.4095V5.41345H16.9499V13.3172C16.9499 14.9032 16.5137 16.1683 15.6412 17.1125C14.7689 18.0566 13.5551 18.5287 11.9999 18.5287Z`,fill:`currentColor`})),format_highlight:I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`},I.createElement(`path`,{d:`m9 11-6 6v3h9l3-3`}),I.createElement(`path`,{d:`m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4`})),code:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M7.99994 17.6537L2.34619 11.9999L7.99994 6.34619L9.06919 7.41544L4.46919 12.0154L9.05369 16.5999L7.99994 17.6537ZM15.9999 17.6537L14.9307 16.5844L19.5307 11.9844L14.9462 7.39994L15.9999 6.34619L21.6537 11.9999L15.9999 17.6537Z`,fill:`currentColor`})),strikeThrough:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M12.15 19.6923C10.9732 19.6923 9.9315 19.359 9.025 18.6923C8.11867 18.0256 7.45525 17.1128 7.03475 15.9538L8.6385 15.2635C8.91667 16.0444 9.3545 16.6867 9.952 17.1905C10.5493 17.6944 11.2923 17.9463 12.1808 17.9463C12.9578 17.9463 13.6744 17.7508 14.3307 17.3598C14.9872 16.9686 15.3155 16.3487 15.3155 15.5C15.3155 15.123 15.2555 14.7968 15.1355 14.5213C15.0157 14.2456 14.8462 13.9885 14.627 13.75H16.677C16.7987 13.9705 16.8932 14.2256 16.9605 14.5153C17.0278 14.8051 17.0615 15.1334 17.0615 15.5C17.0615 16.8372 16.5747 17.8702 15.601 18.599C14.6272 19.3279 13.4768 19.6923 12.15 19.6923ZM2.25 11.75V10.25H21.75V11.75H2.25ZM12.05 4.19629C13.0475 4.19629 13.9123 4.42704 14.6443 4.88854C15.3763 5.35004 15.9673 6.05896 16.4173 7.01529L14.823 7.73079C14.6218 7.26029 14.2978 6.84462 13.851 6.48379C13.4042 6.12279 12.8141 5.94229 12.0808 5.94229C11.2244 5.94229 10.5392 6.16221 10.025 6.60204C9.51083 7.04171 9.264 7.59104 9.2845 8.25004H7.5385C7.50133 7.16421 7.89783 6.21712 8.728 5.40879C9.558 4.60046 10.6653 4.19629 12.05 4.19629Z`,fill:`currentColor`})),superscript:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M16.6924 8V6.2115C16.6924 5.95383 16.7786 5.73875 16.9511 5.56625C17.1235 5.39392 17.3385 5.30775 17.5961 5.30775H19.5001V4.38475H16.6924V3.5H19.4809C19.7385 3.5 19.9536 3.58625 20.1261 3.75875C20.2985 3.93108 20.3846 4.14617 20.3846 4.404V5.2885C20.3846 5.54617 20.2985 5.76125 20.1261 5.93375C19.9536 6.10608 19.7385 6.19225 19.4809 6.19225H17.5771V7.1155H20.3846V8H16.6924ZM4.44238 18.5L8.84638 11.6287L4.77713 5.30775H6.74438L9.95963 10.404H10.0214L13.2501 5.30775H15.2329L11.1194 11.6287L15.5579 18.5H13.5751L10.0214 12.9308H9.95963L6.42513 18.5H4.44238Z`,fill:`currentColor`})),subscript:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M16.6924 20.5V18.7115C16.6924 18.4538 16.7786 18.2387 16.9511 18.0662C17.1235 17.8939 17.3385 17.8077 17.5961 17.8077H19.5001V16.8845H16.6924V16H19.4809C19.7385 16 19.9536 16.0863 20.1261 16.2587C20.2985 16.4311 20.3846 16.6461 20.3846 16.9038V17.7885C20.3846 18.0462 20.2985 18.2612 20.1261 18.4337C19.9536 18.6061 19.7385 18.6923 19.4809 18.6923H17.5771V19.6152H20.3846V20.5H16.6924ZM4.44238 18.6923L8.84638 11.8212L4.77713 5.5H6.74438L9.95963 10.5962H10.0214L13.2501 5.5H15.2329L11.1194 11.8212L15.5579 18.6923H13.5751L10.0214 13.123H9.95963L6.42513 18.6923H4.44238Z`,fill:`currentColor`})),format_list_bulleted:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M9.30775 18.75V17.25H20.5V18.75H9.30775ZM9.30775 12.75V11.25H20.5V12.75H9.30775ZM9.30775 6.75005V5.25005H20.5V6.75005H9.30775ZM5.1635 19.6635C4.706 19.6635 4.31442 19.5006 3.98875 19.1748C3.66292 18.8491 3.5 18.4575 3.5 18C3.5 17.5425 3.66292 17.151 3.98875 16.8253C4.31442 16.4995 4.706 16.3365 5.1635 16.3365C5.621 16.3365 6.01258 16.4995 6.33825 16.8253C6.66408 17.151 6.827 17.5425 6.827 18C6.827 18.4575 6.66408 18.8491 6.33825 19.1748C6.01258 19.5006 5.621 19.6635 5.1635 19.6635ZM5.1635 13.6635C4.706 13.6635 4.31442 13.5006 3.98875 13.1748C3.66292 12.8491 3.5 12.4575 3.5 12C3.5 11.5425 3.66292 11.151 3.98875 10.8253C4.31442 10.4995 4.706 10.3365 5.1635 10.3365C5.621 10.3365 6.01258 10.4995 6.33825 10.8253C6.66408 11.151 6.827 11.5425 6.827 12C6.827 12.4575 6.66408 12.8491 6.33825 13.1748C6.01258 13.5006 5.621 13.6635 5.1635 13.6635ZM5.1635 7.66355C4.706 7.66355 4.31442 7.50063 3.98875 7.1748C3.66292 6.84913 3.5 6.45755 3.5 6.00005C3.5 5.54255 3.66292 5.15096 3.98875 4.8253C4.31442 4.49946 4.706 4.33655 5.1635 4.33655C5.621 4.33655 6.01258 4.49946 6.33825 4.8253C6.66408 5.15096 6.827 5.54255 6.827 6.00005C6.827 6.45755 6.66408 6.84913 6.33825 7.1748C6.01258 7.50063 5.621 7.66355 5.1635 7.66355Z`,fill:`currentColor`})),format_list_numbered:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M3.5 21.5V20.3078H6V19.25H4.5V18.0577H6V17H3.5V15.8077H6.34625C6.58592 15.8077 6.78683 15.8888 6.949 16.051C7.11117 16.2132 7.19225 16.4141 7.19225 16.6538V17.8462C7.19225 18.0859 7.11117 18.2868 6.949 18.449C6.78683 18.6112 6.58592 18.6923 6.34625 18.6923C6.58592 18.6923 6.78683 18.7733 6.949 18.9355C7.11117 19.0977 7.19225 19.2987 7.19225 19.5385V20.6538C7.19225 20.8936 7.11117 21.0946 6.949 21.2568C6.78683 21.4189 6.58592 21.5 6.34625 21.5H3.5ZM3.5 14.8463V12.25C3.5 12.0103 3.58108 11.8093 3.74325 11.647C3.90542 11.4848 4.10642 11.4038 4.34625 11.4038H6V10.3462H3.5V9.15375H6.34625C6.58592 9.15375 6.78683 9.23483 6.949 9.397C7.11117 9.55933 7.19225 9.76033 7.19225 10V11.75C7.19225 11.9897 7.11117 12.1907 6.949 12.353C6.78683 12.5152 6.58592 12.5963 6.34625 12.5963H4.69225V13.6538H7.19225V14.8463H3.5ZM5 8.19225V3.69225H3.5V2.5H6.19225V8.19225H5ZM9.30775 18.75V17.25H20.5V18.75H9.30775ZM9.30775 12.75V11.25H20.5V12.75H9.30775ZM9.30775 6.75V5.25H20.5V6.75H9.30775Z`,fill:`currentColor`})),format_list_checked:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M5.69425 18.452L2.5 15.2578L3.54425 14.2135L5.66925 16.3385L9.91925 12.0885L10.9635 13.1578L5.69425 18.452ZM5.69425 10.8365L2.5 7.64227L3.54425 6.59802L5.66925 8.72302L9.91925 4.47302L10.9635 5.54227L5.69425 10.8365ZM13.0095 16.5578V15.0578H21.5095V16.5578H13.0095ZM13.0095 8.94227V7.44227H21.5095V8.94227H13.0095Z`,fill:`currentColor`})),link:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M10.8077 16.5385H7.0385C5.78283 16.5385 4.7125 16.096 3.8275 15.211C2.9425 14.3262 2.5 13.256 2.5 12.0005C2.5 10.745 2.9425 9.67471 3.8275 8.78955C4.7125 7.90421 5.78283 7.46155 7.0385 7.46155H10.8077V8.96155H7.0385C6.19867 8.96155 5.48233 9.25805 4.8895 9.85105C4.2965 10.444 4 11.1604 4 12C4 12.8397 4.2965 13.556 4.8895 14.149C5.48233 14.742 6.19867 15.0385 7.0385 15.0385H10.8077V16.5385ZM8.25 12.75V11.25H15.75V12.75H8.25ZM13.1923 16.5385V15.0385H16.9615C17.8013 15.0385 18.5177 14.742 19.1105 14.149C19.7035 13.556 20 12.8397 20 12C20 11.1604 19.7035 10.444 19.1105 9.85105C18.5177 9.25805 17.8013 8.96155 16.9615 8.96155H13.1923V7.46155H16.9615C18.2172 7.46155 19.2875 7.90405 20.1725 8.78905C21.0575 9.67388 21.5 10.744 21.5 11.9995C21.5 13.255 21.0575 14.3254 20.1725 15.2105C19.2875 16.0959 18.2172 16.5385 16.9615 16.5385H13.1923Z`,fill:`currentColor`})),add_photo:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M5.11537 20.5C4.6182 20.5 4.19262 20.323 3.83862 19.969C3.48462 19.615 3.30762 19.1894 3.30762 18.6922V5.30773C3.30762 4.81056 3.48462 4.38498 3.83862 4.03098C4.19262 3.67698 4.6182 3.49998 5.11537 3.49998H13.8076V4.99998H5.11537C5.02553 4.99998 4.95178 5.02881 4.89412 5.08648C4.83645 5.14415 4.80762 5.2179 4.80762 5.30773V18.6922C4.80762 18.7821 4.83645 18.8558 4.89412 18.9135C4.95178 18.9711 5.02553 19 5.11537 19H18.4999C18.5895 19 18.6633 18.9711 18.7211 18.9135C18.7788 18.8558 18.8076 18.7821 18.8076 18.6922V9.99998H20.3076V18.6922C20.3076 19.1894 20.1306 19.615 19.7766 19.969C19.4226 20.323 18.997 20.5 18.4999 20.5H5.11537ZM17.1921 8.61523V6.61523H15.1921V5.11548H17.1921V3.11548H18.6921V5.11548H20.6921V6.61523H18.6921V8.61523H17.1921ZM6.55762 16.75H17.1344L13.8459 12.3655L11.0384 16.0192L9.03837 13.4615L6.55762 16.75Z`,fill:`currentColor`})),table:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M3.5 18.6923V5.30775C3.5 4.81058 3.677 4.385 4.031 4.031C4.385 3.677 4.81058 3.5 5.30775 3.5H18.6923C19.1894 3.5 19.615 3.677 19.969 4.031C20.323 4.385 20.5 4.81058 20.5 5.30775V18.6923C20.5 19.1894 20.323 19.615 19.969 19.969C19.615 20.323 19.1894 20.5 18.6923 20.5H5.30775C4.81058 20.5 4.385 20.323 4.031 19.969C3.677 19.615 3.5 19.1894 3.5 18.6923ZM5 9.077H19V5.30775C19 5.21792 18.9712 5.14417 18.9135 5.0865C18.8558 5.02883 18.7821 5 18.6923 5H5.30775C5.21792 5 5.14417 5.02883 5.0865 5.0865C5.02883 5.14417 5 5.21792 5 5.30775V9.077ZM10.1615 14.0385H13.8385V10.577H10.1615V14.0385ZM10.1615 19H13.8385V15.5385H10.1615V19ZM5 14.0385H8.6615V10.577H5V14.0385ZM15.3385 14.0385H19V10.577H15.3385V14.0385ZM5.30775 19H8.6615V15.5385H5V18.6923C5 18.7821 5.02883 18.8558 5.0865 18.9135C5.14417 18.9712 5.21792 19 5.30775 19ZM15.3385 19H18.6923C18.7821 19 18.8558 18.9712 18.9135 18.9135C18.9712 18.8558 19 18.7821 19 18.6923V15.5385H15.3385V19Z`,fill:`currentColor`})),horizontal_rule:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M4.5 12.75V11.25H19.5V12.75H4.5Z`,fill:`currentColor`})),frontmatter:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M4.5 8.75V7.25H8.5V8.75H4.5Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M4.5 14.75V13.25H8.5V14.75H4.5Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M9.5 8.75V7.25H13.5V8.75H9.5Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M9.5 14.75V13.25H13.5V14.75H9.5Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M14.5 8.75V7.25H18.5V8.75H14.5Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M14.5 14.75V13.25H18.5V14.75H14.5Z`,fill:`currentColor`})),frame_source:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M8.6 15.2443L5.35575 12L8.6 8.75575L9.64425 9.825L7.46925 12L9.64425 14.175L8.6 15.2443ZM15.4 15.2443L14.3558 14.175L16.5307 12L14.3558 9.825L15.4 8.75575L18.6443 12L15.4 15.2443ZM5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V15H5V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19H9V20.5H5.30775ZM15 20.5V19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V15H20.5V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H15ZM3.5 9V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H9V5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V9H3.5ZM19 9V5.30775C19 5.23075 18.9679 5.16025 18.9038 5.09625C18.8398 5.03208 18.7692 5 18.6923 5H15V3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V9H19Z`,fill:`currentColor`})),arrow_drop_down:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M11.9999 14.6537L7.59619 10.25H16.4037L11.9999 14.6537Z`,fill:`currentColor`})),admonition:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M12.0001 21.4C11.7654 21.4 11.5385 21.3548 11.3193 21.2645C11.1002 21.174 10.9002 21.0435 10.7193 20.873L3.1271 13.2807C2.9566 13.0999 2.8261 12.8999 2.7356 12.6807C2.64526 12.4616 2.6001 12.2346 2.6001 12C2.6001 11.7653 2.64526 11.5358 2.7356 11.3115C2.8261 11.0871 2.9566 10.8897 3.1271 10.7192L10.7193 3.12698C10.9002 2.94614 11.1002 2.81314 11.3193 2.72798C11.5385 2.64264 11.7654 2.59998 12.0001 2.59998C12.2348 2.59998 12.4643 2.64264 12.6886 2.72798C12.9129 2.81314 13.1103 2.94614 13.2808 3.12698L20.8731 10.7192C21.0539 10.8897 21.1869 11.0871 21.2721 11.3115C21.3574 11.5358 21.4001 11.7653 21.4001 12C21.4001 12.2346 21.3574 12.4616 21.2721 12.6807C21.1869 12.8999 21.0539 13.0999 20.8731 13.2807L13.2808 20.873C13.1103 21.0435 12.9129 21.174 12.6886 21.2645C12.4643 21.3548 12.2348 21.4 12.0001 21.4ZM12.2213 19.8037L19.8039 12.2212C19.8552 12.1699 19.8808 12.0961 19.8808 12C19.8808 11.9038 19.8552 11.8301 19.8039 11.7787L12.2213 4.19623C12.17 4.14489 12.0963 4.11923 12.0001 4.11923C11.9039 4.11923 11.8302 4.14489 11.7788 4.19623L4.19635 11.7787C4.14501 11.8301 4.11935 11.9038 4.11935 12C4.11935 12.0961 4.14501 12.1699 4.19635 12.2212L11.7788 19.8037C11.8302 19.8551 11.9039 19.8807 12.0001 19.8807C12.0963 19.8807 12.17 19.8551 12.2213 19.8037ZM11.2501 13.0865H12.7501V7.47123H11.2501V13.0865ZM12.0001 15.702C12.2258 15.702 12.4168 15.6237 12.5731 15.4672C12.7296 15.3109 12.8078 15.1199 12.8078 14.8942C12.8078 14.6686 12.7296 14.4776 12.5731 14.3212C12.4168 14.1647 12.2258 14.0865 12.0001 14.0865C11.7744 14.0865 11.5834 14.1647 11.4271 14.3212C11.2706 14.4776 11.1923 14.6686 11.1923 14.8942C11.1923 15.1199 11.2706 15.3109 11.4271 15.4672C11.5834 15.6237 11.7744 15.702 12.0001 15.702Z`,fill:`currentColor`})),rich_text:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM5.30775 19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V5.30775C19 5.23075 18.9679 5.16025 18.9038 5.09625C18.8398 5.03208 18.7692 5 18.6923 5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19ZM6.75 17H17.3268L14 12.3655L11.2308 16.0192L9 13.4615L6.75 17Z`,fill:`currentColor`}),I.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M6 12V6.5H9.1925C9.5925 6.5 9.9425 6.65 10.2425 6.95C10.5425 7.25 10.6925 7.6 10.6925 8V8.6925C10.6925 9.03733 10.605 9.32675 10.43 9.56075C10.255 9.79458 10.0168 9.97817 9.7155 10.1115L10.6155 12H9.404L8.504 10.1925H7.1925V12H6ZM9.1925 9H7.1925V7.6925H9.1925C9.26933 7.6925 9.33983 7.7245 9.404 7.7885C9.468 7.85267 9.5 7.92317 9.5 8V8.6925C9.5 8.76933 9.468 8.83983 9.404 8.904C9.33983 8.968 9.26933 9 9.1925 9Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M12.5 7H17.5V8.25H12.5V7Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M12.5 9.25H17.5V10.5H12.5V9.25Z`,fill:`currentColor`})),difference:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM18.6923 19H5.30775C5.23075 19 5.16025 18.9679 5.09625 18.9038C5.03208 18.8398 5 18.7692 5 18.6923V5.30775C5 5.23075 5.03208 5.16025 5.09625 5.09625C5.16025 5.03208 5.23075 5 5.30775 5H18.6923C18.7692 5 18.8398 5.03208 18.9038 5.09625C18.9679 5.16025 19 5.23075 19 5.30775V18.6923C19 18.7692 18.9679 18.8398 18.9038 18.9038C18.8398 18.9679 18.7692 19 18.6923 19Z`,fill:`currentColor`}),I.createElement(`rect`,{x:`9`,y:`10`,width:`5.5`,height:`1.5`,fill:`currentColor`}),I.createElement(`rect`,{x:`9`,y:`15`,width:`5.5`,height:`1.5`,fill:`currentColor`}),I.createElement(`rect`,{x:`11`,y:`8`,width:`1.5`,height:`5.5`,fill:`currentColor`})),markdown:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM18.6923 19H5.30775C5.23075 19 5.16025 18.9679 5.09625 18.9038C5.03208 18.8398 5 18.7692 5 18.6923V5.30775C5 5.23075 5.03208 5.16025 5.09625 5.09625C5.16025 5.03208 5.23075 5 5.30775 5H18.6923C18.7692 5 18.8398 5.03208 18.9038 5.09625C18.9679 5.16025 19 5.23075 19 5.30775V18.6923C19 18.7692 18.9679 18.8398 18.9038 18.9038C18.8398 18.9679 18.7692 19 18.6923 19Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M13 15H11.5V11L9.5 14L7.5 11V15H6V8H7.5L9.5 11L11.5 8H13V15Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M15.9921 15.5833L13.2886 12.8797L14.0546 12.1137L15.4504 13.5016V7.99597L16.5336 7.99993V13.5016L17.9296 12.1137L18.6954 12.8797L15.9921 15.5833Z`,fill:`currentColor`})),open_in_new:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H11.6152V5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V12.3848H20.5V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM9.71925 15.3345L8.6655 14.2808L17.9462 5H14V3.5H20.5V10H19V6.05375L9.71925 15.3345Z`,fill:`currentColor`})),link_off:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M18.8843 16.1038L17.7498 14.9385C18.4228 14.7552 18.9661 14.3946 19.3796 13.8568C19.7931 13.319 19.9998 12.7 19.9998 12C19.9998 11.1604 19.705 10.444 19.1153 9.85105C18.5255 9.25805 17.8139 8.96155 16.9806 8.96155H13.1728V7.46155H16.9806C18.2293 7.46155 19.2947 7.90422 20.1768 8.78955C21.0588 9.67472 21.4998 10.7449 21.4998 12C21.4998 12.8859 21.262 13.6951 20.7863 14.4278C20.3107 15.1606 19.6767 15.7193 18.8843 16.1038ZM15.5806 12.75L14.0806 11.25H15.7306V12.75H15.5806ZM20.1461 22.2538L1.74609 3.8538L2.79984 2.80005L21.1998 21.2L20.1461 22.2538ZM10.8268 16.5386H7.03834C5.78318 16.5386 4.71301 16.0959 3.82784 15.2105C2.94251 14.3254 2.49984 13.2552 2.49984 12C2.49984 10.8885 2.85784 9.91322 3.57384 9.07405C4.28984 8.23505 5.18826 7.72838 6.26909 7.55405H6.49984L7.90759 8.96155H7.03834C6.19851 8.96155 5.48218 9.25805 4.88934 9.85105C4.29634 10.444 3.99984 11.1604 3.99984 12C3.99984 12.8397 4.29634 13.556 4.88934 14.149C5.48218 14.742 6.19851 15.0385 7.03834 15.0385H10.8268V16.5386ZM8.26909 12.75V11.25H10.2113L11.6863 12.75H8.26909Z`,fill:`currentColor`})),edit:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M5 19H6.2615L16.498 8.7635L15.2365 7.502L5 17.7385V19ZM3.5 20.5V17.1155L16.6905 3.93075C16.8417 3.79342 17.0086 3.68733 17.1913 3.6125C17.3741 3.5375 17.5658 3.5 17.7663 3.5C17.9668 3.5 18.1609 3.53558 18.3488 3.60675C18.5367 3.67792 18.7032 3.79108 18.848 3.94625L20.0693 5.18275C20.2244 5.32758 20.335 5.49425 20.401 5.68275C20.467 5.87125 20.5 6.05975 20.5 6.24825C20.5 6.44942 20.4657 6.64133 20.397 6.824C20.3283 7.00683 20.2191 7.17383 20.0693 7.325L6.8845 20.5H3.5ZM15.8562 8.14375L15.2365 7.502L16.498 8.7635L15.8562 8.14375Z`,fill:`currentColor`})),content_copy:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M9.05775 17.5C8.55258 17.5 8.125 17.325 7.775 16.975C7.425 16.625 7.25 16.1974 7.25 15.6923V4.30775C7.25 3.80258 7.425 3.375 7.775 3.025C8.125 2.675 8.55258 2.5 9.05775 2.5H17.4423C17.9474 2.5 18.375 2.675 18.725 3.025C19.075 3.375 19.25 3.80258 19.25 4.30775V15.6923C19.25 16.1974 19.075 16.625 18.725 16.975C18.375 17.325 17.9474 17.5 17.4423 17.5H9.05775ZM9.05775 16H17.4423C17.5192 16 17.5898 15.9679 17.6538 15.9038C17.7179 15.8398 17.75 15.7692 17.75 15.6923V4.30775C17.75 4.23075 17.7179 4.16025 17.6538 4.09625C17.5898 4.03208 17.5192 4 17.4423 4H9.05775C8.98075 4 8.91025 4.03208 8.84625 4.09625C8.78208 4.16025 8.75 4.23075 8.75 4.30775V15.6923C8.75 15.7692 8.78208 15.8398 8.84625 15.9038C8.91025 15.9679 8.98075 16 9.05775 16ZM5.55775 21C5.05258 21 4.625 20.825 4.275 20.475C3.925 20.125 3.75 19.6974 3.75 19.1923V6.30775H5.25V19.1923C5.25 19.2693 5.28208 19.3398 5.34625 19.4038C5.41025 19.4679 5.48075 19.5 5.55775 19.5H15.4423V21H5.55775Z`,fill:`currentColor`})),more_horiz:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M6.23096 13.5C5.81846 13.5 5.46537 13.3531 5.17171 13.0592C4.87787 12.7656 4.73096 12.4125 4.73096 12C4.73096 11.5875 4.87787 11.2344 5.17171 10.9408C5.46537 10.6469 5.81846 10.5 6.23096 10.5C6.64346 10.5 6.99662 10.6469 7.29046 10.9408C7.58412 11.2344 7.73096 11.5875 7.73096 12C7.73096 12.4125 7.58412 12.7656 7.29046 13.0592C6.99662 13.3531 6.64346 13.5 6.23096 13.5ZM12.0002 13.5C11.5877 13.5 11.2346 13.3531 10.941 13.0592C10.6471 12.7656 10.5002 12.4125 10.5002 12C10.5002 11.5875 10.6471 11.2344 10.941 10.9408C11.2346 10.6469 11.5877 10.5 12.0002 10.5C12.4127 10.5 12.7658 10.6469 13.0595 10.9408C13.3533 11.2344 13.5002 11.5875 13.5002 12C13.5002 12.4125 13.3533 12.7656 13.0595 13.0592C12.7658 13.3531 12.4127 13.5 12.0002 13.5ZM17.7695 13.5C17.357 13.5 17.0038 13.3531 16.71 13.0592C16.4163 12.7656 16.2695 12.4125 16.2695 12C16.2695 11.5875 16.4163 11.2344 16.71 10.9408C17.0038 10.6469 17.357 10.5 17.7695 10.5C18.182 10.5 18.535 10.6469 18.8287 10.9408C19.1225 11.2344 19.2695 11.5875 19.2695 12C19.2695 12.4125 19.1225 12.7656 18.8287 13.0592C18.535 13.3531 18.182 13.5 17.7695 13.5Z`,fill:`currentColor`})),more_vert:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M12 19.2692C11.5875 19.2692 11.2344 19.1223 10.9408 18.8285C10.6469 18.5348 10.5 18.1817 10.5 17.7692C10.5 17.3567 10.6469 17.0035 10.9408 16.7097C11.2344 16.416 11.5875 16.2692 12 16.2692C12.4125 16.2692 12.7656 16.416 13.0592 16.7097C13.3531 17.0035 13.5 17.3567 13.5 17.7692C13.5 18.1817 13.3531 18.5348 13.0592 18.8285C12.7656 19.1223 12.4125 19.2692 12 19.2692ZM12 13.5C11.5875 13.5 11.2344 13.353 10.9408 13.0592C10.6469 12.7655 10.5 12.4125 10.5 12C10.5 11.5875 10.6469 11.2344 10.9408 10.9407C11.2344 10.6469 11.5875 10.5 12 10.5C12.4125 10.5 12.7656 10.6469 13.0592 10.9407C13.3531 11.2344 13.5 11.5875 13.5 12C13.5 12.4125 13.3531 12.7655 13.0592 13.0592C12.7656 13.353 12.4125 13.5 12 13.5ZM12 7.73071C11.5875 7.73071 11.2344 7.58388 10.9408 7.29021C10.6469 6.99638 10.5 6.64321 10.5 6.23071C10.5 5.81821 10.6469 5.46513 10.9408 5.17146C11.2344 4.87763 11.5875 4.73071 12 4.73071C12.4125 4.73071 12.7656 4.87763 13.0592 5.17146C13.3531 5.46513 13.5 5.81821 13.5 6.23071C13.5 6.64321 13.3531 6.99638 13.0592 7.29021C12.7656 7.58388 12.4125 7.73071 12 7.73071Z`,fill:`currentColor`})),close:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M6.39994 18.6538L5.34619 17.6L10.9462 12L5.34619 6.4L6.39994 5.34625L11.9999 10.9463L17.5999 5.34625L18.6537 6.4L13.0537 12L18.6537 17.6L17.5999 18.6538L11.9999 13.0538L6.39994 18.6538Z`,fill:`currentColor`})),settings:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M9.69225 21.5L9.3115 18.4538C9.04367 18.3641 8.769 18.2385 8.4875 18.077C8.20617 17.9153 7.95459 17.7422 7.73275 17.5577L4.9115 18.75L2.604 14.75L5.04425 12.9058C5.02125 12.7571 5.00492 12.6077 4.99525 12.4578C4.98559 12.3078 4.98075 12.1583 4.98075 12.0095C4.98075 11.8673 4.98559 11.7228 4.99525 11.576C5.00492 11.4292 5.02125 11.2686 5.04425 11.0943L2.604 9.25L4.9115 5.26925L7.723 6.452C7.96417 6.261 8.22159 6.08633 8.49525 5.928C8.76892 5.76967 9.03784 5.64242 9.302 5.54625L9.69225 2.5H14.3078L14.6885 5.55575C14.9885 5.66475 15.2599 5.792 15.5028 5.9375C15.7458 6.083 15.991 6.2545 16.2385 6.452L19.0885 5.26925L21.396 9.25L18.9173 11.123C18.9531 11.2845 18.9727 11.4355 18.976 11.576C18.9792 11.7163 18.9808 11.8577 18.9808 12C18.9808 12.1358 18.9775 12.274 18.971 12.4145C18.9647 12.5548 18.9417 12.7154 18.902 12.8963L21.3615 14.75L19.0538 18.75L16.2385 17.548C15.991 17.7455 15.7384 17.9202 15.4808 18.072C15.2231 18.224 14.959 18.3481 14.6885 18.4443L14.3078 21.5H9.69225ZM11 20H12.9655L13.325 17.3212C13.8353 17.1879 14.3017 16.9985 14.724 16.753C15.1465 16.5073 15.5539 16.1916 15.9463 15.8057L18.4308 16.85L19.4155 15.15L17.2463 13.5155C17.3296 13.2565 17.3863 13.0026 17.4163 12.7537C17.4464 12.5051 17.4615 12.2538 17.4615 12C17.4615 11.7397 17.4464 11.4884 17.4163 11.2463C17.3863 11.0039 17.3296 10.7564 17.2463 10.5038L19.4345 8.85L18.45 7.15L15.9365 8.2095C15.6018 7.85183 15.2009 7.53583 14.7338 7.2615C14.2664 6.98717 13.7937 6.79292 13.3155 6.67875L13 4H11.0155L10.6845 6.66925C10.1743 6.78975 9.70325 6.97433 9.27125 7.223C8.83909 7.47183 8.42684 7.79233 8.0345 8.1845L5.55 7.15L4.5655 8.85L6.725 10.4595C6.64167 10.6968 6.58334 10.9437 6.55 11.2C6.51667 11.4563 6.5 11.7262 6.5 12.0095C6.5 12.2698 6.51667 12.525 6.55 12.775C6.58334 13.025 6.6385 13.2718 6.7155 13.5155L4.5655 15.15L5.55 16.85L8.025 15.8C8.4045 16.1897 8.81025 16.5089 9.24225 16.7578C9.67442 17.0064 10.152 17.1974 10.675 17.3307L11 20ZM12.0115 15C12.8435 15 13.5515 14.708 14.1355 14.124C14.7195 13.54 15.0115 12.832 15.0115 12C15.0115 11.168 14.7195 10.46 14.1355 9.876C13.5515 9.292 12.8435 9 12.0115 9C11.1692 9 10.4586 9.292 9.87975 9.876C9.30092 10.46 9.0115 11.168 9.0115 12C9.0115 12.832 9.30092 13.54 9.87975 14.124C10.4586 14.708 11.1692 15 12.0115 15Z`,fill:`currentColor`})),delete_big:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M7.30775 20.5C6.80908 20.5 6.38308 20.3234 6.02975 19.9702C5.67658 19.6169 5.5 19.1909 5.5 18.6922V5.99998H4.5V4.49998H9V3.61548H15V4.49998H19.5V5.99998H18.5V18.6922C18.5 19.1974 18.325 19.625 17.975 19.975C17.625 20.325 17.1974 20.5 16.6923 20.5H7.30775ZM17 5.99998H7V18.6922C7 18.7821 7.02883 18.8558 7.0865 18.9135C7.14417 18.9711 7.21792 19 7.30775 19H16.6923C16.7692 19 16.8398 18.9679 16.9038 18.9037C16.9679 18.8397 17 18.7692 17 18.6922V5.99998ZM9.404 17H10.9037V7.99998H9.404V17ZM13.0962 17H14.596V7.99998H13.0962V17Z`,fill:`currentColor`})),delete_small:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M7.30775 20.5C6.80908 20.5 6.38308 20.3234 6.02975 19.9702C5.67658 19.6169 5.5 19.1909 5.5 18.6922V5.99998H4.5V4.49998H9V3.61548H15V4.49998H19.5V5.99998H18.5V18.6922C18.5 19.1974 18.325 19.625 17.975 19.975C17.625 20.325 17.1974 20.5 16.6923 20.5H7.30775ZM17 5.99998H7V18.6922C7 18.7821 7.02883 18.8558 7.0865 18.9135C7.14417 18.9711 7.21792 19 7.30775 19H16.6923C16.7692 19 16.8398 18.9679 16.9038 18.9037C16.9679 18.8397 17 18.7692 17 18.6922V5.99998ZM9.404 17H10.9037V7.99998H9.404V17ZM13.0962 17H14.596V7.99998H13.0962V17Z`,fill:`currentColor`})),format_align_center:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M3.5 20.5V19H20.5V20.5H3.5ZM7.5 16.625V15.125H16.5V16.625H7.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM7.5 8.875V7.375H16.5V8.875H7.5ZM3.5 5V3.5H20.5V5H3.5Z`,fill:`currentColor`})),format_align_left:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M3.5 20.5V19H20.5V20.5H3.5ZM3.5 16.625V15.125H14.5V16.625H3.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM3.5 8.875V7.375H14.5V8.875H3.5ZM3.5 5V3.5H20.5V5H3.5Z`,fill:`currentColor`})),format_align_right:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M3.5 5V3.5H20.5V5H3.5ZM9.5 8.875V7.375H20.5V8.875H9.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM9.5 16.625V15.125H20.5V16.625H9.5ZM3.5 20.5V19H20.5V20.5H3.5Z`,fill:`currentColor`})),add_row:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M4.025 10.2077C4.375 9.85775 4.80258 9.68275 5.30775 9.68275H6.5V11.1827H5.30775C5.21792 11.1827 5.14417 11.2116 5.0865 11.2693C5.02883 11.3269 5 11.4007 5 11.4905V16.1923C5 16.2821 5.02883 16.3558 5.0865 16.4135C5.14417 16.4712 5.21792 16.5 5.30775 16.5H18.6923C18.7821 16.5 18.8558 16.4712 18.9135 16.4135C18.9712 16.3558 19 16.2821 19 16.1923V11.4905C19 11.4007 18.9712 11.3269 18.9135 11.2693C18.8558 11.2116 18.7821 11.1827 18.6923 11.1827H17.6923V9.68275H18.6923C19.1974 9.68275 19.625 9.85775 19.975 10.2077C20.325 10.5577 20.5 10.9853 20.5 11.4905V16.1923C20.5 16.6974 20.325 17.125 19.975 17.475C19.625 17.825 19.1974 18 18.6923 18H5.30775C4.80258 18 4.375 17.825 4.025 17.475C3.675 17.125 3.5 16.6974 3.5 16.1923V11.4905C3.5 10.9853 3.675 10.5577 4.025 10.2077Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M11.3848 9.68275V7.5H12.8848V9.68275H15V11.1827H12.8848V13.2307H11.3848V11.1827H9.26925V9.68275H11.3848Z`,fill:`currentColor`})),add_column:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9.70775 4.025C9.35775 4.375 9.18275 4.80258 9.18275 5.30775V6.5H10.6827V5.30775C10.6827 5.21792 10.7116 5.14417 10.7693 5.0865C10.8269 5.02883 10.9007 5 10.9905 5H15.6923C15.7821 5 15.8558 5.02883 15.9135 5.0865C15.9712 5.14417 16 5.21792 16 5.30775V18.6923C16 18.7821 15.9712 18.8558 15.9135 18.9135C15.8558 18.9712 15.7821 19 15.6923 19H10.9905C10.9007 19 10.8269 18.9712 10.7693 18.9135C10.7116 18.8558 10.6827 18.7821 10.6827 18.6923V17.6923H9.18275V18.6923C9.18275 19.1974 9.35775 19.625 9.70775 19.975C10.0577 20.325 10.4853 20.5 10.9905 20.5H15.6923C16.1974 20.5 16.625 20.325 16.975 19.975C17.325 19.625 17.5 19.1974 17.5 18.6923V5.30775C17.5 4.80258 17.325 4.375 16.975 4.025C16.625 3.675 16.1974 3.5 15.6923 3.5H10.9905C10.4853 3.5 10.0577 3.675 9.70775 4.025Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M9.18275 11.3848H7V12.8848H9.18275V15H10.6827V12.8848H12.7307V11.3848H10.6827V9.26925H9.18275V11.3848Z`,fill:`currentColor`})),insert_col_left:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M13.0001 20.1152H8.67713H8.75388H8.69238H13.0001ZM7.19238 19.8075C7.19238 20.3127 7.36738 20.7402 7.71738 21.0902C8.06738 21.4402 8.49497 21.6152 9.00013 21.6152H12.6924C13.1975 21.6152 13.6251 21.4402 13.9751 21.0902C14.3251 20.7402 14.5001 20.3127 14.5001 19.8075V10.423H13.0001V19.8075C13.0001 19.8973 12.9713 19.9711 12.9136 20.0287C12.856 20.0864 12.7822 20.1152 12.6924 20.1152H9.00013C8.9103 20.1152 8.83655 20.0864 8.77888 20.0287C8.72122 19.9711 8.69238 19.8973 8.69238 19.8075V4.69223C8.26422 4.74357 7.90722 4.93299 7.62138 5.26048C7.33538 5.58798 7.19238 5.97548 7.19238 6.42298V19.8075ZM13.0001 2.49998V4.61523H10.8846V6.11523H13.0001V8.23073H14.5001V6.11523H16.6154V4.61523H14.5001V2.49998H13.0001Z`,fill:`currentColor`})),insert_row_above:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M20.1152 9.99987V14.3229V14.2461V14.3076V9.99987ZM19.8075 15.8076C20.3127 15.8076 20.7402 15.6326 21.0902 15.2826C21.4402 14.9326 21.6152 14.505 21.6152 13.9999V10.3076C21.6152 9.80245 21.4402 9.37487 21.0902 9.02487C20.7402 8.67487 20.3127 8.49987 19.8075 8.49987H10.423V9.99987H19.8075C19.8973 9.99987 19.9711 10.0287 20.0287 10.0864C20.0864 10.144 20.1152 10.2178 20.1152 10.3076V13.9999C20.1152 14.0897 20.0864 14.1635 20.0287 14.2211C19.9711 14.2788 19.8973 14.3076 19.8075 14.3076H4.69223C4.74357 14.7358 4.93299 15.0928 5.26048 15.3786C5.58798 15.6646 5.97548 15.8076 6.42298 15.8076H19.8075ZM2.49998 9.99987H4.61523V12.1154H6.11523V9.99987H8.23073V8.49987H6.11523V6.38462H4.61523V8.49987H2.49998V9.99987Z`,fill:`currentColor`})),insert_row_below:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M20.1152 14.1924V9.86939V9.94614V9.88464V14.1924ZM19.8075 8.38464C20.3127 8.38464 20.7402 8.55964 21.0902 8.90964C21.4402 9.25964 21.6152 9.68723 21.6152 10.1924V13.8846C21.6152 14.3898 21.4402 14.8174 21.0902 15.1674C20.7402 15.5174 20.3127 15.6924 19.8075 15.6924H10.423V14.1924H19.8075C19.8973 14.1924 19.9711 14.1636 20.0287 14.1059C20.0864 14.0482 20.1152 13.9745 20.1152 13.8846V10.1924C20.1152 10.1026 20.0864 10.0288 20.0287 9.97114C19.9711 9.91348 19.8973 9.88464 19.8075 9.88464H4.69223C4.74357 9.45648 4.93299 9.09948 5.26048 8.81364C5.58798 8.52764 5.97548 8.38464 6.42298 8.38464H19.8075ZM2.49998 14.1924H4.61523V12.0769H6.11523V14.1924H8.23073V15.6924H6.11523V17.8076H4.61523V15.6924H2.49998V14.1924Z`,fill:`currentColor`})),insert_col_right:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M10.8075 20.1152H15.1305H15.0537H15.1152H10.8075ZM16.6152 19.8075C16.6152 20.3127 16.4402 20.7402 16.0902 21.0902C15.7402 21.4402 15.3127 21.6152 14.8075 21.6152H11.1152C10.6101 21.6152 10.1825 21.4402 9.83248 21.0902C9.48248 20.7402 9.30748 20.3127 9.30748 19.8075V10.423H10.8075V19.8075C10.8075 19.8973 10.8363 19.9711 10.894 20.0287C10.9517 20.0864 11.0254 20.1152 11.1152 20.1152H14.8075C14.8973 20.1152 14.9711 20.0864 15.0287 20.0287C15.0864 19.9711 15.1152 19.8973 15.1152 19.8075V4.69223C15.5434 4.74357 15.9004 4.93299 16.1862 5.26048C16.4722 5.58798 16.6152 5.97548 16.6152 6.42298V19.8075ZM10.8075 2.49998V4.61523H12.923V6.11523H10.8075V8.23073H9.30748V6.11523H7.19223V4.61523H9.30748V2.49998H10.8075Z`,fill:`currentColor`})),check:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M9.54983 17.6537L4.21533 12.3192L5.28433 11.25L9.54983 15.5155L18.7153 6.34998L19.7843 7.41923L9.54983 17.6537Z`,fill:`currentColor`}))},J={editorRoot:`_editorRoot_er3ed_53`,editorWrapper:`_editorWrapper_er3ed_155`,toolbarRoot:`_toolbarRoot_er3ed_162`,readOnlyToolbarRoot:`_readOnlyToolbarRoot_er3ed_189`,toolbarToggleItem:`_toolbarToggleItem_er3ed_208`,toolbarGroupOfGroups:`_toolbarGroupOfGroups_er3ed_219`,toolbarToggleSingleGroup:`_toolbarToggleSingleGroup_er3ed_224`,toolbarButton:`_toolbarButton_er3ed_239`,activeToolbarButton:`_activeToolbarButton_er3ed_275`,toolbarButtonDropdownContainer:`_toolbarButtonDropdownContainer_er3ed_286`,selectContainer:`_selectContainer_er3ed_288`,selectItem:`_selectItem_er3ed_301`,toolbarButtonSelectTrigger:`_toolbarButtonSelectTrigger_er3ed_307`,selectTrigger:`_selectTrigger_er3ed_308`,selectDropdownArrow:`_selectDropdownArrow_er3ed_373`,contentEditable:`_contentEditable_er3ed_379`,codeMirrorWrapper:`_codeMirrorWrapper_er3ed_391`,codeMirrorToolbar:`_codeMirrorToolbar_er3ed_408`,propertyPanelTitle:`_propertyPanelTitle_er3ed_430`,propertyEditorTable:`_propertyEditorTable_er3ed_438`,iconButton:`_iconButton_er3ed_456`,readOnlyColumnCell:`_readOnlyColumnCell_er3ed_461`,buttonsFooter:`_buttonsFooter_er3ed_474`,propertyEditorInput:`_propertyEditorInput_er3ed_480`,primaryButton:`_primaryButton_er3ed_506`,secondaryButton:`_secondaryButton_er3ed_507`,smallButton:`_smallButton_er3ed_522`,dialogForm:`_dialogForm_er3ed_534`,linkDialogEditForm:`_linkDialogEditForm_er3ed_540`,linkDialogInputContainer:`_linkDialogInputContainer_er3ed_548`,linkDialogInputWrapper:`_linkDialogInputWrapper_er3ed_554`,linkDialogInput:`_linkDialogInput_er3ed_548`,linkDialogAnchor:`_linkDialogAnchor_er3ed_586`,linkDialogPopoverContent:`_linkDialogPopoverContent_er3ed_600`,tableColumnEditorPopoverContent:`_tableColumnEditorPopoverContent_er3ed_601`,dialogContent:`_dialogContent_er3ed_602`,largeDialogContent:`_largeDialogContent_er3ed_614`,dialogTitle:`_dialogTitle_er3ed_624`,dialogCloseButton:`_dialogCloseButton_er3ed_630`,popoverContent:`_popoverContent_er3ed_637`,popoverArrow:`_popoverArrow_er3ed_649`,linkDialogPreviewAnchor:`_linkDialogPreviewAnchor_er3ed_653`,tooltipTrigger:`_tooltipTrigger_er3ed_676`,tooltipContent:`_tooltipContent_er3ed_680`,actionButton:`_actionButton_er3ed_694`,primaryActionButton:`_primaryActionButton_er3ed_701`,tableEditor:`_tableEditor_er3ed_713`,toolCell:`_toolCell_er3ed_724`,tableColumnEditorTrigger:`_tableColumnEditorTrigger_er3ed_743`,addRowButton:`_addRowButton_er3ed_745`,addColumnButton:`_addColumnButton_er3ed_746`,tableColumnEditorToolbar:`_tableColumnEditorToolbar_er3ed_788`,toggleGroupRoot:`_toggleGroupRoot_er3ed_801`,tableToolsColumn:`_tableToolsColumn_er3ed_819`,leftAlignedCell:`_leftAlignedCell_er3ed_828`,rightAlignedCell:`_rightAlignedCell_er3ed_832`,centeredCell:`_centeredCell_er3ed_836`,dialogOverlay:`_dialogOverlay_er3ed_869`,focusedImage:`_focusedImage_er3ed_915`,imageWrapper:`_imageWrapper_er3ed_919`,editImageToolbar:`_editImageToolbar_er3ed_932`,editImageButton:`_editImageButton_er3ed_936`,inlineEditor:`_inlineEditor_er3ed_942`,blockEditor:`_blockEditor_er3ed_951`,nestedEditor:`_nestedEditor_er3ed_960`,genericComponentName:`_genericComponentName_er3ed_979`,diffSourceToggleWrapper:`_diffSourceToggleWrapper_er3ed_985`,ggDiffSourceToggle:`_ggDiffSourceToggle_er3ed_993`,diffSourceToggle:`_diffSourceToggle_er3ed_985`,selectWithLabel:`_selectWithLabel_er3ed_1011`,toolbarTitleMode:`_toolbarTitleMode_er3ed_1026`,imageControlWrapperResizing:`_imageControlWrapperResizing_er3ed_1031`,imageResizer:`_imageResizer_er3ed_1035`,imageResizerN:`_imageResizerN_er3ed_1044`,imageResizerNe:`_imageResizerNe_er3ed_1050`,imageResizerE:`_imageResizerE_er3ed_1056`,imageResizerSe:`_imageResizerSe_er3ed_1062`,imageResizerS:`_imageResizerS_er3ed_1062`,imageResizerSw:`_imageResizerSw_er3ed_1074`,imageResizerW:`_imageResizerW_er3ed_1080`,imageResizerNw:`_imageResizerNw_er3ed_1086`,imagePlaceholder:`_imagePlaceholder_er3ed_1092`,imageDimensionsContainer:`_imageDimensionsContainer_er3ed_1100`,placeholder:`_placeholder_er3ed_1105`,rootContentEditableWrapper:`_rootContentEditableWrapper_er3ed_1118`,downshiftInputWrapper:`_downshiftInputWrapper_er3ed_1128`,downshiftInput:`_downshiftInput_er3ed_1128`,downshiftAutocompleteContainer:`_downshiftAutocompleteContainer_er3ed_1159`,textInput:`_textInput_er3ed_1205`,multiFieldForm:`_multiFieldForm_er3ed_1213`,formField:`_formField_er3ed_1219`,markdownParseError:`_markdownParseError_er3ed_1230`,popupContainer:`_popupContainer_er3ed_1239`,inputSizer:`_inputSizer_er3ed_1244`};function sO(e){try{let t=e.anchor,n=e.focus,r=e.anchor.getNode(),i=e.focus.getNode();return r===i?r:e.isBackward()?fm(n)?r:i:fm(t)?r:i}catch{return null}}var cO=[`transform`,`perspective`,`filter`,`backdrop-filter`,`contain`,`container-type`],lO=[`layout`,`paint`,`strict`,`content`];function uO(e){let t=e?.parentElement;for(;t;){let e=window.getComputedStyle(t),n=e.willChange.split(`,`).map(e=>e.trim()).some(e=>cO.includes(e));if(e.transform!==`none`||e.perspective!==`none`||e.filter!==`none`||e.backdropFilter!==`none`||lO.includes(e.contain)||e.containerType!==`normal`||e.contentVisibility===`auto`||n)return t;t=t.parentElement}return null}function dO(e,t){let n=uO(t);if(n){let t=n.getBoundingClientRect();return{top:Math.round(e.top-t.top),left:Math.round(e.left-t.left),width:Math.round(e.width),height:Math.round(e.height)}}return{top:Math.round(e.top),left:Math.round(e.left),width:Math.round(e.width),height:Math.round(e.height)}}function fO(e,t){let n=e.getRootElement(),r=e.getElementByKey(t);return n===null||r===null?null:dO(r.getBoundingClientRect(),n)}function pO(e){let t=U(),n=window.getSelection(),r=document.activeElement,i=e.getRootElement();if(t!==null&&n!==null&&i!==null&&i.contains(n.anchorNode)&&e.isEditable()){let e=n.getRangeAt(0),t;if(n.isCollapsed){let e=n.anchorNode;e?.nodeType==3&&(e=e.parentNode),t=e.getBoundingClientRect(),t.width=0}else if(n.anchorNode===i){let e=i;for(;e.firstElementChild!=null;)e=e.firstElementChild;t=e.getBoundingClientRect()}else t=e.getBoundingClientRect();return dO(t,i)}return r?.className,null}function mO(e,t){let n=null,r=[],i=``;e.getEditorState().read(()=>{let t=U();!t||H(t)&&t.isCollapsed()||t.getNodes().length===0||(r=a_(e,t).nodes,r.length>0&&(n=hu()))},{editor:e});let a=n;if(!a||r.length===0)return``;let o={error:void 0,failed:!1};if(a.update(()=>{try{let e=Yu(),n=o_(r),a=lu(),o=()=>{a.isEmpty()||(e.append(a),a=lu())};for(let t of n)t.isInline()?a.append(t):(o(),e.append(t));o(),i=AS({root:e,...t})}catch(e){o.failed=!0,o.error=e}},{discrete:!0,skipTransforms:!0}),o.failed)throw o.error;return i.replace(/\n+$/u,``)}var hO=a(aO(),1),gO=({children:e})=>{let t=kr(CE);return I.createElement(JD,{initialEditor:t},e)},_O=()=>{let e=qD(),t=jr(nD),n=jr(pD),r=e=>{n(e),t(e?{current:e}:null)},[i,a,o,s,c,l,u]=Ar(TE,EE,wD,ED,AD,OE,OD);return I.createElement(I.Fragment,null,s.map((e,t)=>I.createElement(e,{key:t})),I.createElement(xO,{wrappers:c},I.createElement(`div`,{className:(0,hO.default)(J.rootContentEditableWrapper,`mdxeditor-root-contenteditable`)},I.createElement(rO,{contentEditable:I.createElement(`div`,{ref:r,className:`mdxeditor-contenteditable-wrapper`},I.createElement(oE,{className:(0,hO.default)(J.contentEditable,i),ariaLabel:e(`contentArea.editableMarkdown`,`editable markdown`),spellCheck:a})),placeholder:I.createElement(`div`,{className:(0,hO.default)(J.contentEditable,J.placeholder,i)},I.createElement(`p`,null,l)),ErrorBoundary:uE}))),o.map((e,t)=>I.createElement(e,{key:t})),u.map((e,t)=>I.createElement(e,{key:t})))},vO={listItemIndent:`one`},yO=e=>oO[e];function bO(e,t,n={}){let r=t;for(let[e,t]of Object.entries(n))r=r.replaceAll(`{{${e}}}`,String(t));return r}var xO=({wrappers:e,children:t})=>{if(e.length===0)return I.createElement(I.Fragment,null,t);let n=e[0];return I.createElement(n,null,I.createElement(xO,{wrappers:e.slice(1)},t))},SO=({children:e,className:t,overlayContainer:n})=>{let r=I.useRef(null),i=I.useRef(null),a=jr(eD),o=jr(tD);return I.useEffect(()=>{let e=document.createElement(`div`);return e.classList.add(`mdxeditor-popup-container`,J.editorRoot,J.popupContainer,...(t??``).trim().split(` `).filter(Boolean)),(n??document.body).appendChild(e),r.current=e,a(r),o(i),()=>{e.remove()}},[t,r,n,a,o]),I.createElement(`div`,{className:(0,hO.default)(`mdxeditor`,J.editorRoot,J.editorWrapper,t),ref:i},e)};function CO(e){return{getMarkdown:()=>{let t=e.getValue(BD);return t===`source`||t===`diff`?e.getValue(VD):e.getValue(LE)},setMarkdown:t=>{e.pub(uD,t)},insertMarkdown:t=>{e.pub(dD,t)},focus:(t,n)=>{var r;(r=e.getValue(CE))==null||r.focus(t,n)},getContentEditableHTML:()=>e.getValue(nD)?.current.innerHTML??``,getSelectionMarkdown:()=>{let t=e.getValue(BD);if(t===`source`||t===`diff`)return``;let n=e.getValue(wE);return n?mO(n,{visitors:e.getValue(GE),toMarkdownExtensions:e.getValue(KE),toMarkdownOptions:e.getValue(qE),jsxComponentDescriptors:e.getValue(YE),jsxIsAvailable:e.getValue(JE)}):``}}}var wO=({onReady:e,onDispose:t})=>{let n=Or(),r=I.useMemo(()=>CO(n),[n]);return I.useLayoutEffect(()=>(e(r),()=>{t(r)}),[r,t,e]),null},TO=I.forwardRef((e,t)=>{let n=I.useRef(null),r=I.useRef(null),i=I.useRef([]),a=I.useRef(e.trim===!1?e.markdown:e.markdown.trim()),o=I.useCallback(e=>{let t=n.current;t&&r.current===null?e(t):i.current.push(e)},[]),s=I.useMemo(()=>({getMarkdown:()=>n.current?.getMarkdown()??a.current,setMarkdown:e=>{a.current=e,o(t=>{t.setMarkdown(e)})},insertMarkdown:e=>{o(t=>{t.insertMarkdown(e)})},focus:(e,t)=>{o(n=>{n.focus(e,t)})},getContentEditableHTML:()=>n.current?.getContentEditableHTML()??``,getSelectionMarkdown:()=>n.current?.getSelectionMarkdown()??``}),[o]),c=I.useCallback(e=>{if(n.current=e,r.current===e)return;if(i.current.length===0){a.current=e.getMarkdown();return}r.current=e;let t=()=>{if(n.current!==e){r.current===e&&(r.current=null);return}let o=i.current.shift();if(!o){r.current=null,a.current=e.getMarkdown();return}o(e),queueMicrotask(t)};t()},[]),l=I.useCallback(e=>{n.current===e&&(a.current=e.getMarkdown(),n.current=null)},[]);return I.useImperativeHandle(t,()=>s,[s]),I.createElement(Br,{plugins:[KD({contentEditableClassName:e.contentEditableClassName??``,spellCheck:e.spellCheck??!0,initialMarkdown:e.markdown,onChange:e.onChange??_T,onBlur:e.onBlur??_T,toMarkdownOptions:e.toMarkdownOptions??vO,autoFocus:e.autoFocus??!1,placeholder:e.placeholder??``,readOnly:!!e.readOnly,iconComponentFor:e.iconComponentFor??yO,suppressHtmlProcessing:e.suppressHtmlProcessing??!1,onError:e.onError??_T,translation:e.translation??bO,trim:e.trim??!0,lexicalTheme:e.lexicalTheme,...`editorState`in e?{editorState:e.editorState}:{},suppressSharedHistory:e.suppressSharedHistory??!1,additionalLexicalNodes:e.additionalLexicalNodes??[],lexicalEditorNamespace:e.lexicalEditorNamespace??`MDXEditor`}),...e.plugins??[]]},I.createElement(SO,{className:e.className,overlayContainer:e.overlayContainer},I.createElement(gO,null,I.createElement(_O,null))),I.createElement(wO,{onReady:c,onDispose:l}))}),EO=typeof window<`u`&&window.document.createElement!==void 0&&(()=>{let e=navigator.userAgentData?.platform;return e?/mac/i.test(e):/Mac|iPod|iPhone|iPad/.test(navigator.userAgent)})();function DO(e,t){return EO?e:t}var OO={testLexicalNode:P_,visitLexicalNode:({lexicalNode:e,actions:t})=>{let n=parseInt(e.getTag()[1],10);t.addAndStepInto(`heading`,{depth:n})}},kO={testNode:`heading`,visitNode:function({mdastNode:e,actions:t}){t.addAndStepInto(N_(`h${e.depth}`))}},AO=[`Digit0`,`Digit1`,`Digit2`,`Digit3`,`Digit4`,`Digit5`,`Digit6`],jO=[1,2,3,4,5,6],MO={Digit1:1,Digit2:2,Digit3:3,Digit4:4,Digit5:5,Digit6:6},NO=R(jO,e=>{e.pub(xD,t=>t.registerCommand(Eo,n=>{let{code:r,ctrlKey:i,metaKey:a,altKey:o}=n;return AO.includes(r)&&DO(a,i)&&o?(n.preventDefault(),t.update(()=>{if(r===`Digit0`)e.pub(RD,()=>lu());else{let t=e.getValue(NO),n=MO[r];t.includes(n)&&e.pub(RD,()=>N_(`h${n}`))}}),!0):!1},1))}),PO=zr({init(e,t){e.pubIn({[UD]:`headings`,[iD]:kO,[rD]:k_,[sD]:OO}),e.pub(NO,t?.allowedHeadingLevels??jO)},update(e,t){e.pub(NO,t?.allowedHeadingLevels??jO)}});function FO(e,t){return e.read(`latest`,()=>{let e=Hu(t);return e!==null&&e.isSelected()})}function IO(e){let[t]=ZT(),[n,r]=(0,I.useState)(()=>FO(t,e));return(0,I.useEffect)(()=>{let n=!0,i=t.registerUpdateListener(()=>{n&&r(FO(t,e))});return()=>{n=!1,i()}},[t,e]),[n,(0,I.useCallback)(n=>{t.update(()=>{let t=U();Cc(t)||(t=Kc(),Xu(t)),Cc(t)&&(n?t.add(e):t.delete(e))})},[t,e]),(0,I.useCallback)(()=>{t.update(()=>{let e=U();Cc(e)&&e.clear()})},[t])]}function LO({nodeKey:e}){let[t]=ZT(),[n,r,i]=IO(e);return(0,I.useEffect)(()=>am(t.registerCommand(co,a=>{let o=t.getElementByKey(e);return Qd(a)===o&&(a.shiftKey||i(),r(!n),!0)},1)),[i,t,n,e,r]),(0,I.useEffect)(()=>{let r=t.getElementByKey(e),i=t._config.theme.hrSelected??`selected`;r!==null&&(n?rm(r,i):im(r,i))},[t,n,e]),null}var RO=class e extends Lh{static getType(){return`horizontalrule`}static clone(t){return new e(t.__key)}static importJSON(e){return BO().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:zO,priority:0})}}decorate(){return(0,L.jsx)(LO,{nodeKey:this.__key})}};function zO(){return{node:BO()}}function BO(){return jd(new RO)}function VO(){let[e]=ZT();return(0,I.useEffect)(()=>e.registerCommand(Ih,e=>{let t=U();return H(t)?(t.focus.getNode()!==null&&Tm(BO()),!0):!1},0),[e]),null}var HO={testLexicalNode:e=>e instanceof RO,visitLexicalNode({actions:e}){e.addAndStepInto(`thematicBreak`)}},UO={testNode:`thematicBreak`,visitNode({actions:e}){e.addAndStepInto(BO())}},WO=Er(e=>{e.sub(e.pipe(WO,Nr(wE)),([,e])=>{e?.dispatchCommand(Ih,void 0)})}),GO=zr({init(e){e.pubIn({[UD]:`thematicBreak`,[iD]:UO,[rD]:RO,[sD]:HO,[TD]:VO})}});function KO(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function qO(e){let t=1,n=e.getParent();for(;n!=null;){if(Y(n)){let e=n.getParent();if(X(e)){t++,n=e.getParent();continue}KO(40)}return t}return t}function JO(e){let t=e.getParent();X(t)||KO(40);let n=t,r=t;for(;r!==null;)r=r.getParent(),X(r)&&(n=r);return n}function YO(e){let t=[],n=e.getChildren().filter(Y);for(let e=0;e<n.length;e++){let r=n[e],i=r.getFirstChild();X(i)?t=t.concat(YO(i)):t.push(r)}return t}function XO(e){return Y(e)&&X(e.getFirstChild())}function ZO(e,t){return Y(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function QO(e){let t=U();if(t!==null){let n=t.getNodes();if(H(t)){let[r]=t.getStartEndPoints(),i=r.getNode(),a=i.getParent();if(kd(i)){let e=i.getFirstChild();if(e)n=e.selectStart().getNodes();else{let e=lu();i.append(e),n=e.select().getNodes()}}else if(ZO(i,n)){let t=gk(e);if(kd(a)){i.replace(t);let e=dk();W(i)&&(e.setFormat(i.getFormatType()),e.setIndent(i.getIndent())),t.append(e)}else if(Y(i)){let e=i.getParentOrThrow();$O(t,e.getChildren()),e.replace(t)}return}}let r=new Set;for(let t=0;t<n.length;t++){let i=n[t];if(W(i)&&i.isEmpty()&&!Y(i)&&!r.has(i.getKey())){ek(i,e);continue}let a=Iu(i)?i.getParent():Y(i)&&i.isEmpty()?i:null;for(;a!=null;){let t=a.getKey();if(X(a)){if(!r.has(t)){let n=gk(e);$O(n,a.getChildren()),a.replace(n),r.add(t)}break}{let n=a.getParent();if(kd(n)&&!r.has(t)){r.add(t),ek(a,e);break}a=n}}}}}function $O(e,t){e.splice(e.getChildrenSize(),0,t)}function ek(e,t){if(X(e))return e;let n=e.getPreviousSibling(),r=e.getNextSibling(),i=dk(),a;if($O(i,e.getChildren()),X(n)&&t===n.getListType())n.append(i),X(r)&&t===r.getListType()&&($O(n,r.getChildren()),r.remove()),a=n;else if(X(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),a=r;else{let n=gk(t);n.append(i),e.replace(n),a=n}i.setFormat(e.getFormatType()),i.setIndent(e.getIndent());let o=U();return H(o)&&(a.getKey()===o.anchor.key&&o.anchor.set(i.getKey(),o.anchor.offset,`element`),a.getKey()===o.focus.key&&o.focus.set(i.getKey(),o.focus.offset,`element`)),e.remove(),a}function tk(e,t){let n=e.getLastChild(),r=t.getFirstChild();n&&r&&XO(n)&&XO(r)&&(tk(n.getFirstChild(),r.getFirstChild()),r.remove());let i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function nk(){let e=U();if(H(e)){let t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(ZO(r,n))t.add(JO(r));else for(let e=0;e<n.length;e++){let r=n[e];if(Iu(r)){let e=Cm(r,sk);e!=null&&t.add(JO(e))}}for(let n of t){let t=n,r=YO(n);for(let n of r){let r=lu().setTextStyle(e.style).setTextFormat(e.format);$O(r,n.getChildren()),t.insertAfter(r),t=r,n.__key===e.anchor.key&&Pp(e.anchor,Hp(yp(r,`next`))),n.__key===e.focus.key&&Pp(e.focus,Hp(yp(r,`next`))),n.remove()}n.remove()}}}function rk(e){let t=e.getListType()!==`check`,n=e.getStart();for(let r of e.getChildren())Y(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),X(r.getFirstChild())||n++)}function ik(e){let t=new Set;if(XO(e)||t.has(e.getKey()))return;let n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(XO(r)&&XO(i)){let n=i.getFirstChild();if(X(n)){n.append(e);let i=r.getFirstChild();X(i)&&($O(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(XO(r)){let t=r.getFirstChild();if(X(t)){let n=t.getFirstChild();n!==null&&n.insertBefore(e)}}else if(XO(i)){let t=i.getFirstChild();X(t)&&t.append(e)}else if(X(n)){let t=Ad(e),a=Ad(n);t.append(a),a.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function ak(e){if(XO(e))return;let t=e.getParent(),n=t?t.getParent():void 0;if(X(n?n.getParent():void 0)&&Y(n)&&X(t)){let r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{let r=Ad(e),i=Ad(t);r.append(i),e.getPreviousSiblings().forEach(e=>i.append(e));let a=Ad(e),o=Ad(t);a.append(o),$O(o,e.getNextSiblings()),n.insertBefore(r),n.insertAfter(a),n.replace(e)}}}function ok(e=!1){let t=U();if(!H(t)||!t.isCollapsed())return!1;let n=t.anchor.getNode(),r=null;if(Y(n)&&n.getChildrenSize()===0)r=n;else if(V(n)){let e=n.getParent();Y(e)&&e.getChildren().every(e=>V(e)&&e.getTextContent().trim()===``)&&(r=e)}if(r===null)return!1;let i=JO(r),a=r.getParent();X(a)||KO(40);let o=a.getParent(),s;if(kd(o))s=lu(),i.insertAfter(s);else{if(!Y(o))return!1;s=Ad(o),o.insertAfter(s)}s.setTextStyle(t.style).setTextFormat(t.format).select();let c=r.getNextSiblings();if(c.length>0){let t=e?function(e,t){return e.getStart()+t.getIndexWithinParent()}(a,r):1,n=Ad(a).setStart(t);if(Y(s)){let e=Ad(s);e.append(n),s.insertAfter(e)}else s.insertAfter(n);n.append(...c)}return function(e){let t=e;for(;t.getNextSibling()==null&&t.getPreviousSibling()==null;){let e=t.getParent();if(e==null||!Y(e)&&!X(e))break;t=e}t.remove()}(r),!0}var sk=class extends Hl{__value;__checked;$config(){return this.config(`listitem`,{$transform:e=>{let t=e.getParent();if(X(t))t.getListType()!==`check`&&e.getChecked()!=null&&e.setChecked(void 0);else if(t){let n=e.createParentElementNode();X(n)||KO(340);let r=[e];for(let t of[`previous`,`next`]){r.reverse();for(let{origin:n}of hp(e,t)){if(!Y(n))break;r.push(n)}}e.insertBefore(n),n.splice(0,0,r),kd(t)||(Xp(n,Rp(hp(n,`next`)),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),t.isEmpty()&&t.isAttached()&&t.remove())}},extends:Hl,importDOM:Ps({li:()=>({conversion:ck,priority:0})})})}constructor(e=1,t=void 0,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){let t=Ud().createElement(`li`);return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){(function(e,t){let n=t.getParent();!X(n)||n.getListType()!==`check`||X(t.getFirstChild())?(e.removeAttribute(`role`),e.removeAttribute(`tabIndex`),e.removeAttribute(`aria-checked`)):(e.setAttribute(`role`,`checkbox`),e.setAttribute(`tabIndex`,`-1`),e.setAttribute(`aria-checked`,t.getChecked()?`true`:`false`))})(t,this),t.value=this.__value,function(e,t,n){let r=t.list;if(!r)return;let i=r.listitem,a=r.nested&&r.nested.listitem,o=n.getParent(),s=X(o)&&o.getListType()===`check`,c=n.getChecked(),l=n.getChildren().some(e=>X(e)),u=[];r.listitemChecked!==void 0&&u.push(r.listitemChecked),r.listitemUnchecked!==void 0&&u.push(r.listitemUnchecked),a!==void 0&&u.push(...nm(a)),u.length>0&&im(e,...u);let d=[];if(i!==void 0&&d.push(...nm(i)),s){let e=c?r.listitemChecked:r.listitemUnchecked;e!==void 0&&d.push(e)}a!==void 0&&l&&d.push(...nm(a)),d.length>0&&rm(e,...d)}(t,n.theme,this);let r=e?e.__style:``,i=this.__style;r!==i&&Js(t.style,i,r),function(e,t,n){let r=t.__textStyle,i=n?n.__textStyle:``;if(n!==null&&i===r)return;let a=Ks(r);for(let t in a)e.style.setProperty(`--listitem-marker-${t}`,a[t]);if(i!==``)for(let t in Ks(i))t in a||e.style.removeProperty(`--listitem-marker-${t}`)}(t,this,e)}updateDOM(e,t,n){let r=t;return this.updateListItemDOM(e,r,n),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){let t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);let r=this.getDirection();return r&&(t.dir=r),XO(this)?{after(e){if(K(e)){let t=e.previousElementSibling;if(K(t)&&t.nodeName===`LI`){for(;e.firstChild;)t.append(e.firstChild);e.remove()}}return e},element:t}:{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){let n=e[t];if(W(n)&&this.canMergeWith(n)){let e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(Y(e))return super.replace(e);this.setIndent(0);let n=this.getParentOrThrow();if(!X(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{let t=Ad(n),r=this.getNextSibling();for(;r;){let e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}let r=this.__key,i=0;if(t&&(W(e)||KO(139),i=e.getChildrenSize(),e.splice(i,0,this.getChildren())),t&&W(e)){let t=U();if(H(t))for(let n of t.getStartEndPoints())n.key===r&&n.type===`element`&&n.set(e.getKey(),i+n.offset,`element`)}return this.remove(),n.getChildrenSize()===0&&n.remove(),e}insertAfter(e,t=!0){let n=this.getParentOrThrow();if(X(n)||KO(39),Y(e))return super.insertAfter(e,t);let r=this.getNextSiblings();if(n.insertAfter(e,t),r.length!==0){let i=Ad(n);r.forEach(e=>i.append(e)),e.insertAfter(i,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&XO(t)&&XO(n)&&(tk(t.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,t=!0){let n=Ad(this);return this.insertAfter(n,t),n}collapseAtStart(e){if(XO(this))return!1;let t=this.getParentOrThrow();if(Y(t.getParentOrThrow()))return ak(this),!0;let n=lu().append(...this.getChildren()),r=this.getNextSiblings();if(r.length>0){let e=Ad(t);e.append(...r),t.insertAfter(e)}return t.insertAfter(n),this.remove(),t.getChildrenSize()===0&&t.remove(),n.selectStart(),!0}getValue(){return this.getLatest().__value}setValue(e){let t=this.getWritable();return t.__value=e,t}getChecked(){let e=this.getLatest(),t,n=this.getParent();return X(n)&&(t=n.getListType()),t===`check`?!!e.__checked:void 0}setChecked(e){let t=this.getWritable();return t.__checked=e,t}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;Y(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!=`number`&&KO(117),(e=Math.floor(e))>=0||KO(199);let t=this.getIndent();for(;t!==e;)t<e?(ik(this),t++):(ak(this),t--);return this}canInsertAfter(e){return Y(e)}canReplaceWith(e){return Y(e)}canMergeWith(e){return Y(e)||uu(e)}extractWithChild(e,t){if(!H(t))return!1;let n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return gk(`bullet`)}canMergeWhenEmpty(){return!0}};function ck(e){if(e.classList.contains(`task-list-item`)){for(let t of e.children)if(t.tagName===`INPUT`)return lk(t)}if(e.classList.contains(`joplin-checkbox`)){for(let t of e.children)if(t.classList.contains(`checkbox-wrapper`)&&t.children.length>0&&t.children[0].tagName===`INPUT`)return lk(t.children[0])}let t=e.getAttribute(`aria-checked`),n=dk(t===`true`||t!==`false`&&void 0);return bf(n,e),{after:uk.bind(null,n),node:yf(n,e)}}function lk(e){if(e.getAttribute(`type`)!==`checkbox`)return{node:null};let t=dk(e.hasAttribute(`checked`));return{after:uk.bind(null,t),node:t}}function uk(e,t){let n=t[0];return t.length===1&&uu(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function dk(e){return jd(new sk(void 0,e))}function Y(e){return e instanceof sk}var fk=class extends Hl{__tag;__start;__listType;$config(){return this.config(`list`,{$transform:e=>{(function(e){let t=e.getNextSibling();X(t)&&e.getListType()===t.getListType()&&tk(e,t)})(e),rk(e)},extends:Hl,importDOM:Ps({ol:()=>({conversion:mk,priority:0}),ul:()=>({conversion:mk,priority:0})})})}constructor(e=`number`,t=1,n){super(n);let r=hk[e]||e;this.__listType=r,this.__tag=r===`number`?`ol`:`ul`,this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){let t=this.getWritable();return t.__listType=e,t.__tag=e===`number`?`ol`:`ul`,t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let t=this.getWritable();return t.__start=e,t}createDOM(e,t){let n=this.__tag,r=Ud().createElement(n);return this.__start!==1&&r.setAttribute(`start`,String(this.__start)),r.__lexicalListType=this.__listType,pk(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(pk(t,n.theme,this),e.__start!==this.__start&&t.setAttribute(`start`,String(this.__start)),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){let t=this.createDOM(e._config,e);return K(t)&&(this.__start!==1&&t.setAttribute(`start`,String(this.__start)),this.__listType===`check`&&t.setAttribute(`__lexicalListType`,`check`)),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,n){let r=n;for(let e=0;e<n.length;e++){let t=n[e];Y(t)||(r===n&&(r=[...n]),r[e]=this.createListItemNode().append(!W(t)||X(t)||t.isInline()?t:dc(t.getTextContent())))}return super.splice(e,t,r)}extractWithChild(e){return Y(e)}createListItemNode(){return dk()}};function pk(e,t,n){let r=[],i=[],a=t.list;if(a!==void 0){let e=a[`${n.__tag}Depth`]||[],t=qO(n)-1,o=t%e.length,s=e[o],c=a[n.__tag],l,u=a.nested,d=a.checklist;if(u!==void 0&&u.list&&(l=u.list),c!==void 0&&r.push(c),d!==void 0&&n.__listType===`check`&&r.push(d),s!==void 0){r.push(...nm(s));for(let t=0;t<e.length;t++)t!==o&&i.push(n.__tag+t)}if(l!==void 0){let e=nm(l);t>1?r.push(...e):i.push(...e)}}i.length>0&&im(e,...i),r.length>0&&rm(e,...r)}function mk(e){let t;if(function(e){return K(e)&&e.nodeName.toLowerCase()===`ol`}(e)){let n=e.start;t=gk(`number`,n)}else t=function(e){if(e.getAttribute(`__lexicallisttype`)===`check`||e.classList.contains(`contains-task-list`)||e.getAttribute(`data-is-checklist`)===`1`)return!0;for(let t of e.childNodes)if(K(t)&&t.hasAttribute(`aria-checked`))return!0;return!1}(e)?gk(`check`):gk(`bullet`);return yf(t,e),{after:e=>function(e,t){let n=t.createListItemNode.bind(t),r=[];for(let t=0;t<e.length;t++){let i=e[t];if(Y(i)){r.push(i);let e=i.getChildren();e.length>1&&e.forEach(e=>{X(e)&&r.push(n().append(e))})}else r.push(n().append(i))}return r}(e,t),node:t}}var hk={ol:`number`,ul:`bullet`};function gk(e=`number`,t=1){return jd(new fk(e,t))}function X(e){return e instanceof fk}var _k=B(`INSERT_CHECK_LIST_COMMAND`);function vk(e,t){let n=t&&t.disableTakeFocusOnClick||!1,r=typeof n==`boolean`?()=>n:n.peek.bind(n),i=e=>{let t=e.target;if(!K(t))return!1;let n=t.__lexicalCheckListLastHandled;return n!==void 0&&e.timeStamp-n<500},a=e=>{let t=e.target;K(t)&&(t.__lexicalCheckListLastHandled=e.timeStamp)},o=e=>{i(e)||(a(e),bk(e,r()))},s=e=>{e.pointerType===`touch`&&(i(e)||(a(e),bk(e,r())))},c=e=>{(function(e,t){yk(e,()=>{e.preventDefault(),t&&e.stopPropagation()})})(e,r())};return am(e.registerCommand(_k,()=>(QO(`check`),!0),1),e.registerCommand(Mo,t=>Sk(t,e,!1),1),e.registerCommand(jo,t=>Sk(t,e,!0),1),e.registerCommand(Io,()=>xk(e)!=null&&(e.getRootElement()?.focus(),!0),1),e.registerCommand(Po,t=>{let n=xk(e);return!(n==null||!e.isEditable())&&(e.update(()=>{let e=Ku(n);Y(e)&&(t.preventDefault(),e.toggleChecked())}),!0)},1),e.registerCommand(ko,t=>e.read(`latest`,()=>{let n=U();if(H(n)&&n.isCollapsed()){let{anchor:r}=n,i=r.type===`element`;if(i||r.offset===0){let n=r.getNode(),a=Af(n,e=>W(e)&&!e.isInline());if(Y(a)){let r=a.getParent();if(X(r)&&r.getListType()===`check`&&(i||a.getFirstDescendant()===n)){let n=e.getElementByKey(a.__key);if(n!=null&&Xd(n)!==n)return n.focus(),t.preventDefault(),!0}}}}return!1}),1),e.registerRootListener(e=>{if(e!==null)return am(om(e,{click:o,pointerup:s}),om(e,{mousedown:c,pointerdown:c},{capture:!0}),is(e,`touchstart`,c,{capture:!0,passive:!1}))}))}function yk(e,t){let n=e.target;if(!K(n))return;let r=n.firstChild;if(K(r)&&(r.tagName===`UL`||r.tagName===`OL`))return;let i=n.parentNode;if(!i||i.__lexicalListType!==`check`)return;let a=null,o=null;if(`clientX`in e)a=e.clientX;else if(`touches`in e){let t=e.touches;t.length>0&&(a=t[0].clientX,o=`touch`)}if(a==null)return;let s=n.getBoundingClientRect(),c=a/jm(n),l=n.ownerDocument.defaultView,u=l?l.getComputedStyle(n,`::before`):{width:`0px`},d=parseFloat(u.width),f=o===`touch`||`pointerType`in e&&e.pointerType===`touch`?32:0;(n.dir===`rtl`?c<s.right+f&&c>s.right-d-f:c>s.left-f&&c<s.left+d+f)&&t()}function bk(e,t){yk(e,()=>{if(K(e.target)){let n=e.target,r=Ou(n);r!=null&&r.isEditable()&&r.update(()=>{let e=Ku(n);Y(e)&&(t?(xd(`skip-selection-focus`),xd(`skip-dom-selection`)):n.focus(),e.toggleChecked())})}})}function xk(e){let t=e.getRootElement(),n=t?Xd(t):null;return K(n)&&n.tagName===`LI`&&n.parentNode!=null&&n.parentNode.__lexicalListType===`check`?n:null}function Sk(e,t,n){let r=xk(t);return r!=null&&t.update(()=>{let i=Ku(r);if(!Y(i))return;let a=function(e,t){let n=t?e.getPreviousSibling():e.getNextSibling(),r=e;for(;n==null&&Y(r);)r=r.getParentOrThrow().getParent(),r!=null&&(n=t?r.getPreviousSibling():r.getNextSibling());for(;Y(n);){let e=t?n.getLastChild():n.getFirstChild();if(!X(e))return n;n=t?e.getLastChild():e.getFirstChild()}return null}(i,n);if(a!=null){a.selectStart();let n=t.getElementByKey(a.__key);n!=null&&(e.preventDefault(),setTimeout(()=>{n.focus()},0))}}),!1}Mg.tag(`ol`,`ul`),Mg.tag(`li`),Mg.tag(`li`).classAll(`task-list-item`),Mg.tag(`li`).classAll(`joplin-checkbox`);var Ck=B(`UPDATE_LIST_START_COMMAND`),wk=B(`INSERT_UNORDERED_LIST_COMMAND`),Tk=B(`INSERT_ORDERED_LIST_COMMAND`),Ek=B(`REMOVE_LIST_COMMAND`);function Dk(e,t){return am(e.registerCommand(Tk,()=>(QO(`number`),!0),1),e.registerCommand(Ck,e=>{let{listNodeKey:t,newStart:n}=e,r=Hu(t);return!!X(r)&&(r.getListType()===`number`&&(r.setStart(n),rk(r)),!0)},1),e.registerCommand(wk,()=>(QO(`bullet`),!0),1),e.registerCommand(Ek,()=>(nk(),!0),1),e.registerCommand(go,()=>ok(!!(t&&t.restoreNumbering)),1),e.registerCommand(Fo,e=>{if(function(){let e=U();if(!H(e)||!e.isCollapsed()||e.anchor.offset!==0)return!1;let t=e.anchor.getNode(),n=Af(t,Y);if(!Y(n))return!1;let r=n.getFirstDescendant();if(r===null||!n.is(t)&&!r.is(t))return!1;let i=n.getParent();if(!X(i)||!n.is(i.getFirstChild()))return!1;let a=i.getPreviousSibling();if(!Gl(a)||a.isIsolated()||!a.isKeyboardSelectable()&&a.isInline())return!1;let o=lu().append(...n.getChildren());return i.insertBefore(o),n.remove(),i.isEmpty()&&i.remove(),o.selectStart(),!0}())return e.preventDefault(),!0;let t=U();if(!H(t)||!t.isCollapsed())return!1;let{anchor:n}=t;if(n.offset!==0)return!1;let r=n.getNode();for(;!Y(r);){if(r.getPreviousSibling()!==null)return!1;let e=r.getParent();if(e===null)return!1;r=e}return!(!Y(r)||!r.collapseAtStart(t))&&(e.preventDefault(),!0)},-8),e.registerNodeTransform(sk,e=>{let t=e.getFirstChild();if(t){if(V(t)){let n=t.getStyle(),r=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{let t=U();H(t)&&(t.style!==e.getTextStyle()||t.format!==e.getTextFormat())&&t.isCollapsed()&&e.is(t.anchor.getNode())&&e.setTextStyle(t.style).setTextFormat(t.format)}}),e.registerNodeTransform(nc,e=>{let t=e.getParent();if(Y(t)&&e.is(t.getFirstChild())){let n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}}))}function Ok(e){let t=e=>{let t=e.getParent();if(X(e.getFirstChild())||!X(t))return;let n=Af(e,e=>Y(e)&&X(e.getParent())&&Y(e.getPreviousSibling()));if(n===null&&e.getIndent()>0)e.setIndent(0);else if(Y(n)){let r=n.getPreviousSibling();if(Y(r)){let n=function(e){let t=e,n=t.getFirstChild();for(;X(n);){let e=n.getLastChild();if(!Y(e))break;t=e,n=t.getFirstChild()}return t}(r).getParent();if(X(n)){let r=qO(n);r+1<qO(t)&&e.setIndent(r)}}}};return e.registerNodeTransform(fk,e=>{let n=[e];for(;n.length>0;){let e=n.shift();if(X(e)){for(let r of e.getChildren())if(Y(r)){t(r);let e=r.getFirstChild();X(e)&&n.push(e)}}}})}var kk={testNode:`list`,visitNode:function({mdastNode:e,lexicalParent:t,actions:n}){let r=gk(e.children.some(e=>typeof e.checked==`boolean`)?`check`:e.ordered?`number`:`bullet`);if(Y(t)){let e=dk();e.append(r),t.insertAfter(e)}else t.append(r);n.visitChildren(e,r)}},Ak={testNode:`listItem`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){let r=n.getListType()===`check`?e.checked??!1:void 0;t.addAndStepInto(dk(r))}},jk={testLexicalNode:X,visitLexicalNode:({lexicalNode:e,actions:t})=>{t.addAndStepInto(`list`,{ordered:e.getListType()===`number`,spread:!1})}},Mk={testLexicalNode:Y,visitLexicalNode:({lexicalNode:e,mdastParent:t,actions:n})=>{let r=e.getChildren(),i=r[0];if(r.length===1&&X(i)){let r=t.children.at(-1);r?n.visitChildren(e,r):n.visitChildren(i,t)}else{let r=e.getParent(),i=n.appendToParent(t,{type:`listItem`,checked:r.getListType()===`check`?!!e.getChecked():void 0,spread:!1,children:[]}),a=null;for(let t of e.getChildren())V(t)||ru(t)||t.isInline()&&(W(t)||Gl(t))?(a??=n.appendToParent(i,{type:`paragraph`,children:[]}),n.visit(t,a)):(a=null,n.visit(t,i))}}};function Nk({maxIndent:e,$canIndent:t}){let[n]=ZT();return(0,I.useEffect)(()=>Uh(n,e,t),[n,e,t]),null}function Pk({disableTakeFocusOnClick:e=!1}){let[t]=ZT();return(0,I.useEffect)(()=>vk(t,{disableTakeFocusOnClick:e}),[t,e]),null}function Fk({hasStrictIndent:e=!1,shouldPreserveNumbering:t=!1}){let[n]=ZT();return(0,I.useEffect)(()=>{if(!n.hasNodes([fk,sk]))throw Error(`ListPlugin: ListNode and/or ListItemNode not registered on editor`)},[n]),(0,I.useEffect)(()=>am(Dk(n,{restoreNumbering:t}),e?Ok(n):()=>{}),[n,e,t]),function(e){(0,I.useEffect)(()=>Dk(e),[e])}(n),null}var Ik={name:`tasklistCheck`,tokenize:Rk};function Lk(){return{text:{91:Ik}}}function Rk(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return nv(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return q(r)?t(r):rv(r)?e.check({tokenize:zk},t,n)(r):n(r)}}function zk(e,t,n){return Yy(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Bk(){return{exit:{taskListCheckValueChecked:Hk,taskListCheckValueUnchecked:Hk,paragraph:Uk}}}function Vk(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Wk}}}function Hk(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Uk(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Wk(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=Wx.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}var Gk=new Map([[`number`,Tk],[`bullet`,wk],[`check`,_k],[``,Ek]]),Kk=R(``,e=>{e.sub(e.pipe(FE,Nr(wE)),([t,n])=>{if(!t||!n)return;let r=t.anchor.getNode(),i=r.getKey()===`root`?r:Af(r,e=>{let t=e.getParent();return t!==null&&kd(t)});i??=r.getTopLevelElementOrThrow();let a=i.getKey();if(n.getElementByKey(a)!==null){if(X(i)){let t=Cm(r,fk),n=t?t.getListType():i.getListType();e.pub(Kk,n)}else e.pub(Kk,``)}})}),qk=Tr(e=>{e.sub(e.pipe(qk,Nr(wE)),([e,t])=>{t?.dispatchCommand(Gk.get(e),void 0)})}),Jk=zr({init(e){var t;(t=e.getValue(CE))==null||t.registerCommand(Bo,()=>!Xk(7),4),e.pubIn({[UD]:`lists`,[oD]:Bk(),[aD]:Lk(),[iD]:[kk,Ak],[rD]:[sk,fk],[sD]:[jk,Mk],[cD]:Vk(),[TD]:[Nk,Fk,Pk],[MD]:[Nk,Fk,Pk]})}});function Yk(e){let t=e.getNodes();return t.length===0?new Set([e.anchor.getNode().getParentOrThrow(),e.focus.getNode().getParentOrThrow()]):new Set(t.map(e=>W(e)?e:e.getParentOrThrow()))}function Xk(e){let t=U();if(!H(t))return!1;let n=Yk(t),r=0;for(let e of n)if(X(e))r=Math.max(qO(e)+1,r);else if(Y(e)){let t=e.getParent();if(t?.getChildren().length===1){let e=t.getParent();if(Y(e)&&e.getChildren().length===1)return!1}if(!X(t))throw Error(`ListMaxIndentLevelPlugin: A ListItemNode must have a ListNode for a parent.`);r=Math.max(qO(t)+1,r)}return r<=e}function Zk(e){return e.length}function Qk(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Zk,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=$k(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=eA(r[d]);else{let e=eA(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
66
+ `)}function $k(e){return e==null?``:String(e)}function eA(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function tA(){return{enter:{table:nA,tableData:oA,tableHeader:oA,tableRow:iA},exit:{codeText:sA,table:rA,tableData:aA,tableHeader:aA,tableRow:aA}}}function nA(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function rA(e){this.exit(e),this.data.inTable=void 0}function iA(e){this.enter({type:`tableRow`,children:[]},e)}function aA(e){this.exit(e)}function oA(e){this.enter({type:`tableCell`,children:[]},e)}function sA(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,cA));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function cA(e,t){return t===`|`?t:e}function lA(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
67
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
68
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Qk(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=Wx.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}var uA=class{constructor(){this.map=[]}add(e,t,n){dA(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function dA(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function fA(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function pA(){return{flow:{null:{name:`table`,tokenize:mA,resolveAll:hA}}}}function mA(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):q(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):rv(t)?Yy(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||nv(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,rv(t)?Yy(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return rv(t)?Yy(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||q(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return rv(t)?Yy(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||q(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||q(n)?(e.exit(`tableRow`),t(n)):rv(n)?Yy(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||nv(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function hA(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new uA;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(_A(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=gA(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=gA(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=gA(f,t,o,i,n,d)):(o[0]=o[1],d=gA(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&_A(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=fA(t.events,n))}return e}function gA(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},vA(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=vA(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=vA(t.events,n[2]),a=vA(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},vA(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function _A(e,t,n,r,i){let a=[],o=vA(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function vA(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var yA=Object.defineProperty,bA=(e,t)=>yA(e,`name`,{value:t,configurable:!0}),xA=!!(typeof window<`u`&&window.document&&window.document.createElement);function SA(e,t,{checkForDefaultPrevented:n=!0}={}){return bA(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}bA(SA,`composeEventHandlers`);function CA(e){if(!xA)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}bA(CA,`getOwnerWindow`);function wA(e){if(!xA)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}bA(wA,`getOwnerDocument`);function TA(e,t=!1){let{activeElement:n}=wA(e);if(!n?.nodeName)return null;if(EA(n)&&n.contentDocument)return TA(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=wA(n).getElementById(e);if(t)return t}}return n}bA(TA,`getActiveElement`);function EA(e){return e.tagName===`IFRAME`}bA(EA,`isFrame`);var DA=Object.defineProperty,OA=(e,t)=>DA(e,`name`,{value:t,configurable:!0});function kA(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}OA(kA,`setRef`);function AA(...e){return t=>{let n=!1,r=e.map(e=>{let r=kA(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():kA(e[t],null)}}}}OA(AA,`composeRefs`);function jA(...e){return I.useCallback(AA(...e),e)}OA(jA,`useComposedRefs`);var MA=Object.defineProperty,NA=(e,t)=>MA(e,`name`,{value:t,configurable:!0});function PA(e,t){let n=I.createContext(t);n.displayName=e+`Context`;let r=NA(e=>{let{children:t,...r}=e,i=I.useMemo(()=>r,Object.values(r));return(0,L.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=I.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return NA(i,`useContext`),[r,i]}NA(PA,`createContext`);function FA(e,t=[]){let n=[];function r(t,r){let i=I.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=NA(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=I.useMemo(()=>o,Object.values(o));return(0,L.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=I.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return NA(s,`useContext`),[o,s]}NA(r,`createContext`);let i=NA(()=>{let t=n.map(e=>I.createContext(e));return NA(function(n){let r=n?.[e]||t;return I.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,IA(i,...t)]}NA(FA,`createContextScope`);function IA(...e){let t=e[0];if(e.length===1)return t;let n=NA(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return NA(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return I.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}NA(IA,`composeContextScopes`);var LA=Object.defineProperty,RA=(e,t)=>LA(e,`name`,{value:t,configurable:!0});function zA(e){let t=I.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];qA(r)&&typeof ZA==`function`&&(r=ZA(r._payload)),I.Children.forEach(r,e=>{if(GA(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;qA(n)&&typeof ZA==`function`&&(n=ZA(n._payload)),a=HA(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=I.cloneElement(a,void 0,s):!o&&I.Children.count(r)===1&&I.isValidElement(r)&&(a=r);let c=a?WA(a):void 0,l=jA(n,c);if(!a){if(r||r===0)throw Error(o?XA(e):YA(e));return r}let u=UA(i,a.props??{});return a.type!==I.Fragment&&(u.ref=n?l:c),I.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}RA(zA,`createSlot`);var BA=Symbol.for(`radix.slottable`);function VA(e){let t=RA(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=BA,t}RA(VA,`createSlottable`);var HA=RA((e,t)=>{if(`child`in e.props){let t=e.props.child;return I.isValidElement(t)?I.cloneElement(t,void 0,e.props.children(t.props.children)):null}return I.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function UA(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}RA(UA,`mergeProps`);function WA(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}RA(WA,`getElementRef`);function GA(e){return I.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===BA}RA(GA,`isSlottable`);var KA=Symbol.for(`react.lazy`);function qA(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===KA&&`_payload`in e&&JA(e._payload)}RA(qA,`isLazyComponent`);function JA(e){return typeof e==`object`&&!!e&&`then`in e}RA(JA,`isPromiseLike`);var YA=RA(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),XA=RA(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),ZA=I.use,QA=Object.defineProperty,$A=(e,t)=>QA(e,`name`,{value:t,configurable:!0}),ej=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=zA(`Primitive.${t}`),r=I.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,L.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function tj(e,t){e&&fE.flushSync(()=>e.dispatchEvent(t))}$A(tj,`dispatchDiscreteCustomEvent`);var nj=Object.defineProperty,rj=(e,t)=>nj(e,`name`,{value:t,configurable:!0});function ij(e){let t=I.useRef(e);return I.useEffect(()=>{t.current=e}),I.useMemo(()=>((...e)=>t.current?.(...e)),[])}rj(ij,`useCallbackRef`);var aj=Object.defineProperty,oj=(e,t)=>aj(e,`name`,{value:t,configurable:!0}),sj=`dismissableLayer.update`,cj=`dismissableLayer.pointerDownOutside`,lj=`dismissableLayer.focusOutside`,uj,dj=I.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),fj=I.forwardRef(oj(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=I.useContext(dj),[d,f]=I.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=I.useState({}),h=jA(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=I.useRef(!1),C=hj(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:I.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),w=gj(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),T=d?y===g.length-1:!1,E=ij(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return I.useEffect(()=>{if(T)return p.addEventListener(`keydown`,E,{capture:!0}),()=>p.removeEventListener(`keydown`,E,{capture:!0})},[p,T,E]),I.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(uj=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),_j(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=uj))}},[d,p,n,u]),I.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),_j())},[d,u]),I.useEffect(()=>{let e=oj(()=>m({}),`handleUpdate`);return document.addEventListener(sj,e),()=>document.removeEventListener(sj,e)},[]),(0,L.jsx)(ej.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:SA(e.onFocusCapture,w.onFocusCapture),onBlurCapture:SA(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:SA(e.onPointerDownCapture,C.onPointerDownCapture)})},`DismissableLayer`));function pj(){let e=I.useContext(dj),[t,n]=I.useState(null);return I.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}oj(pj,`useDismissableLayerSurface`);var mj=oj(()=>!0,`IS_TRUE`);function hj(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=mj}=t,s=ij(e),c=I.useRef(!1),l=I.useRef(!1),u=I.useRef(new Map),d=I.useRef(()=>{});return I.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}oj(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}oj(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}oj(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}oj(p,`handleInteractionBubble`);let m=oj(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||vj(cj,s,p,{discrete:!0})};if(oj(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:oj(()=>c.current=!0,`onPointerDownCapture`)}}oj(hj,`usePointerDownOutside`);function gj(e,t=globalThis?.document){let n=ij(e),r=I.useRef(!1);return I.useEffect(()=>{let e=oj(e=>{e.target&&!r.current&&vj(lj,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:oj(()=>r.current=!0,`onFocusCapture`),onBlurCapture:oj(()=>r.current=!1,`onBlurCapture`)}}oj(gj,`useFocusOutside`);function _j(){let e=new CustomEvent(sj);document.dispatchEvent(e)}oj(_j,`dispatchUpdate`);function vj(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?tj(i,a):i.dispatchEvent(a)}oj(vj,`handleAndDispatchCustomEvent`);var yj=Object.defineProperty,bj=(e,t)=>yj(e,`name`,{value:t,configurable:!0}),xj=0,Sj=null;function Cj(e){return wj(),e.children}bj(Cj,`FocusGuards`);function wj(){I.useEffect(()=>{Sj||={start:Tj(),end:Tj()};let{start:e,end:t}=Sj;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),xj++,()=>{xj===1&&(Sj?.start.remove(),Sj?.end.remove(),Sj=null),xj=Math.max(0,xj-1)}},[])}bj(wj,`useFocusGuards`);function Tj(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}bj(Tj,`createFocusGuard`);var Ej=Object.defineProperty,Dj=(e,t)=>Ej(e,`name`,{value:t,configurable:!0}),Oj=`focusScope.autoFocusOnMount`,kj=`focusScope.autoFocusOnUnmount`,Aj={bubbles:!1,cancelable:!0},jj=I.forwardRef(Dj(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=I.useState(null),l=ij(i),u=ij(a),d=I.useRef(null),f=jA(t,c),p=I.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;I.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Rj(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Rj(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Rj(s)};Dj(e,`handleFocusIn`),Dj(t,`handleFocusOut`),Dj(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),I.useEffect(()=>{if(s){zj.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Oj,Aj);s.addEventListener(Oj,l),s.dispatchEvent(t),t.defaultPrevented||(Mj(Hj(Pj(s)),{select:!0}),document.activeElement===e&&Rj(s))}return()=>{s.removeEventListener(Oj,l),setTimeout(()=>{let t=new CustomEvent(kj,Aj);s.addEventListener(kj,u),s.dispatchEvent(t),t.defaultPrevented||Rj(e??document.body,{select:!0}),s.removeEventListener(kj,u),zj.remove(p)},0)}}},[s,l,u,p]);let m=I.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Nj(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Rj(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Rj(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,L.jsx)(ej.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function Mj(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Rj(r,{select:t}),document.activeElement!==n)return}Dj(Mj,`focusFirst`);function Nj(e){let t=Pj(e);return[Fj(t,e),Fj(t.reverse(),e)]}Dj(Nj,`getTabbableEdges`);function Pj(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Dj(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Dj(Pj,`getTabbableCandidates`);function Fj(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Ij(r,{upTo:t})))return r}Dj(Fj,`findVisible`);function Ij(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Dj(Ij,`isHidden`);function Lj(e){return e instanceof HTMLInputElement&&`select`in e}Dj(Lj,`isSelectableInput`);function Rj(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Lj(e)&&t&&e.select()}}Dj(Rj,`focus`);var zj=Bj();function Bj(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Vj(e,t),e.unshift(t)},remove(t){e=Vj(e,t),e[0]?.resume()}}}Dj(Bj,`createFocusScopesStack`);function Vj(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Dj(Vj,`arrayRemove`);function Hj(e){return e.filter(e=>e.tagName!==`A`)}Dj(Hj,`removeLinks`);var Uj=globalThis?.document?I.useLayoutEffect:()=>{},Wj=Object.defineProperty,Gj=(e,t)=>Wj(e,`name`,{value:t,configurable:!0}),Kj=I.useId||(()=>void 0),qj=0;function Jj(e){let[t,n]=I.useState(Kj());return Uj(()=>{e||n(e=>e??String(qj++))},[e]),e||(t?`radix-${t}`:``)}Gj(Jj,`useId`);var Yj=[`top`,`right`,`bottom`,`left`],Xj=Math.min,Zj=Math.max,Qj=Math.round,$j=Math.floor,eM=e=>({x:e,y:e}),tM={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function nM(e,t,n){return Zj(e,Xj(t,n))}function rM(e,t){return typeof e==`function`?e(t):e}function iM(e){return e.split(`-`)[0]}function aM(e){return e.split(`-`)[1]}function oM(e){return e===`x`?`y`:`x`}function sM(e){return e===`y`?`height`:`width`}function cM(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function lM(e){return oM(cM(e))}function uM(e,t,n){n===void 0&&(n=!1);let r=aM(e),i=lM(e),a=sM(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=yM(o)),[o,yM(o)]}function dM(e){let t=yM(e);return[fM(e),t,fM(t)]}function fM(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var pM=[`left`,`right`],mM=[`right`,`left`],hM=[`top`,`bottom`],gM=[`bottom`,`top`];function _M(e,t,n){switch(e){case`top`:case`bottom`:return n?t?mM:pM:t?pM:mM;case`left`:case`right`:return t?hM:gM;default:return[]}}function vM(e,t,n,r){let i=aM(e),a=_M(iM(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(fM)))),a}function yM(e){let t=iM(e);return tM[t]+e.slice(t.length)}function bM(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function xM(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:bM(e)}function SM(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function CM(e,t,n){let{reference:r,floating:i}=e,a=cM(t),o=lM(t),s=sM(o),c=iM(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=aM(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function wM(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=rM(t,e),p=xM(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=SM(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=SM(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var TM=50,EM=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:wM},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=CM(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<TM&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=CM(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},DM=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=rM(e,t)||{};if(l==null)return{};let d=xM(u),f={x:n,y:r},p=lM(i),m=sM(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Xj(d[_],T),ee=Xj(d[v],T),D=C-h[m]-ee,O=C/2-h[m]/2+w,te=nM(E,O,D),ne=!c.arrow&&aM(i)!=null&&O!==te&&a.reference[m]/2-(O<E?E:ee)-h[m]/2<0,k=ne?O<E?O-E:O-D:0;return{[p]:f[p]+k,data:{[p]:te,centerOffset:O-te-k,...ne&&{alignmentOffset:k}},reset:ne}}}),OM=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=rM(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=iM(r),_=cM(o),v=iM(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[yM(o)]:dM(o)),x=p!==`none`;!d&&x&&b.push(...vM(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=uM(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===cM(t)||T.every(e=>cM(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=cM(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function kM(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function AM(e){return Yj.some(t=>e[t]>=0)}var jM=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=rM(e,t);switch(i){case`referenceHidden`:{let e=kM(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:AM(e)}}}case`escaped`:{let e=kM(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:AM(e)}}}default:return{}}}}},MM=new Set([`left`,`top`]);async function NM(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=iM(n),s=aM(n),c=cM(n)===`y`,l=MM.has(o)?-1:1,u=a&&c?-1:1,d=rM(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var PM=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await NM(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},FM=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=rM(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=cM(i),p=oM(f),m=u[p],h=u[f],g=(e,t)=>nM(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},IM=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=rM(e,t),u={x:n,y:r},d=cM(i),f=oM(d),p=u[f],m=u[d],h=rM(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=MM.has(iM(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},LM=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=rM(e,t),c=await i.detectOverflow(t,s),l=iM(n),u=aM(n),d=cM(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Xj(p-c[m],g),y=Xj(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Zj(c.left,c.right):S=p-2*Zj(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function RM(){return typeof window<`u`}function zM(e){return HM(e)?(e.nodeName||``).toLowerCase():`#document`}function BM(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function VM(e){return((HM(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function HM(e){return RM()?e instanceof Node||e instanceof BM(e).Node:!1}function UM(e){return RM()?e instanceof Element||e instanceof BM(e).Element:!1}function WM(e){return RM()?e instanceof HTMLElement||e instanceof BM(e).HTMLElement:!1}function GM(e){return!RM()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof BM(e).ShadowRoot}function KM(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=rN(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function qM(e){return/^(table|td|th)$/.test(zM(e))}function JM(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var YM=/transform|translate|scale|rotate|perspective|filter/,XM=/paint|layout|strict|content/,ZM=e=>!!e&&e!==`none`,QM;function $M(e){let t=UM(e)?rN(e):e;return ZM(t.transform)||ZM(t.translate)||ZM(t.scale)||ZM(t.rotate)||ZM(t.perspective)||!tN()&&(ZM(t.backdropFilter)||ZM(t.filter))||YM.test(t.willChange||``)||XM.test(t.contain||``)}function eN(e){let t=aN(e);for(;WM(t)&&!nN(t);){if($M(t))return t;if(JM(t))return null;t=aN(t)}return null}function tN(){return QM??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),QM}function nN(e){return/^(html|body|#document)$/.test(zM(e))}function rN(e){return BM(e).getComputedStyle(e)}function iN(e){return UM(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function aN(e){if(zM(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||GM(e)&&e.host||VM(e);return GM(t)?t.host:t}function oN(e){let t=aN(e);return nN(t)?(e.ownerDocument||e).body:WM(t)&&KM(t)?t:oN(t)}function sN(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=oN(e),i=r===e.ownerDocument?.body,a=BM(r);if(i){let e=cN(a);return t.concat(a,a.visualViewport||[],KM(r)?r:[],e&&n?sN(e):[])}return t.concat(r,sN(r,[],n))}function cN(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lN(e){let t=rN(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=WM(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Qj(n)!==a||Qj(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function uN(e){return UM(e)?e:e.contextElement}function dN(e){let t=uN(e);if(!WM(t))return eM(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=lN(t),o=(a?Qj(n.width):n.width)/r,s=(a?Qj(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var fN=eM(0);function pN(e){let t=BM(e);return!tN()||!t.visualViewport?fN:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function mN(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===BM(e)}function hN(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=uN(e),o=eM(1);t&&(r?UM(r)&&(o=dN(r)):o=dN(e));let s=mN(a,n,r)?pN(a):eM(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=BM(a),t=UM(r)?BM(r):r,n=e,i=cN(n);for(;i&&t!==n;){let e=dN(i),t=i.getBoundingClientRect(),r=rN(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=BM(i),i=cN(n)}}return SM({width:u,height:d,x:c,y:l})}function gN(e,t){let n=iN(e).scrollLeft;return t?t.left+n:hN(VM(e)).left+n}function _N(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-gN(e,n),y:n.top+t.scrollTop}}function vN(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=VM(r),s=t?JM(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=eM(1),u=eM(0),d=WM(r);if((d||!a)&&((zM(r)!==`body`||KM(o))&&(c=iN(r)),d)){let e=hN(r);l=dN(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?_N(o,c):eM(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function yN(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function bN(e){let t=iN(e),n=e.ownerDocument.body,r=Zj(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Zj(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+gN(e),o=-t.scrollTop;return rN(n).direction===`rtl`&&(a+=Zj(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var xN=25;function SN(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=BM(e),a=VM(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!tN()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(gN(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=xN&&(s-=o)}return{width:s,height:c,x:l,y:u}}function CN(e,t){let n=hN(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=dN(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function wN(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=SN(e,n,t);else if(t===`document`)r=bN(VM(e));else if(UM(t))r=CN(t,n);else{let n=pN(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return SM(r)}function TN(e,t){let n=t.get(e);if(n)return n;let r=sN(e,[],!1).filter(e=>UM(e)&&zM(e)!==`body`),i=null,a=rN(e).position===`fixed`,o=a?aN(e):e;for(;UM(o)&&!nN(o);){let e=rN(o),t=$M(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=aN(o)}return t.set(e,r),r}function EN(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?JM(t)?[]:TN(t,this._c):[].concat(n),r],o=wN(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=wN(t,a[e],i);s=Zj(n.top,s),c=Xj(n.right,c),l=Xj(n.bottom,l),u=Zj(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function DN(e){let{width:t,height:n}=lN(e);return{width:t,height:n}}function ON(e,t,n){let r=WM(t),i=VM(t),a=n===`fixed`,o=hN(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=eM(0);if((r||!a)&&((zM(t)!==`body`||KM(i))&&(s=iN(t)),r)){let e=hN(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=gN(i));let l=i&&!r&&!a?_N(i,s):eM(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function kN(e){return rN(e).position===`static`}function AN(e,t){if(!WM(e)||rN(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return VM(e)===n&&(n=n.ownerDocument.body),n}function jN(e,t){let n=BM(e);if(JM(e))return n;if(!WM(e)){let t=aN(e);for(;t&&!nN(t);){if(UM(t)&&!kN(t))return t;t=aN(t)}return n}let r=AN(e,t);for(;r&&qM(r)&&kN(r);)r=AN(r,t);return r&&nN(r)&&kN(r)&&!$M(r)?n:r||eN(e)||n}var MN=async function(e){let t=this.getOffsetParent||jN,n=this.getDimensions,r=await n(e.floating);return{reference:ON(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function NN(e){return rN(e).direction===`rtl`}var PN={convertOffsetParentRelativeRectToViewportRelativeRect:vN,getDocumentElement:VM,getClippingRect:EN,getOffsetParent:jN,getElementRects:MN,getClientRects:yN,getDimensions:DN,getScale:dN,isElement:UM,isRTL:NN};function FN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function IN(e,t,n){let r=null,i,a=VM(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=$j(d),h=$j(a.clientWidth-(u+f)),g=$j(a.clientHeight-(d+p)),_=$j(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Zj(0,Xj(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!FN(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=BM(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function LN(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=uN(e),u=i||a?[...l?sN(l):[],...t?sN(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?IN(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?hN(e):null;c&&g();function g(){let t=hN(e);h&&!FN(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var RN=PM,zN=FM,BN=OM,VN=LM,HN=jM,UN=DM,WN=IM,GN=(e,t,n)=>{let r=new Map,i=n??{},a={...PN,...i.platform,_c:r};return EM(e,t,{...i,platform:a})},KN=typeof document<`u`?I.useLayoutEffect:function(){};function qN(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!qN(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!qN(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function JN(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function YN(e,t){let n=JN(e);return Math.round(t*n)/n}function XN(e){let t=I.useRef(e);return KN(()=>{t.current=e}),t}function ZN(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=I.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=I.useState(r);qN(f,r)||p(r);let[m,h]=I.useState(null),[g,_]=I.useState(null),v=I.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=I.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=I.useRef(null),C=I.useRef(null),w=I.useRef(u),T=c!=null,E=XN(c),ee=XN(i),D=XN(l),O=I.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};ee.current&&(e.platform=ee.current),GN(S.current,C.current,e).then(e=>{let t={...e,isPositioned:D.current!==!1};te.current&&!qN(w.current,t)&&(w.current=t,fE.flushSync(()=>{d(t)}))})},[f,t,n,ee,D]);KN(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let te=I.useRef(!1);KN(()=>(te.current=!0,()=>{te.current=!1}),[]),KN(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,O);O()}},[b,x,O,E,T]);let ne=I.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),k=I.useMemo(()=>({reference:b,floating:x}),[b,x]),A=I.useMemo(()=>{let e={position:n,left:0,top:0};if(!k.floating)return e;let t=YN(k.floating,u.x),r=YN(k.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...JN(k.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,k.floating,u.x,u.y]);return I.useMemo(()=>({...u,update:O,refs:ne,elements:k,floatingStyles:A}),[u,O,ne,k,A])}var QN=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:UN({element:r.current,padding:i}).fn(n):r?UN({element:r,padding:i}).fn(n):{}}}},$N=(e,t)=>{let n=RN(e);return{name:n.name,fn:n.fn,options:[e,t]}},eP=(e,t)=>{let n=zN(e);return{name:n.name,fn:n.fn,options:[e,t]}},tP=(e,t)=>({fn:WN(e).fn,options:[e,t]}),nP=(e,t)=>{let n=BN(e);return{name:n.name,fn:n.fn,options:[e,t]}},rP=(e,t)=>{let n=VN(e);return{name:n.name,fn:n.fn,options:[e,t]}},iP=(e,t)=>{let n=HN(e);return{name:n.name,fn:n.fn,options:[e,t]}},aP=(e,t)=>{let n=QN(e);return{name:n.name,fn:n.fn,options:[e,t]}},oP=Object.defineProperty,sP=I.forwardRef(((e,t)=>oP(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,L.jsx)(ej.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,L.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),cP=Object.defineProperty,lP=(e,t)=>cP(e,`name`,{value:t,configurable:!0});function uP(e){let[t,n]=I.useState(void 0);return Uj(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}lP(uP,`useSize`);var dP=Object.defineProperty,fP=(e,t)=>dP(e,`name`,{value:t,configurable:!0}),pP=`Popper`,[mP,hP]=FA(pP),[gP,_P]=mP(pP),vP=fP(e=>{let{__scopePopper:t,children:n}=e,[r,i]=I.useState(null),[a,o]=I.useState(void 0);return(0,L.jsx)(gP,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),yP=`PopperAnchor`,bP=I.forwardRef(fP(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=_P(yP,n),o=I.useRef(null),s=a.onAnchorChange,c=jA(t,I.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=I.useRef(null);I.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&AP(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,L.jsx)(ej.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),xP=`PopperContent`,[SP,CP]=mP(xP),wP=I.forwardRef(fP(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=_P(xP,n),[_,v]=I.useState(null),y=jA(t,v),[b,x]=I.useState(null),S=uP(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},ee=Array.isArray(l)?l:[l],D=ee.length>0,O={padding:E,boundary:ee.filter(OP),altBoundary:D},{refs:te,floatingStyles:ne,placement:k,isPositioned:A,middlewareData:re}=ZN({strategy:`fixed`,placement:T,whileElementsMounted:fP((...e)=>LN(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[$N({mainAxis:i+w,alignmentAxis:o}),c&&eP({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?tP():void 0,...O}),c&&nP({...O}),rP({...O,apply:fP(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),b&&aP({element:b,padding:s}),kP({arrowWidth:C,arrowHeight:w}),f&&iP({strategy:`referenceHidden`,...O,boundary:D?O.boundary:void 0})]}),j=g.setPlacementState;Uj(()=>(j(k),()=>{j(void 0)}),[k,j]);let[ie,ae]=AP(k),oe=ij(m);Uj(()=>{A&&oe?.()},[A,oe]);let se=re.arrow?.x,ce=re.arrow?.y,le=re.arrow?.centerOffset!==0,[M,ue]=I.useState();return Uj(()=>{_&&ue(window.getComputedStyle(_).zIndex)},[_]),(0,L.jsx)(`div`,{ref:te.setFloating,"data-radix-popper-content-wrapper":``,style:{...ne,transform:A?ne.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:M,"--radix-popper-transform-origin":[re.transformOrigin?.x,re.transformOrigin?.y].join(` `),...re.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,L.jsx)(SP,{scope:n,placedSide:ie,placedAlign:ae,onArrowChange:x,arrowX:se,arrowY:ce,shouldHideArrow:le,children:(0,L.jsx)(ej.div,{"data-side":ie,"data-align":ae,...h,ref:y,style:{...h.style,animation:A?h.style?.animation:`none`}})})})},`PopperContent`)),TP=`PopperArrow`,EP={top:`bottom`,right:`left`,bottom:`top`,left:`right`},DP=I.forwardRef(fP(function(e,t){let{__scopePopper:n,...r}=e,i=CP(TP,n),a=EP[i.placedSide];return(0,L.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,L.jsx)(sP,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function OP(e){return e!==null}fP(OP,`isNotNull`);var kP=fP(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=AP(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function AP(e){let[t,n=`center`]=e.split(`-`);return[t,n]}fP(AP,`getSideAndAlignFromPlacement`);var jP=vP,MP=bP,NP=wP,PP=DP,FP=Object.defineProperty,IP=I.forwardRef(((e,t)=>FP(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=I.useState(!1);Uj(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?fE.createPortal((0,L.jsx)(ej.div,{...r,ref:t}),o):null},`Portal`)),LP=Object.defineProperty,RP=(e,t)=>LP(e,`name`,{value:t,configurable:!0});function zP(e,t){return I.useReducer((e,n)=>t[e][n]??e,e)}RP(zP,`useStateMachine`);var BP=RP(e=>{let{present:t,children:n}=e,r=VP(t),i=typeof n==`function`?n({present:r.isPresent}):I.Children.only(n),a=UP(r.ref,GP(i));return typeof n==`function`||r.isPresent?I.cloneElement(i,{ref:a}):null},`Presence`);function VP(e){let[t,n]=I.useState(),r=I.useRef(null),i=I.useRef(e),a=I.useRef(`none`),o=I.useRef(void 0),[s,c]=zP(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return I.useEffect(()=>{s===`mounted`?(a.current=o.current??WP(r.current),o.current=void 0):a.current=`none`},[s]),Uj(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=WP(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Uj(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=RP(a=>{let o=WP(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=RP(e=>{e.target===t&&(a.current=WP(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:I.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=WP(t)}else r.current=null;n(e)},[])}}RP(VP,`usePresence`);function HP(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}RP(HP,`setRef`);function UP(...e){let t=I.useRef(e);return t.current=e,I.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=HP(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():HP(n[e],null)}}},[])}RP(UP,`useStableComposedRefs`);function WP(e){return e?.animationName||`none`}RP(WP,`getAnimationName`);function GP(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}RP(GP,`getElementRef`);var KP=Object.defineProperty,qP=(e,t)=>KP(e,`name`,{value:t,configurable:!0}),JP=I.useEffectEvent,YP=I.useInsertionEffect;function XP(e){if(typeof JP==`function`)return JP(e);let t=I.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof YP==`function`?YP(()=>{t.current=e}):Uj(()=>{t.current=e}),I.useMemo(()=>((...e)=>t.current?.(...e)),[])}qP(XP,`useEffectEvent`);var ZP=Object.defineProperty,QP=(e,t)=>ZP(e,`name`,{value:t,configurable:!0}),$P=I.useInsertionEffect||Uj;function eF({prop:e,defaultProp:t,onChange:n=QP(()=>{},`onChange`),caller:r}){let[i,a,o]=tF({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,I.useCallback(t=>{if(s){let n=nF(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}QP(eF,`useControllableState`);function tF({defaultProp:e,onChange:t}){let[n,r]=I.useState(e),i=I.useRef(n),a=I.useRef(t);return $P(()=>{a.current=t},[t]),I.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}QP(tF,`useUncontrolledState`);function nF(e){return typeof e==`function`}QP(nF,`isFunction`);var rF=Symbol(`RADIX:SYNC_STATE`);function iF(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=XP(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=I.useReducer((t,n)=>{if(n.type===rF)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=I.useRef(p);I.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=I.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return I.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:rF,state:i})},[i,d.state,c]),[h,f]}QP(iF,`useControllableStateReducer`);var aF=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},oF=new WeakMap,sF=new WeakMap,cF={},lF=0,uF=function(e){return e&&(e.host||uF(e.parentNode))},dF=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=uF(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},fF=function(e,t,n,r){var i=dF(t,Array.isArray(e)?e:[e]);cF[n]||(cF[n]=new WeakMap);var a=cF[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(oF.get(e)||0)+1,l=(a.get(e)||0)+1;oF.set(e,c),a.set(e,l),o.push(e),c===1&&i&&sF.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),lF++,function(){o.forEach(function(e){var t=oF.get(e)-1,i=a.get(e)-1;oF.set(e,t),a.set(e,i),t||(sF.has(e)||e.removeAttribute(r),sF.delete(e)),i||e.removeAttribute(n)}),lF--,lF||(oF=new WeakMap,oF=new WeakMap,sF=new WeakMap,cF={})}},pF=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||aF(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),fF(r,i,n,`aria-hidden`)):function(){return null}},mF=function(){return mF=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},mF.apply(this,arguments)};function hF(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function gF(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var _F=`right-scroll-bar-position`,vF=`width-before-scroll-bar`,yF=`with-scroll-bars-hidden`,bF=`--removed-body-scroll-bar-size`;function xF(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function SF(e,t){var n=(0,I.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var CF=typeof window<`u`?I.useLayoutEffect:I.useEffect,wF=new WeakMap;function TF(e,t){var n=SF(t||null,function(t){return e.forEach(function(e){return xF(e,t)})});return CF(function(){var t=wF.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||xF(e,null)}),i.forEach(function(e){r.has(e)||xF(e,a)})}wF.set(n,e)},[e]),n}function EF(e){return e}function DF(e,t){t===void 0&&(t=EF);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function OF(e){e===void 0&&(e={});var t=DF(null);return t.options=mF({async:!0,ssr:!1},e),t}var kF=function(e){var t=e.sideCar,n=hF(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return I.createElement(r,mF({},n))};kF.isSideCarExport=!0;function AF(e,t){return e.useMedium(t),kF}var jF=OF(),MF=function(){},NF=I.forwardRef(function(e,t){var n=I.useRef(null),r=I.useState({onScrollCapture:MF,onWheelCapture:MF,onTouchMoveCapture:MF}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=hF(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=TF([n,t]),C=mF(mF({},b),i);return I.createElement(I.Fragment,null,u&&I.createElement(x,{sideCar:jF,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?I.cloneElement(I.Children.only(s),mF(mF({},C),{ref:S})):I.createElement(v,mF({},C,{className:c,ref:S}),s))});NF.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},NF.classNames={fullWidth:vF,zeroRight:_F};var PF=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function FF(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=PF();return t&&e.setAttribute(`nonce`,t),e}function IF(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function LF(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var RF=function(){var e=0,t=null;return{add:function(n){e==0&&(t=FF())&&(IF(t,n),LF(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},zF=function(){var e=RF();return function(t,n){I.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},BF=function(){var e=zF();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},VF={left:0,top:0,right:0,gap:0},HF=function(e){return parseInt(e||``,10)||0},UF=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[HF(n),HF(r),HF(i)]},WF=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return VF;var t=UF(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},GF=BF(),KF=`data-scroll-locked`,qF=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
69
+ .${yF} {
70
+ overflow: hidden ${r};
71
+ padding-right: ${s}px ${r};
72
+ }
73
+ body[${KF}] {
74
+ overflow: hidden ${r};
75
+ overscroll-behavior: contain;
76
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
77
+ padding-left: ${i}px;
78
+ padding-top: ${a}px;
79
+ padding-right: ${o}px;
80
+ margin-left:0;
81
+ margin-top:0;
82
+ margin-right: ${s}px ${r};
83
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
84
+ }
85
+
86
+ .${_F} {
87
+ right: ${s}px ${r};
88
+ }
89
+
90
+ .${vF} {
91
+ margin-right: ${s}px ${r};
92
+ }
93
+
94
+ .${_F} .${_F} {
95
+ right: 0 ${r};
96
+ }
97
+
98
+ .${vF} .${vF} {
99
+ margin-right: 0 ${r};
100
+ }
101
+
102
+ body[${KF}] {
103
+ ${bF}: ${s}px;
104
+ }
105
+ `},JF=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},YF=function(){I.useEffect(function(){return document.body.setAttribute(KF,(JF()+1).toString()),function(){var e=JF()-1;e<=0?document.body.removeAttribute(KF):document.body.setAttribute(KF,e.toString())}},[])},XF=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;YF();var a=I.useMemo(function(){return WF(i)},[i]);return I.createElement(GF,{styles:qF(a,!t,i,n?``:`!important`)})},ZF=!1;if(typeof window<`u`)try{var QF=Object.defineProperty({},"passive",{get:function(){return ZF=!0,!0}});window.addEventListener(`test`,QF,QF),window.removeEventListener(`test`,QF,QF)}catch{ZF=!1}var $F=ZF?{passive:!1}:!1,eI=function(e){return e.tagName===`TEXTAREA`},tI=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!eI(e)&&n[t]===`visible`)},nI=function(e){return tI(e,`overflowY`)},rI=function(e){return tI(e,`overflowX`)},iI=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),sI(e,r)){var i=cI(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},aI=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},oI=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},sI=function(e,t){return e===`v`?nI(t):rI(t)},cI=function(e,t){return e===`v`?aI(t):oI(t)},lI=function(e,t){return e===`h`&&t===`rtl`?-1:1},uI=function(e,t,n,r,i){var a=lI(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=cI(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&sI(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},dI=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},fI=function(e){return[e.deltaX,e.deltaY]},pI=function(e){return e&&`current`in e?e.current:e},mI=function(e,t){return e[0]===t[0]&&e[1]===t[1]},hI=function(e){return`
106
+ .block-interactivity-${e} {pointer-events: none;}
107
+ .allow-interactivity-${e} {pointer-events: all;}
108
+ `},gI=0,_I=[];function vI(e){var t=I.useRef([]),n=I.useRef([0,0]),r=I.useRef(),i=I.useState(gI++)[0],a=I.useState(BF)[0],o=I.useRef(e);I.useEffect(function(){o.current=e},[e]),I.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=gF([e.lockRef.current],(e.shards||[]).map(pI),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=I.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=dI(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=iI(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=iI(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return uI(h,t,e,h===`h`?s:c,!0)},[]),c=I.useCallback(function(e){var n=e;if(_I.length&&_I[_I.length-1]===a){var r=`deltaY`in n?fI(n):dI(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&mI(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(pI).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=I.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:yI(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=I.useCallback(function(e){n.current=dI(e),r.current=void 0},[]),d=I.useCallback(function(t){l(t.type,fI(t),t.target,s(t,e.lockRef.current))},[]),f=I.useCallback(function(t){l(t.type,dI(t),t.target,s(t,e.lockRef.current))},[]);I.useEffect(function(){return _I.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,$F),document.addEventListener(`touchmove`,c,$F),document.addEventListener(`touchstart`,u,$F),function(){_I=_I.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,$F),document.removeEventListener(`touchmove`,c,$F),document.removeEventListener(`touchstart`,u,$F)}},[]);var p=e.removeScrollBar,m=e.inert;return I.createElement(I.Fragment,null,m?I.createElement(a,{styles:hI(i)}):null,p?I.createElement(XF,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function yI(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var bI=AF(jF,vI),xI=I.forwardRef(function(e,t){return I.createElement(NF,mF({},e,{ref:t,sideCar:bI}))});xI.classNames=NF.classNames;var SI=Object.defineProperty,CI=(e,t)=>SI(e,`name`,{value:t,configurable:!0}),wI=`Popover`,[TI,EI]=FA(wI,[hP]),DI=hP(),[OI,kI]=TI(wI),AI=CI(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=DI(t),c=I.useRef(null),[l,u]=I.useState(!1),[d,f]=eF({prop:r,defaultProp:i??!1,onChange:a,caller:wI});return(0,L.jsx)(jP,{...s,children:(0,L.jsx)(OI,{scope:t,contentId:Jj(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:I.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:I.useCallback(()=>u(!0),[]),onCustomAnchorRemove:I.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),jI=`PopoverAnchor`,MI=I.forwardRef(CI(function(e,t){let{__scopePopover:n,...r}=e,i=kI(jI,n),a=DI(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return I.useEffect(()=>(o(),()=>s()),[o,s]),(0,L.jsx)(MP,{...a,...r,ref:t})},`PopoverAnchor`)),NI=`PopoverTrigger`,PI=I.forwardRef(CI(function(e,t){let{__scopePopover:n,...r}=e,i=kI(NI,n),a=DI(n),o=jA(t,i.triggerRef),s=(0,L.jsx)(ej.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":KI(i.open),...r,ref:o,onClick:SA(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,L.jsx)(MP,{asChild:!0,...a,children:s})},`PopoverTrigger`)),FI=`PopoverPortal`,[II,LI]=TI(FI,{forceMount:void 0}),RI=CI(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=kI(FI,t);return(0,L.jsx)(II,{scope:t,forceMount:n,children:(0,L.jsx)(BP,{present:n||a.open,children:(0,L.jsx)(IP,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),zI=`PopoverContent`,BI=I.forwardRef(CI(function(e,t){let n=LI(zI,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=kI(zI,e.__scopePopover);return(0,L.jsx)(BP,{present:r||a.open,children:a.modal?(0,L.jsx)(HI,{...i,ref:t}):(0,L.jsx)(UI,{...i,ref:t})})},`PopoverContent`)),VI=zA(`PopoverContent.RemoveScroll`),HI=I.forwardRef(CI(function(e,t){let n=kI(zI,e.__scopePopover),r=I.useRef(null),i=jA(t,r),a=I.useRef(!1);return I.useEffect(()=>{let e=r.current;if(e)return pF(e)},[]),(0,L.jsx)(xI,{as:VI,allowPinchZoom:!0,children:(0,L.jsx)(WI,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:SA(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:SA(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:SA(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),UI=I.forwardRef(CI(function(e,t){let n=kI(zI,e.__scopePopover),r=I.useRef(!1),i=I.useRef(!1);return(0,L.jsx)(WI,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),WI=I.forwardRef(CI(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=kI(zI,n),p=DI(n);return wj(),(0,L.jsx)(jj,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,L.jsx)(fj,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,L.jsx)(NP,{"data-state":KI(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`)),GI=I.forwardRef(CI(function(e,t){let{__scopePopover:n,...r}=e,i=DI(n);return(0,L.jsx)(PP,{...i,...r,ref:t})},`PopoverArrow`));function KI(e){return e?`open`:`closed`}CI(KI,`getState`);var qI=AI,JI=MI,YI=RI,XI=BI,ZI=GI,QI=Object.defineProperty,$I=(e,t)=>QI(e,`name`,{value:t,configurable:!0});function eL(e){let t=e+`CollectionProvider`,[n,r]=FA(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=$I(e=>{let{scope:t,children:n}=e,r=I.useRef(null),a=I.useRef(new Map).current;return(0,L.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=zA(s),l=I.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=jA(t,a(s,n).collectionRef);return(0,L.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=zA(u),p=I.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=I.useRef(null),s=jA(t,o),c=a(u,n);return I.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,L.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return I.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return $I(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}$I(eL,`createCollection`);var tL=new WeakMap,nL=class e extends Map{static{$I(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],tL.set(this,!0)}set(e,t){return tL.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=aL(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=rL(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=rL(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return rL(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function rL(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=iL(e,t);return n===-1?void 0:e[n]}$I(rL,`at`);function iL(e,t){let n=e.length,r=aL(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}$I(iL,`toSafeIndex`);function aL(e){return e!==e||e===0?0:Math.trunc(e)}$I(aL,`toSafeInteger`);function oL(e){let t=e+`CollectionProvider`,[n,r]=FA(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new nL,setItemMap:$I(()=>void 0,`setItemMap`)}),o=$I(({state:e,...t})=>e?(0,L.jsx)(c,{...t,state:e}):(0,L.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=$I(e=>{let t=h();return(0,L.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=$I(e=>{let{scope:t,children:n,state:r}=e,a=I.useRef(null),[o,s]=I.useState(null),c=jA(a,s),[l,u]=r;return I.useEffect(()=>{if(!o)return;let e=uL(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,L.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=zA(l),d=I.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=jA(t,a(l,n).collectionRef);return(0,L.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=zA(f),m=I.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=I.useRef(null),[s,c]=I.useState(null),l=jA(t,o,c),{setItemMap:u}=a(f,n),d=I.useRef(i);sL(d.current,i)||(d.current=i);let m=d.current;return I.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(lL):(t.set(s,{...e,element:s}),t.toSorted(lL)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new nL(e)))}},[s,m,u]),(0,L.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return I.useState(new nL)}$I(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return $I(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}$I(oL,`createCollection`);function sL(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}$I(sL,`shallowEqual`);function cL(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}$I(cL,`isElementPreceding`);function lL(e,t){return!e[1].element||!t[1].element?0:cL(e[1].element,t[1].element)?-1:1}$I(lL,`sortByDocumentPosition`);function uL(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}$I(uL,`getChildListObserver`);var dL=Object.defineProperty,fL=(e,t)=>dL(e,`name`,{value:t,configurable:!0}),pL=I.createContext(void 0);function mL(e){let t=I.useContext(pL);return e||t||`ltr`}fL(mL,`useDirection`);var hL=Object.defineProperty,gL=(e,t)=>hL(e,`name`,{value:t,configurable:!0}),_L=!1;function vL(){let[e,t]=I.useState(_L);return I.useEffect(()=>{_L||(_L=!0,t(!0))},[]),e}gL(vL,`useIsHydrated`);var yL=I.useSyncExternalStore;function bL(){return()=>{}}gL(bL,`subscribe`);function xL(){return yL(bL,()=>!0,()=>!1)}gL(xL,`useIsHydratedModern`);var SL=typeof yL==`function`?xL:vL,CL=Object.defineProperty,wL=(e,t)=>CL(e,`name`,{value:t,configurable:!0}),TL=`rovingFocusGroup.onEntryFocus`,EL={bubbles:!1,cancelable:!0},DL=`RovingFocusGroup`,[OL,kL,AL]=eL(DL),[jL,ML]=FA(DL,[AL]),[NL,PL]=jL(DL),FL=I.forwardRef(wL(function(e,t){return(0,L.jsx)(OL.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(OL.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(IL,{...e,ref:t})})})},`RovingFocusGroup`)),IL=I.forwardRef(wL(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=I.useRef(null),p=jA(t,f),m=mL(a),[h,g]=eF({prop:o,defaultProp:s??null,onChange:c,caller:DL}),[_,v]=I.useState(!1),y=ij(l),b=kL(n),x=I.useRef(!1),[S,C]=I.useState(0);return I.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(TL,y),()=>e.removeEventListener(TL,y)},[y]),(0,L.jsx)(NL,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:I.useCallback(e=>g(e),[g]),onItemShiftTab:I.useCallback(()=>v(!0),[]),onFocusableItemAdd:I.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:I.useCallback(()=>C(e=>e-1),[]),children:(0,L.jsx)(ej.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:SA(e.onMouseDown,()=>{x.current=!0}),onFocus:SA(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(TL,EL);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);HL([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:SA(e.onBlur,()=>v(!1))})})},`RovingFocusGroupImpl`)),LL=`RovingFocusGroupItem`,RL=I.forwardRef(wL(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Jj(),l=a||c,u=PL(LL,n),d=u.currentTabStopId===l,f=kL(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=SL();return Uj(()=>{if(g&&r)return p(),()=>m()},[g,r,p,m]),I.useEffect(()=>{if(!g&&r)return p(),()=>m()},[g,r,p,m]),(0,L.jsx)(OL.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,L.jsx)(ej.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:SA(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:SA(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:SA(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=VL(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?UL(n,r+1):n.slice(r+1)}setTimeout(()=>HL(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),zL={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function BL(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}wL(BL,`getDirectionAwareKey`);function VL(e,t,n){let r=BL(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return zL[r]}wL(VL,`getFocusIntent`);function HL(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}wL(HL,`focusFirst`);function UL(e,t){return e.map((n,r)=>e[(t+r)%e.length])}wL(UL,`wrapArray`);var WL=FL,GL=RL,KL=Object.defineProperty,qL=(e,t)=>KL(e,`name`,{value:t,configurable:!0}),JL=`horizontal`,YL=[`horizontal`,`vertical`],XL=I.forwardRef(qL(function(e,t){let{decorative:n,orientation:r=JL,...i}=e,a=ZL(r)?r:JL,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,L.jsx)(ej.div,{"data-orientation":a,...o,...i,ref:t})},`Separator`));function ZL(e){return YL.includes(e)}qL(ZL,`isValidOrientation`);var QL=XL,$L=Object.defineProperty,eR=(e,t)=>$L(e,`name`,{value:t,configurable:!0}),tR=`Toggle`,nR=I.forwardRef(eR(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=eF({prop:n,onChange:i,defaultProp:r??!1,caller:tR});return(0,L.jsx)(ej.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:SA(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),rR=Object.defineProperty,iR=(e,t)=>rR(e,`name`,{value:t,configurable:!0}),aR=`ToggleGroup`,[oR,sR]=FA(aR,[ML]),cR=ML(),lR=I.forwardRef(iR(function(e,t){let{type:n,...r}=e;if(n===`single`)return(0,L.jsx)(fR,{role:`radiogroup`,...r,ref:t});if(n===`multiple`)return(0,L.jsx)(pR,{role:`toolbar`,...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${aR}\``)},`ToggleGroup`)),[uR,dR]=oR(aR),fR=I.forwardRef(iR(function(e,t){let{value:n,defaultValue:r,onValueChange:i=iR(()=>{},`onValueChange`),...a}=e,[o,s]=eF({prop:n,defaultProp:r??``,onChange:i,caller:aR});return(0,L.jsx)(uR,{scope:e.__scopeToggleGroup,type:`single`,value:I.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:I.useCallback(()=>s(``),[s]),children:(0,L.jsx)(gR,{...a,ref:t})})},`ToggleGroupImplSingle`)),pR=I.forwardRef(iR(function(e,t){let{value:n,defaultValue:r,onValueChange:i=iR(()=>{},`onValueChange`),...a}=e,[o,s]=eF({prop:n,defaultProp:r??[],onChange:i,caller:aR}),c=I.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=I.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,L.jsx)(uR,{scope:e.__scopeToggleGroup,type:`multiple`,value:o,onItemActivate:c,onItemDeactivate:l,children:(0,L.jsx)(gR,{...a,ref:t})})},`ToggleGroupImplMultiple`)),[mR,hR]=oR(aR),gR=I.forwardRef(iR(function(e,t){let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=cR(n),u=mL(o),d={dir:u,...c};return(0,L.jsx)(mR,{scope:n,rovingFocus:i,disabled:r,children:i?(0,L.jsx)(WL,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,L.jsx)(ej.div,{...d,ref:t})}):(0,L.jsx)(ej.div,{...d,ref:t})})},`ToggleGroupImpl`)),_R=`ToggleGroupItem`,vR=I.forwardRef(iR(function(e,t){let n=dR(_R,e.__scopeToggleGroup),r=hR(_R,e.__scopeToggleGroup),i=cR(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=I.useRef(null);return r.rovingFocus?(0,L.jsx)(GL,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,L.jsx)(yR,{...s,ref:t})}):(0,L.jsx)(yR,{...s,ref:t})},`ToggleGroupItem`)),yR=I.forwardRef(iR(function(e,t){let{__scopeToggleGroup:n,value:r,...i}=e,a=dR(_R,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0},s=a.type===`single`?o:void 0;return(0,L.jsx)(nR,{...s,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})},`ToggleGroupItemImpl`)),bR=Object.defineProperty,xR=(e,t)=>bR(e,`name`,{value:t,configurable:!0}),SR=`Toolbar`,[CR,wR]=FA(SR,[ML,sR]),TR=ML(),ER=sR(),[DR,OR]=CR(SR),kR=I.forwardRef(xR(function(e,t){let{__scopeToolbar:n,orientation:r=`horizontal`,dir:i,loop:a=!0,...o}=e,s=TR(n),c=mL(i);return(0,L.jsx)(DR,{scope:n,orientation:r,dir:c,children:(0,L.jsx)(WL,{asChild:!0,...s,orientation:r,dir:c,loop:a,children:(0,L.jsx)(ej.div,{role:`toolbar`,"aria-orientation":r,dir:c,...o,ref:t})})})},`Toolbar`)),AR=`ToolbarSeparator`,jR=I.forwardRef(xR(function(e,t){let{__scopeToolbar:n,...r}=e,i=OR(AR,n);return(0,L.jsx)(QL,{orientation:i.orientation===`horizontal`?`vertical`:`horizontal`,...r,ref:t})},`ToolbarSeparator`)),MR=I.forwardRef(xR(function(e,t){let{__scopeToolbar:n,...r}=e,i=TR(n);return(0,L.jsx)(GL,{asChild:!0,...i,focusable:!e.disabled,children:(0,L.jsx)(ej.button,{type:`button`,...r,ref:t})})},`ToolbarButton`)),NR=`ToolbarToggleGroup`,PR=I.forwardRef(xR(function(e,t){let{__scopeToolbar:n,...r}=e,i=OR(NR,n),a=ER(n);return(0,L.jsx)(lR,{"data-orientation":i.orientation,dir:i.dir,...a,...r,ref:t,rovingFocus:!1})},`ToolbarToggleGroup`)),FR=I.forwardRef(xR(function(e,t){let{__scopeToolbar:n,...r}=e,i=ER(n),a={__scopeToolbar:e.__scopeToolbar};return(0,L.jsx)(MR,{asChild:!0,...a,children:(0,L.jsx)(vR,{...i,...r,ref:t})})},`ToolbarToggleItem`)),IR=kR,LR=jR,RR=MR,zR=PR,BR=FR;function VR(e,t){return e===null||e===t?!1:e.dataset.editorDialog!==void 0||e.dataset.toolbarItem!==void 0||e.dataset.editorDropdown?!0:VR(e.parentElement,t)}function HR(){let e=[...Array(256).keys()].map(e=>e.toString(16).padStart(2,`0`)),t=crypto.getRandomValues(new Uint8Array(16));return t[6]=t[6]&15|64,t[8]=t[8]&63|128,[...t.entries()].map(([t,n])=>[4,6,8,10].includes(t)?`-${e[n]}`:e[n]).join(``)}var UR=e=>e===0?`th`:`td`,WR={center:J.centeredCell,left:J.leftAlignedCell,right:J.rightAlignedCell};function GR(e){let t=Hu(e);return rz(t)?t:null}var KR=({mdastNode:e,parentEditor:t,lexicalTable:n})=>{let r=n.getKey(),[i,a]=I.useState(null),[o,s]=Ar(vD,DE),c=I.useMemo(()=>e=>(e.__cacheKey??=HR(),e.__cacheKey),[]),l=I.useCallback(e=>{let i=n.getColCount();if(e===null){a(null);return}let[o,s]=e;if(o>i-1&&(o=0,s++),o<0&&(o=i-1,--s),s>n.getRowCount()-1){a(null),t.update(()=>{let e=GR(r);if(e){if(e.getNextSibling())e.selectNext();else{let t=lu();e.insertAfter(t),t.select()}}});return}if(s<0){a(null),t.update(()=>{var e;(e=GR(r))==null||e.selectPrevious()});return}a([o,s])},[n,t,r]);I.useEffect(()=>{n.focusEmitter.subscribe(l)},[n,l]);let u=I.useCallback(e=>{e.preventDefault(),t.update(()=>{let e=GR(r);e&&(e.addRowToBottom(),a([0,e.getRowCount()]))})},[t,r]),d=I.useCallback(e=>{e.preventDefault(),t.update(()=>{let e=GR(r);e&&(e.addColumnToRight(),a([e.getColCount(),0]))})},[t,r]),[f,p]=I.useState([-1,-1]),m=I.useCallback(e=>{let t=e.target;for(;t&&![`TH`,`TD`].includes(t.tagName);){if(t===e.currentTarget)return;t=t.parentElement}if(t===null)return;let n=t.parentElement,r=n.parentElement.tagName===`TFOOT`?-1:Array.from(n.children).indexOf(t),i=t.tagName===`TH`?-1:Array.from(n.parentElement.children).indexOf(n);p([r,i])},[]),h=qD();return I.createElement(`table`,{className:J.tableEditor,onMouseOver:m,onMouseLeave:()=>{p([-1,-1])}},I.createElement(`colgroup`,null,s?null:I.createElement(`col`,null),Array.from({length:e.children[0].children.length},(t,n)=>{let r=WR[(e.align??[])[n]??`left`];return I.createElement(`col`,{key:n,className:r})}),s?null:I.createElement(`col`,null)),s||I.createElement(`thead`,null,I.createElement(`tr`,null,I.createElement(`th`,{className:J.tableToolsColumn}),Array.from({length:e.children[0].children.length},(r,i)=>I.createElement(`th`,{key:i,"data-tool-cell":!0},I.createElement(YR,{setActiveCellWithBoundaries:l,parentEditor:t,colIndex:i,highlightedCoordinates:f,lexicalTable:n,align:(e.align??[])[i]}))),I.createElement(`th`,{className:J.tableToolsColumn,"data-tool-cell":!0},I.createElement(`button`,{className:J.iconButton,type:`button`,title:h(`table.deleteTable`,`Delete table`),onClick:e=>{e.preventDefault(),t.update(()=>{let e=GR(r);e&&(e.selectNext(),e.remove())})}},o(`delete_small`))))),I.createElement(`tbody`,null,e.children.map((r,a)=>{let u=UR(a);return I.createElement(`tr`,{key:a},s||I.createElement(u,{className:J.toolCell,"data-tool-cell":!0},I.createElement(XR,{setActiveCellWithBoundaries:l,parentEditor:t,rowIndex:a,highlightedCoordinates:f,lexicalTable:n})),r.children.map((r,o)=>I.createElement(qR,{align:e.align?.[o],key:c(r),contents:r.children,setActiveCell:l,rowIndex:a,colIndex:o,lexicalTable:n,parentEditor:t,activeCell:s?[-1,-1]:i})),s||a===0&&I.createElement(`th`,{rowSpan:n.getRowCount(),"data-tool-cell":!0},I.createElement(`button`,{type:`button`,className:J.addColumnButton,onClick:d},o(`add_column`))))})),s||I.createElement(`tfoot`,null,I.createElement(`tr`,null,I.createElement(`th`,null),I.createElement(`th`,{colSpan:n.getColCount(),"data-tool-cell":!0},I.createElement(`button`,{type:`button`,className:J.addRowButton,onClick:u},o(`add_row`))),I.createElement(`th`,null))))},qR=({align:e,...t})=>{let{activeCell:n,setActiveCell:r}=t,i=n?.[0]===t.colIndex&&n[1]===t.rowIndex,a=WR[e??`left`],o=UR(t.rowIndex);return I.createElement(o,{className:a,"data-active":i,onClick:()=>{r([t.colIndex,t.rowIndex])}},I.createElement(JR,{...t,focus:i}))},JR=({focus:e,setActiveCell:t,parentEditor:n,lexicalTable:r,contents:i,colIndex:a,rowIndex:o})=>{let s=r.getKey(),[c,l,u,d,f,p,m,h,g,_]=Ar(VE,GE,HE,YE,ZE,QE,$E,JE,CE,ND),[v,y]=I.useState(null);I.useEffect(()=>{let e=xE({name:`@mdxeditor/table-cell`,nodes:u,namespace:`TableCellEditor`,parentEditor:n,historyMode:`table-local`,initialEditorState:()=>{gT({root:Yu(),mdastRoot:{type:`root`,children:[{type:`paragraph`,children:i}]},visitors:c,jsxComponentDescriptors:d,directiveDescriptors:f,codeBlockEditorDescriptors:p,defaultCodeBlockLanguage:m})}});return y(e),()=>{e.dispose()}},[]);let b=I.useCallback(e=>{v&&(v.getEditorState().read(()=>{let e=wS({root:Yu(),jsxComponentDescriptors:d,visitors:l,jsxIsAvailable:h});n.update(()=>{let t=GR(s);t&&t.updateCellContents(a,o,e.children[0].children)},{discrete:!0}),n.dispatchCommand(SE,void 0)}),t(e))},[a,v,l,d,h,n,o,t,s]);return I.useEffect(()=>{if(v)return am(v.registerCommand(Ro,e=>{e.preventDefault();let t=e.shiftKey?[a-1,o]:[a+1,o];return b(t),!0},4),v.registerCommand(es,()=>(t([a,o]),!1),1),v.registerCommand(No,e=>{e?.preventDefault();let t=e?.shiftKey?[a,o-1]:[a,o+1];return b(t),!0},4),v.registerCommand(ts,e=>{let t=e.relatedTarget;return!VR(t,g.getRootElement())&&(b(null),!0)},0),v.registerCommand(SE,()=>(b(null),!0),0))},[a,v,g,o,b,t]),I.useEffect(()=>{e&&v&&v.focus()},[e,v]),v?I.createElement(JD,{initialEditor:v},I.createElement(rO,{contentEditable:I.createElement(oE,null),placeholder:I.createElement(`div`,null),ErrorBoundary:uE}),_.map((e,t)=>I.createElement(e,{key:t}))):null},YR=({parentEditor:e,highlightedCoordinates:t,align:n,lexicalTable:r,colIndex:i,setActiveCellWithBoundaries:a})=>{let o=r.getKey(),[s,c]=Ar(eD,vD),l=I.useCallback(t=>{e.update(()=>{let e=GR(o);e&&(e.insertColumnAt(t),a([t,0]))})},[e,a,o]),u=I.useCallback(t=>{e.update(()=>{var e;(e=GR(o))==null||e.deleteColumnAt(t)})},[e,o]),d=I.useCallback((t,n)=>{e.update(()=>{var e;(e=GR(o))==null||e.setColumnAlign(t,n)})},[e,o]),f=qD();return I.createElement(qI,null,I.createElement(PI,{className:J.tableColumnEditorTrigger,"data-active":t[0]===i+1,title:f(`table.columnMenu`,`Column menu`)},c(`more_horiz`)),I.createElement(YI,{container:s?.current},I.createElement(BI,{className:(0,hO.default)(J.tableColumnEditorPopoverContent),onOpenAutoFocus:e=>{e.preventDefault()},sideOffset:5,side:`top`},I.createElement(IR,{className:J.tableColumnEditorToolbar},I.createElement(zR,{className:J.toggleGroupRoot,onValueChange:e=>{d(i,e)},value:n??`left`,type:`single`,"aria-label":f(`table.textAlignment`,`Text alignment`)},I.createElement(BR,{value:`left`,title:f(`table.alignLeft`,`Align left`)},c(`format_align_left`)),I.createElement(BR,{value:`center`,title:f(`table.alignCenter`,`Align center`)},c(`format_align_center`)),I.createElement(BR,{value:`right`,title:f(`table.alignRight`,`Align right`)},c(`format_align_right`))),I.createElement(LR,null),I.createElement(RR,{onClick:l.bind(null,i),title:f(`table.insertColumnLeft`,`Insert a column to the left of this one`)},c(`insert_col_left`)),I.createElement(RR,{onClick:l.bind(null,i+1),title:f(`table.insertColumnRight`,`Insert a column to the right of this one`)},c(`insert_col_right`)),I.createElement(RR,{onClick:u.bind(null,i),title:f(`table.deleteColumn`,`Delete this column`)},c(`delete_small`))),I.createElement(ZI,{className:J.popoverArrow}))))},XR=({parentEditor:e,highlightedCoordinates:t,lexicalTable:n,rowIndex:r,setActiveCellWithBoundaries:i})=>{let a=n.getKey(),[o,s]=Ar(eD,vD),c=I.useCallback(t=>{e.update(()=>{let e=GR(a);e&&(e.insertRowAt(t),i([0,t]))})},[e,i,a]),l=I.useCallback(t=>{e.update(()=>{var e;(e=GR(a))==null||e.deleteRowAt(t)})},[e,a]),u=qD();return I.createElement(qI,null,I.createElement(PI,{className:J.tableColumnEditorTrigger,"data-active":t[1]===r,title:u(`table.rowMenu`,`Row menu`)},s(`more_horiz`)),I.createElement(YI,{container:o?.current},I.createElement(BI,{className:(0,hO.default)(J.tableColumnEditorPopoverContent),onOpenAutoFocus:e=>{e.preventDefault()},sideOffset:5,side:`bottom`},I.createElement(IR,{className:J.tableColumnEditorToolbar},I.createElement(RR,{onClick:c.bind(null,r),title:u(`table.insertRowAbove`,`Insert a row above this one`)},s(`insert_row_above`)),I.createElement(RR,{onClick:c.bind(null,r+1),title:u(`table.insertRowBelow`,`Insert a row below this one`)},s(`insert_row_below`)),I.createElement(RR,{onClick:l.bind(null,r),title:u(`table.deleteRow`,`Delete this row`)},s(`delete_small`))),I.createElement(ZI,{className:J.popoverArrow}))))},ZR=Object.defineProperty,QR=(e,t,n)=>t in e?ZR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$R=(e,t,n)=>QR(e,typeof t==`symbol`?t:t+``,n),ez={type:`tableCell`,children:[]};function tz(){let e=_T;return{publish:t=>{e(t)},subscribe:t=>{e=t}}}var nz=class e extends Wl{constructor(e,t){super(t),$R(this,`__mdastNode`),$R(this,`focusEmitter`,tz()),this.__mdastNode=e??{type:`table`,children:[]}}static getType(){return`table`}static clone(t){return new e(structuredClone(t.__mdastNode),t.__key)}static importJSON(e){return iz(e.mdastNode)}static importDOM(){return{table:()=>({conversion:az,priority:3})}}exportJSON(){return{mdastNode:structuredClone(this.__mdastNode),type:`table`,version:1}}getMdastNode(){return this.__mdastNode}getRowCount(){return this.__mdastNode.children.length}getColCount(){return this.__mdastNode.children[0]?.children.length||0}createDOM(){return document.createElement(`div`)}updateDOM(){return!1}updateCellContents(e,t,n){let r=this.getWritable().__mdastNode,i=r.children[t],a=i.children,o=a[e],s=Array.from(a),c={...o,children:n},l={...i,children:s};s[e]=c,r.children[t]=l}insertColumnAt(e){let t=this.getWritable().__mdastNode;for(let n=0;n<t.children.length;n++){let r=t.children[n],i=r.children,a=Array.from(i),o={...r,children:a};a.splice(e,0,structuredClone(ez)),t.children[n]=o}t.align&&t.align.length>0&&t.align.splice(e,0,`left`)}deleteColumnAt(e){let t=this.getWritable().__mdastNode;for(let n=0;n<t.children.length;n++){let r=t.children[n],i=r.children,a=Array.from(i),o={...r,children:a};a.splice(e,1),t.children[n]=o}}insertRowAt(e){let t=this.getWritable().__mdastNode,n={type:`tableRow`,children:Array.from({length:this.getColCount()},()=>structuredClone(ez))};t.children.splice(e,0,n)}deleteRowAt(e){this.getRowCount()===1?(this.selectNext(),this.remove()):this.getWritable().__mdastNode.children.splice(e,1)}addRowToBottom(){this.insertRowAt(this.getRowCount())}addColumnToRight(){this.insertColumnAt(this.getColCount())}setColumnAlign(e,t){let n=this.getWritable().__mdastNode;n.align??=[],n.align[e]=t}decorate(e){return I.createElement(KR,{lexicalTable:this,mdastNode:this.__mdastNode,parentEditor:e})}select(e){this.focusEmitter.publish(e??[0,0])}isInline(){return!1}};function rz(e){return e instanceof nz}function iz(e){return new nz(e)}function az(e){let t=e.querySelectorAll(`tr`);return{node:new nz({type:`table`,children:Array.from(t).map(e=>({type:`tableRow`,children:Array.from(e.querySelectorAll(`td, th`)).map(e=>({type:`tableCell`,children:[{type:`text`,value:e.textContent}]}))}))})}}var oz={testLexicalNode:rz,visitLexicalNode({actions:e,mdastParent:t,lexicalNode:n}){e.appendToParent(t,n.getMdastNode())}},sz={testNode:`table`,visitNode({mdastNode:e,lexicalParent:t}){t.append(iz(e))}};function cz(e=1,t=1){let n={type:`table`,children:[]};for(let r=0;r<e;r++){let e={type:`tableRow`,children:[]};for(let n=0;n<t;n++)e.children.push({type:`tableCell`,children:[]});n.children.push(e)}return n}var lz=Tr(e=>{e.link(e.pipe(lz,Mr(({rows:e,columns:t})=>()=>iz(cz(e,t)))),zD)}),uz=zr({init(e,t){e.pubIn({[oD]:tA(),[aD]:pA(),[iD]:sz,[rD]:nz,[sD]:oz,[cD]:lA({tableCellPadding:t?.tableCellPadding??!0,tablePipeAlign:t?.tablePipeAlign??!0})})}}),dz=new Set([`http:`,`https:`,`mailto:`,`sms:`,`tel:`]),fz=class e extends Hl{__url;__target;__rel;__title;static getType(){return`link`}static clone(t){return new e(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(e=``,t={},n){super(n);let{target:r=null,rel:i=null,title:a=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=a}afterCloneFrom(e){super.afterCloneFrom(e),this.__url=e.__url,this.__rel=e.__rel,this.__target=e.__target,this.__title=e.__title}createDOM(e){let t=Ud().createElement(`a`);return this.updateLinkDOM(null,t,e),rm(t,e.theme.link),t}updateLinkDOM(e,t,n){if($d(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(let n of[`target`,`rel`,`title`]){let r=`__${n}`,i=this[r];e&&e[r]===i||(i?t[n]=i:t.removeAttribute(n))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}static importDOM(){return{a:e=>({conversion:gz,priority:1})}}static importJSON(e){return _z().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){let t=e;e=Ez(e);try{let t=new URL(Ez(e));if(!dz.has(t.protocol))return`about:blank`}catch{let e=t.replace(/[\u0000-\u001F\u007F\s]/g,``).match(/^([a-z][a-z0-9+.-]*):/i);if(e!=null&&!dz.has(`${e[1].toLowerCase()}:`))return`about:blank`}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){let t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){let t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){let t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){let t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){let n=Ad(this);return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!H(t))return!1;let r=t.anchor.getNode(),i=t.focus.getNode();return(this.is(r)||this.isParentOf(r))&&(this.is(i)||this.isParentOf(i))&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith(`mailto:`)}isWebSiteURI(){return this.__url.startsWith(`https://`)||this.__url.startsWith(`http://`)}shouldMergeAdjacentLink(e){return this.getType()===e.getType()&&this.__url===e.__url&&this.__target===e.__target&&this.__rel===e.__rel&&this.__title===e.__title}};function pz(e){let t=Np(e,`next`);return[t,t.getFlipped()]}function mz(e,t){for(let n of t)if(n.origin.isAttached()){Pp(e,Hp(n));return}}function hz(e){let t=U(),n=null,r=null;function i(){H(t)&&(mz(t.anchor,n),mz(t.focus,r),sa(t))}H(t)&&(n=pz(t.anchor),r=pz(t.focus));let a=!1;for(let t of yp(e,`next`)){let n=t.origin;if(W(n)&&!n.isInline()){let r=n.getChildren();if(r.length>0){let t=Ad(e);t.append(...r),n.append(t),a=!0}Xp(n,Rp(t),{$shouldSplit:()=>!1})}}function o(e,t,n){let[r,i]=e,a=e=>up(e)&&e.origin.is(t);if(!a(r)&&!a(i))return e;let o=Hp(yp(n,`next`));return[o,o.getFlipped()]}if(e.isAttached()){let t=e.getPreviousSibling();if(vz(t)&&t.shouldMergeAdjacentLink(e))return n&&=o(n,t,e),r&&=o(r,t,e),t.append(...e.getChildren()),e.remove(),void i();let s=e.getNextSibling();vz(s)&&e.shouldMergeAdjacentLink(s)&&(n&&=o(n,e,s),r&&=o(r,e,s),e.append(...s.getChildren()),s.remove(),a=!0)}if(a){if(!e.canBeEmpty()&&e.isEmpty()){let t=e.getParent();e.remove(),t&&t.isEmpty()&&t.remove()}i()}}function gz(e){let t=null;if($d(e)){let n=e.textContent;(n!==null&&n!==``||e.children.length>0)&&(t=_z(e.getAttribute(`href`)||``,{rel:e.getAttribute(`rel`),target:e.getAttribute(`target`),title:e.getAttribute(`title`)}))}return{node:t}}function _z(e=``,t){return jd(new fz(e,t))}function vz(e){return e instanceof fz}var yz=class e extends fz{__isUnlinked;constructor(e=``,t={},n){super(e,t,n),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}afterCloneFrom(e){super.afterCloneFrom(e),this.__isUnlinked=e.__isUnlinked}static getType(){return`autolink`}static clone(t){return new e(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}shouldMergeAdjacentLink(e){return!1}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){let t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?Ud().createElement(`span`):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return bz().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){let n=bz(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}};function bz(e=``,t){return jd(new yz(e,t))}function xz(e){return e instanceof yz}var Sz=B(`TOGGLE_LINK_COMMAND`);function Cz(e,t){if(e.type===`element`){let n=e.getNode();return W(n)||function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),n.getChildren()[e.offset+t]||null}return null}function wz(e,t={}){let n;if(e&&typeof e==`object`){let{url:r,...i}=e;n=r,t={...i,...t}}else n=e;let{target:r,title:i}=t,a=t.rel===void 0?`noreferrer`:t.rel,o=U();if(o===null||!H(o)&&!Cc(o))return;if(Cc(o)){let e=o.getNodes();if(e.length===0)return;e.forEach(e=>{if(n===null){let t=Af(e,e=>!xz(e)&&vz(e));t&&(t.insertBefore(e),t.getChildren().length===0&&t.remove())}else{let t=Af(e,e=>!xz(e)&&vz(e));if(t)t.setURL(n),r!==void 0&&t.setTarget(r),a!==void 0&&t.setRel(a);else{let t=_z(n,{rel:a,target:r});e.insertBefore(t),t.append(e)}}});return}if(o.isCollapsed()&&n===null)for(let e of o.getNodes()){let t=Af(e,e=>!xz(e)&&vz(e));t!==null&&(t.getParentOrThrow().splice(t.getIndexWithinParent(),0,t.getChildren()),t.remove());return}let s=o.extract();if(n===null){let e=new Set;s.forEach(t=>{let n=Af(t,e=>!xz(e)&&vz(e));if(n!==null){let t=n.getKey();if(e.has(t))return;(function(e,t){let n=new Set(t.filter(t=>e.isParentOf(t)).map(e=>e.getKey())),r=e.getChildren(),i=r=>n.has(r.getKey())||W(r)&&t.some(t=>e.isParentOf(t)&&r.isParentOf(t)),a=r.filter(i);if(a.length===r.length)return r.forEach(t=>e.insertBefore(t)),void e.remove();let o=r.findIndex(i),s=r.findLastIndex(i),c=o===0,l=s===r.length-1;if(c)a.forEach(t=>e.insertBefore(t));else if(l)for(let t=a.length-1;t>=0;t--)e.insertAfter(a[t]);else{for(let t=a.length-1;t>=0;t--)e.insertAfter(a[t]);let t=r.slice(s+1);if(t.length>0){let n=Ad(e);a[a.length-1].insertAfter(n),t.forEach(e=>n.append(e))}}})(n,s),e.add(t)}});return}let c=new Set,l=e=>{c.has(e.getKey())||(c.add(e.getKey()),e.setURL(n),r!==void 0&&e.setTarget(r),a!==void 0&&e.setRel(a),i!==void 0&&e.setTitle(i))};if(s.length===1){let e=s[0],t=Af(e,vz);if(t!==null)return l(t)}(function(e){let t=U();if(!H(t))return e();let n=sa(t),r=n.isBackward(),i=Cz(n.anchor,r?-1:0),a=Cz(n.focus,r?0:-1);if(e(),i||a){let e=U();if(H(e)){let t=e.clone();if(i){let e=i.getParent();e&&t.anchor.set(e.getKey(),i.getIndexWithinParent()+ +!!r,`element`)}if(a){let e=a.getParent();e&&t.focus.set(e.getKey(),a.getIndexWithinParent()+ +!r,`element`)}Xu(sa(t))}}})(()=>{let e=null;for(let t of s){if(!t.isAttached())continue;let o=Af(t,vz);if(o){l(o);continue}if(W(t)){if(!t.isInline())continue;if(vz(t)){if(!(xz(t)||e!==null&&e.getParentOrThrow().isParentOf(t))){l(t),e=t;continue}for(let e of t.getChildren())t.insertBefore(e);t.remove();continue}}let s=t.getPreviousSibling();vz(s)&&s.is(e)?s.append(t):(e=_z(n,{rel:a,target:r,title:i}),t.insertAfter(e),e.append(t))}})}var Tz=/^\+?[0-9\s()-]{5,}$/;function Ez(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes(`@`)?`mailto:${e}`:Tz.test(e)?`tel:${e}`:`https://${e}`}Mg.tag(`a`);function Dz(e,t){return am(e.registerNodeTransform(fz,hz),e.registerCommand(Sz,e=>{let n=t.validateUrl.peek(),r=t.attributes.peek();if(e===null)return wz(null),!0;if(typeof e==`string`)return!(n!==void 0&&!n(e))&&(wz(e,r),!0);{let{url:t,target:n,rel:i,title:a}=e;return wz(t,{...r,rel:i,target:n,title:a}),!0}},0),th(()=>{let n=t.validateUrl.value;if(!n)return;let r=t.attributes.value;return e.registerCommand(vo,t=>{let i=U();if(!H(i)||i.isCollapsed()||!Dm(t,ClipboardEvent)||t.clipboardData===null)return!1;let a=t.clipboardData.getData(`text`);return n(a)?!i.getNodes().some(e=>W(e)||V(e)&&!e.isSimpleText())&&(e.dispatchCommand(Sz,{...r,url:a}),t.preventDefault(),!0):!1},1)}))}function Oz(e,t=e=>e){return n=>{let r=e.exec(n);return r===null?null:{index:r.index,length:r[0].length,text:r[0],url:t(r[0])}}}function kz(e,t){for(let n=0;n<t.length;n++){let r=t[n](e);if(r)return r}return null}var Az=/[.,;\s]/;function jz(e,t){return t.test(e)}function Mz(e,t){return jz(e[e.length-1],t)}function Nz(e,t){return jz(e[0],t)}function Pz(e,t){let n=e.getPreviousSibling();return W(n)&&(n=n.getLastDescendant()),n===null||ru(n)||V(n)&&Mz(n.getTextContent(),t)}function Fz(e,t){let n=e.getNextSibling();return W(n)&&(n=n.getFirstDescendant()),n===null||ru(n)||V(n)&&Nz(n.getTextContent(),t)}function Iz(e,t,n,r,i){return(e>0?jz(r[e-1],n):Pz(i[0],n))?t<r.length?jz(r[t],n):Fz(i[i.length-1],n):!1}function Lz(e,t,n){let r=[],i=[],a=[],o=0,s=0,c=[...e];for(;c.length>0;){let e=c[0],l=e.getTextContent().length,u=s;s+l<=t?(r.push(e),o+=l):u>=n?a.push(e):i.push(e),s+=l,c.shift()}return[o,r,i,a]}function Rz(e,t,n,r){let i=bz(r.url,r.attributes);if(e.length===1){let a,o=e[0];t===0?[a,o]=o.splitText(n):[,a,o]=o.splitText(t,n);let s=dc(r.text);return s.setFormat(a.getFormat()),s.setDetail(a.getDetail()),s.setStyle(a.getStyle()),i.append(s),a.replace(i),o}if(e.length>1){let r=e[0],a,o=r.getTextContent().length;t===0?a=r:[,a]=r.splitText(t);let s=[],c;for(let t=1;t<e.length;t++){let r=e[t],i=r.getTextContent().length,a=o;if(a<n){if(o+i<=n)s.push(r);else{let[e,t]=r.splitText(n-a);s.push(e),c=t}}o+=i}let l=U(),u=l?l.getNodes().find(V):void 0,d=dc(a.getTextContent());return d.setFormat(a.getFormat()),d.setDetail(a.getDetail()),d.setStyle(a.getStyle()),i.append(d,...s),u&&u===a&&(H(l)?d.select(l.anchor.offset,l.focus.offset):Cc(l)&&d.select(0,d.getTextContent().length)),a.replace(i),c}}function zz(e,t,n,r){let i=e.getChildren(),a=i.length;for(let t=0;t<a;t++){let r=i[t];if(!V(r)||!r.isSimpleText())return Bz(e),void n(null,e.getURL())}let o=e.getTextContent(),s=kz(o,t);if(s===null||s.text!==o||!Pz(e,r)||!Fz(e,r))return Bz(e),void n(null,e.getURL());let c=e.getURL();if(c!==s.url&&(e.setURL(s.url),n(s.url,c)),s.attributes){let t=e.getRel();t!==s.attributes.rel&&(e.setRel(s.attributes.rel||null),n(s.attributes.rel||null,t));let r=e.getTarget();r!==s.attributes.target&&(e.setTarget(s.attributes.target||null),n(s.attributes.target||null,r))}}function Bz(e){let t=e.getChildren();for(let n=t.length-1;n>=0;n--)e.insertAfter(t[n]);return e.remove(),t.map(e=>e.getLatest())}var Vz={changeHandlers:[],excludeParents:[],matchers:[],separatorRegex:Az};function Hz(e,t=Vz){let{matchers:n,changeHandlers:r,excludeParents:i,separatorRegex:a=Az}=t,o=(e,t)=>{for(let n of r)n(e,t)};return am(e.registerNodeTransform(nc,e=>{let t=e.getParentOrThrow(),r=e.getPreviousSibling();xz(t)?zz(t,n,o,a):!vz(t)&&!i.some(e=>e(t))&&(e.isSimpleText()&&(Nz(e.getTextContent(),a)||!xz(r))&&(function(e,t,n,r){for(let t of e){let e=t.getParent();if(xz(e)&&!e.getIsUnlinked())return}let i=[...e],a=i.map(e=>e.getTextContent()).join(``),o,s=a,c=0;for(;(o=kz(s,t))&&o!==null;){let e=o.index,t=e+o.length;if(Iz(c+e,c+t,r,a,i)){let[r,,a,l]=Lz(i,c+e,c+t),u=!1;for(let e of a){let t=e.getParent();if(xz(t)&&!t.getIsUnlinked()){u=!0;break}}if(u){c+=t,s=s.substring(t);continue}let d=Rz(a,c+e-r,c+t-r,o);i=d?[d,...l]:l,n(o.url,null),c=0}else c+=t;s=s.substring(t)}})(function(e){let t=[e],n=e.getNextSibling();for(;n!==null&&V(n)&&n.isSimpleText()&&(t.push(n),!/[\s]/.test(n.getTextContent()));)n=n.getNextSibling();return t}(e),n,o,a),(function(e,t,n,r){let i=e.getParent(),a=e.getPreviousSibling(),o=e.getNextSibling(),s=e.getTextContent();if(!xz(i)||i.getIsUnlinked()){if(xz(a)&&!a.getIsUnlinked()&&a.is(e.getPreviousSibling())&&e.getParent()===a.getParent()){if(!Nz(s,r))return Bz(a),void n(null,a.getURL());if(c=s,a.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(c):/^\.[a-zA-Z0-9]{1,}/.test(c)){let i=a.getTextContent()+s,o=kz(i,t);o!==null&&o.text===i&&(a.append(e),zz(a,t,n,r),n(null,a.getURL()))}}var c;!xz(o)||o.getIsUnlinked()||Mz(s,r)||o.is(e.getNextSibling())&&e.getParent()===o.getParent()&&(Bz(o),n(null,o.getURL()))}})(e,n,o,a))}),e.registerCommand(Sz,e=>{let t=U();return e!==null||!H(t)||t.extract().forEach(e=>{let t=e.getParent();xz(t)&&(t.setIsUnlinked(!t.getIsUnlinked()),t.markDirty())}),!1},1))}var Uz={testNode:`link`,visitNode({mdastNode:e,actions:t}){t.addAndStepInto(_z(e.url,{title:e.title}))}},Wz={testLexicalNode:vz,visitLexicalNode:({lexicalNode:e,actions:t})=>{t.addAndStepInto(`link`,{url:e.getURL(),title:e.getTitle()})}};function Gz({validateUrl:e,attributes:t}){let[n]=ZT();return(0,I.useEffect)(()=>{if(!n.hasNodes([fz]))throw Error(`LinkPlugin: LinkNode not registered on editor`)}),(0,I.useEffect)(()=>Dz(n,nh({attributes:t,validateUrl:e})),[n,e,t]),null}function Kz(e,t,n,r){(0,I.useEffect)(()=>{e.hasNodes([yz])||function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(77)}),(0,I.useEffect)(()=>Hz(e,{changeHandlers:n?[n]:[],excludeParents:r??[],matchers:t}),[e,t,n,r])}function qz({matchers:e,onChange:t,excludeParents:n}){let[r]=ZT();return Kz(r,e,t,n),null}var Jz=[Oz(/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,e=>e.startsWith(`http`)?e:`https://${e}`),Oz(/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/,e=>`mailto:${e}`)],Yz=()=>I.createElement(qz,{matchers:Jz}),Xz=R(!1),Zz=zr({init(e,t){let n=!!t?.disableAutoLink,r=t?.validateUrl?{validateUrl:t.validateUrl}:{},i=()=>I.createElement(I.Fragment,null,I.createElement(Gz,{...r}),n?null:I.createElement(Yz,null));e.pubIn({[UD]:`link`,[iD]:Uz,[rD]:[fz,yz],[sD]:Wz,[Xz]:n,[MD]:i,[PD]:i,[TD]:i})}}),Qz=e=>e.type===`checkbox`,$z=e=>e.type===`file`,eB=e=>e instanceof Date,tB=e=>e==null,nB=e=>typeof e==`object`,rB=e=>!tB(e)&&!Array.isArray(e)&&nB(e)&&!eB(e),iB=e=>rB(e)&&e.target?Qz(e.target)?e.target.checked:$z(e.target)?e.target.files:e.target.value:e,aB=/[.[\]'"]/,oB=e=>e.split(aB).filter(Boolean);function sB(e,t){let n=oB(t),r=e._formValues,i=e._defaultValues;for(let e=0;e<n.length-1;e++){let t=n[e];if(r=r==null?r:r[t],i=i==null?i:i[t],r===null||i===null)return null}}var cB=(e,t)=>t.split(`.`).some((t,n,r)=>!isNaN(Number(t))&&e.has(r.slice(0,n).join(`.`))),lB=typeof window<`u`&&window.HTMLElement!==void 0&&typeof document<`u`;function uB(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e);let t=typeof FileList<`u`&&e instanceof FileList;if(lB&&(e instanceof Blob||t))return e;let n=Array.isArray(e);if(!n&&e.constructor!==Object)return e;let r=n?[]:Object.create(Object.getPrototypeOf(e));for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=uB(e[t]));return r}var dB={BLUR:`blur`,FOCUS_OUT:`focusout`,CHANGE:`change`,SUBMIT:`submit`,TRIGGER:`trigger`,VALID:`valid`},fB={onBlur:`onBlur`,onChange:`onChange`,onSubmit:`onSubmit`,onTouched:`onTouched`,all:`all`},pB={max:`max`,min:`min`,maxLength:`maxLength`,minLength:`minLength`,pattern:`pattern`,required:`required`,validate:`validate`},mB=`root`,hB=[`__proto__`,`constructor`,`prototype`],gB=/^\w*$/,_B=e=>gB.test(e),vB=e=>e===void 0,Z=(e,t,n)=>{if(!t||!rB(e))return n;let r=_B(t)?[t]:oB(t);if(r.some(e=>hB.includes(e)))return n;let i=r.reduce((e,t)=>tB(e)?void 0:e[t],e);return vB(i)||i===e?vB(e[t])?n:e[t]:i},yB=e=>typeof e==`boolean`,bB=e=>typeof e==`function`,xB=(e,t,n)=>{let r=-1,i=_B(t)?[t]:oB(t),a=i.length,o=a-1;for(;++r<a;){let t=i[r],a=n;if(r!==o){let n=e[t];a=rB(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if(hB.includes(t))return;e[t]=a,e=e[t]}},SB=I.createContext(null);SB.displayName=`HookFormControlContext`;var CB=()=>I.useContext(SB),wB=(e,t,n,r=!0)=>{let i={};for(let a in e)Object.defineProperty(i,a,{get:()=>{let i=a;return t._proxyFormState[i]!==fB.all&&(t._proxyFormState[i]=!r||fB.all),n&&(n[i]=!0),e[i]}});return i},TB=lB?I.useLayoutEffect:I.useEffect,EB=e=>{let t=e.constructor&&e.constructor.prototype;return rB(t)&&t.hasOwnProperty(`isPrototypeOf`)},DB=e=>tB(e)||!nB(e),OB=(e,t)=>t.length===0&&!Array.isArray(e)&&!EB(e);function kB(e,t,n=new WeakMap){if(e===t)return!0;if(DB(e)||DB(t))return Object.is(e,t);if(eB(e)&&eB(t))return Object.is(e.getTime(),t.getTime());let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(OB(e,r)||OB(t,i))return Object.is(e,t);if(!r.length&&Array.isArray(e)!==Array.isArray(t))return!1;let a=n.get(e);if(a&&a.has(t))return!0;if(a)a.add(t);else{let r=new WeakSet;r.add(t),n.set(e,r)}for(let i of r){let r=e[i];if(!(i in t))return!1;if(i!==`ref`){let e=t[i];if(eB(r)&&eB(e)||(rB(r)||Array.isArray(r))&&(rB(e)||Array.isArray(e))?!kB(r,e,n):!Object.is(r,e))return!1}}return!0}function AB(e){let t=I.useRef(!1),n=I.useRef(!1),r=I.useRef(void 0),i=I.useRef(0);return i.current++,!n.current&&e&&(n.current=!0,r.current=uB(e())),{resyncIfNeeded:I.useCallback((e,a,o)=>{if(e&&(t.current||n.current&&i.current>1)){let e=a();kB(r.current,e)||o(e)}t.current=!0},[]),snapshot:I.useCallback((e,t)=>{e&&(r.current=uB(t()))},[])}}function jB(e){let t=CB(),{control:n=t,disabled:r,name:i,exact:a}=e||{},o=()=>({...n._formState,defaultValues:n._defaultValues}),[s,c]=I.useState(o),l=I.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),{resyncIfNeeded:u,snapshot:d}=AB(o);return TB(()=>{u(!r,o,c);let e=n._subscribe({name:i,formState:l.current,exact:a,callback:e=>{!r&&c({...n._formState,...e,defaultValues:n._defaultValues})}});return()=>{e(),d(!r,o)}},[i,r,a,u,d]),I.useEffect(()=>{l.current.isValid&&n._setValid(!0)},[n]),I.useMemo(()=>wB(s,n,l.current,!1),[s,n])}var MB=e=>typeof e==`string`,NB=(e,t,n,r,i)=>MB(e)?(r&&t.watch.add(e),Z(n,e,i)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),Z(n,e,Z(i,e)))):(r&&(t.watchAll=!0),n);function PB(e){let t=CB(),{control:n=t,name:r,defaultValue:i,disabled:a,exact:o,compute:s}=e||{},c=I.useRef(i),l=I.useRef(s),u=I.useRef(void 0),d=I.useRef(n),f=I.useRef(r);l.current=s;let p=()=>{let e=n._getWatch(r,c.current);return l.current?l.current(e):e},[m,h]=I.useState(p),g=I.useCallback(e=>{let t=NB(r,n._names,e||n._formValues,!1,c.current);return l.current?l.current(t):t},[n._formValues,n._names,r]),_=I.useCallback(e=>{if(!a){let t=NB(r,n._names,e||n._formValues,!1,c.current);if(l.current){let e=l.current(t);kB(e,u.current)||(h(e),u.current=e)}else h(t)}},[n._formValues,n._names,a,r]),{resyncIfNeeded:v,snapshot:y}=AB(p),b=I.useRef(_);b.current=_;let x=I.useRef(g);x.current=g,TB(()=>{d.current!==n||!kB(f.current,r)?(d.current=n,f.current=r,b.current()):v(!a,()=>x.current(),e=>{h(e),u.current=e});let e=n._subscribe({name:r,formState:{values:!0},exact:o,callback:e=>{b.current(e.values)}});return()=>{e(),y(!a,()=>x.current())}},[n,o,r,a,v,y]),I.useEffect(()=>n._removeUnmounted());let S=d.current!==n,C=f.current;return I.useMemo(()=>{if(a)return!1;let e=!S&&!kB(C,r);return S||e},[a,S,r,C])?g():m}function FB(e){let t=CB(),{name:n,disabled:r,control:i=t,shouldUnregister:a,defaultValue:o,exact:s=!0}=e,c=cB(i._names.array,n),l=PB({control:i,name:n,defaultValue:I.useMemo(()=>{let e=Z(i._formValues,n,Z(i._defaultValues,n,o));return vB(e)?sB(i,n):e},[i,n,o]),exact:s}),u=jB({control:i,name:n,exact:s}),d=I.useRef(e),f=I.useRef(null),p=I.useRef(i.register(n,{...e.rules,value:l,...yB(e.disabled)?{disabled:e.disabled}:{}}));d.current=e;let m=I.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Z(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!Z(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Z(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Z(u.validatingFields,n)},error:{enumerable:!0,get:()=>Z(u.errors,n)}}),[u,n]),h=I.useCallback(e=>{let t=iB(e);return Z(i._fields,n)||(p.current=i.register(n,{...d.current.rules,value:t})),p.current.onChange({target:{value:iB(e),name:n},type:dB.CHANGE})},[n,i]),g=I.useCallback(()=>p.current.onBlur({target:{value:Z(i._formValues,n),name:n},type:dB.BLUR}),[n,i._formValues]),_=I.useCallback(e=>{e&&(f.current={focus:()=>bB(e.focus)&&e.focus(),select:()=>bB(e.select)&&e.select(),setCustomValidity:t=>bB(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>bB(e.reportValidity)&&e.reportValidity()});let t=Z(i._fields,n);t&&t._f&&e&&(t._f.ref=f.current)},[i._fields,n]),v=I.useMemo(()=>({name:n,value:l,...yB(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:h,onBlur:g,ref:_}),[n,r,u.disabled,h,g,_,l]);return I.useEffect(()=>{let e=i._options.shouldUnregister||a;p.current=i.register(n,{...d.current.rules,...yB(d.current.disabled)?{disabled:d.current.disabled}:{}});let t=(e,t)=>{let n=Z(i._fields,e);n&&n._f&&(n._f.mount=t)};if(t(n,!0),e){let e=uB(Z(a?i._defaultValues:i._options.values||i._defaultValues,n,Z(i._options.defaultValues,n,d.current.defaultValue)));xB(i._defaultValues,n,e),vB(Z(i._formValues,n))&&xB(i._formValues,n,e)}if(!c&&i.register(n),f.current){let e=Z(i._fields,n);e&&e._f&&(e._f.ref=f.current)}return()=>{(c?e&&!i._state.action:e)?i.unregister(n):t(n,!1)}},[n,i,c,a]),I.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),I.useMemo(()=>({field:v,formState:u,fieldState:m}),[v,u,m])}var IB=e=>e.render(FB(e)),LB=e=>({isOnSubmit:!e||e===fB.onSubmit,isOnBlur:e===fB.onBlur,isOnChange:e===fB.onChange,isOnAll:e===fB.all,isOnTouch:e===fB.onTouched}),RB=(e,t,n)=>{if(n)return!1;if(t.watchAll||t.watch.has(e))return!0;for(let n of t.watch)if(e.startsWith(n)&&e.charAt(n.length)===`.`)return!0;return!1},zB=(e,t,n,r)=>{for(let i of n||Object.keys(e)){if(i===`_f`)continue;let a=n?Z(e,i):e[i];if(a){let{_f:e}=a;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],i)&&!r||e.ref&&t(e.ref,e.name)&&!r)return!0;if(zB(a,t))break}else if((rB(a)||Array.isArray(a))&&zB(a,t))break}}},BB=(e,t,n)=>{let r=Z(e,n),i=Array.isArray(r)?r:[];return xB(i,mB,t[n]),xB(e,n,i),e},VB=e=>rB(e)&&!Object.keys(e).length,HB=e=>{if(!lB)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},UB=e=>e.type===`radio`,WB=e=>e instanceof RegExp,GB=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},KB={value:!1,isValid:!1},qB={value:!0,isValid:!0},JB=e=>{if(!Array.isArray(e))return KB;if(e.length>1){let t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}let t=e[0];return!t||!t.checked||t.disabled?KB:!t.attributes||!(`value`in t.attributes)||vB(t.value)||t.value===``?qB:{value:t.value,isValid:!0}},YB={isValid:!1,value:null},XB=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,YB):YB;function ZB(e,t,n=`validate`){if(MB(e)||Array.isArray(e)&&e.every(MB)||yB(e)&&!e)return{type:n,message:MB(e)?e:``,ref:t}}var QB=e=>rB(e)&&!WB(e)?e:{value:e,message:``},$B=async(e,t,n,r,i,a)=>{let{ref:o,refs:s,required:c,maxLength:l,minLength:u,min:d,max:f,pattern:p,validate:m,name:h,valueAsNumber:g,mount:_}=e._f,v=Z(n,h);if(!_||t.has(h))return{};let y=s?s[0]:o,b=e=>{if(i&&y.reportValidity){let t=yB(e)?``:e||``;s?s.forEach(e=>e.setCustomValidity(t)):y.setCustomValidity(t),y.reportValidity()}},x={},S=UB(o),C=Qz(o),w=S||C,T=(g||$z(o))&&vB(o.value)&&vB(v)||HB(o)&&o.value===``||v===``||Array.isArray(v)&&!v.length,E=GB.bind(null,h,r,x),ee=(e,t,n,r=pB.maxLength,i=pB.minLength)=>{let a=e?t:n;x[h]={type:e?r:i,message:a,ref:o,...E(e?r:i,a)}};if(a?!Array.isArray(v)||!v.length:c&&(!w&&(T||tB(v))||yB(v)&&!v||C&&!JB(s).isValid||S&&!XB(s).isValid)){let{value:e,message:t}=MB(c)?{value:!!c,message:c}:QB(c);if(e&&(x[h]={type:pB.required,message:t,ref:y,...E(pB.required,t)},!r))return b(t),x}if(!T&&(!tB(d)||!tB(f))){let e,t,n=QB(f),i=QB(d);if(!tB(v)&&!eB(v)&&!isNaN(v)){let r=o.valueAsNumber||v&&+v;tB(n.value)||(e=r>n.value),tB(i.value)||(t=r<i.value)}else{let r=o.valueAsDate||new Date(v),a=e=>new Date(new Date().toDateString()+` `+e),s=o.type==`time`,c=o.type==`week`;MB(n.value)&&v&&(e=s?a(v)>a(n.value):c?v>n.value:r>new Date(n.value)),MB(i.value)&&v&&(t=s?a(v)<a(i.value):c?v<i.value:r<new Date(i.value))}if((e||t)&&(ee(!!e,n.message,i.message,pB.max,pB.min),!r))return b(x[h].message),x}if((l||u)&&!T&&(MB(v)||a&&Array.isArray(v))){let e=QB(l),t=QB(u),n=!tB(e.value)&&v.length>+e.value,i=!tB(t.value)&&v.length<+t.value;if((n||i)&&(ee(n,e.message,t.message),!r))return b(x[h].message),x}if(p&&!T&&MB(v)){let{value:e,message:t}=QB(p);if(WB(e)&&!v.match(e)&&(x[h]={type:pB.pattern,message:t,ref:o,...E(pB.pattern,t)},!r))return b(t),x}if(m){if(bB(m)){let e=ZB(await m(v,n),y);if(e&&(x[h]={...e,...E(pB.validate,e.message)},!r))return b(e.message),x}else if(rB(m)){let e={};for(let t in m){if(!VB(e)&&!r)break;let i=ZB(await m[t](v,n),y,t);i&&(e={...i,...E(t,i.message)},b(i.message),r&&(x[h]=e))}if(!VB(e)&&(x[h]={ref:y,...e},!r))return x}}let D=x[h];return b(!D||D.message),x},eV=e=>Array.isArray(e)?e:[e],tV=e=>Array.isArray(e)?e.filter(Boolean):[];function nV(e,t){let n=t.length-1,r=0;for(;r<n;){if(tB(e)){e=void 0;break}e=e[t[r]],r++}return e}function rV(e){for(let t in e)if(e.hasOwnProperty(t)&&!vB(e[t]))return!1;return!0}function iV(e,t){if(MB(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;let n=Array.isArray(t)?t:_B(t)?[t]:oB(t);if(n.some(e=>hB.includes(String(e))))return e;let r=n.length===1?e:nV(e,n),i=n.length-1,a=n[i];return r&&delete r[a],i!==0&&(rB(r)&&VB(r)||Array.isArray(r)&&rV(r))&&iV(e,n.slice(0,-1)),e}var aV=I.createContext(null);aV.displayName=`HookFormContext`;var oV=()=>{let e=[];return{get observers(){return e},next:t=>{for(let n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}};function sV(e,t){let n={};for(let r in e)if(e.hasOwnProperty(r)){let i=e[r],a=t[r];if(i&&rB(i)&&a){let e=sV(i,a);rB(e)&&(n[r]=e)}else e[r]&&(n[r]=a)}return n}var cV=(e,t)=>e!==null&&nB(e)&&Object.prototype.hasOwnProperty.call(e,t),lV=(e,t)=>{if(!t)return!1;let n=e;for(let r of _B(t)?[t]:oB(t)){if(!cV(n,r))return cV(e,t);n=n[r]}return!0},uV=e=>e.type===`select-multiple`,dV=e=>UB(e)||Qz(e),fV=e=>HB(e)&&e.isConnected;function pV(e){return Array.isArray(e)||rB(e)}function mV(e,t,n=``,r=[]){for(let i in e){let a=n?`${n}.${i}`:i,o=e[i];pV(o)&&pV(Z(t,a))?mV(o,t,a,r):r.push(a)}return r}var hV=e=>{for(let t in e)if(bB(e[t]))return!0;return!1};function gV(e){return Array.isArray(e)||rB(e)&&!hV(e)}function _V(e){return!!(e&&`_f`in e)}function vV(e){return Array.isArray(e)?!e.some(e=>!vB(e)):!Object.keys(e).length}function yV(e,t){Array.isArray(e)?e[t]=void 0:delete e[t]}function bV(e,t={},n){for(let r in e){let i=e[r],a=n&&n[r];gV(i)&&(!Array.isArray(i)||!_V(a))?(t[r]=Array.isArray(i)?[]:{},bV(i,t[r],a),vV(t[r])&&yV(t,r)):vB(i)||(t[r]=!0)}return t}function xV(e,t,n,r){n||=bV(t,{},r);for(let i in e){let a=e[i],o=r&&r[i];gV(a)&&(!Array.isArray(a)||!_V(o))?(vB(t)||DB(n[i])?n[i]=bV(a,Array.isArray(a)?[]:{},o):xV(a,tB(t)?{}:t[i],n[i],o),vV(n[i])&&yV(n,i)):kB(a,t[i])?yV(n,i):n[i]=!0}return n}var SV=(e,t)=>{let n=t.split(`.`),r=[],i=n[0];for(let t=1;t<n.length;i+=`.`+n[t++])!isNaN(+n[t])&&e.has(i)&&r.push(`${i}.${n[t]}`);return r},CV=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>vB(e)?e:t?e===``?NaN:e&&+e:n&&MB(e)?new Date(e):r?r(e):e;function wV(e){let t=e.ref;return $z(t)?t.files:UB(t)?XB(e.refs).value:uV(t)?[...t.selectedOptions].map(({value:e})=>e):Qz(t)?JB(e.refs).value:CV(t.value,e)}var TV=(e,t,n,r)=>{let i={};for(let n of e){let e=Z(t,n);e&&xB(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},EV=e=>vB(e)?e:WB(e)?e.source:rB(e)?WB(e.value)?e.value.source:e.value:e,DV=`AsyncFunction`,OV=e=>{if(!e||!e.validate)return!1;if(bB(e.validate))return e.validate.constructor.name===DV;if(rB(e.validate)){for(let t in e.validate)if(e.validate[t].constructor.name===DV)return!0}return!1},kV=e=>e.mount&&(e.required||!vB(e.required)&&e.required!==!1||!vB(e.min)||!vB(e.max)||!vB(e.maxLength)||!vB(e.minLength)||e.pattern||e.validate);function AV(e,t,n){let r=Z(e,n);if(r||_B(n))return{error:r,name:n};let i=n.split(`.`);for(;i.length;){let r=i.join(`.`),a=Z(t,r),o=Z(e,r);if(a&&!Array.isArray(a)&&n!==r)return{name:n};if(o&&o.type)return{name:r,error:o};if(o&&o.root&&o.root.type)return{name:`${r}.root`,error:o.root};i.pop()}return{name:n}}var jV=(e,t,n,r)=>{n(e);let i=Object.keys(e).filter(e=>e!==`name`);return!i.length||r&&i.length>=Object.keys(t).length||i.find(e=>t[e]===(!r||fB.all))},MV=(e,t,n)=>!e||!t||e===t||eV(e).some(e=>e&&(n?e===t||e.startsWith(t+`.`):e.startsWith(t)||t.startsWith(e))),NV=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:!(n?r.isOnChange:i.isOnChange)||e,PV=(e,t)=>{let n=Z(e,t);!tV(n).length&&!(n!=null&&n.root)&&iV(e,t)},FV={mode:fB.onSubmit,reValidateMode:fB.onChange,shouldFocusError:!0},IV=`form`,LV=(e,t)=>{for(let n in e)n in t||delete e[n];Object.assign(e,t)},RV={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function zV(e={}){let t={...FV,...e},n={...uB(RV),isLoading:bB(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},r={},i=(rB(t.defaultValues)||rB(t.values))&&uB(t.defaultValues||t.values)||{},a=t.shouldUnregister?{}:uB(i),o={action:!1,actionArrayLengths:new Map,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c={},l={},u=0,d=LB(t.mode),f=LB(t.reValidateMode),p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},m={...p},h={...m},g={array:oV(),state:oV()},_=0,v=t.criteriaMode===fB.all,y=(e,t)=>n=>{clearTimeout(l[e]),l[e]=setTimeout(t,n)},b=async e=>{if(!o.keepIsValid&&!t.disabled&&(m.isValid||h.isValid||e)){let e=++_,i;t.resolver?(i=VB((await ne()).errors),e===_&&x()):i=await re({fields:r,onlyCheckValid:!0,eventType:dB.VALID}),e===_&&i!==n.isValid&&g.state.next({isValid:i})}},x=(e,r)=>{!t.disabled&&(m.isValidating||m.validatingFields||h.isValidating||h.validatingFields)&&((e||s.mount).forEach(e=>{e&&(r?xB(n.validatingFields,e,r):iV(n.validatingFields,e))}),g.state.next({validatingFields:n.validatingFields,isValidating:!VB(n.validatingFields)}))},S=()=>{n.dirtyFields=xV(i,a,void 0,r)},C=(e,i=[],s,c,l=!0,u=!0)=>{if(c&&s&&!t.disabled){o.action=!0;let t=Z(r,e);if(o.actionArrayLengths.has(e)||o.actionArrayLengths.set(e,Array.isArray(t)?t.length:0),u&&Array.isArray(t)){let n=s(t,c.argA,c.argB);l&&xB(r,e,n)}let a=Z(n.errors,e);if(u&&Array.isArray(a)){let t=a.root,r=s(a,c.argA,c.argB)||a;t&&(r.root=t),l&&xB(n.errors,e,r),PV(n.errors,e)}let d=Z(n.touchedFields,e);if((m.touchedFields||h.touchedFields)&&u&&Array.isArray(d)){let t=s(d,c.argA,c.argB);l&&xB(n.touchedFields,e,t)}(m.dirtyFields||h.dirtyFields)&&S(),g.state.next({name:e,isDirty:ie(e,i),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else xB(a,e,i)},w=(e,t)=>{xB(n.errors,e,t),n.errors={...n.errors},g.state.next({errors:n.errors})},T=e=>{n.errors=e,g.state.next({errors:n.errors,isValid:!1})},E=e=>{let t=_B(e)?[e]:oB(e),n=a,r=i;for(let e=0;e<t.length-1;e++){let i=t[e];if(n=tB(n)?n:n[i],r=tB(r)?r:r[i],n===null&&r!==null)return!0}return!1},ee=e=>{if(!o.actionArrayLengths.size)return!1;let t=_B(e)?[e]:oB(e),n=a,r=``,i=-1,s=0;for(let e=0;e<t.length;e++){if(tB(n))return!1;let a=t[e];if(r=r?`${r}.${a}`:a,Array.isArray(n)&&+a>=n.length)return i===-1?!1:e!==i||+a<s;o.actionArrayLengths.has(r)&&(i=e+1,s=o.actionArrayLengths.get(r)),n=n[a]}return!1},D=(t,c,l,u)=>{let d=Z(r,t);if(d){if(E(t)||ee(t))return;let r=vB(Z(a,t)),f=Z(a,t,vB(l)?Z(i,t):l);vB(f)||u&&u.defaultChecked||c?xB(a,t,c?f:wV(d._f)):se(t,f),o.mount&&!o.action&&(b(),r&&n.isDirty&&(m.isDirty||h.isDirty)&&(ie()||(n.isDirty=!1,g.state.next({...n}))),e.shouldUnregister&&r&&!vB(Z(a,t))&&RB(t,s)&&(o.watch=!0))}},O=(e,o,s,c,l)=>{let u=!1,d=!1,f={name:e};if(!t.disabled||c===!0){if(!s||c){let t=kB(Z(i,e),o);(m.isDirty||h.isDirty)&&(d=n.isDirty,n.isDirty=f.isDirty=!t||ie(),u=d!==f.isDirty),d=!!Z(n.dirtyFields,e),t===n.isDirty?t?iV(n.dirtyFields,e):xB(n.dirtyFields,e,!0):LV(n.dirtyFields,xV(i,a,void 0,r)),f.dirtyFields=n.dirtyFields,u||=(m.dirtyFields||h.dirtyFields)&&d!==!t}if(s){let t=Z(n.touchedFields,e);t||(xB(n.touchedFields,e,s),f.touchedFields=n.touchedFields,u||=(m.touchedFields||h.touchedFields)&&t!==s)}u&&l&&g.state.next(f)}return u?f:{}},te=(e,r,i,a)=>{let o=Z(n.errors,e),s=(m.isValid||h.isValid)&&yB(r)&&n.isValid!==r;if(t.delayError&&i?(c[e]=y(e,()=>w(e,i)),c[e](t.delayError)):(clearTimeout(l[e]),delete c[e],i?xB(n.errors,e,i):iV(n.errors,e),n.errors={...n.errors}),(i?!kB(o,i):o)||!VB(a)||s){let t={...a,...s&&yB(r)?{isValid:r}:{},errors:n.errors,name:e};g.state.next(t)}},ne=async e=>(x(e,!0),await t.resolver(a,t.context,TV(e||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),k=async e=>{let{errors:t}=await ne(e);if(x(e),e){for(let r of e){let e=Z(t,r);e?s.array.has(r)&&rB(e)&&!Object.keys(e).some(e=>!Number.isNaN(Number(e)))?BB(n.errors,{[r]:e},r):xB(n.errors,r,e):iV(n.errors,r)}n.errors={...n.errors}}else n.errors=t;return t},A=async({name:t,eventType:r})=>{if(e.validate){let i=await e.validate({formValues:a,formState:n,name:t,eventType:r});if(rB(i))for(let e in i){let t=i[e];t&&ve(`${IV}.${e}`,{message:MB(t.message)?t.message:``,type:t.type||pB.validate})}else MB(i)||!i?ve(IV,{message:i||``,type:pB.validate}):_e(IV);return i}return!0},re=async({fields:r,onlyCheckValid:i,name:o,eventType:c,context:l={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(l.runRootValidation=!0,!await A({name:o,eventType:c})&&(l.valid=!1,i)))return l.valid;for(let o in r){let u=r[o];if(u){let{_f:r,...d}=u;if(r){let o=s.array.has(r.name),c=u._f&&OV(u._f),d=m.validatingFields||m.isValidating||h.validatingFields||h.isValidating;c&&d&&x([r.name],!0);let f=await $B(u,s.disabled,a,v,t.shouldUseNativeValidation&&!i,o);if(c&&d&&x([r.name]),f[r.name]&&(l.valid=!1,i)||(!i&&(Z(f,r.name)?o?BB(n.errors,f,r.name):xB(n.errors,r.name,f[r.name]):iV(n.errors,r.name)),e.shouldUseNativeValidation&&f[r.name]))break}!VB(d)&&await re({context:l,onlyCheckValid:i,fields:d,name:o,eventType:c})}}return l.valid},j=()=>{for(let e of s.unMount){let t=Z(r,e);t&&(t._f.refs?t._f.refs.every(e=>!fV(e)):!fV(t._f.ref))&&Se(e)}s.unMount=new Set},ie=(e,t)=>(e&&t&&xB(a,e,t),!kB(o.mount?a:i,i)),ae=(e,t,n)=>NB(e,s,{...o.mount?a:vB(t)||MB(e)?i:t},n,t),oe=e=>tV(Z(o.mount?a:i,e,t.shouldUnregister?Z(i,e,[]):[])),se=(e,t,n={},i=!1,o=!1,s=!1)=>{let c=Z(r,e),l=t;if(c){let n=c._f;n&&(!n.disabled&&xB(a,e,CV(t,n)),l=HB(n.ref)&&tB(t)?``:t,uV(n.ref)?[...n.ref.options].forEach(e=>e.selected=l.includes(e.value)):n.refs?Qz(n.ref)?n.refs.forEach(e=>{(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(l)?!!l.find(t=>t===e.value):l===e.value||!!l)}):n.refs.forEach(e=>e.checked=e.value===l):$z(n.ref)?n.ref.value=``:(n.ref.value=l,!n.ref.type&&!o&&!s&&g.state.next({name:e,values:i?a:uB(a)})))}(n.shouldDirty||n.shouldTouch)&&O(e,l,n.shouldTouch,n.shouldDirty,!o),n.shouldValidate&&pe(e,{delayError:n.delayError})},ce=(e,t,n,i=!1,o=!1,c=!1)=>{s.array.has(e)&&g.array.next({name:e,values:i?a:uB(a)});for(let a in t){if(!t.hasOwnProperty(a))continue;let l=t[a],u=e+`.`+a,d=Z(r,u);(s.array.has(e)||rB(l)||d&&!d._f)&&!eB(l)?ce(u,l,n,i,o,c):se(u,l,n,i,o,c)}},le=(e,t,i,c,l=!1)=>{let u=Z(r,e),d=s.array.has(e),f=c?t:uB(t),p=kB(Z(a,e),f);if(p||xB(a,e,f),d)g.array.next({name:e,values:c?a:uB(a)}),(m.isDirty||m.dirtyFields||h.isDirty||h.dirtyFields)&&i.shouldDirty&&(S(),l||g.state.next({name:e,dirtyFields:n.dirtyFields,isDirty:ie(e,f)}));else{let t=Array.isArray(f)&&!f.length||VB(f),n=!p&&!l;!u||u._f||tB(f)||t?se(e,f,i,c,l,n):ce(e,f,i,c,l,n)}if(!p&&!l){let t=RB(e,s),r=c?a:uB(a);if(g.state.next({...t&&n,name:o.mount||t?e:void 0,values:r}),!d)for(let t of SV(s.array,e))g.state.next({name:t,values:r})}},M=(e,t,n={})=>le(e,t,n,!1),ue=(e,t={})=>{let r=bB(e)?e(a):e;if(!kB(a,r)){a={...a,...r};for(let e of s.mount)lV(r,e)&&le(e,Z(r,e),t,!0,!0);g.state.next({...n,name:void 0,type:void 0,...u?{values:a}:{}}),t.shouldValidate&&b()}},de=async i=>{o.mount=!0;let l=i.target,p=l.name,_=!0,y=Z(r,p),S=e=>{_=Number.isNaN(e)||eB(e)&&isNaN(e.getTime())||kB(e,Z(a,p,e))};if(y){let o,C,w=l.type?wV(y._f):iB(i),T=i.type===dB.BLUR||i.type===dB.FOCUS_OUT,E=!kV(y._f)&&!e.validate&&!t.resolver&&!Z(n.errors,p)&&!y._f.deps,ee=E||NV(T,Z(n.touchedFields,p),n.isSubmitted,f,d),D=RB(p,s,T);if(xB(a,p,uB(w)),T){if(!l||!l.readOnly){y._f.onBlur&&y._f.onBlur(i);let e=c[p];e&&e(0)}}else y._f.onChange&&y._f.onChange(i);let k=O(p,w,T),j=!VB(k)||D;if(!T&&g.state.next({name:p,type:i.type,...u?{values:uB(a)}:{}}),ee)return(!E||!n.isValid)&&(m.isValid||h.isValid)&&(t.mode===`onBlur`?T&&b():T||b()),j&&g.state.next({name:p,...D?{}:k});if(!t.resolver&&e.validate&&await A({name:p,eventType:i.type}),!T&&D&&g.state.next({...n}),t.resolver){let{errors:e}=await ne([p]);if(x([p]),S(w),!_){!VB(k)&&g.state.next(k);return}let t=AV(n.errors,r,p),i=AV(e,r,t.name||p);o=i.error,p=i.name,C=VB(e)}else x([p],!0),o=(await $B(y,s.disabled,a,v,t.shouldUseNativeValidation))[p],x([p]),S(w),_&&(o?C=!1:(m.isValid||h.isValid)&&(C=await re({fields:r,onlyCheckValid:!0,name:p,eventType:i.type})));_&&(y._f.deps&&(!Array.isArray(y._f.deps)||y._f.deps.length>0)&&pe(y._f.deps),te(p,C,o,k))}},fe=(e,t)=>{if(Z(n.errors,t)&&e.focus)return e.focus(),1},pe=async(e,i={})=>{let a,o,u=eV(e);if(t.resolver){let t=await k(vB(e)?e:u);a=VB(t),o=e?!u.some(e=>Z(t,e)):a}else e?(o=(await Promise.all(u.map(async e=>{let t=Z(r,e);return await re({fields:t&&t._f?{[e]:t}:t,eventType:dB.TRIGGER})}))).every(Boolean),(o||n.isValid)&&b()):o=a=await re({fields:r,name:e,eventType:dB.TRIGGER});if(i.delayError&&t.delayError&&MB(e)){let r=Z(n.errors,e);r?(iV(n.errors,e),c[e]=y(e,()=>w(e,r)),c[e](t.delayError)):(clearTimeout(l[e]),delete c[e])}if(i.shouldTouch)for(let t of e?u:s.mount)!s.array.has(t)&&xB(n.touchedFields,t,!0);return g.state.next({...!MB(e)||(m.isValid||h.isValid)&&a!==n.isValid?{}:{name:e},...t.resolver||!e?{isValid:a}:{},...i.shouldTouch&&(m.touchedFields||h.touchedFields)?{touchedFields:n.touchedFields}:{},errors:n.errors}),i.shouldFocus&&!o&&zB(r,fe,e?u:s.mount),o},me=(e,t)=>{let r={...o.mount?a:i};return t&&(r=sV(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),vB(e)?r:MB(e)?Z(r,e):e.map(e=>Z(r,e))},he=e=>vB(e)?{...n.errors}:MB(e)?Z(n.errors,e):e.map(e=>Z(n.errors,e)),ge=(e,t)=>{let r=t||n,i=Z(r.errors,e);return{invalid:!!i,isDirty:!!Z(r.dirtyFields,e),error:i,isValidating:!!Z(n.validatingFields,e),isTouched:!!Z(r.touchedFields,e)}},_e=e=>{let t=e?eV(e):void 0;t?.forEach(e=>iV(n.errors,e)),t?t.forEach(e=>{g.state.next({name:e,errors:n.errors})}):(n.errors={},g.state.next({errors:n.errors}))},ve=(e,t,i)=>{let a=(Z(r,e,{_f:{}})._f||{}).ref,{ref:o,message:s,type:c,...l}=Z(n.errors,e)||{};xB(n.errors,e,{...l,...t,ref:a}),g.state.next({name:e,errors:n.errors,isValid:!1}),i&&i.shouldFocus&&a&&a.focus&&a.focus()},ye=(e,t)=>{if(bB(e)){u++;let{unsubscribe:n}=g.state.subscribe({next:n=>`values`in n&&e(n.values||ae(void 0,t),n)}),r=!1;return{unsubscribe:()=>{r||(r=!0,u--,n())}}}return ae(e,t,!0)},be=e=>{let t=!!e.formState?.values;t&&u++;let{unsubscribe:r}=g.state.subscribe({next:t=>{if(MV(e.name,t.name,e.exact)&&jV(t,e.formState||m,Me,e.reRenderRoot)){let r={...a};e.callback({values:r,...n,...t,defaultValues:i})}}});if(!t)return r;let o=!1;return()=>{o||(o=!0,u--,r())}},xe=e=>(o.mount=!0,h={...h,...e.formState},be({...e,formState:{...p,...e.formState}})),Se=(e,o={})=>{for(let c of e?eV(e):s.mount)s.mount.delete(c),s.array.delete(c),o.keepValue||(iV(r,c),iV(a,c)),!o.keepError&&iV(n.errors,c),!o.keepDirty&&iV(n.dirtyFields,c),!o.keepTouched&&iV(n.touchedFields,c),!o.keepIsValidating&&iV(n.validatingFields,c),!t.shouldUnregister&&!o.keepDefaultValue&&iV(i,c);u&&g.state.next({values:uB(a)}),g.state.next({...n,...o.keepDirty?{}:{isDirty:ie()}}),!o.keepIsValid&&b()},Ce=({disabled:e,name:t})=>{if(yB(e)&&o.mount||e||s.disabled.has(t)){let n=s.disabled.has(t)!==!!e;e?s.disabled.add(t):s.disabled.delete(t),n&&o.mount&&!o.action&&b()}},we=(e,n={})=>{let a=Z(r,e),c=yB(n.disabled)||yB(t.disabled),l=!s.registerName.has(e)&&a&&a._f&&!a._f.mount;return xB(r,e,{...a||{},_f:{...a&&a._f?a._f:{ref:{name:e}},name:e,mount:!0,...n}}),s.mount.add(e),a&&!l?Ce({disabled:yB(n.disabled)?n.disabled:t.disabled,name:e}):D(e,!0,n.value),{...c?{disabled:n.disabled||t.disabled}:{},...t.progressive?{required:!!n.required,min:EV(n.min),max:EV(n.max),minLength:EV(n.minLength),maxLength:EV(n.maxLength),pattern:EV(n.pattern)}:{},name:e,onChange:de,onBlur:de,ref:c=>{if(c){s.registerName.add(e),we(e,n),s.registerName.delete(e),a=Z(r,e);let t=vB(c.value)&&c.querySelectorAll&&c.querySelectorAll(`input,select,textarea`)[0]||c,o=dV(t),l=a._f.refs||[];if(o?l.find(e=>e===t):t===a._f.ref)return;let u={...a._f};o?(u.refs=[...l.filter(fV),t,...Array.isArray(Z(i,e))?[{}]:[]],u.ref={type:t.type,name:e}):(u.ref=t,delete u.refs),xB(r,e,{_f:u}),D(e,!1,void 0,t)}else a=Z(r,e,{}),a._f&&(a._f.mount=!1),(t.shouldUnregister||n.shouldUnregister)&&!(cB(s.array,e)&&o.action)&&s.unMount.add(e)}}},Te=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&zB(r,fe,s.mount),Ee=e=>{yB(e)&&(g.state.next({disabled:e}),zB(r,(t,n)=>{let i=Z(r,n);i&&(t.disabled=i._f.disabled||e,Array.isArray(i._f.refs)&&i._f.refs.forEach(t=>{t.disabled=i._f.disabled||e}))},0,!1))},De=(e,i)=>async o=>{let c,l;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let u=uB(a);if(g.state.next({isSubmitting:!0}),t.resolver){let{errors:e,values:t}=await ne();x(),n.errors=e,u=uB(t)}else await re({fields:r,eventType:dB.SUBMIT});if(s.disabled.size)for(let e of s.disabled)iV(u,e);if(iV(n.errors,mB),VB(n.errors)){g.state.next({errors:{}});try{c=await e(u,o)}catch(e){l=e}}else i&&await i({...n.errors},o),Te(),setTimeout(Te);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:VB(n.errors)&&!l,submitCount:n.submitCount+1,errors:n.errors}),l)throw l;return c},Oe=(e,t={})=>{Z(r,e)&&(vB(t.defaultValue)?M(e,uB(Z(i,e))):(M(e,t.defaultValue),xB(i,e,uB(t.defaultValue))),t.keepTouched||iV(n.touchedFields,e),t.keepDirty||(iV(n.dirtyFields,e),n.isDirty=t.defaultValue?ie(e,uB(Z(i,e))):ie()),t.keepError||(iV(n.errors,e),b()),g.state.next({...n}))},ke=(e,c={})=>{let l=e?uB(e):i,u=uB(l),d=VB(e),f=u,p=r;if(c.keepDefaultValues||(i=l),!c.keepValues){if(c.keepDirtyValues){let e=new Set([...s.mount,...mV(xV(i,a,void 0,p),n.dirtyFields)]);for(let t of e){let e=Z(n.dirtyFields,t),r=Z(a,t),i=Z(f,t);e&&!vB(r)?xB(f,t,r):!e&&!vB(i)&&M(t,i)}}else{if(lB&&vB(e))for(let e of s.mount){let t=Z(r,e);if(t&&t._f){let e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(HB(e)){let t=e.closest(`form`);if(t){t.reset();break}}}}if(c.keepFieldsRef)for(let e of s.mount)M(e,Z(f,e));else r={}}if(t.shouldUnregister){if(a=c.keepDefaultValues?uB(i):{},c.keepFieldsRef)for(let e of s.mount)xB(a,e,Z(f,e))}else a=uB(f);g.array.next({values:{...f}}),g.state.next({name:void 0,type:void 0,values:{...f}})}s={mount:c.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:``},o.mount=!m.isValid||!!c.keepIsValid||!!c.keepDirtyValues||!t.shouldUnregister&&!VB(f),o.watch=!!t.shouldUnregister,o.keepIsValid=!!c.keepIsValid,o.action=!1,o.actionArrayLengths.clear(),c.keepErrors||(n.errors={}),g.state.next({submitCount:c.keepSubmitCount?n.submitCount:0,isDirty:d?!1:c.keepDirty?n.isDirty:c.keepValues?ie():!(!c.keepDefaultValues||kB(e,i)),isSubmitted:c.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:d?{}:c.keepDirtyValues?c.keepDefaultValues&&a?xV(i,a,void 0,p):n.dirtyFields:c.keepDefaultValues&&e?xV(i,e,void 0,p):c.keepDirty?n.dirtyFields:{},touchedFields:c.keepTouched?n.touchedFields:{},errors:c.keepErrors?n.errors:{},isSubmitSuccessful:c.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},Ae=(e,n)=>ke(bB(e)?e(a):e,{...t.resetOptions,...n}),je=(e,t={})=>{let n=Z(r,e),i=n&&n._f;if(i){let e=i.refs?i.refs[0]:i.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&bB(e.select)&&e.select()})}},Me=e=>{let{name:t,type:r,values:i,...a}=e;n={...n,...a}};g.state.subscribe({next:Me});let Ne={control:{register:we,unregister:Se,getFieldState:ge,handleSubmit:De,setError:ve,_subscribe:be,_runSchema:ne,_updateIsValidating:x,_focusError:Te,_getWatch:ae,_getDirty:ie,_setValid:b,_setFieldArray:C,_setDisabledField:Ce,_setErrors:T,_getFieldArray:oe,_reset:ke,_resetDefaultValues:()=>bB(t.defaultValues)&&t.defaultValues().then(e=>{Ae(e,t.resetOptions),g.state.next({isLoading:!1})}),_removeUnmounted:j,_disableForm:Ee,_subjects:g,_proxyFormState:m,get _fields(){return r},get _formValues(){return a},get _state(){return o},set _state(e){o=e},get _defaultValues(){return i},get _names(){return s},set _names(e){s=e},get _formState(){return n},get _options(){return t},set _options(e){t={...t,...e},d=LB(t.mode),f=LB(t.reValidateMode)}},subscribe:xe,trigger:pe,register:we,handleSubmit:De,watch:ye,setValue:M,setValues:ue,getValues:me,getErrors:he,reset:Ae,resetField:Oe,resetDefaultValues:(e,t={})=>{if(i=uB(e),!t.keepDirty){let e=xV(i,a,void 0,r);n.dirtyFields=e,n.isDirty=!VB(e)}t.keepIsValid||b(),g.state.next({...n,defaultValues:i})},clearErrors:_e,unregister:Se,setError:ve,setFocus:je,getFieldState:ge};return{...Ne,formControl:Ne}}function BV(e={}){let t=I.useRef(void 0),n=I.useRef(void 0),r=I.useRef(e.formControl),[i,a]=I.useState(()=>({...uB(RV),isLoading:bB(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:bB(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&r.current!==e.formControl){if(r.current=e.formControl,e.formControl)t.current={...e.formControl,formState:i},e.defaultValues&&!bB(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{let{formControl:n,...r}=zV(e);t.current={...r,formState:i}}}let o=t.current.control;o._options=e;let{resyncIfNeeded:s,snapshot:c}=AB();return TB(()=>{let e=()=>({...o._formState,defaultValues:o._defaultValues});s(!0,e,a);let t=o._subscribe({formState:o._proxyFormState,callback:()=>a({...o._formState,defaultValues:o._defaultValues}),reRenderRoot:!0});return a(e=>({...e,isReady:!0})),o._formState.isReady=!0,()=>{t(),c(!0,e)}},[o,s,c]),I.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),I.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),I.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),I.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),I.useEffect(()=>{if(o._proxyFormState.isDirty){let e=o._getDirty();e!==i.isDirty&&o._subjects.state.next({isDirty:e})}},[o,i.isDirty]),I.useEffect(()=>{e.values&&!kB(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),o._options.resetOptions?.keepIsValid||o._setValid(),n.current=e.values,a(e=>({...e}))):o._resetDefaultValues()},[o,e.values]),I.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=I.useMemo(()=>wB(i,o),[o,i]),t.current}function VV(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function HV(){return HV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},HV.apply(null,arguments)}var UV=e(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),WV=e(((e,t)=>{var n=UV();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),GV=e(((e,t)=>{t.exports=WV()()})),KV=e((e=>{if(typeof Symbol==`function`&&Symbol.for){var t=Symbol.for;t(`react.element`),t(`react.portal`),t(`react.fragment`),t(`react.strict_mode`),t(`react.profiler`),t(`react.provider`),t(`react.context`),t(`react.forward_ref`),t(`react.suspense`),t(`react.suspense_list`),t(`react.memo`),t(`react.lazy`),t(`react.block`),t(`react.server.block`),t(`react.fundamental`),t(`react.debug_trace_mode`),t(`react.legacy_hidden`)}})),qV=e(((e,t)=>{t.exports=KV()})),JV=e=>typeof e==`object`&&!!e&&e.nodeType===1,YV=(e,t)=>(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`,XV=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return YV(n.overflowY,t)||YV(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch{return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},ZV=(e,t,n,r,i,a,o,s)=>a<e&&o>t||a>e&&o<t?0:a<=e&&s<=n||o>=t&&s>=n?a-e-r:o>t&&s<n||a<e&&s>n?o-t+i:0,QV=e=>e.parentElement??(e.getRootNode().host||null),$V=(e,t)=>{if(typeof document>`u`)return[];let{scrollMode:n,block:r,inline:i,boundary:a,skipOverflowHiddenElements:o}=t,s=typeof a==`function`?a:e=>e!==a;if(!JV(e))throw TypeError(`Invalid target`);let c=document.scrollingElement||document.documentElement,l=[],u=e;for(;JV(u)&&s(u);){if(u=QV(u),u===c){l.push(u);break}u!=null&&u===document.body&&XV(u)&&!XV(document.documentElement)||u!=null&&XV(u,o)&&l.push(u)}let d=window.visualViewport?.width??innerWidth,f=window.visualViewport?.height??innerHeight,p=window.scrollX??pageXOffset,m=window.scrollY??pageYOffset,{height:h,width:g,top:_,right:v,bottom:y,left:b}=e.getBoundingClientRect(),x=r===`start`||r===`nearest`?_:r===`end`?y:_+h/2,S=i===`center`?b+g/2:i===`end`?v:b,C=[];for(let e=0;e<l.length;e++){let t=l[e],{height:a,width:o,top:s,right:u,bottom:w,left:T}=t.getBoundingClientRect();if(n===`if-needed`&&_>=0&&b>=0&&y<=f&&v<=d&&_>=s&&y<=w&&b>=T&&v<=u)return C;let E=getComputedStyle(t),ee=parseInt(E.borderLeftWidth,10),D=parseInt(E.borderTopWidth,10),O=parseInt(E.borderRightWidth,10),te=parseInt(E.borderBottomWidth,10),ne=0,k=0,A=`offsetWidth`in t?t.offsetWidth-t.clientWidth-ee-O:0,re=`offsetHeight`in t?t.offsetHeight-t.clientHeight-D-te:0,j=`offsetWidth`in t?t.offsetWidth===0?0:o/t.offsetWidth:0,ie=`offsetHeight`in t?t.offsetHeight===0?0:a/t.offsetHeight:0;if(c===t)ne=r===`start`?x:r===`end`?x-f:r===`nearest`?ZV(m,m+f,f,D,te,m+x,m+x+h,h):x-f/2,k=i===`start`?S:i===`center`?S-d/2:i===`end`?S-d:ZV(p,p+d,d,ee,O,p+S,p+S+g,g),ne=Math.max(0,ne+m),k=Math.max(0,k+p);else{ne=r===`start`?x-s-D:r===`end`?x-w+te+re:r===`nearest`?ZV(s,w,a,D,te+re,x,x+h,h):x-(s+a/2)+re/2,k=i===`start`?S-T-ee:i===`center`?S-(T+o/2)+A/2:i===`end`?S-u+O+A:ZV(T,u,o,ee,O+A,S,S+g,g);let{scrollLeft:e,scrollTop:n}=t;ne=Math.max(0,Math.min(n+ne/ie,t.scrollHeight-a/ie+re)),k=Math.max(0,Math.min(e+k/j,t.scrollWidth-o/j+A)),x+=n-ne,S+=e-k}C.push({el:t,top:ne,left:k})}return C},Q=a(GV());qV();var eH=0;function tH(){}function nH(e,t){e&&$V(e,{boundary:t,block:`nearest`,scrollMode:`if-needed`}).forEach(function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r})}function rH(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function iH(e,t){var n;function r(){n&&clearTimeout(n)}function i(){var i=[...arguments];r(),n=setTimeout(function(){n=null,e.apply(void 0,i)},t)}return i.cancel=r,i}function aH(){var e=[...arguments];return function(t){var n=[...arguments].slice(1);return e.some(function(e){return e&&e.apply(void 0,[t].concat(n)),t.preventDownshiftDefault||t.hasOwnProperty(`nativeEvent`)&&t.nativeEvent.preventDownshiftDefault})}}function oH(){var e=[...arguments];return function(t){e.forEach(function(e){typeof e==`function`?e(t):e&&(e.current=t)})}}function sH(){return String(eH++)}function cH(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n===r?``:n+` result`+(n===1?` is`:`s are`)+` available, use up and down arrow keys to navigate. Press Enter key to select.`:`No results are available.`:``}function lH(e,t){return Object.keys(e).reduce(function(n,r){return n[r]=uH(t,r)?t[r]:e[r],n},{})}function uH(e,t){return e[t]!==void 0}function dH(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&t.indexOf(`Arrow`)!==0?`Arrow`+t:t}function fH(e,t,n,r,i){if(i===void 0&&(i=!0),n===0)return-1;var a=n-1;(typeof t!=`number`||t<0||t>=n)&&(t=e>0?-1:a+1);var o=t+e;o<0?o=i?a:0:o>a&&(o=i?0:a);var s=pH(e,o,n,r,i);return s===-1?t>=n?-1:t:s}function pH(e,t,n,r,i){var a=r(t);if(!a||!a.hasAttribute(`disabled`))return t;if(e>0){for(var o=t+1;o<n;o++)if(!r(o).hasAttribute(`disabled`))return o}else for(var s=t-1;s>=0;s--)if(!r(s).hasAttribute(`disabled`))return s;return i?e>0?pH(1,0,n,r,!1):pH(-1,n-1,n,r,!1):-1}function mH(e,t,n,r){return r===void 0&&(r=!0),t.some(function(t){return t&&(rH(t,e,n)||r&&rH(t,n.document.activeElement,n))})}var hH=iH(function(e){_H(e).textContent=``},500);function gH(e,t){var n=_H(t);e&&(n.textContent=e,hH(t))}function _H(e){e===void 0&&(e=document);var t=e.getElementById(`a11y-status-message`);return t||(t=e.createElement(`div`),t.setAttribute(`id`,`a11y-status-message`),t.setAttribute(`role`,`status`),t.setAttribute(`aria-live`,`polite`),t.setAttribute(`aria-relevant`,`additions text`),Object.assign(t.style,{border:`0`,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0`,position:`absolute`,width:`1px`}),e.body.appendChild(t),t)}var vH=[`isInitialMount`,`highlightedIndex`,`items`,`environment`],yH={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:``};function bH(e,t,n){var r=e.props,i=e.type,a={};Object.keys(t).forEach(function(r){xH(r,e,t,n),n[r]!==t[r]&&(a[r]=n[r])}),r.onStateChange&&Object.keys(a).length&&r.onStateChange(HV({type:i},a))}function xH(e,t,n,r){var i=t.props,a=t.type,o=`on`+AH(e)+`Change`;i[o]&&r[e]!==void 0&&r[e]!==n[e]&&i[o](HV({type:a},r))}function SH(e,t){return t.changes}function CH(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+` has been selected.`:``}var wH=iH(function(e,t){gH(e(),t)},200),TH=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?I.useLayoutEffect:I.useEffect;function EH(e){var t=e.id,n=t===void 0?`downshift-`+sH():t,r=e.labelId,i=e.menuId,a=e.getItemId,o=e.toggleButtonId,s=e.inputId;return(0,I.useRef)({labelId:r||n+`-label`,menuId:i||n+`-menu`,getItemId:a||function(e){return n+`-item-`+e},toggleButtonId:o||n+`-toggle-button`,inputId:s||n+`-input`}).current}function DH(e,t,n,r){var i,a;if(e===void 0){if(t===void 0)throw Error(r);i=n[t],a=t}else a=t===void 0?n.indexOf(e):t,i=e;return[i,a]}function OH(e){return e?String(e):``}function kH(e){return/^\S{1}$/.test(e)}function AH(e){return``+e.slice(0,1).toUpperCase()+e.slice(1)}function jH(e){var t=(0,I.useRef)(e);return t.current=e,t}function MH(e,t,n){var r=(0,I.useRef)(),i=(0,I.useRef)(),a=(0,I.useCallback)(function(t,n){i.current=n,t=lH(t,n.props);var r=e(t,n);return n.props.stateReducer(t,HV({},n,{changes:r}))},[e]),o=(0,I.useReducer)(a,t),s=o[0],c=o[1],l=jH(n),u=(0,I.useCallback)(function(e){return c(HV({props:l.current},e))},[l]),d=i.current;return(0,I.useEffect)(function(){d&&r.current&&r.current!==s&&bH(d,lH(r.current,d.props),s),r.current=s},[s,n,d]),[s,u]}function NH(e,t,n){var r=MH(e,t,n),i=r[0],a=r[1];return[lH(i,n),a]}var PH={itemToString:OH,stateReducer:SH,getA11ySelectionMessage:CH,scrollIntoView:nH,environment:typeof window>`u`?{}:window};function FH(e,t,n){n===void 0&&(n=yH);var r=e[`default`+AH(t)];return r===void 0?n[t]:r}function IH(e,t,n){n===void 0&&(n=yH);var r=e[t];if(r!==void 0)return r;var i=e[`initial`+AH(t)];return i===void 0?FH(e,t,n):i}function LH(e){var t=IH(e,`selectedItem`),n=IH(e,`isOpen`),r=IH(e,`highlightedIndex`),i=IH(e,`inputValue`);return{highlightedIndex:r<0&&t&&n?e.items.indexOf(t):r,isOpen:n,selectedItem:t,inputValue:i}}function RH(e,t,n){var r=e.items,i=e.initialHighlightedIndex,a=e.defaultHighlightedIndex,o=t.selectedItem,s=t.highlightedIndex;return r.length===0?-1:i!==void 0&&s===i?i:a===void 0?o?r.indexOf(o):n===0?-1:n<0?r.length-1:0:a}function zH(e,t,n,r){var i=(0,I.useRef)({isMouseDown:!1,isTouchMove:!1});return(0,I.useEffect)(function(){if(n?.addEventListener!=null){var a=function(){i.current.isMouseDown=!0},o=function(a){i.current.isMouseDown=!1,e&&!mH(a.target,t.map(function(e){return e.current}),n)&&r()},s=function(){i.current.isTouchMove=!1},c=function(){i.current.isTouchMove=!0},l=function(a){e&&!i.current.isTouchMove&&!mH(a.target,t.map(function(e){return e.current}),n,!1)&&r()};return n.addEventListener(`mousedown`,a),n.addEventListener(`mouseup`,o),n.addEventListener(`touchstart`,s),n.addEventListener(`touchmove`,c),n.addEventListener(`touchend`,l),function(){n.removeEventListener(`mousedown`,a),n.removeEventListener(`mouseup`,o),n.removeEventListener(`touchstart`,s),n.removeEventListener(`touchmove`,c),n.removeEventListener(`touchend`,l)}}},[e,n]),i}var BH=function(){return tH};function VH(e,t,n){var r=n.isInitialMount,i=n.highlightedIndex,a=n.items,o=n.environment,s=VV(n,vH);(0,I.useEffect)(function(){r||wH(function(){return e(HV({highlightedIndex:i,highlightedItem:a[i],resultCount:a.length},s))},o.document)},t)}function HH(e){var t=e.highlightedIndex,n=e.isOpen,r=e.itemRefs,i=e.getItemNodeFromIndex,a=e.menuElement,o=e.scrollIntoView,s=(0,I.useRef)(!0);return TH(function(){t<0||!n||!Object.keys(r.current).length||(s.current===!1?s.current=!0:o(i(t),a))},[t]),s}var UH=tH;function WH(e,t,n){n===void 0&&(n=!0);var r=e.items?.length&&t>=0;return HV({isOpen:!1,highlightedIndex:-1},r&&HV({selectedItem:e.items[t],isOpen:FH(e,`isOpen`),highlightedIndex:FH(e,`highlightedIndex`)},n&&{inputValue:e.itemToString(e.items[t])}))}function GH(e,t,n){var r=t.type,i=t.props,a;switch(r){case n.ItemMouseMove:a={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:a={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:RH(i,e,0)};break;case n.FunctionOpenMenu:a={isOpen:!0,highlightedIndex:RH(i,e,0)};break;case n.FunctionCloseMenu:a={isOpen:!1};break;case n.FunctionSetHighlightedIndex:a={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:a={inputValue:t.inputValue};break;case n.FunctionReset:a={highlightedIndex:FH(i,`highlightedIndex`),isOpen:FH(i,`isOpen`),selectedItem:FH(i,`selectedItem`),inputValue:FH(i,`inputValue`)};break;default:throw Error(`Reducer called without proper action type.`)}return HV({},e,a)}function KH(e){for(var t=e.keysSoFar,n=e.highlightedIndex,r=e.items,i=e.itemToString,a=e.getItemNodeFromIndex,o=t.toLowerCase(),s=0;s<r.length;s++){var c=(s+n+ +(t.length<2))%r.length,l=r[c];if(l!==void 0&&i(l).toLowerCase().startsWith(o)&&!a(c)?.hasAttribute(`disabled`))return c}return n}Q.default.array.isRequired,Q.default.func,Q.default.func,Q.default.func,Q.default.number,Q.default.number,Q.default.number,Q.default.bool,Q.default.bool,Q.default.bool,Q.default.any,Q.default.any,Q.default.any,Q.default.string,Q.default.string,Q.default.string,Q.default.func,Q.default.string,Q.default.func,Q.default.func,Q.default.func,Q.default.func,Q.default.func,Q.default.shape({addEventListener:Q.default.func,removeEventListener:Q.default.func,document:Q.default.shape({getElementById:Q.default.func,activeElement:Q.default.any,body:Q.default.any})});function qH(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n===r?``:`${n} result${n===1?` is`:`s are`} available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select.`:`No results are available.`:``}var JH=mF(mF({},PH),{getA11yStatusMessage:qH}),YH=tH,XH=0,ZH=1,QH=2,$H=3,eU=4,tU=5,nU=6,rU=7,iU=8,aU=9,oU=10,sU=11,cU=12,lU=13,uU=14,dU=15,fU=16,pU=17,mU=18,hU=19,gU=20,_U=21,vU=Object.freeze({__proto__:null,ToggleButtonClick:XH,ToggleButtonKeyDownArrowDown:ZH,ToggleButtonKeyDownArrowUp:QH,ToggleButtonKeyDownCharacter:$H,ToggleButtonKeyDownEscape:eU,ToggleButtonKeyDownHome:tU,ToggleButtonKeyDownEnd:nU,ToggleButtonKeyDownEnter:rU,ToggleButtonKeyDownSpaceButton:iU,ToggleButtonKeyDownPageUp:aU,ToggleButtonKeyDownPageDown:oU,ToggleButtonBlur:sU,MenuMouseLeave:cU,ItemMouseMove:lU,ItemClick:uU,FunctionToggleMenu:dU,FunctionOpenMenu:fU,FunctionCloseMenu:pU,FunctionSetHighlightedIndex:mU,FunctionSelectItem:hU,FunctionSetInputValue:gU,FunctionReset:_U});function yU(e,t){var n=t.type,r=t.props,i=t.altKey,a;switch(n){case uU:a={isOpen:FH(r,`isOpen`),highlightedIndex:FH(r,`highlightedIndex`),selectedItem:r.items[t.index]};break;case $H:var o=t.key,s=``+e.inputValue+o;a={inputValue:s,highlightedIndex:KH({keysSoFar:s,highlightedIndex:!e.isOpen&&e.selectedItem?r.items.indexOf(e.selectedItem):e.highlightedIndex,items:r.items,itemToString:r.itemToString,getItemNodeFromIndex:t.getItemNodeFromIndex}),isOpen:!0};break;case ZH:a={highlightedIndex:e.isOpen?fH(1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1):i&&e.selectedItem==null?-1:RH(r,e,1),isOpen:!0};break;case QH:a=e.isOpen&&i?WH(r,e.highlightedIndex,!1):{highlightedIndex:e.isOpen?fH(-1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1):RH(r,e,-1),isOpen:!0};break;case rU:case iU:a=WH(r,e.highlightedIndex,!1);break;case tU:a={highlightedIndex:pH(1,0,r.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case nU:a={highlightedIndex:pH(-1,r.items.length-1,r.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case aU:a={highlightedIndex:fH(-10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case oU:a={highlightedIndex:fH(10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case eU:a={isOpen:!1,highlightedIndex:-1};break;case sU:a=HV({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&r.items?.length&&{selectedItem:r.items[e.highlightedIndex]});break;case hU:a={selectedItem:t.selectedItem};break;default:return GH(e,t,vU)}return HV({},e,a)}var bU=[`onMouseLeave`,`refKey`,`onKeyDown`,`onBlur`,`ref`],xU=[`onBlur`,`onClick`,`onPress`,`onKeyDown`,`refKey`,`ref`],SU=[`item`,`index`,`onMouseMove`,`onClick`,`onPress`,`refKey`,`ref`,`disabled`];CU.stateChangeTypes=vU;function CU(e){e===void 0&&(e={}),YH(e,CU);var t=HV({},JH,e),n=t.items,r=t.scrollIntoView,i=t.environment,a=t.itemToString,o=t.getA11ySelectionMessage,s=t.getA11yStatusMessage,c=NH(yU,LH(t),t),l=c[0],u=c[1],d=l.isOpen,f=l.highlightedIndex,p=l.selectedItem,m=l.inputValue,h=(0,I.useRef)(null),g=(0,I.useRef)(null),_=(0,I.useRef)({}),v=(0,I.useRef)(null),y=EH(t),b=(0,I.useRef)(),x=(0,I.useRef)(!0),S=jH({state:l,props:t}),C=(0,I.useCallback)(function(e){return _.current[y.getItemId(e)]},[y]);VH(s,[d,f,m,n],HV({isInitialMount:x.current,previousResultCount:b.current,items:n,environment:i,itemToString:a},l)),VH(o,[p],HV({isInitialMount:x.current,previousResultCount:b.current,items:n,environment:i,itemToString:a},l));var w=HH({menuElement:g.current,highlightedIndex:f,isOpen:d,itemRefs:_,scrollIntoView:r,getItemNodeFromIndex:C});(0,I.useEffect)(function(){return v.current=iH(function(e){e({type:gU,inputValue:``})},500),function(){v.current.cancel()}},[]),(0,I.useEffect)(function(){m&&v.current(u)},[u,m]),UH({isInitialMount:x.current,props:t,state:l}),(0,I.useEffect)(function(){x.current||(b.current=n.length)});var T=zH(d,[g,h],i,function(){u({type:sU})}),E=BH(`getMenuProps`,`getToggleButtonProps`);(0,I.useEffect)(function(){return x.current=!1,function(){x.current=!0}},[]),(0,I.useEffect)(function(){d||(_.current={})},[d]);var ee=(0,I.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),u({type:ZH,getItemNodeFromIndex:C,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),u({type:QH,getItemNodeFromIndex:C,altKey:e.altKey})},Home:function(e){e.preventDefault(),u({type:tU,getItemNodeFromIndex:C})},End:function(e){e.preventDefault(),u({type:nU,getItemNodeFromIndex:C})},Escape:function(){S.current.state.isOpen&&u({type:eU})},Enter:function(e){e.preventDefault(),u({type:S.current.state.isOpen?rU:XH})},PageUp:function(e){S.current.state.isOpen&&(e.preventDefault(),u({type:aU,getItemNodeFromIndex:C}))},PageDown:function(e){S.current.state.isOpen&&(e.preventDefault(),u({type:oU,getItemNodeFromIndex:C}))}," ":function(e){e.preventDefault();var t=S.current.state;if(!t.isOpen){u({type:XH});return}t.inputValue?u({type:$H,key:` `,getItemNodeFromIndex:C}):u({type:iU})}}},[u,C,S]),D=(0,I.useCallback)(function(){u({type:dU})},[u]),O=(0,I.useCallback)(function(){u({type:pU})},[u]),te=(0,I.useCallback)(function(){u({type:fU})},[u]),ne=(0,I.useCallback)(function(e){u({type:mU,highlightedIndex:e})},[u]),k=(0,I.useCallback)(function(e){u({type:hU,selectedItem:e})},[u]),A=(0,I.useCallback)(function(){u({type:_U})},[u]),re=(0,I.useCallback)(function(e){u({type:gU,inputValue:e})},[u]),j=(0,I.useCallback)(function(e){return HV({id:y.labelId,htmlFor:y.toggleButtonId},e)},[y]),ie=(0,I.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.onMouseLeave,a=r.refKey,o=a===void 0?`ref`:a;r.onKeyDown,r.onBlur;var s=r.ref,c=VV(r,bU),l=(t===void 0?{}:t).suppressRefError;return E(`getMenuProps`,l!==void 0&&l,o,g),HV((n={},n[o]=oH(s,function(e){g.current=e}),n.id=y.menuId,n.role=`listbox`,n[`aria-labelledby`]=c&&c[`aria-label`]?void 0:``+y.labelId,n.onMouseLeave=aH(i,function(){u({type:cU})}),n),c)},[u,E,y]);return{getToggleButtonProps:(0,I.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.onBlur,a=r.onClick;r.onPress;var o=r.onKeyDown,s=r.refKey,c=s===void 0?`ref`:s,l=r.ref,d=VV(r,xU),f=(t===void 0?{}:t).suppressRefError,p=f!==void 0&&f,m=S.current.state,g=function(){u({type:XH})},_=function(){m.isOpen&&!T.current.isMouseDown&&u({type:sU})},v=function(e){var t=dH(e);t&&ee[t]?ee[t](e):kH(t)&&u({type:$H,key:t,getItemNodeFromIndex:C})},b=HV((n={},n[c]=oH(l,function(e){h.current=e}),n[`aria-activedescendant`]=m.isOpen&&m.highlightedIndex>-1?y.getItemId(m.highlightedIndex):``,n[`aria-controls`]=y.menuId,n[`aria-expanded`]=S.current.state.isOpen,n[`aria-haspopup`]=`listbox`,n[`aria-labelledby`]=d&&d[`aria-label`]?void 0:``+y.labelId,n.id=y.toggleButtonId,n.role=`combobox`,n.tabIndex=0,n.onBlur=aH(i,_),n),d);return d.disabled||(b.onClick=aH(a,g),b.onKeyDown=aH(o,v)),E(`getToggleButtonProps`,p,c,h),b},[S,y,E,u,T,ee,C]),getLabelProps:j,getMenuProps:ie,getItemProps:(0,I.useCallback)(function(e){var t,n=e===void 0?{}:e,r=n.item,i=n.index,a=n.onMouseMove,o=n.onClick;n.onPress;var s=n.refKey,c=s===void 0?`ref`:s,l=n.ref,d=n.disabled,f=VV(n,SU),m=S.current,h=m.state,g=m.props,v=DH(r,i,g.items,`Pass either item or index to getItemProps!`),b=v[0],x=v[1],C=function(){x!==h.highlightedIndex&&(w.current=!1,u({type:lU,index:x,disabled:d}))},T=function(){u({type:uU,index:x})},E=HV((t={disabled:d,role:`option`,"aria-selected":``+(b===p),id:y.getItemId(x)},t[c]=oH(l,function(e){e&&(_.current[y.getItemId(x)]=e)}),t),f);return d||(E.onClick=aH(o,T)),E.onMouseMove=aH(a,C),E},[S,p,y,w,u]),toggleMenu:D,openMenu:te,closeMenu:O,setHighlightedIndex:ne,selectItem:k,reset:A,setInputValue:re,highlightedIndex:f,isOpen:d,selectedItem:p,inputValue:m}}var wU=0,TU=1,EU=2,DU=3,OU=4,kU=5,AU=6,jU=7,MU=8,NU=9,PU=10,FU=11,IU=12,LU=13,RU=14,zU=15,BU=16,VU=17,HU=18,UU=19,WU=20,GU=21,KU=22,qU=Object.freeze({__proto__:null,InputKeyDownArrowDown:wU,InputKeyDownArrowUp:TU,InputKeyDownEscape:EU,InputKeyDownHome:DU,InputKeyDownEnd:OU,InputKeyDownPageUp:kU,InputKeyDownPageDown:AU,InputKeyDownEnter:jU,InputChange:MU,InputBlur:NU,InputFocus:PU,MenuMouseLeave:FU,ItemMouseMove:IU,ItemClick:LU,ToggleButtonClick:RU,FunctionToggleMenu:zU,FunctionOpenMenu:BU,FunctionCloseMenu:VU,FunctionSetHighlightedIndex:HU,FunctionSelectItem:UU,FunctionSetInputValue:WU,FunctionReset:GU,ControlledPropUpdatedSelectedItem:KU});function JU(e){var t=LH(e),n=t.selectedItem,r=t.inputValue;return r===``&&n&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(n)),HV({},t,{inputValue:r})}Q.default.array.isRequired,Q.default.func,Q.default.func,Q.default.func,Q.default.func,Q.default.number,Q.default.number,Q.default.number,Q.default.bool,Q.default.bool,Q.default.bool,Q.default.any,Q.default.any,Q.default.any,Q.default.string,Q.default.string,Q.default.string,Q.default.string,Q.default.string,Q.default.string,Q.default.func,Q.default.string,Q.default.string,Q.default.func,Q.default.func,Q.default.func,Q.default.func,Q.default.func,Q.default.func,Q.default.shape({addEventListener:Q.default.func,removeEventListener:Q.default.func,document:Q.default.shape({getElementById:Q.default.func,activeElement:Q.default.any,body:Q.default.any})});function YU(e,t,n){var r=(0,I.useRef)(),i=MH(e,t,n),a=i[0],o=i[1];return(0,I.useEffect)(function(){uH(n,`selectedItem`)&&(n.selectedItemChanged(r.current,n.selectedItem)&&o({type:KU,inputValue:n.itemToString(n.selectedItem)}),r.current=a.selectedItem===r.current?n.selectedItem:a.selectedItem)},[a.selectedItem,n.selectedItem]),[lH(a,n),o]}var XU=tH,ZU=HV({},PH,{selectedItemChanged:function(e,t){return e!==t},getA11yStatusMessage:cH});function QU(e,t){var n=t.type,r=t.props,i=t.altKey,a;switch(n){case LU:a={isOpen:FH(r,`isOpen`),highlightedIndex:FH(r,`highlightedIndex`),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case wU:a=e.isOpen?{highlightedIndex:fH(1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:i&&e.selectedItem==null?-1:RH(r,e,1,t.getItemNodeFromIndex),isOpen:r.items.length>=0};break;case TU:a=e.isOpen?i?WH(r,e.highlightedIndex):{highlightedIndex:fH(-1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:RH(r,e,-1,t.getItemNodeFromIndex),isOpen:r.items.length>=0};break;case jU:a=WH(r,e.highlightedIndex);break;case EU:a=HV({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:``});break;case kU:a={highlightedIndex:fH(-10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case AU:a={highlightedIndex:fH(10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case DU:a={highlightedIndex:pH(1,0,r.items.length,t.getItemNodeFromIndex,!1)};break;case OU:a={highlightedIndex:pH(-1,r.items.length-1,r.items.length,t.getItemNodeFromIndex,!1)};break;case NU:a=HV({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&r.items?.length&&t.selectItem&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])});break;case MU:a={isOpen:!0,highlightedIndex:FH(r,`highlightedIndex`),inputValue:t.inputValue};break;case PU:a={isOpen:!0,highlightedIndex:RH(r,e,0)};break;case UU:a={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case KU:a={inputValue:t.inputValue};break;default:return GH(e,t,qU)}return HV({},e,a)}var $U=[`onMouseLeave`,`refKey`,`ref`],eW=[`item`,`index`,`refKey`,`ref`,`onMouseMove`,`onMouseDown`,`onClick`,`onPress`,`disabled`],tW=[`onClick`,`onPress`,`refKey`,`ref`],nW=[`onKeyDown`,`onChange`,`onInput`,`onFocus`,`onBlur`,`onChangeText`,`refKey`,`ref`];rW.stateChangeTypes=qU;function rW(e){e===void 0&&(e={}),XU(e,rW);var t=HV({},ZU,e),n=t.initialIsOpen,r=t.defaultIsOpen,i=t.items,a=t.scrollIntoView,o=t.environment,s=t.getA11yStatusMessage,c=t.getA11ySelectionMessage,l=t.itemToString,u=YU(QU,JU(t),t),d=u[0],f=u[1],p=d.isOpen,m=d.highlightedIndex,h=d.selectedItem,g=d.inputValue,_=(0,I.useRef)(null),v=(0,I.useRef)({}),y=(0,I.useRef)(null),b=(0,I.useRef)(null),x=(0,I.useRef)(!0),S=EH(t),C=(0,I.useRef)(),w=jH({state:d,props:t}),T=(0,I.useCallback)(function(e){return v.current[S.getItemId(e)]},[S]);VH(s,[p,m,g,i],HV({isInitialMount:x.current,previousResultCount:C.current,items:i,environment:o,itemToString:l},d)),VH(c,[h],HV({isInitialMount:x.current,previousResultCount:C.current,items:i,environment:o,itemToString:l},d));var E=HH({menuElement:_.current,highlightedIndex:m,isOpen:p,itemRefs:v,scrollIntoView:a,getItemNodeFromIndex:T});UH({isInitialMount:x.current,props:t,state:d}),(0,I.useEffect)(function(){(n||r||p)&&y.current&&y.current.focus()},[]),(0,I.useEffect)(function(){x.current||(C.current=i.length)});var ee=zH(p,[y,_,b],o,function(){f({type:NU,selectItem:!1})}),D=BH(`getInputProps`,`getMenuProps`);(0,I.useEffect)(function(){return x.current=!1,function(){x.current=!0}},[]),(0,I.useEffect)(function(){if(!p)v.current={};else if(o.document?.activeElement!==y.current){var e;y==null||(e=y.current)==null||e.focus()}},[p,o]);var O=(0,I.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),f({type:wU,altKey:e.altKey,getItemNodeFromIndex:T})},ArrowUp:function(e){e.preventDefault(),f({type:TU,altKey:e.altKey,getItemNodeFromIndex:T})},Home:function(e){w.current.state.isOpen&&(e.preventDefault(),f({type:DU,getItemNodeFromIndex:T}))},End:function(e){w.current.state.isOpen&&(e.preventDefault(),f({type:OU,getItemNodeFromIndex:T}))},Escape:function(e){var t=w.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),f({type:EU}))},Enter:function(e){w.current.state.isOpen&&e.which!==229&&(e.preventDefault(),f({type:jU,getItemNodeFromIndex:T}))},PageUp:function(e){w.current.state.isOpen&&(e.preventDefault(),f({type:kU,getItemNodeFromIndex:T}))},PageDown:function(e){w.current.state.isOpen&&(e.preventDefault(),f({type:AU,getItemNodeFromIndex:T}))}}},[f,w,T]),te=(0,I.useCallback)(function(e){return HV({id:S.labelId,htmlFor:S.inputId},e)},[S]),ne=(0,I.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.onMouseLeave,a=r.refKey,o=a===void 0?`ref`:a,s=r.ref,c=VV(r,$U),l=(t===void 0?{}:t).suppressRefError;return D(`getMenuProps`,l!==void 0&&l,o,_),HV((n={},n[o]=oH(s,function(e){_.current=e}),n.id=S.menuId,n.role=`listbox`,n[`aria-labelledby`]=c&&c[`aria-label`]?void 0:``+S.labelId,n.onMouseLeave=aH(i,function(){f({type:FU})}),n),c)},[f,D,S]),k=(0,I.useCallback)(function(e){var t,n,r=e===void 0?{}:e,i=r.item,a=r.index,o=r.refKey,s=o===void 0?`ref`:o,c=r.ref,l=r.onMouseMove,u=r.onMouseDown,d=r.onClick;r.onPress;var p=r.disabled,m=VV(r,eW),h=w.current,g=h.props,_=h.state,y=DH(i,a,g.items,`Pass either item or index to getItemProps!`)[1],b=`onClick`,x=d;return HV((t={},t[s]=oH(c,function(e){e&&(v.current[S.getItemId(y)]=e)}),t.disabled=p,t.role=`option`,t[`aria-selected`]=``+(y===_.highlightedIndex),t.id=S.getItemId(y),t),!p&&(n={},n[b]=aH(x,function(){f({type:LU,index:y})}),n),{onMouseMove:aH(l,function(){y!==_.highlightedIndex&&(E.current=!1,f({type:IU,index:y,disabled:p}))}),onMouseDown:aH(u,function(e){return e.preventDefault()})},m)},[f,w,E,S]),A=(0,I.useCallback)(function(e){var t,n=e===void 0?{}:e,r=n.onClick;n.onPress;var i=n.refKey,a=i===void 0?`ref`:i,o=n.ref,s=VV(n,tW),c=w.current.state;return HV((t={},t[a]=oH(o,function(e){b.current=e}),t[`aria-controls`]=S.menuId,t[`aria-expanded`]=c.isOpen,t.id=S.toggleButtonId,t.tabIndex=-1,t),!s.disabled&&HV({},{onClick:aH(r,function(){f({type:RU})})}),s)},[f,w,S]),re=(0,I.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.onKeyDown,a=r.onChange,s=r.onInput,c=r.onFocus,l=r.onBlur;r.onChangeText;var u=r.refKey,d=u===void 0?`ref`:u,p=r.ref,m=VV(r,nW),h=(t===void 0?{}:t).suppressRefError;D(`getInputProps`,h!==void 0&&h,d,y);var g=w.current.state,_=function(e){var t=dH(e);t&&O[t]&&O[t](e)},v=function(e){f({type:MU,inputValue:e.target.value})},b=function(e){g.isOpen&&!ee.current.isMouseDown&&f({type:NU,selectItem:e.relatedTarget!==null||o.document.activeElement===o.document.body})},x=function(){g.isOpen||f({type:PU})},C=`onChange`,T={};if(!m.disabled){var E;T=(E={},E[C]=aH(a,s,v),E.onKeyDown=aH(i,_),E.onBlur=aH(l,b),E.onFocus=aH(c,x),E)}return HV((n={},n[d]=oH(p,function(e){y.current=e}),n[`aria-activedescendant`]=g.isOpen&&g.highlightedIndex>-1?S.getItemId(g.highlightedIndex):``,n[`aria-autocomplete`]=`list`,n[`aria-controls`]=S.menuId,n[`aria-expanded`]=g.isOpen,n[`aria-labelledby`]=m&&m[`aria-label`]?void 0:``+S.labelId,n.autoComplete=`off`,n.id=S.inputId,n.role=`combobox`,n.value=g.inputValue,n),T,m)},[D,w,S,O,f,ee,o]),j=(0,I.useCallback)(function(){f({type:zU})},[f]),ie=(0,I.useCallback)(function(){f({type:VU})},[f]),ae=(0,I.useCallback)(function(){f({type:BU})},[f]),oe=(0,I.useCallback)(function(e){f({type:HU,highlightedIndex:e})},[f]),se=(0,I.useCallback)(function(e){f({type:UU,selectedItem:e})},[f]);return{getItemProps:k,getLabelProps:te,getMenuProps:ne,getInputProps:re,getToggleButtonProps:A,toggleMenu:j,openMenu:ae,closeMenu:ie,setHighlightedIndex:oe,setInputValue:(0,I.useCallback)(function(e){f({type:WU,inputValue:e})},[f]),selectItem:se,reset:(0,I.useCallback)(function(){f({type:GU})},[f]),highlightedIndex:m,isOpen:p,selectedItem:h,inputValue:g}}var iW={activeIndex:-1,selectedItems:[]};function aW(e,t){return IH(e,t,iW)}function oW(e,t){return FH(e,t,iW)}function sW(e){return{activeIndex:aW(e,`activeIndex`),selectedItems:aW(e,`selectedItems`)}}function cW(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&t.value!==``&&(t.selectionStart!==0||t.selectionEnd!==0))}function lW(e){var t=e.removedSelectedItem,n=e.itemToString;return n(t)+` has been removed.`}Q.default.array,Q.default.array,Q.default.array,Q.default.func,Q.default.func,Q.default.func,Q.default.number,Q.default.number,Q.default.number,Q.default.func,Q.default.func,Q.default.string,Q.default.string,Q.default.shape({addEventListener:Q.default.func,removeEventListener:Q.default.func,document:Q.default.shape({getElementById:Q.default.func,activeElement:Q.default.any,body:Q.default.any})});var uW={itemToString:PH.itemToString,stateReducer:PH.stateReducer,environment:PH.environment,getA11yRemovalMessage:lW,keyNavigationNext:`ArrowRight`,keyNavigationPrevious:`ArrowLeft`},dW=tH,fW=0,pW=1,mW=2,hW=3,gW=4,_W=5,vW=6,yW=7,bW=8,xW=9,SW=10,CW=11,wW=12,TW=Object.freeze({__proto__:null,SelectedItemClick:fW,SelectedItemKeyDownDelete:pW,SelectedItemKeyDownBackspace:mW,SelectedItemKeyDownNavigationNext:hW,SelectedItemKeyDownNavigationPrevious:gW,DropdownKeyDownNavigationPrevious:_W,DropdownKeyDownBackspace:vW,DropdownClick:yW,FunctionAddSelectedItem:bW,FunctionRemoveSelectedItem:xW,FunctionSetSelectedItems:SW,FunctionSetActiveIndex:CW,FunctionReset:wW});function EW(e,t){var n=t.type,r=t.index,i=t.props,a=t.selectedItem,o=e.activeIndex,s=e.selectedItems,c;switch(n){case fW:c={activeIndex:r};break;case gW:c={activeIndex:o-1<0?0:o-1};break;case hW:c={activeIndex:o+1>=s.length?-1:o+1};break;case mW:case pW:if(o<0)break;var l=o;s.length===1?l=-1:o===s.length-1&&(l=s.length-2),c=HV({selectedItems:[].concat(s.slice(0,o),s.slice(o+1))},{activeIndex:l});break;case _W:c={activeIndex:s.length-1};break;case vW:c={selectedItems:s.slice(0,s.length-1)};break;case bW:c={selectedItems:[].concat(s,[a])};break;case yW:c={activeIndex:-1};break;case xW:var u=o,d=s.indexOf(a);if(d<0)break;s.length===1?u=-1:d===s.length-1&&(u=s.length-2),c={selectedItems:[].concat(s.slice(0,d),s.slice(d+1)),activeIndex:u};break;case SW:c={selectedItems:t.selectedItems};break;case CW:c={activeIndex:t.activeIndex};break;case wW:c={activeIndex:oW(i,`activeIndex`),selectedItems:oW(i,`selectedItems`)};break;default:throw Error(`Reducer called without proper action type.`)}return HV({},e,c)}var DW=[`refKey`,`ref`,`onClick`,`onKeyDown`,`selectedItem`,`index`],OW=[`refKey`,`ref`,`onKeyDown`,`onClick`,`preventKeyAction`];kW.stateChangeTypes=TW;function kW(e){e===void 0&&(e={}),dW(e,kW);var t=HV({},uW,e),n=t.getA11yRemovalMessage,r=t.itemToString,i=t.environment,a=t.keyNavigationNext,o=t.keyNavigationPrevious,s=NH(EW,sW(t),t),c=s[0],l=s[1],u=c.activeIndex,d=c.selectedItems,f=(0,I.useRef)(!0),p=(0,I.useRef)(null),m=(0,I.useRef)(d),h=(0,I.useRef)();h.current=[];var g=jH({state:c,props:t});(0,I.useEffect)(function(){if(!f.current){if(d.length<m.current.length){var e=m.current.find(function(e){return d.indexOf(e)<0});gH(n({itemToString:r,resultCount:d.length,removedSelectedItem:e,activeIndex:u,activeSelectedItem:d[u]}),i.document)}m.current=d}},[d.length]),(0,I.useEffect)(function(){f.current||(u===-1&&p.current?p.current.focus():h.current[u]&&h.current[u].focus())},[u]),UH({isInitialMount:f.current,props:t,state:c});var _=BH(`getDropdownProps`);(0,I.useEffect)(function(){return f.current=!1,function(){f.current=!0}},[]);var v=(0,I.useMemo)(function(){var e={};return e[o]=function(){l({type:gW})},e[a]=function(){l({type:hW})},e.Delete=function(){l({type:pW})},e.Backspace=function(){l({type:mW})},e},[l,a,o]),y=(0,I.useMemo)(function(){var e={};return e[o]=function(e){cW(e)&&l({type:_W})},e.Backspace=function(e){cW(e)&&l({type:vW})},e},[l,o]);return{getSelectedItemProps:(0,I.useCallback)(function(e){var t,n=e===void 0?{}:e,r=n.refKey,i=r===void 0?`ref`:r,a=n.ref,o=n.onClick,s=n.onKeyDown,c=n.selectedItem,u=n.index,d=VV(n,DW),f=g.current.state,p=DH(c,u,f.selectedItems,`Pass either item or index to getSelectedItemProps!`)[1],m=p>-1&&p===f.activeIndex;return HV((t={},t[i]=oH(a,function(e){e&&h.current.push(e)}),t.tabIndex=m?0:-1,t.onClick=aH(o,function(){l({type:fW,index:p})}),t.onKeyDown=aH(s,function(e){var t=dH(e);t&&v[t]&&v[t](e)}),t),d)},[l,g,v]),getDropdownProps:(0,I.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.refKey,a=i===void 0?`ref`:i,o=r.ref,s=r.onKeyDown,c=r.onClick,u=r.preventKeyAction,d=u!==void 0&&u,f=VV(r,OW),m=(t===void 0?{}:t).suppressRefError;return _(`getDropdownProps`,m!==void 0&&m,a,p),HV((n={},n[a]=oH(o,function(e){e&&(p.current=e)}),n),!d&&{onKeyDown:aH(s,function(e){var t=dH(e);t&&y[t]&&y[t](e)}),onClick:aH(c,function(){l({type:yW})})},f)},[l,y,_]),addSelectedItem:(0,I.useCallback)(function(e){l({type:bW,selectedItem:e})},[l]),removeSelectedItem:(0,I.useCallback)(function(e){l({type:xW,selectedItem:e})},[l]),setSelectedItems:(0,I.useCallback)(function(e){l({type:SW,selectedItems:e})},[l]),setActiveIndex:(0,I.useCallback)(function(e){l({type:CW,activeIndex:e})},[l]),reset:(0,I.useCallback)(function(){l({type:wW})},[l]),selectedItems:d,activeIndex:u}}var AW=20,jW=e=>e.suggestions.length>0?I.createElement(MW,{...e}):I.createElement(`input`,{className:J.textInput,size:40,autoFocus:!0,...e.register(e.inputName)}),MW=({autofocus:e,suggestions:t,control:n,inputName:r,placeholder:i,initialInputValue:a,setValue:o})=>{let[s,c]=I.useState(t.slice(0,AW)),l=kr(vD),u=t.length>0,{isOpen:d,getToggleButtonProps:f,getMenuProps:p,getInputProps:m,highlightedIndex:h,getItemProps:g,selectedItem:_}=rW({initialInputValue:a,onInputValueChange({inputValue:e=``}){o(r,e),e=e.toLowerCase()||``;let n=[];for(let r of t)if(r.toLowerCase().includes(e)&&(n.push(r),n.length>=AW))break;c(n)},items:s,itemToString(e){return e??``}}),v=d&&s.length>0;return I.createElement(`div`,{className:J.downshiftAutocompleteContainer},I.createElement(`div`,{"data-visible-dropdown":v,className:J.downshiftInputWrapper},I.createElement(IB,{name:r,control:n,render:({field:t})=>{let n=m();return I.createElement(`input`,{...n,name:t.name,placeholder:i,className:J.downshiftInput,size:30,"data-editor-dialog":!0,autoFocus:e})}}),u&&I.createElement(`button`,{"aria-label":`toggle menu`,type:`button`,...f()},l(`arrow_drop_down`))),I.createElement(`div`,{className:J.downshiftAutocompleteContainer},I.createElement(`ul`,{...p(),"data-visible":v},s.map((e,t)=>I.createElement(`li`,{"data-selected":_===e,"data-highlighted":h===t,key:`${e}${t}`,...g({item:e,index:t})},e)))))},NW={testNode:`blockquote`,visitNode({actions:e}){e.addAndStepInto(D_())}},PW={testLexicalNode:O_,visitLexicalNode:({actions:e})=>{e.addAndStepInto(`blockquote`)}},FW=zr({init(e){e.pubIn({[UD]:`quote`,[iD]:NW,[rD]:E_,[sD]:PW})}});function IW(){let e=_T;return{publish:()=>{e()},subscribe:t=>{e=t}}}function LW(e,t,n,r){let i=[...e].sort((e,t)=>t.priority-e.priority),a=n??``;return i.find(e=>e.match(t??``,a))??i.find(e=>e.match(r??``,a))}var RW=Object.defineProperty,zW=(e,t,n)=>t in e?RW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BW=(e,t,n)=>zW(e,typeof t==`symbol`?t:t+``,n),VW=class e extends Wl{constructor(e,t,n,r){super(r),BW(this,`__code`),BW(this,`__meta`),BW(this,`__language`),BW(this,`__focusEmitter`,IW()),BW(this,`setCode`,e=>{e!==this.__code&&(this.getWritable().__code=e)}),BW(this,`setMeta`,e=>{e!==this.__meta&&(this.getWritable().__meta=e)}),BW(this,`setLanguage`,e=>{e!==this.__language&&(this.getWritable().__language=e)}),BW(this,`select`,()=>{this.__focusEmitter.publish()}),this.__code=e,this.__meta=n,this.__language=t}static getType(){return`codeblock`}static clone(t){return new e(t.__code,t.__language,t.__meta,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__code=e.__code,this.__meta=e.__meta,this.__language=e.__language,this.__focusEmitter=IW()}static importJSON(e){return KW({code:typeof e.code==`string`?e.code:``,language:typeof e.language==`string`?e.language:``,meta:typeof e.meta==`string`?e.meta:``})}static importDOM(){return{pre:()=>({conversion:JW,priority:3})}}exportJSON(){return{code:this.getCode(),language:this.getLanguage(),meta:this.getMeta(),type:`codeblock`,version:1}}createDOM(e,t){return document.createElement(`div`)}updateDOM(){return!1}getCode(){return this.__code}getMeta(){return this.__meta}getLanguage(){return this.__language}decorate(e){return I.createElement(GW,{parentEditor:e,code:this.getCode(),meta:this.getMeta(),language:this.getLanguage(),codeBlockNode:this,nodeKey:this.getKey(),focusEmitter:this.__focusEmitter})}isInline(){return!1}},HW=I.createContext(null),UW=({parentEditor:e,lexicalNode:t,children:n})=>{let r=I.useMemo(()=>({lexicalNode:t,parentEditor:e,setCode:n=>{e.update(()=>{t.setCode(n),setTimeout(()=>{e.dispatchCommand(SE,void 0)},0)})},setLanguage:n=>{e.update(()=>{t.setLanguage(n)})},setMeta:n=>{e.update(()=>{t.setMeta(n)})}}),[t,e]);return I.createElement(HW.Provider,{value:r},n)};function WW(){let e=I.useContext(HW);if(!e)throw Error(`useCodeBlockEditor must be used within a CodeBlockEditor`);return e}var GW=e=>{let t=kr(QE),n=kr($E),r=LW(t,e.language,e.meta,n);if(!r)throw Error(`No CodeBlockEditor registered for language=${e.language} meta=${e.meta}`);let i=r.Editor,{codeBlockNode:a,parentEditor:o,...s}=e;return I.createElement(UW,{parentEditor:e.parentEditor,lexicalNode:e.codeBlockNode},I.createElement(i,{...s}))};function KW(e){let{code:t=``,language:n=``,meta:r=``}=e;return new VW(t,n,r)}function qW(e){return e instanceof VW}function JW(e){let t=e,n=t.textContent,r=e.getAttribute(`class`)??``,i=e.getAttribute(`data-language`)??``,a=/language-(\w+)/.exec(r);return{node:KW({code:n,language:a?a[1]:i,meta:t.getAttribute(`data-meta`)??``})}}var YW={testLexicalNode:qW,visitLexicalNode:({lexicalNode:e,actions:t})=>{t.addAndStepInto(`code`,{value:e.getCode(),lang:e.getLanguage(),meta:e.getMeta()})}},XW={testNode:(e,{codeBlockEditorDescriptors:t,defaultCodeBlockLanguage:n})=>e.type===`code`&&LW(t,e.lang,e.meta,n)!==void 0,visitNode({mdastNode:e,actions:t}){t.addAndStepInto(KW({code:e.value,language:e.lang??``,meta:e.meta??``}))}},ZW=Tr(e=>{e.link(e.pipe(ZW,Nr($E),Mr(([e,t])=>()=>KW({language:t,...e}))),zD)}),QW=yD(QE),$W=zr({update(e,t){e.pub($E,t?.defaultCodeBlockLanguage??``)},init(e,t){e.pubIn({[UD]:`codeblock`,[$E]:t?.defaultCodeBlockLanguage??``,[QE]:t?.codeBlockEditorDescriptors??[],[iD]:XW,[rD]:VW,[sD]:YW})}});function $(e){return new Ge(we.define(e))}function eG(e){return o(()=>import(`./dist-yFKhRrHN.js`).then(t=>t.sql({dialect:t[e]})),__vite__mapDeps([0,1,2]))}var tG=[N.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return o(()=>import(`./dist-CF7An11X.js`).then(e=>e.cpp()),__vite__mapDeps([3,1]))}}),N.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return o(()=>import(`./dist-CF7An11X.js`).then(e=>e.cpp()),__vite__mapDeps([3,1]))}}),N.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return eG(`Cassandra`)}}),N.of({name:`CSS`,extensions:[`css`],load(){return o(()=>import(`./dist-Cude8a0m.js`).then(e=>e.i).then(e=>e.css()),__vite__mapDeps([4,5,6,1]))}}),N.of({name:`Go`,extensions:[`go`],load(){return o(()=>import(`./dist-rE2oRtJp.js`).then(e=>e.go()),__vite__mapDeps([7,1,2]))}}),N.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return o(()=>import(`./dist-BEsFc6FD.js`).then(e=>e.t).then(e=>e.html()),__vite__mapDeps([8,5,6,1,4,9,2]))}}),N.of({name:`Java`,extensions:[`java`],load(){return o(()=>import(`./dist-D8nmL5S9.js`).then(e=>e.java()),__vite__mapDeps([10,1]))}}),N.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return o(()=>import(`./dist-CFA64Yc7.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([9,5,6,1,2]))}}),N.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return o(()=>import(`./dist-Bvh8zyxa.js`).then(e=>e.jinja()),__vite__mapDeps([11,1,8,5,6,4,9,2]))}}),N.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return o(()=>import(`./dist-5wk4daHl.js`).then(e=>e.json()),__vite__mapDeps([12,1]))}}),N.of({name:`JSX`,extensions:[`jsx`],load(){return o(()=>import(`./dist-CFA64Yc7.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([9,5,6,1,2]))}}),N.of({name:`LESS`,extensions:[`less`],load(){return o(()=>import(`./dist-T8k-QVDQ.js`).then(e=>e.less()),__vite__mapDeps([13,1,4,5,6]))}}),N.of({name:`Liquid`,extensions:[`liquid`],load(){return o(()=>import(`./dist-zx0nNkxV.js`).then(e=>e.liquid()),__vite__mapDeps([14,1,8,5,6,4,9,2]))}}),N.of({name:`MariaDB SQL`,load(){return eG(`MariaSQL`)}}),N.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return o(()=>import(`./dist-CUM-iKNF.js`).then(e=>e.markdown()),[])}}),N.of({name:`MS SQL`,load(){return eG(`MSSQL`)}}),N.of({name:`MySQL`,load(){return eG(`MySQL`)}}),N.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return o(()=>import(`./dist-U99ikhIT.js`).then(e=>e.php()),__vite__mapDeps([15,1,8,5,6,4,9,2]))}}),N.of({name:`PLSQL`,extensions:[`pls`],load(){return eG(`PLSQL`)}}),N.of({name:`PostgreSQL`,load(){return eG(`PostgreSQL`)}}),N.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return o(()=>import(`./dist-CXS6W3P9.js`).then(e=>e.python()),__vite__mapDeps([16,1,2]))}}),N.of({name:`Rust`,extensions:[`rs`],load(){return o(()=>import(`./dist-DaG9QYNU.js`).then(e=>e.rust()),__vite__mapDeps([17,1]))}}),N.of({name:`Sass`,extensions:[`sass`],load(){return o(()=>import(`./dist-zzOk7PS8.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([18,1,4,5,6]))}}),N.of({name:`SCSS`,extensions:[`scss`],load(){return o(()=>import(`./dist-zzOk7PS8.js`).then(e=>e.sass()),__vite__mapDeps([18,1,4,5,6]))}}),N.of({name:`SQL`,extensions:[`sql`],load(){return eG(`StandardSQL`)}}),N.of({name:`SQLite`,load(){return eG(`SQLite`)}}),N.of({name:`TSX`,extensions:[`tsx`],load(){return o(()=>import(`./dist-CFA64Yc7.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([9,5,6,1,2]))}}),N.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return o(()=>import(`./dist-CFA64Yc7.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([9,5,6,1,2]))}}),N.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return o(()=>import(`./dist-Ceimhh7q.js`).then(e=>e.wast()),__vite__mapDeps([19,1]))}}),N.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return o(()=>import(`./dist-ZMc9InB9.js`).then(e=>e.xml()),__vite__mapDeps([20,1]))}}),N.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return o(()=>import(`./dist-DNBDudvB.js`).then(e=>e.yaml()),__vite__mapDeps([21,1]))}}),N.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return o(()=>import(`./apl-gfMMiTNf.js`).then(e=>$(e.apl)),[])}}),N.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return o(()=>import(`./asciiarmor-C_eisQCp.js`).then(e=>$(e.asciiArmor)),[])}}),N.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return o(()=>import(`./asn1-DCl_8MCW.js`).then(e=>$(e.asn1({}))),[])}}),N.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return o(()=>import(`./asterisk-BEn0Cwpx.js`).then(e=>$(e.asterisk)),[])}}),N.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return o(()=>import(`./brainfuck-D5EjA2JK.js`).then(e=>$(e.brainfuck)),[])}}),N.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return o(()=>import(`./cobol-DHLQUbN7.js`).then(e=>$(e.cobol)),[])}}),N.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return o(()=>import(`./clike-D_6L3tnO.js`).then(e=>$(e.csharp)),[])}}),N.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return o(()=>import(`./clojure-BflJGmDX.js`).then(e=>$(e.clojure)),[])}}),N.of({name:`ClojureScript`,extensions:[`cljs`],load(){return o(()=>import(`./clojure-BflJGmDX.js`).then(e=>$(e.clojure)),[])}}),N.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return o(()=>import(`./css-CnaYoQib.js`).then(e=>$(e.gss)),[])}}),N.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return o(()=>import(`./cmake-84nbDH0I.js`).then(e=>$(e.cmake)),[])}}),N.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return o(()=>import(`./coffeescript-De_zI4J0.js`).then(e=>$(e.coffeeScript)),[])}}),N.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return o(()=>import(`./commonlisp-DgAKBe0r.js`).then(e=>$(e.commonLisp)),[])}}),N.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return o(()=>import(`./cypher-p9eYesGn.js`).then(e=>$(e.cypher)),[])}}),N.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return o(()=>import(`./python-B_1Jd8HM.js`).then(e=>$(e.cython)),[])}}),N.of({name:`Crystal`,extensions:[`cr`],load(){return o(()=>import(`./crystal-Bsdphhtm.js`).then(e=>$(e.crystal)),[])}}),N.of({name:`D`,extensions:[`d`],load(){return o(()=>import(`./d-DWkQyNnU.js`).then(e=>$(e.d)),[])}}),N.of({name:`Dart`,extensions:[`dart`],load(){return o(()=>import(`./clike-D_6L3tnO.js`).then(e=>$(e.dart)),[])}}),N.of({name:`diff`,extensions:[`diff`,`patch`],load(){return o(()=>import(`./diff-ChtP43wD.js`).then(e=>$(e.diff)),[])}}),N.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return o(()=>import(`./dockerfile-DJkHQgkl.js`).then(e=>$(e.dockerFile)),__vite__mapDeps([22,23]))}}),N.of({name:`DTD`,extensions:[`dtd`],load(){return o(()=>import(`./dtd-DTF72YNO.js`).then(e=>$(e.dtd)),[])}}),N.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return o(()=>import(`./dylan-BCDoL_-p.js`).then(e=>$(e.dylan)),[])}}),N.of({name:`EBNF`,load(){return o(()=>import(`./ebnf-D4c0_ac3.js`).then(e=>$(e.ebnf)),[])}}),N.of({name:`ECL`,extensions:[`ecl`],load(){return o(()=>import(`./ecl-BVIeWmwY.js`).then(e=>$(e.ecl)),[])}}),N.of({name:`edn`,extensions:[`edn`],load(){return o(()=>import(`./clojure-BflJGmDX.js`).then(e=>$(e.clojure)),[])}}),N.of({name:`Eiffel`,extensions:[`e`],load(){return o(()=>import(`./eiffel-BEjRio4Q.js`).then(e=>$(e.eiffel)),[])}}),N.of({name:`Elm`,extensions:[`elm`],load(){return o(()=>import(`./elm-Cshzl8qu.js`).then(e=>$(e.elm)),[])}}),N.of({name:`Erlang`,extensions:[`erl`],load(){return o(()=>import(`./erlang-BV0c4Hdn.js`).then(e=>$(e.erlang)),[])}}),N.of({name:`Esper`,load(){return o(()=>import(`./sql-DuQMFDvy.js`).then(e=>$(e.esper)),[])}}),N.of({name:`Factor`,extensions:[`factor`],load(){return o(()=>import(`./factor-LKH5gN8L.js`).then(e=>$(e.factor)),__vite__mapDeps([24,23]))}}),N.of({name:`FCL`,load(){return o(()=>import(`./fcl-ClOhbFR7.js`).then(e=>$(e.fcl)),[])}}),N.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return o(()=>import(`./forth-D6RzAl64.js`).then(e=>$(e.forth)),[])}}),N.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return o(()=>import(`./fortran-Bt6PBEDR.js`).then(e=>$(e.fortran)),[])}}),N.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return o(()=>import(`./mllike-B45xgp2S.js`).then(e=>$(e.fSharp)),[])}}),N.of({name:`Gas`,extensions:[`s`],load(){return o(()=>import(`./gas-BHEdbvp9.js`).then(e=>$(e.gas)),[])}}),N.of({name:`Gherkin`,extensions:[`feature`],load(){return o(()=>import(`./gherkin-oBAE_ms0.js`).then(e=>$(e.gherkin)),[])}}),N.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return o(()=>import(`./groovy-CUpZ7dEl.js`).then(e=>$(e.groovy)),[])}}),N.of({name:`Haskell`,extensions:[`hs`],load(){return o(()=>import(`./haskell-BRsoo5mP.js`).then(e=>$(e.haskell)),[])}}),N.of({name:`Haxe`,extensions:[`hx`],load(){return o(()=>import(`./haxe-DjVOVvNP.js`).then(e=>$(e.haxe)),[])}}),N.of({name:`HXML`,extensions:[`hxml`],load(){return o(()=>import(`./haxe-DjVOVvNP.js`).then(e=>$(e.hxml)),[])}}),N.of({name:`HTTP`,load(){return o(()=>import(`./http-CLVgA2GD.js`).then(e=>$(e.http)),[])}}),N.of({name:`IDL`,extensions:[`pro`],load(){return o(()=>import(`./idl-BUZw3wgd.js`).then(e=>$(e.idl)),[])}}),N.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return o(()=>import(`./javascript-Bu8mWwtz.js`).then(e=>$(e.jsonld)),[])}}),N.of({name:`Julia`,extensions:[`jl`],load(){return o(()=>import(`./julia-CQfgDRfP.js`).then(e=>$(e.julia)),[])}}),N.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return o(()=>import(`./clike-D_6L3tnO.js`).then(e=>$(e.kotlin)),[])}}),N.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return o(()=>import(`./livescript-BXxG0Yva.js`).then(e=>$(e.liveScript)),[])}}),N.of({name:`Lua`,extensions:[`lua`],load(){return o(()=>import(`./lua-DPCEkfD_.js`).then(e=>$(e.lua)),[])}}),N.of({name:`mIRC`,extensions:[`mrc`],load(){return o(()=>import(`./mirc-C9zpzAZU.js`).then(e=>$(e.mirc)),[])}}),N.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return o(()=>import(`./mathematica-u8YMmbU0.js`).then(e=>$(e.mathematica)),[])}}),N.of({name:`Modelica`,extensions:[`mo`],load(){return o(()=>import(`./modelica-CqHI_q-D.js`).then(e=>$(e.modelica)),[])}}),N.of({name:`MUMPS`,extensions:[`mps`],load(){return o(()=>import(`./mumps-BSzj6Xyz.js`).then(e=>$(e.mumps)),[])}}),N.of({name:`Mbox`,extensions:[`mbox`],load(){return o(()=>import(`./mbox-BEMVcqjs.js`).then(e=>$(e.mbox)),[])}}),N.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return o(()=>import(`./nginx-8H7HVH4w.js`).then(e=>$(e.nginx)),[])}}),N.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return o(()=>import(`./nsis-viPvXFiq.js`).then(e=>$(e.nsis)),__vite__mapDeps([25,23]))}}),N.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return o(()=>import(`./ntriples-B9h1VB_g.js`).then(e=>$(e.ntriples)),[])}}),N.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return o(()=>import(`./clike-D_6L3tnO.js`).then(e=>$(e.objectiveC)),[])}}),N.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return o(()=>import(`./clike-D_6L3tnO.js`).then(e=>$(e.objectiveCpp)),[])}}),N.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return o(()=>import(`./mllike-B45xgp2S.js`).then(e=>$(e.oCaml)),[])}}),N.of({name:`Octave`,extensions:[`m`],load(){return o(()=>import(`./octave-D2Q8cUp1.js`).then(e=>$(e.octave)),[])}}),N.of({name:`Oz`,extensions:[`oz`],load(){return o(()=>import(`./oz-BwTct_5T.js`).then(e=>$(e.oz)),[])}}),N.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return o(()=>import(`./pascal-Dp_KdFgX.js`).then(e=>$(e.pascal)),[])}}),N.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return o(()=>import(`./perl-BkSkiI9m.js`).then(e=>$(e.perl)),[])}}),N.of({name:`Pig`,extensions:[`pig`],load(){return o(()=>import(`./pig-AF4Hwhju.js`).then(e=>$(e.pig)),[])}}),N.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return o(()=>import(`./powershell-BcIto6Sf.js`).then(e=>$(e.powerShell)),[])}}),N.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return o(()=>import(`./properties-C357ku5U.js`).then(e=>$(e.properties)),[])}}),N.of({name:`ProtoBuf`,extensions:[`proto`],load(){return o(()=>import(`./protobuf-D1ij_kNL.js`).then(e=>$(e.protobuf)),[])}}),N.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return o(()=>import(`./pug-3K-JMW4g.js`).then(e=>$(e.pug)),__vite__mapDeps([26,27]))}}),N.of({name:`Puppet`,extensions:[`pp`],load(){return o(()=>import(`./puppet-BZyAS7I4.js`).then(e=>$(e.puppet)),[])}}),N.of({name:`Q`,extensions:[`q`],load(){return o(()=>import(`./q-B9NhS7L_.js`).then(e=>$(e.q)),[])}}),N.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return o(()=>import(`./r-CxDmU1I4.js`).then(e=>$(e.r)),[])}}),N.of({name:`RPM Changes`,load(){return o(()=>import(`./rpm-gpDK5sbt.js`).then(e=>$(e.rpmChanges)),[])}}),N.of({name:`RPM Spec`,extensions:[`spec`],load(){return o(()=>import(`./rpm-gpDK5sbt.js`).then(e=>$(e.rpmSpec)),[])}}),N.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return o(()=>import(`./ruby-ChfNwlCY.js`).then(e=>$(e.ruby)),[])}}),N.of({name:`SAS`,extensions:[`sas`],load(){return o(()=>import(`./sas-C2OyD2Y6.js`).then(e=>$(e.sas)),[])}}),N.of({name:`Scala`,extensions:[`scala`],load(){return o(()=>import(`./clike-D_6L3tnO.js`).then(e=>$(e.scala)),[])}}),N.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return o(()=>import(`./scheme-D9qYN0V5.js`).then(e=>$(e.scheme)),[])}}),N.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return o(()=>import(`./shell-DwuoZtxw.js`).then(e=>$(e.shell)),[])}}),N.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return o(()=>import(`./sieve-tLWDfEkZ.js`).then(e=>$(e.sieve)),[])}}),N.of({name:`Smalltalk`,extensions:[`st`],load(){return o(()=>import(`./smalltalk-BLp5-jwC.js`).then(e=>$(e.smalltalk)),[])}}),N.of({name:`Solr`,load(){return o(()=>import(`./solr-B78wSQJQ.js`).then(e=>$(e.solr)),[])}}),N.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return o(()=>import(`./mllike-B45xgp2S.js`).then(e=>$(e.sml)),[])}}),N.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return o(()=>import(`./sparql-Dz-mlCAC.js`).then(e=>$(e.sparql)),[])}}),N.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return o(()=>import(`./spreadsheet-CTIncYxj.js`).then(e=>$(e.spreadsheet)),[])}}),N.of({name:`Squirrel`,extensions:[`nut`],load(){return o(()=>import(`./clike-D_6L3tnO.js`).then(e=>$(e.squirrel)),[])}}),N.of({name:`Stylus`,extensions:[`styl`],load(){return o(()=>import(`./stylus-BOVgKnng.js`).then(e=>$(e.stylus)),[])}}),N.of({name:`Swift`,extensions:[`swift`],load(){return o(()=>import(`./swift-DKB6_1j6.js`).then(e=>$(e.swift)),[])}}),N.of({name:`sTeX`,load(){return o(()=>import(`./stex-DNzd62Q_.js`).then(e=>$(e.stex)),[])}}),N.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return o(()=>import(`./stex-DNzd62Q_.js`).then(e=>$(e.stex)),[])}}),N.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return o(()=>import(`./verilog-CjI9Y6RI.js`).then(e=>$(e.verilog)),[])}}),N.of({name:`Tcl`,extensions:[`tcl`],load(){return o(()=>import(`./tcl-BGfruO1u.js`).then(e=>$(e.tcl)),[])}}),N.of({name:`Textile`,extensions:[`textile`],load(){return o(()=>import(`./textile-C4jVoHG1.js`).then(e=>$(e.textile)),[])}}),N.of({name:`TiddlyWiki`,load(){return o(()=>import(`./tiddlywiki-VlUiK86J.js`).then(e=>$(e.tiddlyWiki)),[])}}),N.of({name:`Tiki wiki`,load(){return o(()=>import(`./tiki-AK6FwT8q.js`).then(e=>$(e.tiki)),[])}}),N.of({name:`TOML`,extensions:[`toml`],load(){return o(()=>import(`./toml-BPTmHmyx.js`).then(e=>$(e.toml)),[])}}),N.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return o(()=>import(`./troff-C2dAgh7P.js`).then(e=>$(e.troff)),[])}}),N.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return o(()=>import(`./ttcn-PPSTk1ow.js`).then(e=>$(e.ttcn)),[])}}),N.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return o(()=>import(`./ttcn-cfg-2b4Gb5sE.js`).then(e=>$(e.ttcnCfg)),[])}}),N.of({name:`Turtle`,extensions:[`ttl`],load(){return o(()=>import(`./turtle-Cx3rYX2g.js`).then(e=>$(e.turtle)),[])}}),N.of({name:`Web IDL`,extensions:[`webidl`],load(){return o(()=>import(`./webidl-D5jiJvOU.js`).then(e=>$(e.webIDL)),[])}}),N.of({name:`VB.NET`,extensions:[`vb`],load(){return o(()=>import(`./vb-BthdM_4N.js`).then(e=>$(e.vb)),[])}}),N.of({name:`VBScript`,extensions:[`vbs`],load(){return o(()=>import(`./vbscript-D9f6rSsU.js`).then(e=>$(e.vbScript)),[])}}),N.of({name:`Velocity`,extensions:[`vtl`],load(){return o(()=>import(`./velocity-CqftRsjg.js`).then(e=>$(e.velocity)),[])}}),N.of({name:`Verilog`,extensions:[`v`],load(){return o(()=>import(`./verilog-CjI9Y6RI.js`).then(e=>$(e.verilog)),[])}}),N.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return o(()=>import(`./vhdl-kS471soi.js`).then(e=>$(e.vhdl)),[])}}),N.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return o(()=>import(`./xquery-BKJx4mf9.js`).then(e=>$(e.xQuery)),[])}}),N.of({name:`Yacas`,extensions:[`ys`],load(){return o(()=>import(`./yacas-CXXgtw0p.js`).then(e=>$(e.yacas)),[])}}),N.of({name:`Z80`,extensions:[`z80`],load(){return o(()=>import(`./z80-Co3PbHdE.js`).then(e=>$(e.z80)),[])}}),N.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return o(()=>import(`./mscgen-qgSLujhx.js`).then(e=>$(e.mscgen)),[])}}),N.of({name:`Xù`,extensions:[`xu`],load(){return o(()=>import(`./mscgen-qgSLujhx.js`).then(e=>$(e.xu)),[])}}),N.of({name:`MsGenny`,extensions:[`msgenny`],load(){return o(()=>import(`./mscgen-qgSLujhx.js`).then(e=>$(e.msgenny)),[])}}),N.of({name:`Vue`,extensions:[`vue`],load(){return o(()=>import(`./dist-CcIFukP1.js`).then(e=>e.vue()),__vite__mapDeps([28,1,8,5,6,4,9,2]))}}),N.of({name:`Angular Template`,load(){return o(()=>import(`./dist-BE34pwMP.js`).then(e=>e.angular()),__vite__mapDeps([29,1,8,5,6,4,9,2]))}})],nG=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=sG(e.state,n.from);return r.line?iG(e):r.block?oG(e):!1};function rG(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var iG=rG(fG,0),aG=rG(dG,0),oG=rG((e,t)=>dG(e,t,uG(t)),0);function sG(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var cG=50;function lG(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-cG,r),o=e.sliceDoc(i,i+cG),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=100?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+cG),d=e.sliceDoc(i-cG,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function uG(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function dG(e,t,n=t.selection.ranges){let r=n.map(e=>sG(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>lG(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function fG(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=sG(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var pG=Be.define(),mG=Be.define(),hG=ve.define(),gG=ve.define({combine(e){return D(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),_G=m.define({create(){return IG.empty},update(e,t){let n=t.state.facet(gG),r=t.annotation(pG);if(r){let i=wG.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?TG(o,o.length,n.minDepth,i):jG(o,t.startState.selection),new IG(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(mG);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(Ne.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=wG.fromTransaction(t),o=t.annotation(Ne.time),s=t.annotation(Ne.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new IG(e.done.map(wG.fromJSON),e.undone.map(wG.fromJSON))}});function vG(e={}){return[_G,gG.of(e),M.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?bG:e.inputType==`historyRedo`?xG:null;return n?(e.preventDefault(),n(t)):!1}})]}function yG(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(_G,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var bG=yG(0,!1),xG=yG(1,!1),SG=yG(0,!0),CG=yG(1,!0),wG=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&Oe.fromJSON(t.changes),[],t.mapped&&Fe.fromJSON(t.mapped),t.startSelection&&P.fromJSON(t.startSelection),t.selectionsAfter.map(P.fromJSON))}static fromTransaction(t,n){let r=kG;for(let e of t.startState.facet(hG)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,kG)}static selection(t){return new e(void 0,kG,void 0,void 0,t)}};function TG(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function EG(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function DG(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function OG(e,t){return e.length?t.length?e.concat(t):e:t}var kG=[],AG=200;function jG(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-AG));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),TG(e,e.length-1,1e9,n.setSelAfter(r)))}return[wG.selection([t])]}function MG(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function NG(e,t){if(!e.length)return e;let n=e.length,r=kG;for(;n;){let i=PG(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[wG.selection(r)]:kG}function PG(e,t,n){let r=OG(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):kG,n);if(!e.changes)return wG.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new wG(i,g.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var FG=/^(input\.type|delete)($|\.)/,IG=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||FG.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,EG(s.changes,t.changes))||r==`input.type.compose`)?TG(o,o.length-1,i.minDepth,new wG(t.changes.compose(s.changes),OG(g.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,kG)):TG(o,o.length,i.minDepth,t),new e(o,kG,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:kG;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&DG(a[a.length-1],t)?this:new e(jG(this.done,t),this.undone,n,r)}addMapping(t){return new e(NG(this.done,t),NG(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:pG.of({side:e,rest:MG(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?kG:r.slice(0,r.length-1);return i.mapped&&(n=NG(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:pG.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}return null}};IG.empty=new IG(kG,kG);var LG=[{key:`Mod-z`,run:bG,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:xG,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:xG,preventDefault:!0},{key:`Mod-u`,run:SG,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:CG,preventDefault:!0}];function RG(e,t){return P.create(e.ranges.map(t),e.mainIndex)}function zG(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function BG({state:e,dispatch:t},n){let r=RG(e.selection,n);return!r.eq(e.selection,!0)&&(t(zG(e,r)),!0)}function VG(e,t){return P.cursor(t?e.to:e.from)}function HG(e,t){return BG(e,n=>n.empty?e.moveByChar(n,t):VG(n,t))}function UG(e){return e.textDirectionAt(e.state.selection.main.head)==u.LTR}var WG=e=>HG(e,!UG(e)),GG=e=>HG(e,UG(e));function KG(e,t){return BG(e,n=>n.empty?e.moveByGroup(n,t):VG(n,t))}var qG=e=>KG(e,!UG(e)),JG=e=>KG(e,UG(e));typeof Intl<`u`&&Intl.Segmenter;function YG(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function XG(e,t,n){let r=_(e).resolveInner(t.head),i=n?E.closedBy:E.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;YG(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?ee(e,r.from,1):ee(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,P.cursor(s,n?-1:1)}var ZG=e=>BG(e,t=>XG(e.state,t,!UG(e))),QG=e=>BG(e,t=>XG(e.state,t,UG(e)));function $G(e,t){return BG(e,n=>{if(!n.empty)return VG(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var eK=e=>$G(e,!1),tK=e=>$G(e,!0);function nK(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(M.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function rK(e,t){let n=nK(e),{state:r}=e,i=RG(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):VG(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=M.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(zG(r,i),{effects:a}),!0}var iK=e=>rK(e,!1),aK=e=>rK(e,!0);function oK(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=P.cursor(r.from+n))}return i}var sK=e=>BG(e,t=>oK(e,t,!0)),cK=e=>BG(e,t=>oK(e,t,!1)),lK=e=>BG(e,t=>oK(e,t,!UG(e))),uK=e=>BG(e,t=>oK(e,t,UG(e))),dK=e=>BG(e,t=>P.cursor(e.lineBlockAt(t.head).from,1)),fK=e=>BG(e,t=>P.cursor(e.lineBlockAt(t.head).to,-1));function pK(e,t,n){let r=!1,i=RG(e.selection,t=>{let i=ee(e,t.head,-1)||ee(e,t.head,1)||t.head>0&&ee(e,t.head-1,1)||t.head<e.doc.length&&ee(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?P.range(t.anchor,a):P.cursor(a)});return r?(t(zG(e,i)),!0):!1}var mK=({state:e,dispatch:t})=>pK(e,t,!1);function hK(e,t,n){let r=RG(e.state.selection,e=>{e.undirectional&&e.head>=e.anchor!=t&&(e=P.range(e.head,e.anchor));let r=n(e);return P.range(e.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return!r.eq(e.state.selection)&&(e.dispatch(zG(e.state,r)),!0)}function gK(e,t){return hK(e,t,n=>e.moveByChar(n,t))}var _K=e=>gK(e,!UG(e)),vK=e=>gK(e,UG(e));function yK(e,t){return hK(e,t,n=>e.moveByGroup(n,t))}var bK=e=>yK(e,!UG(e)),xK=e=>yK(e,UG(e)),SK=e=>{let t=!UG(e);return hK(e,t,n=>XG(e.state,n,t))},CK=e=>{let t=UG(e);return hK(e,t,n=>XG(e.state,n,t))};function wK(e,t){return hK(e,t,n=>e.moveVertically(n,t))}var TK=e=>wK(e,!1),EK=e=>wK(e,!0);function DK(e,t){return hK(e,t,n=>e.moveVertically(n,t,nK(e).height))}var OK=e=>DK(e,!1),kK=e=>DK(e,!0),AK=e=>hK(e,!0,t=>oK(e,t,!0)),jK=e=>hK(e,!1,t=>oK(e,t,!1)),MK=e=>{let t=!UG(e);return hK(e,t,n=>oK(e,n,t))},NK=e=>{let t=UG(e);return hK(e,t,n=>oK(e,n,t))},PK=e=>hK(e,!1,t=>P.cursor(e.lineBlockAt(t.head).from)),FK=e=>hK(e,!0,t=>P.cursor(e.lineBlockAt(t.head).to)),IK=({state:e,dispatch:t})=>(t(zG(e,{anchor:0})),!0),LK=({state:e,dispatch:t})=>(t(zG(e,{anchor:e.doc.length})),!0),RK=({state:e,dispatch:t})=>(t(zG(e,{anchor:e.selection.main.anchor,head:0})),!0),zK=({state:e,dispatch:t})=>(t(zG(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),BK=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),VK=({state:e,dispatch:t})=>{let n=oq(e).map(({from:t,to:n})=>P.undirectionalRange(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:P.create(n),userEvent:`select`})),!0},HK=({state:e,dispatch:t})=>{let n=RG(e.selection,t=>{let n=_(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return P.undirectionalRange(n.from,n.to)}return t});return!n.eq(e.selection)&&(t(zG(e,n)),!0)};function UK(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}if(r.head==n.head)break;n=r}}return i.length!=r.ranges.length&&(e.dispatch(zG(n,P.create(i,i.length-1))),!0)}var WK=e=>UK(e,!1),GK=e=>UK(e,!0),KK=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=P.create([n.main]):n.main.empty||(r=P.create([P.cursor(n.main.head)])),r?(t(zG(e,r)),!0):!1};function qK(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=JK(e,o,!1)):o>i&&(n=`delete.forward`,o=JK(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=JK(e,i,!1),a=JK(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:P.cursor(i,i<r.head?-1:1)}});return!i.changes.empty&&(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?M.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function JK(e,t,n){if(e instanceof M)for(let r of e.state.facet(M.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var YK=(e,t,n)=>qK(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=O(s,a.tabSize)%se(a)||se(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=A(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=A(o.text,c-o.from,!1,!1)+o.from);return c}),XK=e=>YK(e,!1,!0),ZK=e=>YK(e,!0,!1),QK=(e,t)=>qK(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=A(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),$K=e=>QK(e,!1),eq=e=>QK(e,!0),tq=e=>qK(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),nq=e=>qK(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),rq=e=>qK(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),iq=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:ne.of([``,``])},range:P.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},aq=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:A(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:A(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:P.cursor(a)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function oq(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function sq(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of oq(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(P.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(P.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:P.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var cq=({state:e,dispatch:t})=>sq(e,t,!1),lq=({state:e,dispatch:t})=>sq(e,t,!0);function uq(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of oq(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var dq=({state:e,dispatch:t})=>uq(e,t,!1),fq=({state:e,dispatch:t})=>uq(e,t,!0),pq=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(oq(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=RG(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function mq(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=_(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(E.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var hq=_q(!1),gq=_q(!0);function _q(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&mq(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new Le(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=h(s,r);for(c??=O(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,Me(t,c)];return o&&l.push(Me(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:ne.of(l)},range:P.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function vq(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:P.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var yq=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Le(e,{overrideIndentation:e=>n[e]??-1}),i=vq(e,(t,i,a)=>{let o=h(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=Me(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},bq=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(vq(e,(t,n)=>{n.push({from:t.from,insert:e.facet(c)})}),{userEvent:`input.indent`})),!0),xq=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(vq(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=O(r,e.tabSize),a=0,o=Me(e,Math.max(0,i-se(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),Sq=e=>(e.setTabFocusMode(),!0),Cq=[{key:`Ctrl-b`,run:WG,shift:_K,preventDefault:!0},{key:`Ctrl-f`,run:GG,shift:vK},{key:`Ctrl-p`,run:eK,shift:TK},{key:`Ctrl-n`,run:tK,shift:EK},{key:`Ctrl-a`,run:dK,shift:PK},{key:`Ctrl-e`,run:fK,shift:FK},{key:`Ctrl-d`,run:ZK},{key:`Ctrl-h`,run:XK},{key:`Ctrl-k`,run:tq},{key:`Ctrl-Alt-h`,run:$K},{key:`Ctrl-o`,run:iq},{key:`Ctrl-t`,run:aq},{key:`Ctrl-v`,run:aK}],wq=[{key:`ArrowLeft`,run:WG,shift:_K,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:qG,shift:bK,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:lK,shift:MK,preventDefault:!0},{key:`ArrowRight`,run:GG,shift:vK,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:JG,shift:xK,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:uK,shift:NK,preventDefault:!0},{key:`ArrowUp`,run:eK,shift:TK,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:IK,shift:RK},{mac:`Ctrl-ArrowUp`,run:iK,shift:OK},{key:`ArrowDown`,run:tK,shift:EK,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:LK,shift:zK},{mac:`Ctrl-ArrowDown`,run:aK,shift:kK},{key:`PageUp`,run:iK,shift:OK},{key:`PageDown`,run:aK,shift:kK},{key:`Home`,run:cK,shift:jK,preventDefault:!0},{key:`Mod-Home`,run:IK,shift:RK},{key:`End`,run:sK,shift:AK,preventDefault:!0},{key:`Mod-End`,run:LK,shift:zK},{key:`Enter`,run:hq,shift:hq},{key:`Mod-a`,run:BK},{key:`Backspace`,run:XK,shift:XK,preventDefault:!0},{key:`Delete`,run:ZK,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:$K,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:eq,preventDefault:!0},{mac:`Mod-Backspace`,run:nq,preventDefault:!0},{mac:`Mod-Delete`,run:rq,preventDefault:!0}].concat(Cq.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),Tq=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:ZG,shift:SK},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:QG,shift:CK},{key:`Alt-ArrowUp`,run:cq},{key:`Shift-Alt-ArrowUp`,run:dq},{key:`Alt-ArrowDown`,run:lq},{key:`Shift-Alt-ArrowDown`,run:fq},{key:`Mod-Alt-ArrowUp`,run:WK},{key:`Mod-Alt-ArrowDown`,run:GK},{key:`Escape`,run:KK},{key:`Mod-Enter`,run:gq},{key:`Alt-l`,mac:`Ctrl-l`,run:VK},{key:`Mod-i`,run:HK,preventDefault:!0},{key:`Mod-[`,run:xq},{key:`Mod-]`,run:bq},{key:`Mod-Alt-\\`,run:yq},{key:`Shift-Mod-k`,run:pq},{key:`Shift-Mod-\\`,run:mK},{key:`Mod-/`,run:nG},{key:`Alt-A`,mac:`Ctrl-A`,run:aG},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:Sq}].concat(wq),Eq={key:`Tab`,run:bq,shift:xq},Dq=`#2e3440`,Oq=`#3b4252`,kq=`#434c5e`,Aq=`#4c566a`,jq=`#e5e9f0`,Mq=`#eceff4`,Nq=`#8fbcbb`,Pq=`#88c0d0`,Fq=`#81a1c1`,Iq=`#5e81ac`,Lq=`#bf616a`,Rq=`#d08770`,zq=`#ebcb8b`,Bq=`#a3be8c`,Vq=`#b48ead`,Hq=`#d30102`,Uq=Mq,Wq=Uq,Gq=`#ffffff`,Kq=Oq,qq=Uq,Jq=Oq,Yq=M.theme({"&":{color:Dq,backgroundColor:Gq},".cm-content":{caretColor:Jq},".cm-cursor, .cm-dropCursor":{borderLeftColor:Jq},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:qq},".cm-panels":{backgroundColor:Uq,color:Aq},".cm-panels.cm-panels-top":{borderBottom:`2px solid black`},".cm-panels.cm-panels-bottom":{borderTop:`2px solid black`},".cm-searchMatch":{backgroundColor:`#72a1ff59`,outline:`1px solid ${Aq}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:jq},".cm-activeLine":{backgroundColor:Wq},".cm-selectionMatch":{backgroundColor:jq},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${Aq}`},"&.cm-focused .cm-matchingBracket":{backgroundColor:Mq},".cm-gutters":{backgroundColor:Mq,color:Dq,border:`none`},".cm-activeLineGutter":{backgroundColor:Wq},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:Kq},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Kq,borderBottomColor:Kq},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Wq,color:Aq}}},{dark:!1}),Xq=ge.define([{tag:j.keyword,color:Iq},{tag:[j.name,j.deleted,j.character,j.propertyName,j.macroName],color:Rq},{tag:[j.variableName],color:Rq},{tag:[j.function(j.variableName)],color:Iq},{tag:[j.labelName],color:Fq},{tag:[j.color,j.constant(j.name),j.standard(j.name)],color:Iq},{tag:[j.definition(j.name),j.separator],color:Bq},{tag:[j.brace],color:Nq},{tag:[j.annotation],color:Hq},{tag:[j.number,j.changed,j.annotation,j.modifier,j.self,j.namespace],color:Pq},{tag:[j.typeName,j.className],color:zq},{tag:[j.operator,j.operatorKeyword],color:Bq},{tag:[j.tagName],color:Vq},{tag:[j.squareBracket],color:Lq},{tag:[j.angleBracket],color:Rq},{tag:[j.attributeName],color:zq},{tag:[j.regexp],color:Iq},{tag:[j.quote],color:Oq},{tag:[j.string],color:Rq},{tag:j.link,color:Nq,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[j.url,j.escape,j.special(j.string)],color:Rq},{tag:[j.meta],color:Pq},{tag:[j.comment],color:kq,fontStyle:`italic`},{tag:j.strong,fontWeight:`bold`,color:Iq},{tag:j.emphasis,fontStyle:`italic`,color:Iq},{tag:j.strikethrough,textDecoration:`line-through`},{tag:j.heading,fontWeight:`bold`,color:Iq},{tag:j.special(j.heading1),fontWeight:`bold`,color:Iq},{tag:j.heading1,fontWeight:`bold`,color:Iq},{tag:[j.heading2,j.heading3,j.heading4],fontWeight:`bold`,color:Iq},{tag:[j.heading5,j.heading6],color:Iq},{tag:[j.atom,j.bool,j.special(j.variableName)],color:Rq},{tag:[j.processingInstruction,j.inserted],color:Nq},{tag:[j.contentSeparator],color:zq},{tag:j.invalid,color:kq,borderBottom:`1px dotted ${Hq}`}]),Zq=[Yq,k(Xq)],Qq=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,$q=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(Qq(e)):Qq,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return l(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=v(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=je(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n,a=!0;;e++){let n=r.charCodeAt(e),o=this.match(n,i,a,this.bufferPos+this.bufferStart,e==r.length-1);if(o)return this.value=o,this;if(e==r.length-1)break;a&&e<t.length&&t.charCodeAt(e)==n?i++:a=!1}}}match(e,t,n,r,i){let a=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],o=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?a={from:n.from,to:r,precise:i&&n.precise}:(n.index++,o=!0)),o?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?a={from:t,to:r,precise:n&&i}:this.matches.push({from:t,index:1,precise:n})),a&&this.test&&!this.test(a.from,a.to,this.buffer,this.bufferStart)&&(a=null),a}};typeof Symbol<`u`&&($q.prototype[Symbol.iterator]=function(){return this});var eJ={from:-1,to:-1,match:/.*/.exec(``),precise:!0},tJ=`gm`+(/x/.unicode==null?``:`u`),nJ=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=eJ,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new aJ(e,t,n,r,i);this.re=new RegExp(t,tJ+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter();let a=e.lineAt(r);this.curLineStart=a.from,this.matchPos=sJ(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=sJ(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},rJ=new WeakMap,iJ=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=rJ.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return rJ.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),rJ.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},aJ=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=eJ,this.matchPos=sJ(e,r),this.re=new RegExp(t,tJ+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=iJ.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,precise:!0,match:t},this.matchPos=sJ(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=iJ.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(nJ.prototype[Symbol.iterator]=aJ.prototype[Symbol.iterator]=function(){return this});function oJ(e){try{return new RegExp(e,tJ),!0}catch{return!1}}function sJ(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var cJ=e=>{let t=pe(e,`cm-goto-line`);if(t){let e=t.dom.querySelector(`input[type=text]`);return e&&e.select(),!0}let{state:n}=e,r=String(n.doc.lineAt(e.state.selection.main.head).number),{close:i,result:a}=be(e,{class:`cm-goto-line`,label:n.phrase(`Go to line`),input:{type:`text`,name:`line`,value:r},focus:!0,submitLabel:n.phrase(`go`)});return a.then(t=>{let r=t&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.elements.line.value);if(!r){e.dispatch({effects:i});return}let a=n.doc.lineAt(n.selection.main.head),[,o,s,c,l]=r,u=c?+c.slice(1):0,d=s?+s:a.number;if(s&&l){let e=d/100;o&&(e=e*(o==`-`?-1:1)+a.number/n.doc.lines),d=Math.round(n.doc.lines*e)}else s&&o&&(d=d*(o==`-`?-1:1)+a.number);let f=n.doc.line(Math.max(1,Math.min(n.doc.lines,d))),p=P.cursor(f.from+Math.max(0,Math.min(u,f.length)));e.dispatch({effects:[i,M.scrollIntoView(p.from,{y:`center`})],selection:p})}),!0},lJ={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},uJ=ve.define({combine(e){return D(e,lJ,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function dJ(e){let t=[_J,gJ];return e&&t.push(uJ.of(e)),t}var fJ=Ye.mark({class:`cm-selectionMatch`}),pJ=Ye.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function mJ(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=De.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=De.Word)}function hJ(e,t,n,r){return e(t.sliceDoc(n,n+1))==De.Word&&e(t.sliceDoc(r-1,r))==De.Word}var gJ=ce.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(uJ),{state:n}=e,r=n.selection;if(r.ranges.length>1)return Ye.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return Ye.none;let e=n.wordAt(i.head);if(!e)return Ye.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return Ye.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(mJ(o,n,i.from,i.to)&&hJ(o,n,i.from,i.to)))return Ye.none}else if(a=n.sliceDoc(i.from,i.to),!a)return Ye.none}let s=[];for(let r of e.visibleRanges){let e=new $q(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||mJ(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(pJ.range(r,a)):(r>=i.to||a<=i.from)&&s.push(fJ.range(r,a)),s.length>t.maxMatches))return Ye.none}}return Ye.set(s)}},{decorations:e=>e.decorations}),_J=M.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),vJ=({state:e,dispatch:t})=>{let{selection:n}=e,r=P.create(n.ranges.map(t=>e.wordAt(t.head)||P.cursor(t.head)),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)};function yJ(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new $q(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new $q(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var bJ=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return vJ({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=yJ(e,r);return i?(t(e.update({selection:e.selection.addRange(P.range(i.from,i.to),!1),effects:M.scrollIntoView(i.to)})),!0):!1},xJ=ve.define({combine(e){return D(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new tY(e),scrollToMatch:e=>M.scrollIntoView(e)})}}),SJ=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||oJ(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
109
+ `:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new NJ(this):new DJ(this)}getCursor(e,t=0,n){let r=e.doc?e:Je.create({doc:e});return n??=r.doc.length,this.regexp?kJ(this,r,t,n):TJ(this,r,t,n)}},CJ=class{constructor(e){this.spec=e}};function wJ(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function TJ(e,t,n,r){let i;return e.wholeWord&&(i=EJ(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=wJ(e.test,t,i)),new $q(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function EJ(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(AJ(i,n-a))!=De.Word||t(jJ(i,n-a))!=De.Word)&&(t(jJ(i,r-a))!=De.Word||t(AJ(i,r-a))!=De.Word))}var DJ=class extends CJ{constructor(e){super(e)}nextMatch(e,t,n){let r=TJ(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=TJ(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=TJ(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=TJ(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=TJ(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function OJ(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function kJ(e,t,n,r){let i;return e.wholeWord&&(i=MJ(t.charCategorizer(t.selection.main.head))),e.test&&(i=OJ(e.test,t,i)),new nJ(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function AJ(e,t){return e.slice(A(e,t,!1),t)}function jJ(e,t){return e.slice(t,A(e,t))}function MJ(e){return(t,n,r)=>!r[0].length||(e(AJ(r.input,r.index))!=De.Word||e(jJ(r.input,r.index))!=De.Word)&&(e(jJ(r.input,r.index+r[0].length))!=De.Word||e(AJ(r.input,r.index+r[0].length))!=De.Word)}var NJ=class extends CJ{nextMatch(e,t,n){let r=kJ(this.spec,e,n,e.doc.length).next();return r.done&&(r=kJ(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=kJ(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=kJ(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=kJ(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},PJ=g.define(),FJ=g.define(),IJ=m.define({create(e){return new LJ(YJ(e).create(),null)},update(e,t){for(let n of t.effects)n.is(PJ)?e=new LJ(n.value.create(),e.panel):n.is(FJ)&&(e=new LJ(e.query,n.value?JJ:null));return e},provide:e=>Pe.from(e,e=>e.panel)}),LJ=class{constructor(e,t){this.query=e,this.panel=t}},RJ=Ye.mark({class:`cm-searchMatch`}),zJ=Ye.mark({class:`cm-searchMatch cm-searchMatch-selected`}),BJ=ce.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(IJ))}update(e){let t=e.state.field(IJ);(t!=e.startState.field(IJ)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Ye.none;let{view:n}=this,r=new qe;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?zJ:RJ)})}return r.finish()}},{decorations:e=>e.decorations});function VJ(e){return t=>{let n=t.state.field(IJ,!1);return n&&n.query.spec.valid?e(t,n):QJ(t)}}var HJ=VJ((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=P.single(r.from,r.to),a=e.state.facet(xJ);return e.dispatch({selection:i,effects:[aY(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),ZJ(e),!0}),UJ=VJ((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=P.single(i.from,i.to),o=e.state.facet(xJ);return e.dispatch({selection:a,effects:[aY(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),ZJ(e),!0}),WJ=VJ((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:P.create(n.map(e=>P.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),GJ=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new $q(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(P.range(t.value.from,t.value.to))}return t(e.update({selection:P.create(a,o),userEvent:`select.search.matches`})),!0},KJ=VJ((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];o.precise?o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=t.nextMatch(n,o.from,o.to),u.push(M.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`))):o=t.nextMatch(n,o.from,o.to);let d=e.state.changes(s);return o&&(c=P.single(o.from,o.to).map(d),u.push(aY(e,o)),u.push(n.facet(xJ).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effects:u,userEvent:`input.replace`}),!0}),qJ=VJ((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:e,to:i,precise:a}=r;a&&n.push({from:e,to:i,insert:t.getReplacement(r)})}if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:M.announce.of(r),userEvent:`input.replace.all`}),!0});function JJ(e){return e.state.facet(xJ).createPanel(e)}function YJ(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(xJ);return new SJ({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function XJ(e){let t=fe(e,JJ);return t&&t.dom.querySelector(`[main-field]`)}function ZJ(e){let t=XJ(e);t&&t==e.root.activeElement&&t.select()}var QJ=e=>{let t=e.state.field(IJ,!1);if(t&&t.panel){let n=XJ(e);if(n&&n!=e.root.activeElement){let r=YJ(e.state,t.query.spec);r.valid&&e.dispatch({effects:PJ.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[FJ.of(!0),t?PJ.of(YJ(e.state,t.query.spec)):g.appendConfig.of(sY)]});return!0},$J=e=>{let t=e.state.field(IJ,!1);if(!t||!t.panel)return!1;let n=fe(e,JJ);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:FJ.of(!1)}),!0},eY=[{key:`Mod-f`,run:QJ,scope:`editor search-panel`},{key:`F3`,run:HJ,shift:UJ,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:HJ,shift:UJ,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:$J,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:GJ},{key:`Mod-Alt-g`,run:cJ},{key:`Mod-d`,run:bJ,preventDefault:!0}],tY=class{constructor(e){this.view=e;let t=this.query=e.state.field(IJ).query.spec;this.commit=this.commit.bind(this),this.searchField=Se(`input`,{value:t.search,placeholder:nY(e,`Find`),"aria-label":nY(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=Se(`input`,{value:t.replace,placeholder:nY(e,`Replace`),"aria-label":nY(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=Se(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=Se(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=Se(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return Se(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=Se(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>HJ(e),[nY(e,`next`)]),n(`prev`,()=>UJ(e),[nY(e,`previous`)]),n(`select`,()=>WJ(e),[nY(e,`all`)]),Se(`label`,null,[this.caseField,nY(e,`match case`)]),Se(`label`,null,[this.reField,nY(e,`regexp`)]),Se(`label`,null,[this.wordField,nY(e,`by word`)]),...e.state.readOnly?[]:[Se(`br`),this.replaceField,n(`replace`,()=>KJ(e),[nY(e,`replace`)]),n(`replaceAll`,()=>qJ(e),[nY(e,`replace all`)])],Se(`button`,{name:`close`,onclick:()=>$J(e),"aria-label":nY(e,`close`),type:`button`},[`×`])])}commit(){let e=new SJ({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:PJ.of(e)}))}keydown(e){Ue(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?UJ:HJ)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),KJ(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(PJ)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(xJ).top}};function nY(e,t){return e.state.phrase(t)}var rY=30,iY=/[\s\.,:;?!]/;function aY(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-rY),o=Math.min(i,n+rY),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<rY;e++)if(!iY.test(s[e+1])&&iY.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-rY;e--)if(!iY.test(s[e-1])&&iY.test(s[e])){s=s.slice(0,e);break}}return M.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var oY=M.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),sY=[IJ,oe.low(BJ),oY],cY=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},lY=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(CY).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new qe,s=[],c=0,l=r.doc.iter(),u=0,d=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>d)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,d);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==d))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=PY(s);if(i)o.add(n,n,Ye.widget({widget:new DY(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,Ye.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==d)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let f=o.finish();return new e(f,n,uY(f))}};function uY(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0)){if(!r)r=new cY(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new cY(r.from,n,r.diagnostic)}}),r}function dY(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(CY).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(pY))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function fY(e,t){return e.field(gY,!1)?t:t.concat(g.appendConfig.of(IY))}var pY=g.define(),mY=g.define(),hY=g.define(),gY=m.define({create(){return new lY(Ye.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=uY(n,e.selected.diagnostic,i)||uY(n,null,i)}!n.size&&i&&t.state.facet(CY).autoPanel&&(i=null),e=new lY(n,i,r)}for(let n of t.effects)if(n.is(pY)){let r=t.state.facet(CY).autoPanel?n.value.length?kY.open:null:e.panel;e=lY.init(n.value,r,t.state)}else n.is(mY)?e=new lY(e.diagnostics,n.value?kY.open:null,e.selected):n.is(hY)&&(e=new lY(e.diagnostics,e.panel,n.value));return e},provide:e=>[Pe.from(e,e=>e.panel),M.decorations.from(e,e=>e.diagnostics)]}),_Y=Ye.mark({class:`cm-lintRange cm-lintRange-active`});function vY(e,t,n){let{diagnostics:r}=e.state.field(gY),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(CY).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:!0,create(){return{dom:yY(e,i)}}}:null}function yY(e,t){return Se(`ul`,{class:`cm-tooltip-lint`},t.map(t=>EY(e,t,!1)))}var bY=e=>{let t=e.state.field(gY,!1);(!t||!t.panel)&&e.dispatch({effects:fY(e.state,[mY.of(!0)])});let n=fe(e,kY.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},xY=e=>{let t=e.state.field(gY,!1);return!t||!t.panel?!1:(e.dispatch({effects:mY.of(!1)}),!0)},SY=[{key:`Mod-Shift-m`,run:bY,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(gY,!1);if(!t)return!1;let n=e.state.selection.main,r=uY(t.diagnostics,null,n.to+1);return!r&&(r=uY(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),y(e,r.from,1,{tooltip:FY,until:e=>e.docChanged||e.newSelection.main.head<r.from||e.newSelection.main.head>r.to}),!0)}}],CY=ve.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...D(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:wY,tooltipFilter:wY,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function wY(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function TY(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function EY(e,t,n){let r=n?TY(t.actions):[];return Se(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},Se(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=uY(e.state.field(gY).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),Se(`u`,s.slice(c,c+1)),s.slice(c+1)],u=n.markClass?` `+n.markClass:``;return Se(`button`,{type:`button`,class:`cm-diagnosticAction`+u,onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&Se(`div`,{class:`cm-diagnosticSource`},t.source))}var DY=class extends de{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return Se(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},OY=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=EY(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},kY=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)xY(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=TY(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=uY(this.view.state.field(gY).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=Se(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=Se(`div`,{class:`cm-panel-lint`},this.list,Se(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>xY(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(gY).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(gY),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new OY(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new OY(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=uY(this.view.state.field(gY).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:hY.of(t)})}static open(t){return new e(t)}};function AY(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function jY(e){return AY(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var MY=M.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:jY(`#f11`)},".cm-lintRange-warning":{backgroundImage:jY(`orange`)},".cm-lintRange-info":{backgroundImage:jY(`#999`)},".cm-lintRange-hint":{backgroundImage:jY(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function NY(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function PY(e){let t=`hint`,n=1;for(let r of e){let e=NY(r.severity);e>n&&(n=e,t=r.severity)}return t}var FY=Ie(vY,{hideOn:dY}),IY=[gY,M.decorations.compute([gY],e=>{let{selected:t,panel:n}=e.field(gY);return!t||!n||t.from==t.to?Ye.none:Ye.set([_Y.range(t.from,t.to)])}),FY,MY],LY=[ke(),Ce(),We(),vG(),_e(),Ve(),C(),Je.allowMultipleSelections.of(!0),te(),k(Ee,{fallback:!0}),ze(),nt(),et(),Re(),w(),s(),dJ(),He.of([...$e,...Tq,...eY,...LG,...ae,...tt,...SY])];function RY(e,t,n){let r=kr(wE),i=jr(gD),a=I.useRef(null),{lexicalNode:o}=WW(),s=I.useRef(!1),c=I.useRef(!1),l=I.useCallback(()=>{i({editorType:`codeblock`,rootNode:o,editorRef:a.current})},[o,i]),u=I.useCallback(t=>{if(t.key===`ArrowDown`){let t=a.current?.getCodemirror()?.state;t&&t.doc.length===t.selection.ranges[0].to&&(s.current?(r?.update(()=>{var t;let n=Hu(e);n.getNextSibling()?((t=a.current?.getCodemirror())==null||t.contentDOM.blur(),n.selectNext()):n.insertAfter(lu())}),s.current=!1):s.current=!0)}else if(t.key===`ArrowUp`){let t=a.current?.getCodemirror()?.state;t&&t.selection.ranges[0].from===0&&(c.current?(r?.update(()=>{var t;let n=Hu(e);n.getPreviousSibling()&&((t=a.current?.getCodemirror())==null||t.contentDOM.blur(),n.selectPrevious())}),c.current=!1):c.current=!0)}else t.key===`Enter`?t.stopPropagation():(t.key===`Backspace`||t.key===`Delete`)&&(a.current?.getCodemirror()?.state)?.doc.length===0&&r?.update(()=>{Hu(e).remove()})},[r,e]);return I.useEffect(()=>{let e=a.current;return setTimeout(()=>{var t,n;(t=e?.getCodemirror())==null||t.contentDOM.addEventListener(`focus`,l),(n=e?.getCodemirror())==null||n.contentDOM.addEventListener(`keydown`,u)},300),()=>{var t,n;(t=e?.getCodemirror())==null||t.contentDOM.removeEventListener(`focus`,l),(n=e?.getCodemirror())==null||n.contentDOM.removeEventListener(`keydown`,u)}},[a,l,u,t]),I.useEffect(()=>{n.subscribe(()=>{var e;(e=a.current?.getCodemirror())==null||e.focus(),l()})},[n,a,e,l]),a}var zY=Object.defineProperty,BY=(e,t)=>zY(e,`name`,{value:t,configurable:!0});function VY(e,[t,n]){return Math.min(n,Math.max(t,e))}BY(VY,`clamp`);var HY=Object.defineProperty,UY=(e,t)=>HY(e,`name`,{value:t,configurable:!0});function WY(e){let t=I.useRef({value:e,previous:e});return I.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}UY(WY,`usePrevious`);var GY=Object.defineProperty,KY=(e,t)=>GY(e,`name`,{value:t,configurable:!0}),qY=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),JY=I.forwardRef(KY(function(e,t){return(0,L.jsx)(ej.span,{...e,ref:t,style:{...qY,...e.style}})},`VisuallyHidden`)),YY=Object.defineProperty,XY=(e,t)=>YY(e,`name`,{value:t,configurable:!0}),ZY=[` `,`Enter`,`ArrowUp`,`ArrowDown`],QY=[` `,`Enter`],$Y=`Select`,[eX,tX,nX]=eL($Y),[rX,iX]=FA($Y,[nX,hP]),aX=hP(),[oX,sX]=rX($Y),[cX,lX]=rX($Y);function uX(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=aX(t),[_,v]=I.useState(null),[y,b]=I.useState(null),[x,S]=I.useState(!1),C=mL(l),[w,T]=eF({prop:r,defaultProp:i??!1,onChange:a,caller:$Y}),[E,ee]=eF({prop:o,defaultProp:s,onChange:c,caller:$Y}),D=I.useRef(null),O=I.useRef(E);I.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=XY(()=>ee(O.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,ee]);let te=!_||!!m||!!_.closest(`form`),[ne,k]=I.useState(new Set),A=Jj(),re=Array.from(ne).map(e=>e.props.value).join(`;`),j=I.useCallback(e=>{k(t=>new Set(t).add(e))},[]),ie=I.useCallback(e=>{k(t=>{let n=new Set(t);return n.delete(e),n})},[]),ae={required:p,trigger:_,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:A,value:E,onValueChange:ee,open:w,onOpenChange:T,dir:C,triggerPointerDownPosRef:D,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:ne,nativeSelectKey:re,isFormControl:te};return(0,L.jsx)(jP,{...g,children:(0,L.jsx)(oX,{scope:t,...ae,children:(0,L.jsx)(eX.Provider,{scope:t,children:(0,L.jsx)(cX,{scope:t,onNativeOptionAdd:j,onNativeOptionRemove:ie,children:GX(h)?h(ae):n})})})})}XY(uX,`SelectProvider`);var dX=XY(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,L.jsx)(uX,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,L.jsxs)(L.Fragment,{children:[n,e?(0,L.jsx)(WX,{__scopeSelect:t}):null]})})},`Select`),fX=`SelectTrigger`,pX=I.forwardRef(XY(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=aX(n),o=sX(fX,n),s=o.disabled||r,c=jA(t,o.onTriggerChange),l=tX(n),u=I.useRef(`touch`),[d,f,p]=qX(e=>{let t=l().filter(e=>!e.disabled),n=JX(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=XY(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,L.jsx)(MP,{asChild:!0,...a,children:(0,L.jsx)(ej.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":KX(o.value)?``:void 0,...i,ref:c,onClick:SA(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:SA(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:SA(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&ZY.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),mX=`SelectValue`,hX=I.forwardRef(XY(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=sX(mX,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=jA(t,c.onValueNodeChange);Uj(()=>{l(u)},[l,u]);let f=KX(c.value);return(0,L.jsx)(ej.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,L.jsx)(I.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),gX=I.forwardRef(XY(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,L.jsx)(ej.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[_X,vX]=rX(`SelectPortal`,{forceMount:void 0}),yX=XY(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,L.jsx)(_X,{scope:e.__scopeSelect,forceMount:n,children:(0,L.jsx)(IP,{asChild:!0,...r})})},`SelectPortal`),bX=`SelectContent`,xX=I.forwardRef(XY(function(e,t){let n=vX(bX,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=sX(bX,e.__scopeSelect),[o,s]=I.useState();return Uj(()=>{s(new DocumentFragment)},[]),(0,L.jsx)(BP,{present:r||a.open,children:({present:e})=>e?(0,L.jsx)(DX,{...i,ref:t}):(0,L.jsx)(SX,{...i,fragment:o})})},`SelectContent`)),SX=I.forwardRef(XY(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?fE.createPortal((0,L.jsx)(wX,{scope:n,children:(0,L.jsx)(eX.Slot,{scope:n,children:(0,L.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),CX=10,[wX,TX]=rX(bX),EX=zA(`SelectContent.RemoveScroll`),DX=I.forwardRef(XY(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=sX(bX,n),[y,b]=I.useState(null),[x,S]=I.useState(null),C=jA(t,b),[w,T]=I.useState(null),[E,ee]=I.useState(null),D=tX(n),[O,te]=I.useState(!1),ne=I.useRef(!1);I.useEffect(()=>{if(y)return pF(y)},[y]),wj();let k=I.useCallback(e=>{let[t,...n]=D().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[D,x]),A=I.useCallback(()=>k([w,y]),[k,w,y]);I.useEffect(()=>{O&&A()},[O,A]);let{onOpenChange:re,triggerPointerDownPosRef:j}=v;I.useEffect(()=>{if(y){let e={x:0,y:0},t=XY(t=>{e={x:Math.abs(Math.round(t.pageX)-(j.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(j.current?.y??0))}},`handlePointerMove`),n=XY(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(y)||re(!1),document.removeEventListener(`pointermove`,t),j.current=null},`handlePointerUp`);return j.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,re,j]),I.useEffect(()=>{let e=XY(()=>re(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[re]);let[ie,ae]=qX(e=>{let t=D().filter(e=>!e.disabled),n=JX(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),oe=I.useCallback((e,t,n)=>{let r=!ne.current&&!n;(v.value!==void 0&&v.value===t||r)&&(T(e),r&&(ne.current=!0))},[v.value]),se=I.useCallback(()=>y?.focus(),[y]),ce=I.useCallback((e,t,n)=>{let r=!ne.current&&!n;(v.value!==void 0&&v.value===t||r)&&ee(e)},[v.value]),le=r===`popper`?kX:OX,M=le===kX?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,L.jsx)(wX,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:oe,selectedItem:w,onItemLeave:se,itemTextRefCallback:ce,focusSelectedItem:A,selectedItemText:E,position:r,isPositioned:O,searchRef:ie,children:(0,L.jsx)(xI,{as:EX,allowPinchZoom:!0,children:(0,L.jsx)(jj,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:SA(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,L.jsx)(fj,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,L.jsx)(le,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...M,onPlaced:()=>te(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:SA(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ae(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=D().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>k(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),OX=I.forwardRef(XY(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=sX(bX,n),o=TX(bX,n),[s,c]=I.useState(null),[l,u]=I.useState(null),d=jA(t,u),f=tX(n),p=I.useRef(!1),m=I.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=I.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-CX,d=VY(a,[CX,Math.max(CX,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-CX,d=VY(a,[CX,Math.max(CX,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-CX*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-CX,ee=c-E,D=g.offsetHeight/2,O=g.offsetTop+D,te=m+v+O,ne=x-te;if(te<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=te+Math.max(ee,D+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+D)+ne;s.style.height=t+`px`,h.scrollTop=te-E+h.offsetTop}s.style.margin=`${CX}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);Uj(()=>y(),[y]);let[b,x]=I.useState();Uj(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]);let S=I.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]);return(0,L.jsx)(AX,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:S,children:(0,L.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,L.jsx)(ej.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),kX=I.forwardRef(XY(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=CX,...a}=e,o=aX(n);return(0,L.jsx)(NP,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[AX,jX]=rX(bX,{}),MX=`SelectViewport`,NX=I.forwardRef(XY(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=TX(MX,n),o=jX(MX,n),s=jA(t,a.onViewportChange),c=I.useRef(0);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,L.jsx)(eX.Slot,{scope:n,children:(0,L.jsx)(ej.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:SA(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-CX*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[PX,FX]=rX(`SelectGroup`),IX=`SelectItem`,[LX,RX]=rX(IX),zX=I.forwardRef(XY(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=sX(IX,n),c=TX(IX,n),l=s.value===r,[u,d]=I.useState(a??``),[f,p]=I.useState(!1),m=jA(t,ij(e=>c.itemRefCallback?.(e,r,i))),h=Jj(),g=I.useRef(`touch`),_=XY(()=>{i||(s.onValueChange(r),s.onOpenChange(!1))},`handleSelect`);return(0,L.jsx)(LX,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:I.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,L.jsx)(eX.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,L.jsx)(ej.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:SA(o.onFocus,()=>p(!0)),onBlur:SA(o.onBlur,()=>p(!1)),onClick:SA(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:SA(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:SA(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:SA(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:SA(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:SA(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(QY.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),BX=`SelectItemText`,VX=I.forwardRef(XY(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=sX(BX,n),s=TX(BX,n),c=RX(BX,n),l=lX(BX,n),[u,d]=I.useState(null),f=ij(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=jA(t,d,c.onItemTextChange,f),m=u?.textContent,h=I.useMemo(()=>(0,L.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return Uj(()=>(g(h),()=>_(h)),[g,_,h]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(ej.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!KX(o.value)?fE.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),HX=I.forwardRef(XY(function(e,t){let{__scopeSelect:n,...r}=e;return(0,L.jsx)(ej.div,{"aria-hidden":!0,...r,ref:t})},`SelectSeparator`)),UX=`SelectBubbleInput`,WX=I.forwardRef(XY(function({__scopeSelect:e,...t},n){let r=sX(UX,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=I.useRef(null),m=jA(n,p),h=i??``,g=WY(h),_=Array.from(d).some(e=>(e.props.value??``)===``);return I.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(g!==h&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,h),e.dispatchEvent(t)}},[g,h]),(0,L.jsxs)(ej.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...qY,...t.style},ref:m,defaultValue:h,children:[KX(i)&&!_?(0,L.jsx)(`option`,{value:``}):null,Array.from(d)]},f)},`SelectBubbleInput`));function GX(e){return typeof e==`function`}XY(GX,`isFunction`);function KX(e){return e===``||e===void 0}XY(KX,`shouldShowPlaceholder`);function qX(e){let t=ij(e),n=I.useRef(``),r=I.useRef(0),i=I.useCallback(e=>{let i=n.current+e;t(i),XY((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=I.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return I.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}XY(qX,`useTypeaheadSearch`);function JX(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=YX(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}XY(JX,`findNextItem`);function YX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}XY(YX,`wrapArray`);var XX=Object.defineProperty,ZX=(e,t)=>XX(e,`name`,{value:t,configurable:!0}),[QX,$X]=FA(`Tooltip`,[hP]),eZ=hP(),tZ=`TooltipProvider`,nZ=700,rZ=`tooltip.open`,[iZ,aZ]=QX(tZ),oZ=ZX(e=>{let{__scopeTooltip:t,delayDuration:n=nZ,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=I.useRef(!0),s=I.useRef(!1),c=I.useRef(0);return I.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,L.jsx)(iZ,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:I.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:I.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:I.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),sZ=`Tooltip`,[cZ,lZ]=QX(sZ),uZ=ZX(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=aZ(sZ,e.__scopeTooltip),l=eZ(t),[u,d]=I.useState(null),[f,p]=I.useState(void 0),m=Jj(),h=I.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=I.useRef(!1),[y,b]=eF({prop:r,defaultProp:i??!1,onChange:ZX(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(rZ))):c.onClose(),a?.(e)},`onChange`),caller:sZ}),x=I.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),S=I.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=I.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),w=I.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},_)},[_,b]);I.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let T=f??m;return(0,L.jsx)(jP,{...l,children:(0,L.jsx)(cZ,{scope:t,contentId:T,setContentId:p,open:y,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:I.useCallback(()=>{c.isOpenDelayedRef.current?w():S()},[c.isOpenDelayedRef,w,S]),onTriggerLeave:I.useCallback(()=>{g?C():(window.clearTimeout(h.current),h.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})},`Tooltip`),dZ=`TooltipTrigger`,fZ=I.forwardRef(ZX(function(e,t){let{__scopeTooltip:n,...r}=e,i=lZ(dZ,n),a=aZ(dZ,n),o=eZ(n),s=jA(t,I.useRef(null),i.onTriggerChange),c=I.useRef(!1),l=I.useRef(!1),u=I.useCallback(()=>c.current=!1,[]);return I.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,L.jsx)(MP,{asChild:!0,...o,children:(0,L.jsx)(ej.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:SA(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:SA(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:SA(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:SA(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:SA(e.onBlur,i.onClose),onClick:SA(e.onClick,i.onClose)})})},`TooltipTrigger`)),pZ=`TooltipPortal`,[mZ,hZ]=QX(pZ,{forceMount:void 0}),gZ=ZX(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=lZ(pZ,t);return(0,L.jsx)(mZ,{scope:t,forceMount:n,children:(0,L.jsx)(BP,{present:n||a.open,children:(0,L.jsx)(IP,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),_Z=`TooltipContent`,vZ=I.forwardRef(ZX(function(e,t){let n=hZ(_Z,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=lZ(_Z,e.__scopeTooltip);return(0,L.jsx)(BP,{present:r||o.open,children:o.disableHoverableContent?(0,L.jsx)(xZ,{side:i,...a,ref:t}):(0,L.jsx)(yZ,{side:i,...a,ref:t})})},`TooltipContent`)),yZ=I.forwardRef(ZX(function(e,t){let n=lZ(_Z,e.__scopeTooltip),r=aZ(_Z,e.__scopeTooltip),i=I.useRef(null),a=jA(t,i),[o,s]=I.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=I.useCallback(()=>{s(null),d(!1)},[d]),p=I.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=wZ(r,CZ(r,n.getBoundingClientRect())),a=TZ(t.getBoundingClientRect()),o=DZ([...i,...a]);s(o),d(!0)},[d]);return I.useEffect(()=>()=>f(),[f]),I.useEffect(()=>{if(c&&u){let e=ZX(e=>p(e,u),`handleTriggerLeave`),t=ZX(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),I.useEffect(()=>{if(o){let e=ZX(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!EZ(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,L.jsx)(xZ,{...e,ref:a})},`TooltipContentHoverable`)),bZ=VA(`TooltipContent`),xZ=I.forwardRef(ZX(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=lZ(_Z,n),u=eZ(n),{onClose:d}=l;I.useEffect(()=>(document.addEventListener(rZ,d),()=>document.removeEventListener(rZ,d)),[d]),I.useEffect(()=>{if(l.trigger){let e=ZX(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return Uj(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,L.jsx)(fj,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,L.jsxs)(NP,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,L.jsx)(bZ,{children:r}),i?(0,L.jsx)(JY,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),SZ=I.forwardRef(ZX(function(e,t){let{__scopeTooltip:n,...r}=e,i=eZ(n);return(0,L.jsx)(PP,{...i,...r,ref:t})},`TooltipArrow`));function CZ(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}ZX(CZ,`getExitSideFromRect`);function wZ(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}ZX(wZ,`getPaddedExitPoints`);function TZ(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}ZX(TZ,`getPointsFromRect`);function EZ(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}ZX(EZ,`isPointInPolygon`);function DZ(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),OZ(t)}ZX(DZ,`getHull`);function OZ(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}ZX(OZ,`getHullPresorted`);var kZ=oZ,AZ=uZ,jZ=fZ,MZ=gZ,NZ=vZ,PZ=SZ,FZ=I.forwardRef(({title:e,children:t},n)=>{let r=kr(eD);return I.createElement(kZ,{delayDuration:100},I.createElement(AZ,null,I.createElement(jZ,{ref:n,asChild:!0},I.createElement(`span`,{className:J.tooltipTrigger},t)),I.createElement(MZ,{container:r?.current},I.createElement(NZ,{className:(0,hO.default)(J.tooltipContent),sideOffset:10},e))))}),IZ=I.forwardRef(({children:e,className:t,...n},r)=>I.createElement(zX,{...n,ref:r,className:(0,hO.default)(t,J.selectItem)},I.createElement(VX,null,e))),LZ=({title:e,placeholder:t,className:n})=>{let[r,i]=Ar(DE,vD);return I.createElement(FZ,{title:e},I.createElement(pX,{"aria-label":t,className:(0,hO.default)(J.selectTrigger,n),"data-toolbar-item":!0,disabled:r},I.createElement(hX,{placeholder:t}),I.createElement(gX,{className:J.selectDropdownArrow},i(`arrow_drop_down`))))},RZ=({children:e,className:t=J.selectContainer})=>{let n=kr(eD);return I.createElement(yX,{container:n?.current},I.createElement(xX,{className:(0,hO.default)(t,`mdxeditor-select-content`),onCloseAutoFocus:e=>{e.preventDefault()},position:`popper`},I.createElement(NX,{"data-editor-dropdown":!0,style:{maxHeight:`var(--radix-select-content-available-height)`}},e)))},zZ=e=>I.createElement(dX,{value:e.value||``,onValueChange:e.onChange,disabled:e.disabled},I.createElement(LZ,{title:e.triggerTitle,placeholder:e.placeholder}),I.createElement(RZ,null,e.items.map((e,t)=>e===`separator`?I.createElement(HX,{key:t}):I.createElement(IZ,{key:t,value:e.value},e.label)))),BZ=({language:e,nodeKey:t,code:n,focusEmitter:r})=>{let i=qD(),{parentEditor:a,lexicalNode:o}=WW(),[s,c,l,u,d]=Ar(DE,KZ,qZ,vD,WZ),f=RY(t,e,r),{setCode:p}=WW(),m=I.useRef(null),h=I.useRef(null),{value:g,items:_}=I.useMemo(()=>UZ(d,e),[d,e]),v=I.useRef(p);return v.current=p,f.current={getCodemirror:()=>m.current},I.useEffect(()=>{let t=h.current;return(async()=>{let r=[...c,LY,Zq,ke(),He.of([Eq]),M.lineWrapping,M.updateListener.of(({state:e})=>{v.current(e.doc.toString())}),M.domEventHandlers({focus:()=>{a.update(()=>{Xu(null)})}})];if(s&&r.push(Je.readOnly.of(!0)),e!==``){let t=d.keyMap[e]??e,n=d.supportMap[t];if(n)r.push(n.extension);else if(l){let t=tG.find(t=>t.name===e||t.alias.includes(e)||t.extensions.includes(e));if(t)try{let e=await t.load();r.push(e.extension)}catch{console.warn(`failed to load language support for`,e)}}}t.innerHTML=``,m.current=new M({parent:t,state:Je.create({doc:n,extensions:r})}),t.addEventListener(`keydown`,VZ)})(),()=>{var e;(e=m.current)==null||e.destroy(),m.current=null,t.removeEventListener(`keydown`,VZ)}},[s,e,...c]),I.createElement(`div`,{className:J.codeMirrorWrapper},I.createElement(`div`,{className:J.codeMirrorToolbar},I.createElement(zZ,{disabled:s,value:g,onChange:e=>{a.update(()=>{o.setLanguage(e===`__EMPTY_VALUE__`?``:e),setTimeout(()=>{a.update(()=>{o.getLatest().select()})})})},triggerTitle:i(`codeBlock.selectLanguage`,`Select code block language`),placeholder:i(`codeBlock.inlineLanguage`,`Language`),items:_}),I.createElement(`button`,{className:J.iconButton,type:`button`,disabled:s,title:i(`codeblock.delete`,`Delete code block`),onClick:e=>{e.preventDefault(),a.update(()=>{o.remove()})}},u(`delete_small`))),I.createElement(`div`,{ref:h}))};function VZ(e){e.stopPropagation()}function HZ(e){let t=[],n={},r={};if(Array.isArray(e))for(let i of e){let e=i.alias?.[0]??i.name.toLowerCase(),a=e||`__EMPTY_VALUE__`;if(t.push({value:a,label:i.name}),n[e]=a,i.alias)for(let e of i.alias)n[e]=a;if(i.extensions)for(let e of i.extensions)n[e]=a;n[i.name.toLowerCase()]=a,i.support&&(r[a]=i.support)}else{let r={};for(let[i,a]of Object.entries(e))a in r||(r[a]=i,t.push({value:i||`__EMPTY_VALUE__`,label:a})),n[i]=r[a]||`__EMPTY_VALUE__`}return{items:t,keyMap:n,supportMap:r}}function UZ(e,t){let n=e.keyMap[t]??t;return!n||e.items.some(e=>e.value===n)?{value:n,items:e.items}:{value:n,items:[...e.items,{value:n,label:t}]}}var WZ=R(HZ({js:`JavaScript`,ts:`TypeScript`,tsx:`TypeScript (React)`,jsx:`JavaScript (React)`,css:`CSS`})),GZ=Tr(e=>{e.link(e.pipe(GZ,Mr(({language:e,code:t})=>({code:t,language:e,meta:``}))),ZW)}),KZ=R([]),qZ=R(!0),JZ=zr({update(e,t){e.pubIn({[WZ]:HZ(t?.codeBlockLanguages??{}),[KZ]:t?.codeMirrorExtensions??[],[qZ]:t?.autoLoadLanguageSupport??!0})},init(e,t){let n=HZ(t?.codeBlockLanguages??{});e.pubIn({[WZ]:n,[KZ]:t?.codeMirrorExtensions??[],[QW]:YZ(n),[qZ]:t?.autoLoadLanguageSupport??!0})}});function YZ(e){return{match(t,n){return!n||Object.hasOwn(e.keyMap,t??``)},priority:1,Editor:BZ}}function XZ({url:e,title:t,text:n,onSubmit:r,onCancel:i,linkAutocompleteSuggestions:a,showLinkTitleField:o,showAnchorTextField:s}){let{register:c,handleSubmit:l,control:u,setValue:d,reset:f}=BV({values:{url:e,title:t,text:n}}),p=qD();return I.createElement(`form`,{onSubmit:e=>{l(r)(e),e.stopPropagation(),e.preventDefault()},onReset:e=>{e.stopPropagation(),i()},onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),i())},className:(0,hO.default)(J.multiFieldForm,J.linkDialogEditForm)},I.createElement(`div`,{className:J.formField},I.createElement(`label`,{htmlFor:`link-url`},p(`createLink.url`,`URL`)),I.createElement(jW,{register:c,initialInputValue:e,inputName:`url`,suggestions:a,setValue:d,control:u,placeholder:p(`createLink.urlPlaceholder`,`Select or paste an URL`),autofocus:!0})),s?I.createElement(`div`,{className:J.formField},I.createElement(`label`,{htmlFor:`link-text`,title:p(`createLink.textTooltip`,`The text to be displayed for the link`)},p(`createLink.text`,`Anchor text`)),I.createElement(`input`,{id:`link-text`,className:J.textInput,size:40,...c(`text`)})):null,o?I.createElement(`div`,{className:J.formField},I.createElement(`label`,{htmlFor:`link-title`,title:p(`createLink.titleTooltip`,`The link's title attribute, shown on hover`)},p(`createLink.title`,`Link title`)),I.createElement(`input`,{id:`link-title`,className:J.textInput,size:40,...c(`title`)})):null,I.createElement(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:`var(--spacing-2)`}},I.createElement(`button`,{type:`submit`,title:p(`createLink.saveTooltip`,`Set URL`),"aria-label":p(`createLink.saveTooltip`,`Set URL`),className:(0,hO.default)(J.primaryButton)},p(`dialogControls.save`,`Save`)),I.createElement(`button`,{type:`reset`,title:p(`createLink.cancelTooltip`,`Cancel change`),"aria-label":p(`createLink.cancelTooltip`,`Cancel change`),className:(0,hO.default)(J.secondaryButton)},p(`dialogControls.cancel`,`Cancel`))))}var ZZ=()=>{let[e,t,n,r,i,a,o,s]=Ar(eD,pD,wE,vD,rQ,lQ,uQ,pQ),c=jr(nQ),l=jr(iQ),u=jr(aQ),d=jr(oQ),f=jr(sQ);I.useEffect(()=>{let e=t?.closest(`.mdxeditor-root-contenteditable`),r=()=>{n?.getEditorState().read(()=>{c(!0)})};return window.addEventListener(`resize`,r),window.addEventListener(`scroll`,r),e?.addEventListener(`scroll`,r),()=>{window.removeEventListener(`resize`,r),window.removeEventListener(`scroll`,r),e?.removeEventListener(`scroll`,r)}},[n,t,c]);let[p,m]=I.useState(!1),h=qD();if(i.type===`inactive`)return null;let g=i.rectangle,_=i.type===`preview`&&i.url.startsWith(`http`);return I.createElement(qI,{open:!0},I.createElement(JI,{"data-visible":i.type===`edit`,className:J.linkDialogAnchor,style:{top:`${g.top}px`,left:`${g.left}px`,width:`${g.width}px`,height:`${g.height}px`}}),I.createElement(YI,{container:e?.current},I.createElement(XI,{className:(0,hO.default)(J.linkDialogPopoverContent),sideOffset:5,updatePositionStrategy:`always`,onOpenAutoFocus:e=>{e.preventDefault()},key:i.linkNodeKey},i.type===`edit`&&I.createElement(XZ,{url:i.url,title:i.title,text:i.text,onSubmit:l,onCancel:u.bind(null),linkAutocompleteSuggestions:a,showLinkTitleField:s,showAnchorTextField:i.withAnchorText}),i.type===`preview`&&I.createElement(I.Fragment,null,I.createElement(`a`,{className:J.linkDialogPreviewAnchor,"data-testid":`link-dialog-preview`,href:i.href??`about:blank`,..._?{target:`_blank`,rel:`noreferrer`}:{},onClick:e=>{o!==null&&(e.preventDefault(),o(i.url))},title:_?h(`linkPreview.open`,`Open {{url}} in new window`,{url:i.url}):i.url},I.createElement(`span`,null,i.url),_&&r(`open_in_new`)),I.createElement(QZ,{onClick:()=>{d()},title:h(`linkPreview.edit`,`Edit link URL`),"aria-label":h(`linkPreview.edit`,`Edit link URL`)},r(`edit`)),I.createElement(kZ,null,I.createElement(AZ,{open:p},I.createElement(jZ,{asChild:!0},I.createElement(QZ,{title:h(`linkPreview.copyToClipboard`,`Copy to clipboard`),"aria-label":h(`linkPreview.copyToClipboard`,`Copy to clipboard`),onClick:()=>{window.navigator.clipboard.writeText(i.url).then(()=>{m(!0),setTimeout(()=>{m(!1)},1e3)})}},r(p?`check`:`content_copy`))),I.createElement(MZ,{container:e?.current},I.createElement(NZ,{className:(0,hO.default)(J.tooltipContent),sideOffset:5},h(`linkPreview.copied`,`Copied!`),I.createElement(PZ,null))))),I.createElement(QZ,{title:h(`linkPreview.remove`,`Remove link`),"aria-label":h(`linkPreview.remove`,`Remove link`),onClick:()=>{f()}},r(`link_off`))),I.createElement(ZI,{className:J.popoverArrow}))))},QZ=I.forwardRef(({className:e,...t},n)=>I.createElement(`button`,{className:(0,hO.default)(J.actionButton,e),ref:n,...t}));function $Z(e){if(!e)return null;let t=sO(e);if(t===null)return null;let n=t.getParent();return vz(n)?n:vz(t)?t:null}function eQ(e=U()){if(!Cc(e))return null;let t=e.getNodes(),n=t.length===1?t[0]:null;return Gl(n)&&n.isInline()?n:null}function tQ(e,t,n){return e?e.getEditorState().read(()=>{let e=t===``?null:Hu(t),r=U(),i=H(r)?$Z(r):null;return(vz(e)?e:i)?.sanitizeUrl(n)??`about:blank`}):`about:blank`}var nQ=Tr(),rQ=R({type:`inactive`},e=>{e.pub(SD,t=>t.registerCommand(Io,()=>e.getValue(rQ).type===`preview`&&(e.pub(rQ,{type:`inactive`}),!0),1)),e.sub(e.pipe(BD),t=>{t!==`rich-text`&&e.pub(rQ,{type:`inactive`})}),e.pub(SD,t=>t.registerCommand(Eo,t=>{if(t.key===`k`&&(EO?t.metaKey:t.ctrlKey)&&!e.getValue(DE)){let n=U();return H(n)||eQ(n)!==null?(e.pub(cQ),t.stopPropagation(),t.preventDefault(),!0):!1}return!1},3)),e.sub(e.pipe(oQ,Nr(rQ,wE)),([,t,n])=>{if(t.type===`preview`)setTimeout(()=>{n?.getEditorState().read(()=>{let n=Hu(t.linkNodeKey),r=vz(n)?n.getTextContent().length>0&&n.getChildrenSize()<=1:!1,i=r&&n?n.getTextContent():``;e.pub(rQ,{type:`edit`,initialUrl:t.url,url:t.url,title:t.title,text:i,withAnchorText:r,linkNodeKey:t.linkNodeKey,decoratorNodeKey:t.decoratorNodeKey,rectangle:t.rectangle})})});else throw Error(`Cannot switch to edit mode when not in preview mode`)}),e.sub(e.pipe(iQ,Nr(wE,rQ,FE)),([t,n,r,i])=>{let a=t.text?.trim()??``,o=t.url?.trim()??``,s=t.title?.trim()??``;if(o!==``){if(r.decoratorNodeKey!==void 0){let t=``,i=!1;if(n?.update(()=>{let e=Hu(r.decoratorNodeKey);if(e===null)return;let a=Kc();if(a.add(e.getKey()),Xu(a),i=n.dispatchCommand(Sz,o),!i)return;let c=e.getParent();vz(c)&&(c.setTitle(s),t=c.getKey())},{discrete:!0}),t===``)return;e.pub(rQ,{type:`preview`,linkNodeKey:t,decoratorNodeKey:r.decoratorNodeKey,rectangle:r.rectangle,title:s,url:o,href:tQ(n,t,o)});return}if(i?.isCollapsed()){let e=a||s||o;n?.update(()=>{let t=$Z(i);if(!t){let t=_z(o,{title:s});t.append(dc(e)),nl([t]),t.select()}else if(xz(t)){let e=_z(o,{title:s});e.append(dc(a)),t.replace(e),e.select()}else t.setURL(o),t.setTitle(s),fQ(t.getFirstChild(),a)},{discrete:!0})}else n?.update(()=>{fQ(i?.anchor.getNode(),a)}),n?.dispatchCommand(Sz,{url:o,title:s});e.pub(rQ,{type:`preview`,linkNodeKey:r.linkNodeKey,rectangle:r.rectangle,title:s,url:o,href:tQ(n,r.linkNodeKey??``,o)})}else r.type===`edit`&&r.initialUrl!==``&&(r.decoratorNodeKey===void 0?n?.dispatchCommand(Sz,null):n?.update(()=>{let e=Hu(r.decoratorNodeKey);if(e===null)return;let t=Kc();t.add(e.getKey()),Xu(t),n.dispatchCommand(Sz,null)})),e.pub(rQ,{type:`inactive`})}),e.link(e.pipe(aQ,Nr(rQ,wE),Mr(([,e,t])=>{if(e.type===`edit`)return t?.focus(),e.initialUrl===``?{type:`inactive`}:{type:`preview`,url:e.initialUrl,href:tQ(t,e.linkNodeKey,e.initialUrl),linkNodeKey:e.linkNodeKey,decoratorNodeKey:e.decoratorNodeKey,rectangle:e.rectangle};throw Error(`Cannot cancel edit when not in edit mode`)})),rQ),e.link(e.pipe(e.combine(FE,nQ),Nr(wE,rQ,DE),Mr(([[e],t,n,r])=>{if(n.decoratorNodeKey!==void 0&&t&&!r){if(t.getEditorState().read(()=>{let e=U();if(!Cc(e))return null;let t=e.getNodes();return t.length===1?t[0].getKey():null})!==n.decoratorNodeKey)return{type:`inactive`};let e=fO(t,n.decoratorNodeKey);return e===null?{type:`inactive`}:{...n,rectangle:e}}if(H(e)&&t&&!r){let n=$Z(e);if(!e.isCollapsed())return{type:`inactive`};if(n){let e=pO(t);return e?{type:`preview`,url:n.getURL(),href:n.sanitizeUrl(n.getURL()),linkNodeKey:n.getKey(),title:n.getTitle(),rectangle:e}:{type:`inactive`}}return{type:`inactive`}}return{type:`inactive`}})),rQ)}),iQ=Tr(),aQ=Er();Er();var oQ=Er(),sQ=Er(e=>{e.sub(e.pipe(sQ,Nr(wE)),([,e])=>{e?.dispatchCommand(Sz,null)})}),cQ=Er(e=>{e.sub(e.pipe(cQ,Nr(FE,wE)),([,t,n])=>{if(!n)return;let r=n.getEditorState().read(()=>{let e=eQ();if(e===null)return null;let t=e.getParent(),n=vz(t)?t:null;return{nodeKey:e.getKey(),url:n?.getURL()??``,title:n?.getTitle()??``,linkNodeKey:n?.getKey()??``}});if(r!==null){let t=fO(n,r.nodeKey);if(t===null)return;e.pub(rQ,{type:`edit`,initialUrl:r.url,url:r.url,title:r.title,text:``,withAnchorText:!1,linkNodeKey:r.linkNodeKey,decoratorNodeKey:r.nodeKey,rectangle:t});return}H(t)&&n.focus(()=>{setTimeout(()=>{n.getEditorState().read(()=>{let r=$Z(t),i=pO(n);if(i===null)return;let a=r?.getURL()??``,o=r?.getURL()??``,s=r?.getTitle()??``,c=r?.getKey()??``,l=r?r.getTextContent().length>0&&r.getChildrenSize()<=1:t.isCollapsed(),u=l&&r?r.getTextContent():``;e.pub(rQ,{type:`edit`,initialUrl:a,url:o,title:s,text:u,withAnchorText:l,linkNodeKey:c,rectangle:i})})})})})}),lQ=R([]),uQ=R(null),dQ=R(null,e=>{e.pub(SD,t=>{function n(n){let[r,i]=e.getValues([DE,dQ]);r&&i!==null&&t.update(()=>{let e=Ku(n.target);if(e!==null){let t=Af(e,e=>e instanceof fz);t!==null&&i(n,t,t.getURL())}})}return t.registerRootListener((e,t)=>{e&&e.addEventListener(`click`,n),t&&t.removeEventListener(`click`,n)})})});function fQ(e,t){V(e)&&t&&(e.setTextContent(t),e.selectStart())}var pQ=R(!0),mQ=zr({init(e,t){e.pub(TD,t?.LinkDialog??ZZ),e.pub(uQ,t?.onClickLinkCallback??null),e.pub(dQ,t?.onReadOnlyClickLinkCallback??null),e.pub(pQ,t?.showLinkTitleField??!0)},update(e,t={}){e.pub(lQ,t.linkAutocompleteSuggestions??[])}});function hQ(e,t){return I.forwardRef((n,r)=>{let i=(0,hO.default)(t.className,n.className);return I.createElement(e,{...t,...n,className:i,ref:r})})}function gQ(e){return({title:t,children:n,...r})=>I.createElement(e,{"aria-label":t,...r},I.createElement(FZ,{title:t},n))}var _Q=({readOnly:e,children:t,className:n})=>I.createElement(IR,{className:(0,hO.default)(`mdxeditor-toolbar`,J.toolbarRoot,{[J.readOnlyToolbarRoot]:e},n),...e?{tabIndex:-1}:{}},t),vQ=gQ(hQ(RR,{className:J.toolbarButton,"data-toolbar-item":!0})),yQ=hQ(BR,{className:J.toolbarToggleItem,"data-toolbar-item":!0});hQ(zR,{type:`single`,className:J.toolbarToggleSingleGroup});var bQ=I.forwardRef(({on:e,title:t,children:n,disabled:r,...i},a)=>I.createElement(zR,{type:`single`,className:J.toolbarToggleSingleGroup,...i,value:e?`on`:`off`,ref:a},I.createElement(yQ,{"aria-label":t,value:`on`,disabled:r},I.createElement(FZ,{title:t},n)))),xQ=({items:e})=>I.createElement(`div`,{className:J.toolbarGroupOfGroups},e.map((e,t)=>I.createElement(bQ,{key:t,title:e.title,on:e.active,onValueChange:t=>{e.onChange(t===`on`)},disabled:e.disabled},e.contents))),SQ=({value:e,onChange:t,className:n,ggClassName:r,items:i,disabled:a})=>{let o=qD();return I.createElement(`div`,{className:(0,hO.default)(J.toolbarGroupOfGroups,r)},I.createElement(zR,{"aria-label":o(`toolbar.toggleGroup`,`toggle group`),type:`single`,className:(0,hO.default)(J.toolbarToggleSingleGroup,n),onValueChange:t,value:e||``,disabled:a,onFocus:e=>{e.preventDefault()}},i.map((e,t)=>I.createElement(yQ,{key:t,"aria-label":e.title,value:e.value},I.createElement(FZ,{title:e.title},e.contents)))))},CQ=R(()=>null),wQ=R(``),TQ=()=>"This is an empty toolbar. Pass `{toolbarContents: () => { return <>toolbar components</> }}` to the toolbarPlugin to customize it.",EQ=zr({init(e,t){let n=t?.toolbarPosition===`bottom`?kD:DD;e.pubIn({[CQ]:t?.toolbarContents??TQ,[wQ]:t?.toolbarClassName??``,[n]:()=>{let[e,t,n]=Ar(CQ,DE,wQ);return I.createElement(_Q,{className:n,readOnly:t},e())}})},update(e,t){e.pub(CQ,t?.toolbarContents??TQ),e.pub(wQ,t?.toolbarClassName??``)}}),DQ=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}offset(t,n=t){return new e(this.fromA+t,this.toA+t,this.fromB+n,this.toB+n)}};function OQ(e,t,n,r,i,a){if(e==r)return[];let o=RQ(e,t,n,r,i,a),s=zQ(e,t+o,n,r,i+o,a);t+=o,n-=s,i+=o,a-=s;let c=n-t,l=a-i;if(!c||!l)return[new DQ(t,n,i,a)];if(c>l){let o=e.slice(t,n).indexOf(r.slice(i,a));if(o>-1)return[new DQ(t,t+o,i,i),new DQ(t+o+l,n,a,a)]}else if(l>c){let o=r.slice(i,a).indexOf(e.slice(t,n));if(o>-1)return[new DQ(t,t,i,i+o),new DQ(n,n,i+o+c,a)]}if(c==1||l==1)return[new DQ(t,n,i,a)];let u=VQ(e,t,n,r,i,a);if(u){let[o,s,c]=u;return OQ(e,t,o,r,i,s).concat(OQ(e,o+c,n,r,s+c,a))}return MQ(e,t,n,r,i,a)}var kQ=1e9,AQ=0,jQ=!1;function MQ(e,t,n,r,i,a){let o=n-t,s=a-i;if(kQ<1e9&&Math.min(o,s)>kQ*16||AQ>0&&Date.now()>AQ)return Math.min(o,s)>kQ*64?[new DQ(t,n,i,a)]:HQ(e,t,n,r,i,a);let c=Math.ceil((o+s)/2);PQ.reset(c),FQ.reset(c);let l=(n,a)=>e.charCodeAt(t+n)==r.charCodeAt(i+a),u=(t,i)=>e.charCodeAt(n-t-1)==r.charCodeAt(a-i-1),d=(o-s)%2==0?null:FQ,f=d?null:PQ;for(let p=0;p<c;p++){if(p>kQ||AQ>0&&!(p&63)&&Date.now()>AQ)return HQ(e,t,n,r,i,a);let m=PQ.advance(p,o,s,c,d,!1,l)||FQ.advance(p,o,s,c,f,!0,u);if(m)return IQ(e,t,n,t+m[0],r,i,a,i+m[1])}return[new DQ(t,n,i,a)]}var NQ=class{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let e=0;e<this.len;e++)this.vec[e]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,t,n,r,i,a,o){for(let s=-e+this.start;s<=e-this.end;s+=2){let c=r+s,l=s==-e||s!=e&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,u=l-s;for(;l<t&&u<n&&o(l,u);)l++,u++;if(this.vec[c]=l,l>t)this.end+=2;else if(u>n)this.start+=2;else if(i){let e=r+(t-n)-s;if(e>=0&&e<this.len&&i.vec[e]!=-1){if(a){let n=i.vec[e];if(n>=t-l)return[n,r+n-e]}else{let n=t-i.vec[e];if(l>=n)return[l,u]}}}}return null}},PQ=new NQ,FQ=new NQ;function IQ(e,t,n,r,i,a,o,s){let c=!1;return!r$(e,r)&&++r==n&&(c=!0),!r$(i,s)&&++s==o&&(c=!0),c?[new DQ(t,n,a,o)]:OQ(e,t,r,i,a,s).concat(OQ(e,r,n,i,s,o))}function LQ(e,t){let n=1,r=Math.min(e,t);for(;n<r;)n<<=1;return n}function RQ(e,t,n,r,i,a){if(t==n||t==a||e.charCodeAt(t)!=r.charCodeAt(i))return 0;let o=LQ(n-t,a-i);for(let s=t,c=i;;){let i=s+o,l=c+o;if(i>n||l>a||e.slice(s,i)!=r.slice(c,l)){if(o==1)return s-t-+!r$(e,s);o>>=1}else if(i==n||l==a)return i-t;else s=i,c=l}}function zQ(e,t,n,r,i,a){if(t==n||i==a||e.charCodeAt(n-1)!=r.charCodeAt(a-1))return 0;let o=LQ(n-t,a-i);for(let s=n,c=a;;){let a=s-o,l=c-o;if(a<t||l<i||e.slice(a,s)!=r.slice(l,c)){if(o==1)return n-s-+!r$(e,s);o>>=1}else if(a==t||l==i)return n-a;else s=a,c=l}}function BQ(e,t,n,r,i,a,o,s){let c=r.slice(i,a),l=null;for(;;){if(l||o<s)return l;for(let s=t+o;;){r$(e,s)||s++;let u=s+o;if(r$(e,u)||(u+=u==s+1?1:-1),u>=n)break;let d=e.slice(s,u),f=-1;for(;(f=c.indexOf(d,f+1))!=-1;){let o=RQ(e,u,n,r,i+f+d.length,a),c=zQ(e,t,s,r,i,i+f),p=d.length+o+c;(!l||l[2]<p)&&(l=[s-c,i+f-c,p])}s=u}if(s<0)return l;o>>=1}}function VQ(e,t,n,r,i,a){let o=n-t,s=a-i;if(o<s){let o=VQ(r,i,a,e,t,n);return o&&[o[1],o[0],o[2]]}return o<4||s*2<o?null:BQ(e,t,n,r,i,a,Math.floor(o/4),-1)}function HQ(e,t,n,r,i,a){jQ=!0;let o=n-t,s=a-i,c;if(o<s){let s=BQ(r,i,a,e,t,n,Math.floor(o/6),50);c=s&&[s[1],s[0],s[2]]}else c=BQ(e,t,n,r,i,a,Math.floor(s/6),50);if(!c)return[new DQ(t,n,i,a)];let[l,u,d]=c;return OQ(e,t,l,r,i,u).concat(OQ(e,l+d,n,r,u+d,a))}function UQ(e,t){for(let n=1;n<e.length;n++){let r=e[n-1],i=e[n];r.toA>i.fromA-t&&r.toB>i.fromB-t&&(e[n-1]=new DQ(r.fromA,i.toA,r.fromB,i.toB),e.splice(n--,1))}}function WQ(e,t,n){for(;;){UQ(n,1);let r=!1;for(let i=0;i<n.length;i++){let a=n[i],o,s;(o=RQ(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[i]=new DQ(a.fromA+o,a.toA,a.fromB+o,a.toB)),(s=zQ(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[i]=new DQ(a.fromA,a.toA-s,a.fromB,a.toB-s));let c=a.toA-a.fromA,l=a.toB-a.fromB;if(c&&l)continue;let u=a.fromA-(i?n[i-1].toA:0),d=(i<n.length-1?n[i+1].fromA:e.length)-a.toA;if(!u||!d)continue;let f=c?e.slice(a.fromA,a.toA):t.slice(a.fromB,a.toB);u<=f.length&&e.slice(a.fromA-u,a.fromA)==f.slice(f.length-u)?(n[i]=new DQ(a.fromA-u,a.toA-u,a.fromB-u,a.toB-u),r=!0):d<=f.length&&e.slice(a.toA,a.toA+d)==f.slice(0,d)&&(n[i]=new DQ(a.fromA+d,a.toA+d,a.fromB+d,a.toB+d),r=!0)}if(!r)break}return n}function GQ(e,t,n){for(let r=0,i=0;i<e.length;i++){let a=e[i],o=a.toA-a.fromA,s=a.toB-a.fromB;if(o&&s||o>3||s>3){let c=i==e.length-1?t.length:e[i+1].fromA,l=a.fromA-r,u=c-a.toA,d=QQ(t,a.fromA,l),f=ZQ(t,a.toA,u),p=a.fromA-d,m=f-a.toA;if((!o||!s)&&p&&m){let l=Math.max(o,s),[u,h,g]=o?[t,a.fromA,a.toA]:[n,a.fromB,a.toB];l>p&&t.slice(d,a.fromA)==u.slice(g-p,g)?(a=e[i]=new DQ(d,d+o,a.fromB-p,a.toB-p),d=a.fromA,f=ZQ(t,a.toA,c-a.toA)):l>m&&t.slice(a.toA,f)==u.slice(h,h+m)&&(a=e[i]=new DQ(f-o,f,a.fromB+m,a.toB+m),f=a.toA,d=QQ(t,a.fromA,a.fromA-r)),p=a.fromA-d,m=f-a.toA}if(p||m)a=e[i]=new DQ(a.fromA-p,a.toA+m,a.fromB-p,a.toB+m);else if(!o){let t=e$(n,a.fromB,a.toB),r,o=t<0?-1:$Q(n,a.toB,a.fromB);t>-1&&(r=t-a.fromB)<=u&&n.slice(a.fromB,t)==n.slice(a.toB,a.toB+r)?a=e[i]=a.offset(r):o>-1&&(r=a.toB-o)<=l&&n.slice(a.fromB-r,a.fromB)==n.slice(o,a.toB)&&(a=e[i]=a.offset(-r))}else if(!s){let n=e$(t,a.fromA,a.toA),r,o=n<0?-1:$Q(t,a.toA,a.fromA);n>-1&&(r=n-a.fromA)<=u&&t.slice(a.fromA,n)==t.slice(a.toA,a.toA+r)?a=e[i]=a.offset(r):o>-1&&(r=a.toA-o)<=l&&t.slice(a.fromA-r,a.fromA)==t.slice(o,a.toA)&&(a=e[i]=a.offset(-r))}}r=a.toA}return UQ(e,3),e}var KQ;try{KQ=RegExp(`[\\p{Alphabetic}\\p{Number}]`,`u`)}catch{}function qQ(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function JQ(e,t){if(t==e.length)return 0;let n=e.charCodeAt(t);return n<192?+!!qQ(n):KQ?!t$(n)||t==e.length-1?+!!KQ.test(String.fromCharCode(n)):KQ.test(e.slice(t,t+2))?2:0:0}function YQ(e,t){if(!t)return 0;let n=e.charCodeAt(t-1);return n<192?+!!qQ(n):KQ?!n$(n)||t==1?+!!KQ.test(String.fromCharCode(n)):KQ.test(e.slice(t-2,t))?2:0:0}var XQ=8;function ZQ(e,t,n){if(t==e.length||!YQ(e,t))return t;for(let r=t,i=t+n,a=0;a<XQ;a++){let t=JQ(e,r);if(!t||r+t>i)return r;r+=t}return t}function QQ(e,t,n){if(!t||!JQ(e,t))return t;for(let r=t,i=t-n,a=0;a<XQ;a++){let t=YQ(e,r);if(!t||r-t<i)return r;r-=t}return t}function $Q(e,t,n){for(;t!=n;t--)if(e.charCodeAt(t-1)==10)return t;return-1}function e$(e,t,n){for(;t!=n;t++)if(e.charCodeAt(t)==10)return t;return-1}var t$=e=>e>=55296&&e<=56319,n$=e=>e>=56320&&e<=57343;function r$(e,t){return!t||t==e.length||!t$(e.charCodeAt(t-1))||!n$(e.charCodeAt(t))}function i$(e,t,n){let r=n?.override;return r?r(e,t):(kQ=(n?.scanLimit??1e9)>>1,AQ=n?.timeout?Date.now()+n.timeout:0,jQ=!1,WQ(e,t,OQ(e,0,e.length,t,0,t.length)))}function a$(){return!jQ}function o$(e,t,n){return GQ(i$(e,t,n),e,t)}var s$=ve.define({combine:e=>e[0]}),c$=g.define(),l$=ve.define(),u$=m.define({create(e){return null},update(e,t){for(let n of t.effects)n.is(c$)&&(e=n.value);for(let n of t.state.facet(l$))e=n(e,t);return e}}),d$=class e{constructor(e,t,n,r,i,a=!0){this.changes=e,this.fromA=t,this.toA=n,this.fromB=r,this.toB=i,this.precise=a}offset(t,n){return t||n?new e(this.changes,this.fromA+t,this.toA+t,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,t,n){return m$(o$(e.toString(),t.toString(),n),e,t,0,0,a$())}static updateA(e,t,n,r,i){return v$(_$(e,r,!0,n.length),e,t,n,i)}static updateB(e,t,n,r,i){return v$(_$(e,r,!1,t.length),e,t,n,i)}};function f$(e,t,n,r){let i=n.lineAt(e),a=r.lineAt(t);return i.to==e&&a.to==t&&e<n.length&&t<r.length?[e+1,t+1]:[i.from,a.from]}function p$(e,t,n,r){let i=n.lineAt(e),a=r.lineAt(t);return i.from==e&&a.from==t?[e,t]:[i.to+1,a.to+1]}function m$(e,t,n,r,i,a){let o=[];for(let s=0;s<e.length;s++){let c=e[s],[l,u]=f$(c.fromA+r,c.fromB+i,t,n),[d,f]=p$(c.toA+r,c.toB+i,t,n),p=[c.offset(-l+r,-u+i)];for(;s<e.length-1;){let a=e[s+1],[o,c]=f$(a.fromA+r,a.fromB+i,t,n);if(o>d+1&&c>f+1)break;p.push(a.offset(-l+r,-u+i)),[d,f]=p$(a.toA+r,a.toB+i,t,n),s++}o.push(new d$(p,l,Math.max(l,d),u,Math.max(u,f),a))}return o}var h$=1e3;function g$(e,t,n,r){let i=0,a=e.length;for(;;){if(i==a){let r=0,a=0;i&&({toA:r,toB:a}=e[i-1]);let o=t-(n?r:a);return[r+o,a+o]}let o=i+a>>1,s=e[o],[c,l]=n?[s.fromA,s.toA]:[s.fromB,s.toB];if(c>t)a=o;else if(l<=t)i=o+1;else return r?[s.fromA,s.fromB]:[s.toA,s.toB]}}function _$(e,t,n,r){let i=[];return t.iterChangedRanges((a,o,s,c)=>{let l=0,u=n?t.length:r,d=0,f=n?r:t.length;a>h$&&([l,d]=g$(e,a-h$,n,!0)),o<t.length-h$&&([u,f]=g$(e,o+h$,n,!1));let p=c-s-(o-a),m,[h,g]=n?[p,0]:[0,p];i.length&&(m=i[i.length-1]).toA>=l?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:u,toB:f,diffA:m.diffA+h,diffB:m.diffB+g}:i.push({fromA:l,toA:u,fromB:d,toB:f,diffA:h,diffB:g})}),i}function v$(e,t,n,r,i){if(!e.length)return t;let a=[];for(let o=0,s=0,c=0,l=0;;o++){let u=o==e.length?null:e[o],d=u?u.fromA+s:n.length,f=u?u.fromB+c:r.length;for(;l<t.length;){let e=t[l];if(u&&(e.toA+s>d||e.toB+c>f))break;a.push(e.offset(s,c)),l++}if(!u)break;let p=u.toA+s+u.diffA,m=u.toB+c+u.diffB,h=o$(n.sliceString(d,p),r.sliceString(f,m),i);for(let e of m$(h,n,r,d,f,a$()))a.push(e);for(s+=u.diffA,c+=u.diffB;l<t.length;){let e=t[l];if(e.fromA+s>p&&e.fromB+c>m)break;l++}}return a}var y$={scanLimit:500},b$=ce.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=A$(e))}update(e){(e.docChanged||e.viewportChanged||S$(e.startState,e.state)||C$(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=A$(e.view))}},{decorations:e=>e.deco}),x$=oe.low(re({class:`cm-changeGutter`,markers:e=>e.plugin(b$)?.gutter||f.empty}));function S$(e,t){return e.field(u$,!1)!=t.field(u$,!1)}function C$(e,t){return e.facet(s$)!=t.facet(s$)}var w$=Ye.line({class:`cm-changedLine`}),T$=Ye.mark({class:`cm-changedText`}),E$=Ye.mark({tagName:`ins`,class:`cm-insertedLine`}),D$=Ye.mark({tagName:`del`,class:`cm-deletedLine`}),O$=new class extends b{constructor(){super(...arguments),this.elementClass=`cm-changedLineGutter`}};function k$(e,t,n,r,i,a){let o=n?e.fromA:e.fromB,s=n?e.toA:e.toB,c=0;if(o!=s){i.add(o,o,w$),i.add(o,s,n?D$:E$),a&&a.add(o,o,O$);for(let l=t.iterRange(o,s-1),u=o;!l.next().done;){if(l.lineBreak){u++,i.add(u,u,w$),a&&a.add(u,u,O$);continue}let t=u+l.value.length;if(r)for(;c<e.changes.length;){let r=e.changes[c],a=o+(n?r.fromA:r.fromB),s=o+(n?r.toA:r.toB),l=Math.max(u,a),d=Math.min(t,s);if(l<d&&i.add(l,d,T$),s<t)c++;else break}u=t}}}function A$(e){let t=e.state.field(u$),{side:n,highlightChanges:r,markGutter:i,overrideChunk:a}=e.state.facet(s$),o=n==`a`,s=new qe,c=i?new qe:null,{from:l,to:u}=e.viewport;for(let n of t){if((o?n.fromA:n.fromB)>=u)break;(o?n.toA:n.toB)>l&&(!a||!a(e.state,n,s,c))&&k$(n,e.state.doc,o,r,s,c)}return{deco:s.finish(),gutter:c&&c.finish()}}var j$=class extends de{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement(`div`);return e.className=`cm-mergeSpacer`,e.style.height=this.height+`px`,e}updateDOM(e){return e.style.height=this.height+`px`,!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}},M$=g.define({map:(e,t)=>e.map(t)}),N$=m.define({create:()=>Ye.none,update:(e,t)=>{for(let e of t.effects)if(e.is(M$))return e.value;return e.map(t.changes)},provide:e=>M.decorations.from(e)}),P$=.01;function F$(e,t){if(e.size!=t.size)return!1;let n=e.iter(),r=t.iter();for(;n.value;){if(n.from!=r.from||Math.abs(n.value.spec.widget.height-r.value.spec.widget.height)>1)return!1;n.next(),r.next()}return!0}function I$(e,t,n){let r=new qe,i=new qe,a=e.state.field(N$).iter(),o=t.state.field(N$).iter(),s=0,c=0,l=0,u=0,d=e.viewport,f=t.viewport;for(let p=0;;p++){let m=p<n.length?n[p]:null,h=m?m.fromA:e.state.doc.length,g=m?m.fromB:t.state.doc.length;if(s<h){let n=e.lineBlockAt(s).top+l-(t.lineBlockAt(c).top+u);n<-.01?(l-=n,r.add(s,s,Ye.widget({widget:new j$(-n),block:!0,side:-1}))):n>P$&&(u+=n,i.add(c,c,Ye.widget({widget:new j$(n),block:!0,side:-1})))}if(h>s+1e3&&s<d.from&&h>d.from&&c<f.from&&g>f.from){let e=Math.min(d.from-s,f.from-c);s+=e,c+=e,p--}else if(m)s=m.toA,c=m.toB;else break;for(;a.value&&a.from<s;)l-=a.value.spec.widget.height,a.next();for(;o.value&&o.from<c;)u-=o.value.spec.widget.height,o.next()}for(;a.value;)l-=a.value.spec.widget.height,a.next();for(;o.value;)u-=o.value.spec.widget.height,o.next();let p=e.contentHeight+l-(t.contentHeight+u);p<P$?r.add(e.state.doc.length,e.state.doc.length,Ye.widget({widget:new j$(-p),block:!0,side:1})):p>P$&&i.add(t.state.doc.length,t.state.doc.length,Ye.widget({widget:new j$(p),block:!0,side:1}));let m=r.finish(),h=i.finish();F$(m,e.state.field(N$))||e.dispatch({effects:M$.of(m)}),F$(h,t.state.field(N$))||t.dispatch({effects:M$.of(h)})}var L$=g.define({map:(e,t)=>t.mapPos(e)}),R$=class extends de{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let t=document.createElement(`div`);return t.className=`cm-collapsedLines`,t.textContent=e.state.phrase(`$ unchanged lines`,this.lines),t.addEventListener(`click`,t=>{let n=e.posAtDOM(t.target);e.dispatch({effects:L$.of(n)});let{side:r,sibling:i}=e.state.facet(s$);i&&i().dispatch({effects:L$.of(z$(n,e.state.field(u$),r==`a`))})}),t}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return`collapsed-unchanged-code`}};function z$(e,t,n){let r=0,i=0;for(let a=0;;a++){let o=a<t.length?t[a]:null;if(!o||(n?o.fromA:o.fromB)>=e)return i+(e-r);[r,i]=n?[o.toA,o.toB]:[o.toB,o.toA]}}var B$=m.define({create(e){return Ye.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)n.is(L$)&&(e=e.update({filter:e=>e!=n.value}));if(e.size&&t.state.field(u$)!=t.startState.field(u$,!1)){let n=t.state.facet(s$).side==`a`,r=[];for(let i of t.state.field(u$))e.between(n?i.fromA:i.fromB,n?i.toA:i.toB,e=>{r.push(e)});r.length&&(e=e.update({filter:e=>r.indexOf(e)<0}))}return e},provide:e=>M.decorations.from(e)});function V$({margin:e=3,minSize:t=4}){return B$.init(n=>H$(n,e,t))}function H$(e,t,n){let r=new qe,i=e.facet(s$).side==`a`,a=e.field(u$),o=1;for(let s=0;;s++){let c=s<a.length?a[s]:null,l=s?o+t:1,u=c?e.doc.lineAt(i?c.fromA:c.fromB).number-1-t:e.doc.lines,d=u-l+1;if(d>=n&&r.add(e.doc.line(l).from,e.doc.line(u).to,Ye.replace({widget:new R$(d),block:!0})),!c)break;o=e.doc.lineAt(Math.min(e.doc.length,i?c.toA:c.toB)).number}return r.finish()}var U$=M.styleModule.of(new Te({".cm-mergeView":{overflowY:`auto`},".cm-mergeViewEditors":{display:`flex`,alignItems:`stretch`},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:`hidden`},".cm-merge-revert":{width:`1.6em`,flexGrow:0,flexShrink:0,position:`relative`},".cm-merge-revert button":{position:`absolute`,display:`block`,width:`100%`,boxSizing:`border-box`,textAlign:`center`,background:`none`,border:`none`,font:`inherit`,cursor:`pointer`}})),W$=M.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:`auto !important`,overflowY:`visible !important`},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:`rgba(160, 128, 100, .08)`},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:`rgba(100, 160, 128, .08)`},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:`linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat`},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:`linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat`},"&light.cm-merge-b .cm-changedText":{background:`linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat`},"&dark.cm-merge-b .cm-changedText":{background:`linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat`},"&.cm-merge-b .cm-deletedText":{background:`#ff000033`},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:`none`},".cm-deletedChunk":{paddingLeft:`6px`,"& .cm-chunkButtons":{position:`absolute`,insetInlineEnd:`5px`},"& button":{border:`none`,cursor:`pointer`,color:`white`,margin:`0 2px`,borderRadius:`3px`,"&[name=accept]":{background:`#2a2`},"&[name=reject]":{background:`#d43`}}},".cm-collapsedLines":{padding:`5px 5px 5px 10px`,cursor:`pointer`,"&:before":{content:`"⦚"`,marginInlineEnd:`7px`},"&:after":{content:`"⦚"`,marginInlineStart:`7px`}},"&light .cm-collapsedLines":{color:`#444`,background:`linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)`},"&dark .cm-collapsedLines":{color:`#ddd`,background:`linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)`},".cm-changeGutter":{width:`3px`,paddingLeft:`1px`},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:`#e43`},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:`#fa9`},"&light.cm-merge-b .cm-changedLineGutter":{background:`#2b2`},"&dark.cm-merge-b .cm-changedLineGutter":{background:`#8f8`},".cm-inlineChangedLineGutter":{background:`#75d`}}),G$=new he,K$=new he,q$=class{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||y$;let t=[oe.low(b$),W$,U$,N$,M.updateListener.of(e=>{this.measuring<0&&(e.heightChanged||e.viewportChanged)&&!e.transactions.some(e=>e.effects.some(e=>e.is(M$)))&&this.measure()})],n=[s$.of({side:`a`,sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&n.push(x$);let r=Je.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],M.editorAttributes.of({class:`cm-merge-a`}),K$.of(n),t]}),i=[s$.of({side:`b`,sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&i.push(x$);let a=Je.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],M.editorAttributes.of({class:`cm-merge-b`}),K$.of(i),t]});this.chunks=d$.build(r.doc,a.doc,this.diffConf);let o=[u$.init(()=>this.chunks),G$.of(e.collapseUnchanged?V$(e.collapseUnchanged):[])];r=r.update({effects:g.appendConfig.of(o)}).state,a=a.update({effects:g.appendConfig.of(o)}).state,this.dom=document.createElement(`div`),this.dom.className=`cm-mergeView`,this.editorDOM=this.dom.appendChild(document.createElement(`div`)),this.editorDOM.className=`cm-mergeViewEditors`;let s=e.orientation||`a-b`,c=document.createElement(`div`);c.className=`cm-mergeViewEditor`;let l=document.createElement(`div`);l.className=`cm-mergeViewEditor`,this.editorDOM.appendChild(s==`a-b`?c:l),this.editorDOM.appendChild(s==`a-b`?l:c),this.a=new M({state:r,parent:c,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.a)}),this.b=new M({state:a,parent:l,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls==`b-to-a`,e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,t){if(e.some(e=>e.docChanged)){let n=e[e.length-1],r=e.reduce((e,t)=>e.compose(t.changes),Oe.empty(e[0].startState.doc.length));this.chunks=t==this.a?d$.updateA(this.chunks,n.newDoc,this.b.state.doc,r,this.diffConf):d$.updateB(this.chunks,this.a.state.doc,n.newDoc,r,this.diffConf),t.update([...e,n.state.update({effects:c$.of(this.chunks)})]);let i=t==this.a?this.b:this.a;i.update([i.state.update({effects:c$.of(this.chunks)})]),this.scheduleMeasure()}else t.update(e)}reconfigure(e){if(`diffConfig`in e&&(this.diffConf=e.diffConfig),`orientation`in e){let t=e.orientation!=`b-a`;if(t!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let e=this.a.dom.parentNode,n=this.b.dom.parentNode;e.remove(),n.remove(),this.editorDOM.insertBefore(t?e:n,this.editorDOM.firstChild),this.editorDOM.appendChild(t?n:e),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent=``)}}if(`revertControls`in e||`renderRevertControl`in e){let t=!!this.revertDOM,n=this.revertToA,r=this.renderRevert;`revertControls`in e&&(t=!!e.revertControls,n=e.revertControls==`b-to-a`),`renderRevertControl`in e&&(r=e.renderRevertControl),this.setupRevertControls(t,n,r)}let t=`highlightChanges`in e,n=`gutter`in e,r=`collapseUnchanged`in e;if(t||n||r){let i=[],a=[];if(t||n){let r=this.a.state.facet(s$),o=n?e.gutter!==!1:r.markGutter,s=t?e.highlightChanges!==!1:r.highlightChanges;i.push(K$.reconfigure([s$.of({side:`a`,sibling:()=>this.b,highlightChanges:s,markGutter:o}),o?x$:[]])),a.push(K$.reconfigure([s$.of({side:`b`,sibling:()=>this.a,highlightChanges:s,markGutter:o}),o?x$:[]]))}if(r){let t=G$.reconfigure(e.collapseUnchanged?V$(e.collapseUnchanged):[]);i.push(t),a.push(t)}this.a.dispatch({effects:i}),this.b.dispatch({effects:a})}this.scheduleMeasure()}setupRevertControls(e,t,n){this.revertToA=t,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=n,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement(`div`),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener(`mousedown`,e=>this.revertClicked(e)),this.revertDOM.className=`cm-merge-revert`):this.revertDOM&&(this.revertDOM.textContent=``)}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){I$(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,t=e.firstChild,n=this.a.viewport,r=this.b.viewport;for(let i=0;i<this.chunks.length;i++){let a=this.chunks[i];if(a.fromA>n.to||a.fromB>r.to)break;if(a.fromA<n.from||a.fromB<r.from)continue;let o=this.a.lineBlockAt(a.fromA).top+`px`;for(;t&&+t.dataset.chunk<i;)t=J$(t);t&&t.dataset.chunk==String(i)?(t.style.top!=o&&(t.style.top=o),t=t.nextSibling):e.insertBefore(this.renderRevertButton(o,i),t)}for(;t;)t=J$(t)}renderRevertButton(e,t){let n;if(this.renderRevert)n=this.renderRevert();else{n=document.createElement(`button`);let e=this.a.state.phrase(`Revert this chunk`);n.setAttribute(`aria-label`,e),n.setAttribute(`title`,e),n.textContent=this.revertToLeft?`⇜`:`⇝`}return n.style.top=e,n.setAttribute(`data-chunk`,String(t)),n}revertClicked(e){let t=e.target,n;for(;t&&t.parentNode!=this.revertDOM;)t=t.parentNode;if(t&&(n=this.chunks[t.dataset.chunk])){let[t,r,i,a,o,s]=this.revertToA?[this.b,this.a,n.fromB,n.toB,n.fromA,n.toA]:[this.a,this.b,n.fromA,n.toA,n.fromB,n.toB],c=t.state.sliceDoc(i,Math.max(i,a-1));i!=a&&s<=r.state.doc.length&&(c+=t.state.lineBreak),r.dispatch({changes:{from:o,to:Math.min(r.state.doc.length,s),insert:c},userEvent:`revert`}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}};function J$(e){let t=e.nextSibling;return e.remove(),t}var Y$=[LY,Zq,sr(),ke(),M.lineWrapping],X$=()=>{let[e,t,n]=Ar(LE,DE,t1),r=jr(VD),i=jr(_D),a=I.useRef(null),o=I.useCallback(o=>{var s;if(o!==null){let s=[...n,...Y$,M.updateListener.of(({state:e})=>{r(e.doc.toString())}),M.focusChangeEffect.of((e,t)=>(t||i(new FocusEvent(`blur`)),null))];t&&s.push(Je.readOnly.of(!0)),o.innerHTML=``,a.current=new M({parent:o,state:Je.create({doc:e,extensions:s})})}else(s=a.current)==null||s.destroy(),a.current=null},[e,t,r,n,i]);return I.createElement(`div`,{ref:o,className:`cm-sourceView mdxeditor-source-editor`})};function Z$(e,t){e!==void 0&&e.dispatch({changes:{from:0,to:e.state.doc.length,insert:t}})}var Q$=()=>{let e=Or(),[t,n,r,i]=Ar(LE,e1,DE,n1),a=jr(VD),o=I.useRef(null),s=I.useRef(null),c=kr(t1),l=jr(_D);return I.useEffect(()=>e.sub(e1,e=>{Z$(s.current?.a,e)}),[e]),I.useEffect(()=>e.sub(LE,e=>{Z$(s.current?.b,e)}),[e]),I.useEffect(()=>{let e=r||i;return s.current=new q$({...e?{renderRevertControl:void 0,revertControls:void 0}:{renderRevertControl:()=>{let e=document.createElement(`button`);return e.classList.add(`cm-merge-revert`),e.appendChild(document.createTextNode(`⮕`)),e},revertControls:`a-to-b`},parent:o.current,orientation:`a-b`,gutter:!0,a:{doc:n,extensions:[...c,...Y$,Je.readOnly.of(!0)]},b:{doc:t,extensions:[...c,...Y$,Je.readOnly.of(e),M.updateListener.of(({state:e})=>{let t=e.doc.toString();a(t)}),M.focusChangeEffect.of((e,t)=>(t||l(new FocusEvent(`blur`)),null))]}}),()=>{var e;(e=s.current)==null||e.destroy(),s.current=null}},[a,c]),I.createElement(`div`,{ref:o,className:`mdxeditor-diff-editor`})},$$=({children:e})=>{let[t,n]=Ar(ME,BD);return I.createElement(`div`,{className:`mdxeditor-diff-source-wrapper`},t?I.createElement(`div`,{className:J.markdownParseError},I.createElement(`p`,null,t.error,`.`),I.createElement(`p`,null,`You can fix the errors in source mode and switch to rich text mode when you are ready.`)):null,I.createElement(`div`,{className:`mdxeditor-rich-text-editor`,style:{display:n===`rich-text`&&t==null?`block`:`none`}},e),n===`diff`?I.createElement(Q$,null):null,n===`source`?I.createElement(X$,null):null)},e1=R(``),t1=R([]),n1=R(!1),r1=zr({update:(e,t)=>{e.pub(e1,t?.diffMarkdown??``)},init(e,t){e.pubIn({[e1]:t?.diffMarkdown??``,[t1]:t?.codeMirrorExtensions??[],[jD]:$$,[n1]:t?.readOnlyDiff??!1,[BD]:t?.viewMode??`rich-text`})}});function i1(e,t){let n=e;for(let r=hp(e,t);r&&(C1(r.origin)||hc(r.origin));r=r.getAdjacentCaret())n=r.origin;return n}function a1(e){return i1(e,`previous`)}function o1(e,t){for(let n of e.childNodes)if(K(n)&&n.tagName===t||o1(n,t))return!0;return!1}var s1=`data-language`,c1=`data-highlight-language`,l1=`data-theme`,u1=class e extends Hl{__language;__theme;__isSyntaxHighlightSupported;static getType(){return`code`}static clone(t){return new e(t.__language,t.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){let t=Ud().createElement(`code`);rm(t,e.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(s1,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(c1,n));let r=this.getTheme();r&&t.setAttribute(l1,r);let i=this.getStyle();return i&&Js(t.style,i),t}updateDOM(e,t,n){let r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(s1,r):i&&t.removeAttribute(s1);let a=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?a&&r?r!==i&&t.setAttribute(c1,r):t.removeAttribute(c1):a&&r&&t.setAttribute(c1,r);let o=this.__theme,s=e.__theme;o?o!==s&&t.setAttribute(l1,o):s&&t.removeAttribute(l1);let c=this.__style,l=e.__style;return c!==l&&Js(t.style,c,l),!1}exportDOM(e){let t=Ud().createElement(`pre`);rm(t,e._config.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(s1,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(c1,n));let r=this.getTheme();r&&t.setAttribute(l1,r);let i=this.getStyle();return i&&Js(t.style,i),{element:t}}static importDOM(){return{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||o1(e,`BR`))?{conversion:p1,priority:1}:null,div:()=>({conversion:m1,priority:1}),pre:()=>({conversion:p1,priority:0}),table:e=>v1(e)?{conversion:h1,priority:3}:null,td:e=>{let t=e,n=t.closest(`table`);return t.classList.contains(`js-file-line`)||n&&v1(n)?{conversion:g1,priority:3}:null},tr:e=>{let t=e.closest(`table`);return t&&v1(t)?{conversion:g1,priority:3}:null}}}static importJSON(e){return d1().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){if(!Ph(cf(),`@lexical/code`)){let t=y1(e);if(t)return t}let{anchor:n,focus:r}=e,i=(n.isBefore(r)?n:r).getNode();if(V(i)){let e=a1(i),t=[];for(;;)if(hc(e))t.push(mc()),e=e.getNextSibling();else{if(!C1(e))break;{let n=0,r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&r[n]===` `;)n++;if(n!==0&&t.push(S1(` `.repeat(n))),n!==i)break;e=e.getNextSibling()}}let r=i.splitText(n.offset)[0],a=n.offset===0?0:1,o=r.getIndexWithinParent()+a,s=i.getParentOrThrow(),c=[nu(),...t];s.splice(o,0,c);let l=t[t.length-1];l?l.select():n.offset===0?r.selectPrevious():r.getNextSibling().selectNext(0,0)}if(f1(i)){let{offset:t}=e.anchor;i.splice(t,0,[nu()]),i.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){let e=lu();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}setLanguage(e){let t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){let t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){let t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function d1(e,t){return kf(u1).setLanguage(e).setTheme(t)}function f1(e){return e instanceof u1}function p1(e){return{node:d1(e.getAttribute(s1))}}function m1(e){let t=e,n=_1(t);return n||function(e){let t=e.parentElement;for(;t!==null;){if(_1(t))return!0;t=t.parentElement}return!1}(t)?{node:n?d1():null}:{node:null}}function h1(){return{node:d1()}}function g1(){return{node:null}}function _1(e){return e.style.fontFamily.match(`monospace`)!==null}function v1(e){return e.classList.contains(`js-file-line-container`)}function y1(e){let{anchor:t}=e;if(e.isCollapsed()&&t.type===`element`){let e=t.getNode();if(f1(e)){let n=e.getChildrenSize();if(n>=2&&t.offset===n){let t=e.getLastChild();if(ru(t)&&ru(t.getPreviousSibling())){let t=lu();return e.splice(n-2,2,[]).insertAfter(t,!1),t.select(),t}}}}return null}var b1=class e extends nc{__highlightType;constructor(e=``,t,n){super(e,n),this.__highlightType=t}static getType(){return`code-highlight`}static clone(t){return new e(t.__text,t.__highlightType||void 0,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__highlightType=e.__highlightType}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){let t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){let t=super.createDOM(e);return rm(t,x1(e.theme,this.__highlightType)),t}updateDOM(e,t,n){let r=super.updateDOM(e,t,n),i=x1(n.theme,e.__highlightType),a=x1(n.theme,this.__highlightType);return i!==a&&(i&&im(t,i),a&&rm(t,a)),r}static importJSON(e){return S1().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return d1()}};function x1(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function S1(e=``,t){return jd(new b1(e,t))}function C1(e){return e instanceof b1}Mg.tag(`tr`,`td`),Mg.tag(`pre`),Mg.tag(`code`),Mg.tag(`div`),Mg.tag(`div`,`br`),Mg.tag(`div`),Mg.tag(`table`).classAll(`js-file-line-container`),Mg.tag(`td`).classAll(`js-file-line`);function w1(e,t){let n={};for(let r of e){let e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}function T1(e){let t=w1(e,e=>e.type);return{element:t.element||[],multilineElement:t[`multiline-element`]||[],textFormat:t[`text-format`]||[],textMatch:t[`text-match`]||[]}}var E1=/[!-/:-@[-`{-~\s]/;function D1(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`).replace(/&#(\d+);/g,(e,t)=>String.fromCodePoint(Number(t)))}var O1=/^(\s*)(\d{1,})\.\s/,k1=/^(\s*)[-*+]\s/,A1=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,j1=/^(#{1,6})\s/,M1=/^>\s/,N1=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,P1=/^[ \t]*`{3,}$/,F1=Gi(`mdListMarker`,{parse:e=>typeof e==`string`&&/^[-*+]$/.test(e)?e:`-`,resetOnCopyNode:!0}),I1=Gi(`mdCodeFence`,{parse:e=>typeof e==`string`&&/^`{3,}$/.test(e)?e:"```",resetOnCopyNode:!0}),L1=Gi(`mdHardLineBreak`,{parse:e=>typeof e==`string`&&/^(\\| {2,})$/.test(e)?e:``,resetOnCopyNode:!0});function R1(e){if(e.endsWith(`\\`))return[e.slice(0,-1),`\\`];let t=e.match(/^(.*?\S)( {2,})$/);return t?[t[1],t[2]]:null}function z1(e){let t=e.getChildren(),n=t.length-1,r=t[n];if(!V(r))return null;let i=r.getTextContent(),a=R1(i);if(a!==null){let[e,t]=a;return r.setTextContent(e),t}return/^ {2,}$/.test(i)&&function(e,t){for(let n=t-1;n>=0;n--){if(ru(e[n]))return!1;if(/\S/.test(e[n].getTextContent()))return!0}return!1}(t,n)?(r.setTextContent(``),i):null}function B1(e){let t=nu(),n=z1(e);return n!==null&&qi(t,L1,n),t}var V1=e=>(t,n,r,i)=>{let a=e(r);a.append(...n),t.replace(a),i||a.select(0,0)},H1=e=>(t,n,r,i)=>{let a=t.getPreviousSibling(),o=t.getNextSibling(),s=dk(e===`check`?r[3]===`x`:void 0),c=r[0].trim()[0],l=e!==`bullet`&&e!==`check`||c!==F1.parse(c)?void 0:c;if(X(o)&&o.getListType()===e){l&&qi(o,F1,l);let n=o.getFirstChild();n===null?o.append(s):n.insertBefore(s),e===`number`&&o.setStart(Number(r[2])),t.remove()}else if(X(a)&&a.getListType()===e)l&&qi(a,F1,l),a.append(s),t.remove();else{let n=gk(e,e===`number`?Number(r[2]):void 0);l&&qi(n,F1,l),n.append(s),t.replace(n)}s.append(...n),i||s.select(0,0);let u=function(e){let t=e.match(/\t/g),n=e.match(/ /g),r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]);u&&s.setIndent(u)},U1=(e,t,n,r)=>{let i=[],a=e.getChildren(),o=0;for(let s of a)if(Y(s)){if(s.getChildrenSize()===1){let e=s.getFirstChild();if(X(e)){let a=U1(e,t,n+1,r);a&&i.push(a);continue}}if(r&&!s.getChildren().some(e=>e.isSelected(r)))continue;let a=` `.repeat(4*n),c=e.getListType(),l=Ki(e,F1),u=c===`number`?`${e.getStart()+o}. `:c===`check`?`${l} [${s.getChecked()?`x`:` `}] `:l+` `,d=t(s);c!==`number`&&(d=d.replace(/^(\s{0,3}\d+)(\.\s)/,`$1\\$2`)),i.push(a+u+d),o++}return i.join(`
110
+ `)},W1={dependencies:[k_],export:(e,t)=>{if(!P_(e))return null;let n=Number(e.getTag().slice(1));return`#`.repeat(n)+` `+t(e)},regExp:j1,replace:V1(e=>N_(`h`+e[1].length)),triggerOnEnter:!0,type:`element`},G1={dependencies:[E_],export:(e,t)=>{if(!O_(e))return null;let n=t(e).split(`
111
+ `),r=[];for(let e of n)r.push(`> `+e);return r.join(`
112
+ `)},regExp:M1,replace:(e,t,n,r)=>{if(r){let n=e.getPreviousSibling();if(O_(n))return n.splice(n.getChildrenSize(),0,[B1(n),...t]),void e.remove()}let i=D_();i.append(...t),e.replace(i),r||i.select(0,0)},triggerOnEnter:!0,type:`element`},K1={dependencies:[u1],export:e=>{if(!f1(e))return null;let t=e.getTextContent(),n=Ki(e,I1);if(t.indexOf(n)>-1){let e=t.match(/`{3,}/g);if(e){let t=Math.max(...e.map(e=>e.length));n="`".repeat(t+1)}}return n+(e.getLanguage()||``)+(t?`
113
+ `+t:``)+`
114
+ `+n},handleImportAfterStartMatch:({lines:e,rootNode:t,startLineIndex:n,startMatch:r})=>{let i=r[1],a=i.trim().length,o=e[n],s=r.index+i.length,c=o.slice(s),l=RegExp(`\`{${a},}$`);if(l.test(c)){let e=c.match(l),i=c.slice(0,c.lastIndexOf(e[0])),a=[...r];return a[2]=``,K1.replace(t,null,a,e,[i],!0),[!0,n]}let u=RegExp(`^[ \\t]*\`{${a},}$`);for(let i=n+1;i<e.length;i++){let a=e[i];if(u.test(a)){let s=a.match(u),c=e.slice(n+1,i),l=o.slice(r[0].length);return l.length>0&&c.unshift(l),K1.replace(t,null,r,s,c,!0),[!0,i]}}let d=e.slice(n+1),f=o.slice(r[0].length);return f.length>0&&d.unshift(f),K1.replace(t,null,r,null,d,!0),[!0,e.length-1]},regExpEnd:{optional:!0,regExp:P1},regExpStart:N1,replace:(e,t,n,r,i,a)=>{let o,s,c=n[1]?n[1].trim():"```",l=n[2]||void 0;if(!t&&i){if(i.length===1)r?(o=d1(l),s=i[0]):(o=d1(l),s=i[0].startsWith(` `)?i[0].slice(1):i[0]);else{for(o=d1(l),i.length>0&&(i[0].trim().length===0?i.shift():i[0].startsWith(` `)&&(i[0]=i[0].slice(1)));i.length>0&&!i[i.length-1].length;)i.pop();s=i.join(`
115
+ `)}qi(o,I1,c);let t=dc(s);o.append(t),e.append(o)}else t&&V1(e=>d1(e?e[2]:void 0))(e,t,n,a)},type:`multiline-element`},q1={dependencies:[fk,sk],export:(e,t,n)=>X(e)?U1(e,t,0,n):null,regExp:k1,replace:H1(`bullet`),triggerOnEnter:!0,type:`element`},J1={dependencies:[fk,sk],export:(e,t,n)=>X(e)?U1(e,t,0,n):null,regExp:A1,replace:H1(`check`),triggerOnEnter:!0,type:`element`},Y1={dependencies:[fk,sk],export:(e,t,n)=>X(e)?U1(e,t,0,n):null,regExp:O1,replace:H1(`number`),triggerOnEnter:!0,type:`element`},X1={format:[`code`],tag:"`",type:`text-format`},Z1={format:[`highlight`],tag:`==`,type:`text-format`},Q1={format:[`bold`,`italic`],tag:`***`,type:`text-format`},$1={format:[`bold`,`italic`],intraword:!1,tag:`___`,type:`text-format`},e0={format:[`bold`],tag:`**`,type:`text-format`},t0={format:[`bold`],intraword:!1,tag:`__`,type:`text-format`},n0={format:[`strikethrough`],tag:`~~`,type:`text-format`},r0={format:[`italic`],tag:`*`,type:`text-format`},i0={format:[`italic`],intraword:!1,tag:`_`,type:`text-format`},a0={dependencies:[fz],export:(e,t,n)=>{if(!vz(e)||xz(e))return null;let r=t(e),i=e.getTitle();return i!=null&&(i=i.replace(/([\\"])/g,`\\$1`)),i?`[${r}](${e.getURL()} "${i}")`:`[${r}](${e.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[\]]*(?:\[[^[\]]*\][^[\]]*)*)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{if(Af(e,vz))return;let[,n,r,i]=t,a=_z(r==null?void 0:D1(r),{title:i==null?void 0:D1(i)}),o=n.split(`[`).length-1,s=n.split(`]`).length-1,c=n,l=``;if(o<s)return;if(o>s){let e=n.split(`[`);l=`[`+e[0],c=e.slice(1).join(`[`)}let u=dc(c);return u.setFormat(e.getFormat()),a.append(u),e.replace(a),l&&a.insertBefore(dc(l)),u},trigger:`)`,type:`text-match`},o0=[W1,G1,q1,Y1],s0=[K1],c0=[X1,Q1,$1,e0,t0,Z1,r0,i0,n0],l0=[a0],u0=[...o0,...s0,...c0,...l0];function d0(e){return V(e)&&!e.hasFormat(`code`)}function f0(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function p0(e,t,n,r,i){if(!kd(e.getParent())||e.getFirstChild()!==t)return!1;let a=t.getTextContent();if(!i&&a[n-1]!==` `)return!1;for(let{regExp:o,replace:s}of r){let r=a.match(o),c=i||r&&r[0].endsWith(` `)?n:n-1;if(r&&r[0].length===c){let i=t.getNextSiblings(),[a,o]=t.splitText(n);if(!1!==s(e,o?[o,...i]:i,r,!1))return a.remove(),!0}}return!1}function m0(e,t,n,r,i){if(!kd(e.getParent())||e.getFirstChild()!==t)return!1;let a=t.getTextContent();if(!i&&a[n-1]!==` `)return!1;for(let{regExpStart:o,replace:s,regExpEnd:c}of r){if(c&&!(`optional`in c)||c&&`optional`in c&&!c.optional)continue;let r=a.match(o);if(r){let a=i||r[0].endsWith(` `)?n:n-1;if(r[0].length!==a)continue;let o=t.getNextSiblings(),[c,l]=t.splitText(n);if(!1!==s(e,l?[l,...o]:o,r,null,null,!1))return c.remove(),!0}}return!1}function h0(e,t){let n=0,r=e.getTextContent();for(let e=0;e<t;e++)r[e]==="`"&&n++;return n%2!=0}function g0(e,t,n){let r=n.length;for(let i=t;i>=r;i--){let t=i-r;if(_0(e,t,n,0,r)&&e[t+r]!==` `)return t}return-1}function _0(e,t,n,r,i){for(let a=0;a<i;a++)if(e[t+a]!==n[r+a])return!1;return!0}function v0(e,t=u0){let n=T1(t),r=n.element.filter(e=>e.triggerOnEnter),i=w1(n.textFormat,({tag:e})=>e[e.length-1]),a=w1(n.textMatch,({trigger:e})=>e),o=new Set([` `]);for(let e of n.textFormat)o.add(e.tag.slice(-1));for(let e of n.textMatch)e.trigger!==void 0&&o.add(e.trigger);for(let n of t){let t=n.type;if(t===`element`||t===`text-match`||t===`multiline-element`){let t=n.dependencies;for(let n of t)e.hasNode(n)||f0(173,n.getType())}}let s=(e,t,r)=>!!p0(e,t,r,n.element)||!!m0(e,t,r,n.multilineElement)||!!function(e,t,n){let r=e.getTextContent(),i=n[r[t-1]];if(i==null)return!1;t<r.length&&(r=r.slice(0,t));for(let t of i){if(!t.replace||!t.regExp)continue;let n=r.match(t.regExp);if(n===null)continue;let i=n.index||0,a=i+n[0].length,o;return i===0?[o]=e.splitText(a):[,o]=e.splitText(i,a),o.selectNext(0,0),t.replace(o,n),!0}return!1}(t,r,a)||!!function(e,t,n){let r=e.getTextContent(),i=t-1,a=r[i],o=n[a];if(!o)return!1;for(let t of o){let{tag:n}=t,o=n.length,s=i-o+1;if(o>1&&!_0(r,s,n,0,o)||r[s-1]===` `)continue;let c=r[i+1];if(!1===t.intraword&&c&&!E1.test(c))continue;let l=e,u=l,d=g0(r,s,n),f=u;for(;d<0&&(f=f.getPreviousSibling())&&!ru(f);)if(V(f)){if(f.hasFormat(`code`))continue;let e=f.getTextContent();u=f,d=g0(e,e.length,n)}if(d<0||u===l&&d+o===s)continue;let p=u.getTextContent();if(d>0&&p[d-1]===a)continue;let m=p[d-1];if(!1===t.intraword&&m&&!E1.test(m)||!t.format.includes(`code`)&&h0(u,d))continue;let h=l.getTextContent(),g=h.slice(0,s)+h.slice(i+1);l.setTextContent(g);let _=u===l?g:p;u.setTextContent(_.slice(0,d)+_.slice(d+o));let v=U(),y=Gc();Xu(y);let b=i-o*(u===l?2:1)+1;y.anchor.set(u.__key,d,`text`),y.focus.set(l.__key,b,`text`);for(let e of t.format)y.formatText(e,pi[e]);y.anchor.set(y.focus.key,y.focus.offset,y.focus.type);for(let e of t.format)y.hasFormat(e)&&y.toggleFormat(e);return H(v)&&(y.format=v.format),!0}return!1}(t,r,i);return am(e.registerUpdateListener(({tags:t,dirtyLeaves:n,editorState:r,prevEditorState:i})=>{if(t.has(`collaboration`)||t.has(`historic`)||e.isComposing())return;let a=t.has(Ws),c=r.read(U),l=i.read(U);if(!H(l)||!H(c)||!c.isCollapsed()||c.is(l)&&!a)return;let u=c.anchor.key,d=c.anchor.offset,f=r._nodeMap.get(u);if(V(f)&&n.has(u)&&(a||d===1||!(d>l.anchor.offset+1))){if(a){let e=r.read(()=>f.getTextContent())[d-1];if(!o.has(e))return}e.update(()=>{if(!d0(f))return;let e=f.getParent();e===null||f1(e)||s(e,f,c.anchor.offset)&&xd(`history-push`)})}}),e.registerCommand(No,e=>{if(e!==null&&e.shiftKey)return!1;let t=U();if(!H(t)||!t.isCollapsed())return!1;let i=t.anchor.offset,a=t.anchor.getNode();if(!V(a)||!d0(a))return!1;let o=a.getParent();return o===null||f1(o)?!1:i===a.getTextContent().length&&!(!m0(o,a,i,n.multilineElement,!0)&&!p0(o,a,i,r,!0))&&(e!==null&&e.preventDefault(),!0)},1))}var y0=[{dependencies:[Lh],export:e=>Bh(e)?`***`:null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{let i=zh();r||e.getNextSibling()!=null?e.replace(i):e.insertBefore(i),i.selectNext()},triggerOnEnter:!0,type:`element`},...u0];function b0({transformers:e=y0}){let[t]=ZT();return(0,I.useEffect)(()=>v0(t,e),[t,e]),null}var x0=zr({init(e){let t=e.getValue(HD),n=T0(t,t.includes(`headings`)?e.getValue(NO):[]),r=n.filter(e=>!w0.has(e));e.pubIn({[TD]:()=>I.createElement(b0,{transformers:n}),[MD]:()=>I.createElement(b0,{transformers:n}),[PD]:()=>I.createElement(b0,{transformers:r})})}}),S0=e=>(t,n,r)=>{let i=e(r);i.append(...n),t.replace(i),i.select(0,0)},C0={dependencies:[RO],export:e=>Bh(e)?`***`:null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{let i=BO();r||e.getNextSibling()!=null?e.replace(i):e.insertBefore(i),i.selectNext()},type:`element`},w0=new Set([Y1,q1,J1]);function T0(e,t){let n=[Q1,$1,e0,t0,X1,r0,i0];if(e.includes(`headings`)){let e=Math.min(...t),r=Math.max(...t),i=RegExp(`^(#{${e},${r}})\\s`),a={dependencies:[k_],export:(e,t)=>{if(!P_(e))return null;let n=Number(e.getTag().slice(1));return`#`.repeat(n)+` `+t(e)},regExp:i,replace:S0(e=>N_(`h${e[1].length}`)),type:`element`};n.push(a)}if(e.includes(`thematicBreak`)&&n.push(C0),e.includes(`quote`)&&n.push(G1),e.includes(`link`)&&n.push(a0),e.includes(`lists`)&&n.push(Y1,q1,J1),e.includes(`codeblock`)){let e={...K1,dependencies:[VW],replace:(e,t,n)=>{let r=KW({code:``,language:n[1]??``,meta:``});e.selectPrevious(),e.replace(r),setTimeout(()=>{r.select()},80)}};n.push(e)}return n}var E0=()=>{let e=jr(RD),t=kr(LD),n=kr(HD),r=n.includes(`quote`),i=n.includes(`headings`),a=qD();if(!r&&!i)return null;let o=[{label:a(`toolbar.blockTypes.paragraph`,`Paragraph`),value:`paragraph`}];if(r&&o.push({label:a(`toolbar.blockTypes.quote`,`Quote`),value:`quote`}),i){let e=kr(NO);o.push(...e.map(e=>({label:a(`toolbar.blockTypes.heading`,`Heading {{level}}`,{level:e}),value:`h${e}`})))}return I.createElement(zZ,{value:t,onChange:t=>{switch(t){case`quote`:e(()=>D_());break;case`paragraph`:e(()=>lu());break;case``:break;default:if(t.startsWith(`h`))e(()=>N_(t));else throw Error(`Unknown block type: ${t}`)}},triggerTitle:a(`toolbar.blockTypeSelect.selectBlockTypeTooltip`,`Select block type`),placeholder:a(`toolbar.blockTypeSelect.placeholder`,`Block type`),items:o})},D0=({format:e,addTitle:t,removeTitle:n,icon:r,formatName:i})=>{let[a,o]=Ar(jE,vD),s=jr(PE),c=(a&e)!==0;return I.createElement(bQ,{title:c?n:t,on:c,onValueChange:()=>{s(i)}},o(r))},O0=({options:e})=>{let t=qD(),n=e===void 0;return I.createElement(`div`,{className:J.toolbarGroupOfGroups},n||e.includes(`Bold`)?I.createElement(D0,{format:1,addTitle:t(`toolbar.bold`,`Bold`),removeTitle:t(`toolbar.removeBold`,`Remove bold`),icon:`format_bold`,formatName:`bold`}):null,n||e.includes(`Italic`)?I.createElement(D0,{format:2,addTitle:t(`toolbar.italic`,`Italic`),removeTitle:t(`toolbar.removeItalic`,`Remove italic`),icon:`format_italic`,formatName:`italic`}):null,n||e.includes(`Underline`)?I.createElement(D0,{format:8,addTitle:t(`toolbar.underline`,`Underline`),removeTitle:t(`toolbar.removeUnderline`,`Remove underline`),icon:`format_underlined`,formatName:`underline`}):null)},k0=()=>{let[e,t]=Ar(jE,vD),n=jr(PE),r=qD(),i=!!(e&16),a=i?r(`toolbar.removeInlineCode`,`Remove code format`):r(`toolbar.inlineCode`,`Inline code format`);return I.createElement(xQ,{items:[{title:a,contents:t(`code`),active:i,onChange:n.bind(null,`code`)}]})},A0=()=>{let e=jr(cQ),t=kr(vD),n=qD();return I.createElement(vQ,{"aria-label":n(`toolbar.link`,`Create link`),title:n(`toolbar.link`,`Create link`),onPointerDown:e=>{e.preventDefault()},onClick:t=>{e()}},t(`link`))},j0=({children:e,SourceToolbar:t,options:n=[`rich-text`,`diff`,`source`]})=>{let[r,i]=Ar(BD,vD),a=jr(BD),o=qD(),s=[];return n.includes(`rich-text`)&&s.push({title:o(`toolbar.richText`,`Rich text`),contents:i(`rich_text`),value:`rich-text`}),n.includes(`diff`)&&s.push({title:o(`toolbar.diffMode`,`Diff mode`),contents:i(`difference`),value:`diff`}),n.includes(`source`)&&s.push({title:o(`toolbar.source`,`Source mode`),contents:i(`markdown`),value:`source`}),I.createElement(I.Fragment,null,r===`rich-text`?e:r===`diff`?I.createElement(`span`,{className:J.toolbarTitleMode},o(`toolbar.diffMode`,`Diff mode`)):t??I.createElement(`span`,{className:J.toolbarTitleMode},o(`toolbar.source`,`Source mode`)),I.createElement(`div`,{className:J.diffSourceToggleWrapper},I.createElement(SQ,{className:J.diffSourceToggle,ggClassName:J.ggDiffSourceToggle,value:r,items:s,onChange:e=>{a(e===``?`rich-text`:e)}})))},M0=()=>{let e=jr(ZW),t=kr(vD),n=qD();return I.createElement(vQ,{title:n(`toolbar.codeBlock`,`Insert Code Block`),onClick:()=>{e({})}},t(`frame_source`))},N0=()=>{let e=kr(vD),t=jr(lz),n=qD(),r=kr(FD);return I.createElement(vQ,{title:n(`toolbar.table`,`Insert Table`),onClick:()=>{t({rows:3,columns:3})},...r?{"aria-disabled":!0,"data-disabled":!0,disabled:!0}:{}},e(`table`))},P0=()=>{let e=jr(WO),t=kr(vD),n=qD();return I.createElement(vQ,{title:n(`toolbar.thematicBreak`,`Insert thematic break`),onClick:()=>{e()}},t(`horizontal_rule`))},F0={bullet:`format_list_bulleted`,number:`format_list_numbered`,check:`format_list_checked`},I0=({options:e=[`bullet`,`number`,`check`]})=>{let[t,n,r]=Ar(Kk,vD,FD),i=jr(qk),a=qD(),o={bullet:a(`toolbar.bulletedList`,`Bulleted list`),number:a(`toolbar.numberedList`,`Numbered list`),check:a(`toolbar.checkList`,`Check list`)},s=e.map(e=>({value:e,title:o[e],contents:n(F0[e])}));return I.createElement(SQ,{value:t||``,items:s,onChange:i,disabled:r})},L0=()=>{let[e,t]=Ar(vD,wE),[n,r]=I.useState(!1),[i,a]=I.useState(!1),o=qD();return I.useEffect(()=>{if(t)return am(t.registerCommand($o,e=>(r(e),!1),4),t.registerCommand(Qo,e=>(a(e),!1),4))},[t]),I.createElement(xQ,{items:[{title:o(`toolbar.undo`,`Undo {{shortcut}}`,{shortcut:EO?`⌘Z`:`Ctrl+Z`}),disabled:!n,contents:e(`undo`),active:!1,onChange:()=>t?.dispatchCommand(wo,void 0)},{title:o(`toolbar.redo`,`Redo {{shortcut}}`,{shortcut:EO?`⌘Y`:`Ctrl+Y`}),disabled:!i,contents:e(`redo`),active:!1,onChange:()=>t?.dispatchCommand(To,void 0)}]})};function R0(){let e=()=>document.documentElement.dataset.theme!==`light`,[t,n]=(0,I.useState)(e);return(0,I.useEffect)(()=>{let t=new MutationObserver(()=>n(e()));return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]}),()=>t.disconnect()},[]),t}function z0(e){let t=[],n=!1,r=/^(\s*([-*+]|\d+[.)])\s|#{1,6}\s|\||>|\s*```|---\s*$|\s*[-*_]{3,}\s*$|\s*\\?\[\^[^\]]+\]:)/;for(let i of e.split(`
116
+ `)){if(/^\s*```/.test(i)){n=!n,t.push(i);continue}let e=t[t.length-1];!n&&e!==void 0&&e.trim()!==``&&i.trim()!==``&&!/^(#{1,6}\s|\||>|\s*```)/.test(e)&&!/ {2}$|\\$/.test(e)&&!r.test(i)&&!/^\s*<|^\s*!\[/.test(i)?t[t.length-1]=`${e.replace(/\s+$/,``)} ${i.trim()}`:t.push(i)}return t.join(`
117
+ `)}function B0(e){return e.replace(/\\\[\\\[([^\]]*?)\\\]\\\]/g,`[[$1]]`).replace(/\\\[\\\[([^\]]*?)\]\]/g,`[[$1]]`).replace(/\\\[\^/g,`[^`)}function V0(e){let t=e.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/);return t?{head:t[0],body:e.slice(t[0].length)}:{head:``,body:e}}function H0(){return[PO(),Jk(),FW(),GO(),Zz(),mQ(),uz(),$W({defaultCodeBlockLanguage:``}),JZ({codeBlockLanguages:{"":`text`,txt:`text`,js:`JavaScript`,ts:`TypeScript`,json:`JSON`,yaml:`YAML`,bash:`Shell`,md:`Markdown`}}),x0(),r1({viewMode:`rich-text`}),EQ({toolbarContents:()=>(0,L.jsxs)(j0,{children:[(0,L.jsx)(L0,{}),(0,L.jsx)(E0,{}),(0,L.jsx)(O0,{}),(0,L.jsx)(k0,{}),(0,L.jsx)(I0,{}),(0,L.jsx)(A0,{}),(0,L.jsx)(N0,{}),(0,L.jsx)(P0,{}),(0,L.jsx)(M0,{})]})})]}function U0({markdown:e,onChange:t,onError:n,autoFocus:r=!0}){let i=R0(),a=(0,I.useMemo)(()=>H0(),[]);return(0,L.jsx)(TO,{className:`editor-mdx ${i?`dark-theme`:``}`,contentEditableClassName:`editor-content md-body`,markdown:e,plugins:a,autoFocus:r?{defaultSelection:`rootStart`,preventScroll:!0}:void 0,onChange:(e,n)=>{n||t(B0(e))},onError:n})}export{U0 as DocEditor,sr as a,fr as c,Qn as i,ir as n,ar as o,$n as r,Gn as s,V0 as splitFrontmatter,Wn as t,B0 as unescapeExtensions,z0 as unwrapParagraphs,R0 as useIsDark};