`},aO=[{flavour:"affine:paragraph",type:"text",name:"Text",description:"Start typing with plain text.",hotkey:["Mod-Alt-0","Mod-Shift-0"],icon:G.N$i},{flavour:"affine:paragraph",type:"h1",name:"Heading 1",description:"Headings in the largest font.",hotkey:["Mod-Alt-1","Mod-Shift-1"],icon:G.BQZ},{flavour:"affine:paragraph",type:"h2",name:"Heading 2",description:"Headings in the 2nd font size.",hotkey:["Mod-Alt-2","Mod-Shift-2"],icon:G.SoJ},{flavour:"affine:paragraph",type:"h3",name:"Heading 3",description:"Headings in the 3rd font size.",hotkey:["Mod-Alt-3","Mod-Shift-3"],icon:G.Nrq},{flavour:"affine:paragraph",type:"h4",name:"Heading 4",description:"Headings in the 4th font size.",hotkey:["Mod-Alt-4","Mod-Shift-4"],icon:G.WXD},{flavour:"affine:paragraph",type:"h5",name:"Heading 5",description:"Headings in the 5th font size.",hotkey:["Mod-Alt-5","Mod-Shift-5"],icon:G.TXg},{flavour:"affine:paragraph",type:"h6",name:"Heading 6",description:"Headings in the 6th font size.",hotkey:["Mod-Alt-6","Mod-Shift-6"],icon:G.ma5},{flavour:"affine:list",type:"bulleted",name:"Bulleted List",description:"Create a bulleted list.",hotkey:["Mod-Alt-8","Mod-Shift-8"],icon:G.RyS},{flavour:"affine:list",type:"numbered",name:"Numbered List",description:"Create a numbered list.",hotkey:["Mod-Alt-9","Mod-Shift-9"],icon:G.gZg},{flavour:"affine:list",type:"todo",name:"To-do List",description:"Add tasks to a to-do list.",hotkey:null,icon:G.lOw},{flavour:"affine:code",type:void 0,name:"Code Block",description:"Code snippet with formatting.",hotkey:["Mod-Alt-c"],icon:G.I5t},{flavour:"affine:paragraph",type:"quote",name:"Quote",description:"Add a blockquote for emphasis.",hotkey:null,icon:G.cyi},{flavour:"affine:divider",type:"divider",name:"Divider",description:"Visually separate content.",hotkey:["Mod-Alt-d","Mod-Shift-d"],icon:G.za1}],aP=({formatBar:e,host:t,ref:i})=>{let s=e.configItems.filter(e=>"paragraph-action"===e.type).filter(({flavour:e})=>t.doc.schema.flavourSchemaMap.has(e)),o=(0,t$.u)(s,t=>(0,L.qy)`
t.action(e.std.command.chain(),e)}"
>
${"function"==typeof t.icon?t.icon():t.icon}
${t.name}
`);return(0,L.qy)`
${o}
`},aH=e=>{if("text"!==e.displayType&&"block"!==e.displayType)return null;let t=e.selectedBlocks;if(t.some(e=>!e.model.text))return null;let i=t.length<1?aO[0].icon:aO.find(({flavour:e,type:i})=>t[0].flavour===e&&t[0].model.type===i)?.icon??aO[0].icon;if(!iO(e.block))return console.error("paragraph button host is not a page component"),null;let{setFloating:s,setReference:o}=(0,aC.H)(t=>{if(!t){let t=e.shadowRoot?.querySelector(".paragraph-panel");if(!t)return;t.style.display="none";return}let i=e.formatBarElement,s=e.shadowRoot?.querySelector(".paragraph-button"),o=e.shadowRoot?.querySelector(".paragraph-panel");(0,H.Z1)(s),(0,H.Z1)(o),(0,H.Z1)(i,"format quick bar should exist"),o.style.display="flex",(0,sI.rD)(i,o,{placement:"top-start",middleware:[(0,sI.UU)(),(0,sI.cY)(6),(0,sI.BN)({padding:6})]}).then(({x:e,y:t})=>{o.style.left=`${e}px`,o.style.top=`${t}px`}).catch(console.error)}),r=aP({formatBar:e,host:e.host,ref:s});return(0,L.qy)`