(self.webpackChunk=self.webpackChunk||[]).push([[564],{3016:(e,t,o)=>{o(22370)},22370:()=>{tinymce.IconManager.add("default",{icons:{"accessibility-check":'<svg width="24" height="24"><path d="M12 2a2 2 0 0 1 2 2 2 2 0 0 1-2 2 2 2 0 0 1-2-2c0-1.1.9-2 2-2Zm8 7h-5v12c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-5c0-.6-.4-1-1-1a1 1 0 0 0-1 1v5c0 .6-.4 1-1 1a1 1 0 0 1-1-1V9H4a1 1 0 1 1 0-2h16c.6 0 1 .4 1 1s-.4 1-1 1Z" fill-rule="nonzero"/></svg>',"accordion-toggle":'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 15c0-.6.4-1 1-1h6c.6 0 1 .4 1 1s-.4 1-1 1h-6a1 1 0 0 1-1-1Z"/><path opacity=".2" fill-rule="evenodd" clip-rule="evenodd" d="M4 15c0-.6.4-1 1-1h6c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1-1-1Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M12 19c0-.6.4-1 1-1h6c.6 0 1 .4 1 1s-.4 1-1 1h-6a1 1 0 0 1-1-1Z"/><path opacity=".2" fill-rule="evenodd" clip-rule="evenodd" d="M4 19c0-.6.4-1 1-1h6c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1-1-1Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M12.3 7.3a1 1 0 0 1 1.4 0L16 9.6l2.3-2.3a1 1 0 1 1 1.4 1.4L16 12.4l-3.7-3.7a1 1 0 0 1 0-1.4ZM4.3 11.7a1 1 0 0 1 0-1.4L6.6 8 4.3 5.7a1 1 0 0 1 1.4-1.4L9.4 8l-3.7 3.7a1 1 0 0 1-1.4 0Z"/></svg>',accordion:'<svg width="24" height="24"><rect x="12" y="7" width="10" height="2" rx="1"/><rect x="12" y="11" width="10" height="2" rx="1"/><rect x="12" y="15" width="6" height="2" rx="1"/><path fill-rule="evenodd" clip-rule="evenodd" d="M2.3 7.3a1 1 0 0 1 1.4 0L6 9.6l2.3-2.3a1 1 0 0 1 1.4 1.4L6 12.4 2.3 8.7a1 1 0 0 1 0-1.4Z"/></svg>',"action-next":'<svg width="24" height="24"><path fill-rule="nonzero" d="M5.7 7.3a1 1 0 0 0-1.4 1.4l7.7 7.7 7.7-7.7a1 1 0 1 0-1.4-1.4L12 13.6 5.7 7.3Z"/></svg>',"action-prev":'<svg width="24" height="24"><path fill-rule="nonzero" d="M18.3 15.7a1 1 0 0 0 1.4-1.4L12 6.6l-7.7 7.7a1 1 0 0 0 1.4 1.4L12 9.4l6.3 6.3Z"/></svg>',addtag:'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M15 5a2 2 0 0 1 1.6.8L21 12l-4.4 6.2a2 2 0 0 1-1.6.8h-3v-2h3l3.5-5L15 7H5v3H3V7c0-1.1.9-2 2-2h10Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M6 12a1 1 0 0 0-1 1v2H3a1 1 0 1 0 0 2h2v2a1 1 0 1 0 2 0v-2h2a1 1 0 1 0 0-2H7v-2c0-.6-.4-1-1-1Z"/></svg>',"ai-prompt":'<svg width="24" height="24"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M15 6.7a1 1 0 0 0-1.4 0l-9.9 10a1 1 0 0 0 0 1.3l2.1 2.1c.4.4 1 .4 1.4 0l10-9.9c.3-.3.3-1 0-1.4l-2.2-2Zm1.4 2.8-2-2-3 2.7 2.2 2.2 2.8-2.9Z"/><path d="m18.5 7.3-.7-1.5-1.5-.8 1.5-.7.7-1.5.7 1.5 1.5.7-1.5.8-.7 1.5ZM18.5 16.5l-.7-1.6-1.5-.7 1.5-.7.7-1.6.7 1.6 1.5.7-1.5.7-.7 1.6ZM9.7 7.3 9 5.8 7.5 5 9 4.3l.7-1.5.7 1.5L12 5l-1.5.8-.7 1.5Z"/></g><defs><clipPath id="a"><path d="M0 0h24v24H0z"/></clipPath></defs></svg>',ai:'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M5 3a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V6a3 3 0 0 0-3-3H5Zm6.8 11.5.5 1.2a68.3 68.3 0 0 0 .7 1.1l.4.1c.3 0 .5 0 .7-.3.2-.1.3-.3.3-.6l-.3-1-2.6-6.2a20.4 20.4 0 0 0-.5-1.3l-.5-.4-.7-.2c-.2 0-.5 0-.6.2-.2 0-.4.2-.5.4l-.3.6-.3.7L5.7 15l-.2.6-.1.4c0 .3 0 .5.3.7l.6.2c.3 0 .5 0 .7-.2l.4-1 .5-1.2h3.9ZM9.8 9l1.5 4h-3l1.5-4Zm5.6-.9v7.6c0 .4 0 .7.2 1l.7.2c.3 0 .6 0 .8-.3l.2-.9V8.1c0-.4 0-.7-.2-.9a1 1 0 0 0-.8-.3c-.2 0-.5.1-.7.3l-.2 1Z"/></svg>',"align-center":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 1 1 0-2Zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2Zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',"align-justify":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',"align-left":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',"align-none":'<svg width="24" height="24"><path d="M14.2 5 13 7H5a1 1 0 1 1 0-2h9.2Zm4 0h.8a1 1 0 0 1 0 2h-2l1.2-2Zm-6.4 4-1.2 2H5a1 1 0 0 1 0-2h6.8Zm4 0H19a1 1 0 0 1 0 2h-4.4l1.2-2Zm-6.4 4-1.2 2H5a1 1 0 0 1 0-2h4.4Zm4 0H19a1 1 0 0 1 0 2h-6.8l1.2-2ZM7 17l-1.2 2H5a1 1 0 0 1 0-2h2Zm4 0h8a1 1 0 0 1 0 2H9.8l1.2-2Zm5.2-13.5 1.3.7-9.7 16.3-1.3-.7 9.7-16.3Z" fill-rule="evenodd"/></svg>',"align-right":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',"arrow-left":'<svg width="24" height="24"><path d="m5.6 13 12 6a1 1 0 0 0 1.4-1V6a1 1 0 0 0-1.4-.9l-12 6a1 1 0 0 0 0 1.8Z" fill-rule="evenodd"/></svg>',"arrow-right":'<svg width="24" height="24"><path d="m18.5 13-12 6A1 1 0 0 1 5 18V6a1 1 0 0 1 1.4-.9l12 6a1 1 0 0 1 0 1.8Z" fill-rule="evenodd"/></svg>',bold:'<svg width="24" height="24"><path d="M7.8 19c-.3 0-.5 0-.6-.2l-.2-.5V5.7c0-.2 0-.4.2-.5l.6-.2h5c1.5 0 2.7.3 3.5 1 .7.6 1.1 1.4 1.1 2.5a3 3 0 0 1-.6 1.9c-.4.6-1 1-1.6 1.2.4.1.9.3 1.3.6s.8.7 1 1.2c.4.4.5 1 .5 1.6 0 1.3-.4 2.3-1.3 3-.8.7-2.1 1-3.8 1H7.8Zm5-8.3c.6 0 1.2-.1 1.6-.5.4-.3.6-.7.6-1.3 0-1.1-.8-1.7-2.3-1.7H9.3v3.5h3.4Zm.5 6c.7 0 1.3-.1 1.7-.4.4-.4.6-.9.6-1.5s-.2-1-.7-1.4c-.4-.3-1-.4-2-.4H9.4v3.8h4Z" fill-rule="evenodd"/></svg>',bookmark:'<svg width="24" height="24"><path d="M6 4v17l6-4 6 4V4c0-.6-.4-1-1-1H7a1 1 0 0 0-1 1Z" fill-rule="nonzero"/></svg>',"border-style":'<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="2" x="3" y="6" rx="1"/><rect width="2.8" height="2" x="3" y="16" rx="1"/><rect width="2.8" height="2" x="6.8" y="16" rx="1"/><rect width="2.8" height="2" x="10.6" y="16" rx="1"/><rect width="2.8" height="2" x="14.4" y="16" rx="1"/><rect width="2.8" height="2" x="18.2" y="16" rx="1"/><rect width="8" height="2" x="3" y="11" rx="1"/><rect width="8" height="2" x="13" y="11" rx="1"/></g></svg>',"border-width":'<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="5" x="3" y="5" rx="1"/><rect width="18" height="3.5" x="3" y="11.5" rx="1"/><rect width="18" height="2" x="3" y="17" rx="1"/></g></svg>',brightness:'<svg width="24" height="24"><path d="M12.7 18.3a1 1 0 0 0-.7-.3 1 1 0 0 0-.7.3 1 1 0 0 0-.3.7v1a1 1 0 0 0 .3.7 1 1 0 0 0 .7.3 1 1 0 0 0 .7-.3 1 1 0 0 0 .3-.7v-1a1 1 0 0 0-.3-.7ZM11.3 5.7a1 1 0 0 0 .7.3 1 1 0 0 0 .7-.3A1 1 0 0 0 13 5V4a1 1 0 0 0-.3-.7A1 1 0 0 0 12 3a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7v1a1 1 0 0 0 .3.7Zm9.4 5.6a1 1 0 0 0-.7-.3h-1a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7 1 1 0 0 0 .3.7 1 1 0 0 0 .7.3h1a1 1 0 0 0 .7-.3 1 1 0 0 0 .3-.7 1 1 0 0 0-.3-.7Zm-15 1.4A1 1 0 0 0 6 12a1 1 0 0 0-.3-.7A1 1 0 0 0 5 11H4a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7 1 1 0 0 0 .3.7 1 1 0 0 0 .7.3h1a1 1 0 0 0 .7-.3Zm13 4.6-.7-.8a1 1 0 0 0-.8-.3 1 1 0 0 0-.7.3 1 1 0 0 0-.3.7 1 1 0 0 0 .3.8l.7.7a1 1 0 0 0 .7.3 1 1 0 0 0 .8-.3 1 1 0 0 0 .3-.8 1 1 0 0 0-.3-.7ZM5.3 6.7l.7.8a1 1 0 0 0 .8.3 1 1 0 0 0 .7-.3 1 1 0 0 0 .3-.7 1 1 0 0 0-.3-.8l-.7-.7A1 1 0 0 0 6 5a1 1 0 0 0-.8.3 1 1 0 0 0-.3.8 1 1 0 0 0 .3.6Zm12 1a1 1 0 0 0 .7-.2l.7-.7A1 1 0 0 0 19 6a1 1 0 0 0-.3-.8 1 1 0 0 0-.8-.3 1 1 0 0 0-.7.3l-.7.7a1 1 0 0 0-.3.8 1 1 0 0 0 .3.7 1 1 0 0 0 .7.2ZM6.7 16.4a1 1 0 0 0-.8.2l-.7.7a1 1 0 0 0-.3.7 1 1 0 0 0 .3.8 1 1 0 0 0 .8.3 1 1 0 0 0 .7-.3l.7-.7a1 1 0 0 0 .3-.8 1 1 0 0 0-.3-.7 1 1 0 0 0-.7-.3Z"/><path fill-rule="evenodd" d="M13.6 8.3A4 4 0 0 0 12 8a4 4 0 0 0-1.6.3A4 4 0 0 0 9 9.5a4 4 0 0 0-.6 1A4 4 0 0 0 8 12c0 .6.1 1 .3 1.6a4 4 0 0 0 2.1 2 4 4 0 0 0 1.6.4 4 4 0 0 0 1.6-.3 4 4 0 0 0 2-2.1A4 4 0 0 0 16 12a4 4 0 0 0-.3-1.6 4 4 0 0 0-2.1-2ZM14 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"/></svg>',browse:'<svg width="24" height="24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-4v-2h4V8H5v10h4v2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 9.4-2.3 2.3a1 1 0 1 1-1.4-1.4l4-4a1 1 0 0 1 1.4 0l4 4a1 1 0 0 1-1.4 1.4L13 13.4V20a1 1 0 0 1-2 0v-6.6Z" fill-rule="nonzero"/></svg>',cancel:'<svg width="24" height="24"><path d="M12 4.6a7.4 7.4 0 1 1 0 14.8 7.4 7.4 0 0 1 0-14.8ZM12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm0 8L14.8 8l1 1.1-2.7 2.8 2.7 2.7-1.1 1.1-2.7-2.7-2.7 2.7-1-1.1 2.6-2.7-2.7-2.7 1-1.1 2.8 2.7Z" fill-rule="nonzero"/></svg>',"cell-background-color":'<svg width="24" height="24"><path d="m15.7 2 1.6 1.6-2.7 2.6 5.9 5.8c.7.7.7 1.7 0 2.4l-6.3 6.1a1.7 1.7 0 0 1-2.4 0l-6.3-6.1c-.7-.7-.7-1.7 0-2.4L15.7 2ZM18 12l-4.5-4L9 12h9ZM4 16s2 2.4 2 3.8C6 21 5.1 22 4 22s-2-1-2-2.2C2 18.4 4 16 4 16Z"/></svg>',"cell-border-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M5 13v5h2v2H5a2 2 0 0 1-2-2v-5h2zm8-7V4h6a2 2 0 0 1 2 2h-8z" opacity=".2"/><path fill-rule="nonzero" d="M13 4v2H5v7H3V6c0-1.1.9-2 2-2h8zm-2.6 14.1.1-.1.1.1.2.3.2.2.2.2c.4.6.8 1.2.8 1.7 0 .8-.7 1.5-1.5 1.5S9 21.3 9 20.5c0-.5.4-1.1.8-1.7l.2-.2.2-.2.2-.3z"/><path d="m13 11-2 2H5v-2h6V6h2z"/><path fill-rule="nonzero" d="m18.4 8 1 1-1.8 1.9 4 4c.5.4.5 1.1 0 1.6l-4.3 4.2a1.2 1.2 0 0 1-1.6 0l-4.4-4.2c-.4-.5-.4-1.2 0-1.7l7-6.8Zm1.6 7-3-3-3 3h6Z"/></g></svg>',"change-case":'<svg width="24" height="24"><path d="M18.4 18.2v-.6c-.5.8-1.3 1.2-2.4 1.2-2.2 0-3.3-1.6-3.3-4.8 0-3.1 1-4.7 3.3-4.7 1.1 0 1.8.3 2.4 1.1v-.6c0-.5.4-.8.8-.8s.8.3.8.8v8.4c0 .5-.4.8-.8.8a.8.8 0 0 1-.8-.8zm-2-7.4c-1.3 0-1.8.9-1.8 3.2 0 2.4.5 3.3 1.7 3.3 1.3 0 1.8-.9 1.8-3.2 0-2.4-.5-3.3-1.7-3.3zM10 15.7H5.5l-.8 2.6a1 1 0 0 1-1 .7h-.2a.7.7 0 0 1-.7-1l4-12a1 1 0 0 1 2 0l4 12a.7.7 0 0 1-.8 1h-.2a1 1 0 0 1-1-.7l-.8-2.6zm-.3-1.5-2-6.5-1.9 6.5h3.9z" fill-rule="evenodd"/></svg>',"character-count":'<svg width="24" height="24"><path d="M4 11.5h16v1H4v-1Zm4.8-6.8V10H7.7V5.8h-1v-1h2ZM11 8.3V9h2v1h-3V7.7l2-1v-.9h-2v-1h3v2.4l-2 1Zm6.3-3.4V10h-3.1V9h2.1V8h-2.1V6.8h2.1v-1h-2.1v-1h3.1ZM5.8 16.4c0-.5.2-.8.5-1 .2-.2.6-.3 1.2-.3l.8.1c.2 0 .4.2.5.3l.4.4v2.8l.2.3H8.2V18.7l-.6.3H7c-.4 0-.7 0-1-.2a1 1 0 0 1-.3-.9c0-.3 0-.6.3-.8.3-.2.7-.4 1.2-.4l.6-.2h.3v-.2l-.1-.2a.8.8 0 0 0-.5-.1 1 1 0 0 0-.4 0l-.3.4h-1Zm2.3.8h-.2l-.2.1-.4.1a1 1 0 0 0-.4.2l-.2.2.1.3.5.1h.4l.4-.4v-.6Zm2-3.4h1.2v1.7l.5-.3h.5c.5 0 .9.1 1.2.5.3.4.5.8.5 1.4 0 .6-.2 1.1-.5 1.5-.3.4-.7.6-1.3.6l-.6-.1-.4-.4v.4h-1.1v-5.4Zm1.1 3.3c0 .3 0 .6.2.8a.7.7 0 0 0 1.2 0l.2-.8c0-.4 0-.6-.2-.8a.7.7 0 0 0-.6-.3l-.6.3-.2.8Zm6.1-.5c0-.2 0-.3-.2-.4a.8.8 0 0 0-.5-.2c-.3 0-.5.1-.6.3l-.2.9c0 .3 0 .6.2.8.1.2.3.3.6.3.2 0 .4 0 .5-.2l.2-.4h1.1c0 .5-.3.8-.6 1.1a2 2 0 0 1-1.3.4c-.5 0-1-.2-1.3-.6a2 2 0 0 1-.5-1.4c0-.6.1-1.1.5-1.5.3-.4.8-.5 1.4-.5.5 0 1 0 1.2.3.4.3.5.7.5 1.2h-1v-.1Z" fill-rule="evenodd"/></svg>',"checklist-rtl":'<svg width="24" height="24"><path d="M5 17h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm14.2 11c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 8c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',checklist:'<svg width="24" height="24"><path d="M11 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8a1 1 0 0 1 0 2h-8a1 1 0 0 1 0-2ZM7.2 16c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8Zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8Zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 8c-.2.3-.7.4-1 0L3.8 6.9a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8Z" fill-rule="evenodd"/></svg>',checkmark:'<svg width="24" height="24"><path d="M18.2 5.4a1 1 0 0 1 1.6 1.2l-8 12a1 1 0 0 1-1.5.1l-5-5a1 1 0 1 1 1.4-1.4l4.1 4.1 7.4-11Z" fill-rule="nonzero"/></svg>',"chevron-down":'<svg width="10" height="10"><path d="M8.7 2.2c.3-.3.8-.3 1 0 .4.4.4.9 0 1.2L5.7 7.8c-.3.3-.9.3-1.2 0L.2 3.4a.8.8 0 0 1 0-1.2c.3-.3.8-.3 1.1 0L5 6l3.7-3.8Z" fill-rule="nonzero"/></svg>',"chevron-left":'<svg width="10" height="10"><path d="M7.8 1.3 4 5l3.8 3.7c.3.3.3.8 0 1-.4.4-.9.4-1.2 0L2.2 5.7a.8.8 0 0 1 0-1.2L6.6.2C7 0 7.4 0 7.8.2c.3.3.3.8 0 1.1Z" fill-rule="nonzero"/></svg>',"chevron-right":'<svg width="10" height="10"><path d="M2.2 1.3a.8.8 0 0 1 0-1c.4-.4.9-.4 1.2 0l4.4 4.1c.3.4.3.9 0 1.2L3.4 9.8c-.3.3-.8.3-1.2 0a.8.8 0 0 1 0-1.1L6 5 2.2 1.3Z" fill-rule="nonzero"/></svg>',"chevron-up":'<svg width="10" height="10"><path d="M8.7 7.8 5 4 1.3 7.8c-.3.3-.8.3-1 0a.8.8 0 0 1 0-1.2l4.1-4.4c.3-.3.9-.3 1.2 0l4.2 4.4c.3.3.3.9 0 1.2-.3.3-.8.3-1.1 0Z" fill-rule="nonzero"/></svg>',close:'<svg width="24" height="24"><path d="M17.3 8.2 13.4 12l3.9 3.8a1 1 0 0 1-1.5 1.5L12 13.4l-3.8 3.9a1 1 0 0 1-1.5-1.5l3.9-3.8-3.9-3.8a1 1 0 0 1 1.5-1.5l3.8 3.9 3.8-3.9a1 1 0 0 1 1.5 1.5Z" fill-rule="evenodd"/></svg>',"code-sample":'<svg width="24" height="26"><path d="M7.1 11a2.8 2.8 0 0 1-.8 2 2.8 2.8 0 0 1 .8 2v1.7c0 .3.1.6.4.8.2.3.5.4.8.4.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.7 0-1.4-.3-2-.8-.5-.6-.8-1.3-.8-2V15c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4v-.8c0-.2.2-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V9.3c0-.7.3-1.4.8-2 .6-.5 1.3-.8 2-.8.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8V11Zm9.8 0V9.3c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4V7c0-.2.1-.4.4-.4.7 0 1.4.3 2 .8.5.6.8 1.3.8 2V11c0 .3.1.6.4.8.2.3.5.4.8.4.2 0 .4.2.4.4v.8c0 .2-.2.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8v1.7c0 .7-.3 1.4-.8 2-.6.5-1.3.8-2 .8a.4.4 0 0 1-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 0 1 .8-2 2.8 2.8 0 0 1-.8-2Zm-3.3-.4c0 .4-.1.8-.5 1.1-.3.3-.7.5-1.1.5-.4 0-.8-.2-1.1-.5-.4-.3-.5-.7-.5-1.1 0-.5.1-.9.5-1.2.3-.3.7-.4 1.1-.4.4 0 .8.1 1.1.4.4.3.5.7.5 1.2ZM12 13c.4 0 .8.1 1.1.5.4.3.5.7.5 1.1 0 1-.1 1.6-.5 2a3 3 0 0 1-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 0 1-.5-.5V17a3 3 0 0 0 1-.2l.6-.6c-.6 0-1-.2-1.3-.5-.2-.3-.3-.7-.3-1 0-.5.1-1 .5-1.2.3-.4.7-.5 1.1-.5Z" fill-rule="evenodd"/></svg>',"color-levels":'<svg width="24" height="24"><path d="M17.5 11.4A9 9 0 0 1 18 14c0 .5 0 1-.2 1.4 0 .4-.3.9-.5 1.3a6.2 6.2 0 0 1-3.7 3 5.7 5.7 0 0 1-3.2 0A5.9 5.9 0 0 1 7.6 18a6.2 6.2 0 0 1-1.4-2.6 6.7 6.7 0 0 1 0-2.8c0-.4.1-.9.3-1.3a13.6 13.6 0 0 1 2.3-4A20 20 0 0 1 12 4a26.4 26.4 0 0 1 3.2 3.4 18.2 18.2 0 0 1 2.3 4Zm-2 4.5c.4-.7.5-1.4.5-2a7.3 7.3 0 0 0-1-3.2c.2.6.2 1.2.2 1.9a4.5 4.5 0 0 1-1.3 3 5.3 5.3 0 0 1-2.3 1.5 4.9 4.9 0 0 1-2 .1 4.3 4.3 0 0 0 2.4.8 4 4 0 0 0 2-.6 4 4 0 0 0 1.5-1.5Z" fill-rule="evenodd"/></svg>',"color-picker":'<svg width="24" height="24"><path d="M12 3a9 9 0 0 0 0 18 1.5 1.5 0 0 0 1.1-2.5c-.2-.3-.4-.6-.4-1 0-.8.7-1.5 1.5-1.5H16a5 5 0 0 0 5-5c0-4.4-4-8-9-8Zm-5.5 9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Zm3-4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Zm5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Zm3 4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Z" fill-rule="nonzero"/></svg>',"color-swatch-remove-color":'<svg width="24" height="24" class="color-swatch-remove-color"><path stroke="#000" stroke-width="2" d="M21 3 3 21" fill-rule="evenodd"/></svg>',"color-swatch":'<svg width="24" height="24"><rect x="3" y="3" width="18" height="18" rx="1" fill-rule="evenodd"/></svg>',"comment-add":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="m9 19 3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 0 0-1 1v10c0 .6.4 1 1 1h4v2Zm-2 4v-4H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3h-6.4L7 23Z"/><path d="M13 10h2a1 1 0 0 1 0 2h-2v2a1 1 0 0 1-2 0v-2H9a1 1 0 0 1 0-2h2V8a1 1 0 0 1 2 0v2Z"/></g></svg>',comment:'<svg width="24" height="24"><path fill-rule="nonzero" d="m9 19 3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 0 0-1 1v10c0 .6.4 1 1 1h4v2Zm-2 4v-4H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3h-6.4L7 23Z"/></svg>',contrast:'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 0 1 19.4 9c.4 1 .6 2 .6 3.1s-.2 2.1-.6 3.1a8 8 0 0 1-1.7 2.6 8 8 0 0 1-2.6 1.7 7.8 7.8 0 0 1-3.1.6 7.8 7.8 0 0 1-3.1-.6 8 8 0 0 1-2.6-1.7A8 8 0 0 1 4.6 15 7.8 7.8 0 0 1 4 12c0-1.1.2-2.1.6-3.1a8 8 0 0 1 1.7-2.6A8 8 0 0 1 9 4.6 7.8 7.8 0 0 1 12 4Zm-6 8a6 6 0 0 0 1.8 4.2 6 6 0 0 0 1.9 1.3 5.8 5.8 0 0 0 2.3.5V6c-.8 0-1.6.2-2.3.5a6 6 0 0 0-2 1.3 6 6 0 0 0-1.2 1.9A5.8 5.8 0 0 0 6 12Z"/></svg>',copy:'<svg width="24" height="24"><path d="M16 3H6a2 2 0 0 0-2 2v11h2V5h10V3Zm1 4a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V9c0-1.2.9-2 2-2h7Zm0 12V9h-7v10h7Z" fill-rule="nonzero"/></svg>',crop:'<svg width="24" height="24"><path d="M17 8v7h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v2c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-2H7V9H5a1 1 0 1 1 0-2h2V5c0-.6.4-1 1-1s1 .4 1 1v2h7l3-3 1 1-3 3ZM9 9v5l5-5H9Zm1 6h5v-5l-5 5Z" fill-rule="evenodd"/></svg>',"cut-column":'<svg width="24" height="24"><path fill-rule="evenodd" d="M7.2 4.5c.9 0 1.6.4 2.2 1A3.7 3.7 0 0 1 10.5 8v.5l1 1 4-4 1-.5a3.3 3.3 0 0 1 2 0c.4 0 .7.3 1 .5L17 8h4v13h-6V10l-1.5 1.5.5.5v4l-2.5-2.5-1 1v.5c0 .4 0 .8-.3 1.2-.2.5-.4.9-.8 1.2-.6.7-1.3 1-2.2 1-.8.2-1.5 0-2-.6l-.5-.8-.2-1c0-.4 0-.8.3-1.2A3.9 3.9 0 0 1 7 12.7c.5-.2 1-.3 1.5-.2l1-1-1-1c-.5 0-1 0-1.5-.2-.5-.1-1-.4-1.4-.9-.4-.3-.6-.7-.8-1.2L4.5 7c0-.4 0-.7.2-1 0-.3.3-.6.5-.8.5-.5 1.2-.8 2-.7Zm12.3 5h-3v10h3v-10ZM8 13.8h-.3l-.4.2a2.8 2.8 0 0 0-.7.4v.1a2.8 2.8 0 0 0-.6.8l-.1.4v.7l.2.5.5.2h.7a2.6 2.6 0 0 0 .8-.3 2.4 2.4 0 0 0 .7-.7 2.5 2.5 0 0 0 .3-.8 1.5 1.5 0 0 0 0-.8 1 1 0 0 0-.2-.4 1 1 0 0 0-.5-.2H8Zm3.5-3.7c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4ZM7 5.8h-.4a1 1 0 0 0-.5.3 1 1 0 0 0-.2.5v.7a2.5 2.5 0 0 0 .3.8l.2.3h.1l.4.4.4.2.4.1h.7L9 9l.2-.4a1.6 1.6 0 0 0 0-.8 2.6 2.6 0 0 0-.3-.8A2.5 2.5 0 0 0 7.7 6l-.4-.1H7Z"/></svg>',"cut-row":'<svg width="24" height="24"><path fill-rule="evenodd" d="M22 3v5H9l3 3 2-2h4l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8.7.6 1 1.3 1 2.2.2.8 0 1.5-.6 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 0 1-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 0 1 8.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 0 1 0-2c0-.4.3-.7.5-1l2 2V3h14ZM8.5 15.3h-.3a2.6 2.6 0 0 0-.8.4 2.5 2.5 0 0 0-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 0 0 .8-.3L9 18V18l.4-.4.2-.4.1-.4v-.7a1 1 0 0 0-.2-.5 1 1 0 0 0-.4-.2h-.5Zm7 0H15a1 1 0 0 0-.4.3 1 1 0 0 0-.2.5 1.5 1.5 0 0 0 0 .7v.4a2.8 2.8 0 0 0 .5.7h.1a2.8 2.8 0 0 0 .8.6l.4.1h.7l.5-.2.2-.5v-.7a2.6 2.6 0 0 0-.3-.8 2.4 2.4 0 0 0-.7-.7 2.5 2.5 0 0 0-.8-.3h-.3ZM12 11.6c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4Zm8.5-7.1h-11v2h11v-2Z"/></svg>',cut:'<svg width="24" height="24"><path d="M18 15c.6.7 1 1.4 1 2.3 0 .8-.2 1.5-.7 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 0 1-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 0 1 8.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 0 1 0-2c0-.4.3-.7.5-1l6 6 6-6 .5 1a3.3 3.3 0 0 1 0 2c0 .4-.3.7-.5 1l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8Zm-8.5 2.2.1-.4v-.7a1 1 0 0 0-.2-.5 1 1 0 0 0-.4-.2 1.6 1.6 0 0 0-.8 0 2.6 2.6 0 0 0-.8.3 2.5 2.5 0 0 0-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 0 0 .8-.3 2.8 2.8 0 0 0 1-1Zm2.5-2.8c.4 0 .7-.1 1-.4.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4s-.7.1-1 .4c-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4Zm5.4 4 .2-.5v-.7a2.6 2.6 0 0 0-.3-.8 2.4 2.4 0 0 0-.7-.7 2.5 2.5 0 0 0-.8-.3 1.5 1.5 0 0 0-.8 0 1 1 0 0 0-.4.2 1 1 0 0 0-.2.5 1.5 1.5 0 0 0 0 .7v.4l.3.4.3.4a2.8 2.8 0 0 0 .8.5l.4.1h.7l.5-.2Z" fill-rule="evenodd"/></svg>',"document-properties":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h10a2 2 0 0 0 2-2V7.6L14.4 3ZM17 19H7V5h6v4h4v10Z" fill-rule="nonzero"/></svg>',drag:'<svg width="24" height="24"><path d="M13 5h2v2h-2V5Zm0 4h2v2h-2V9ZM9 9h2v2H9V9Zm4 4h2v2h-2v-2Zm-4 0h2v2H9v-2Zm0 4h2v2H9v-2Zm4 0h2v2h-2v-2ZM9 5h2v2H9V5Z" fill-rule="evenodd"/></svg>',"duplicate-column":'<svg width="24" height="24"><path d="M17 6v16h-7V6h7Zm-2 2h-3v12h3V8Zm-2-6v2H8v15H6V2h7Z"/></svg>',"duplicate-row":'<svg width="24" height="24"><path d="M22 11v7H6v-7h16Zm-2 2H8v3h12v-3Zm-1-6v2H4v5H2V7h17Z"/></svg>',duplicate:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M16 3v2H6v11H4V5c0-1.1.9-2 2-2h10Zm3 8h-2V9h-7v10h9a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V9c0-1.2.9-2 2-2h7a2 2 0 0 1 2 2v2Z"/><path d="M17 14h1a1 1 0 0 1 0 2h-1v1a1 1 0 0 1-2 0v-1h-1a1 1 0 0 1 0-2h1v-1a1 1 0 0 1 2 0v1Z"/></g></svg>',"edit-block":'<svg width="24" height="24"><path fill-rule="nonzero" d="m19.8 8.8-9.4 9.4c-.2.2-.5.4-.9.4l-5.4 1.2 1.2-5.4.5-.8 9.4-9.4c.7-.7 1.8-.7 2.5 0l2.1 2.1c.7.7.7 1.8 0 2.5Zm-2-.2 1-.9v-.3l-2.2-2.2a.3.3 0 0 0-.3 0l-1 1L18 8.5Zm-1 1-2.5-2.4-6 6 2.5 2.5 6-6Zm-7 7.1-2.6-2.4-.3.3-.1.2-.7 3 3.1-.6h.1l.4-.5Z"/></svg>',"edit-image":'<svg width="24" height="24"><path d="M18 16h2V7a2 2 0 0 0-2-2H7v2h11v9ZM6 17h15a1 1 0 0 1 0 2h-1v1a1 1 0 0 1-2 0v-1H6a2 2 0 0 1-2-2V7H3a1 1 0 1 1 0-2h1V4a1 1 0 1 1 2 0v13Zm3-5.3 1.3 2 3-4.7 3.7 6H7l2-3.3Z" fill-rule="nonzero"/></svg>',"embed-page":'<svg width="24" height="24"><path d="M19 6V5H5v14h2A13 13 0 0 1 19 6Zm0 1.4c-.8.8-1.6 2.4-2.2 4.6H19V7.4Zm0 5.6h-2.4c-.4 1.8-.6 3.8-.6 6h3v-6Zm-4 6c0-2.2.2-4.2.6-6H13c-.7 1.8-1.1 3.8-1.1 6h3Zm-4 0c0-2.2.4-4.2 1-6H9.6A12 12 0 0 0 8 19h3ZM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 0 0-4 4.5h2.2Zm-3.4 0a12 12 0 0 1 2.8-4 12 12 0 0 0-5 4h2.2Z" fill-rule="nonzero"/></svg>',embed:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm1 2v14h14V5H5Zm4.8 2.6 5.6 4a.5.5 0 0 1 0 .8l-5.6 4A.5.5 0 0 1 9 16V8a.5.5 0 0 1 .8-.4Z" fill-rule="nonzero"/></svg>',emoji:'<svg width="24" height="24"><path d="M9 11c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1Zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1Zm-3 5.5c2.1 0 4-1.5 4.4-3.5H7.6c.5 2 2.3 3.5 4.4 3.5ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm0 14.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13Z" fill-rule="nonzero"/></svg>',export:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M14.4 3 18 7v1h-5V5H7v14h9a1 1 0 0 1 2 0c0 1-.8 2-1.9 2H7c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2h7.5Z"/><path d="M18.1 12c.5 0 .9.4.9 1 0 .5-.3 1-.8 1h-7.3c-.5 0-.9-.4-.9-1 0-.5.3-1 .8-1h7.3Z"/><path d="M16.4 9.2a1 1 0 0 1 1.4.2l2.4 3.6-2.4 3.6a1 1 0 0 1-1.7-1v-.2l1.7-2.4-1.6-2.4a1 1 0 0 1 .2-1.4Z"/></g></svg>',fill:'<svg width="24" height="26"><path d="m16.6 12-9-9-1.4 1.4 2.4 2.4-5.2 5.1c-.5.6-.5 1.6 0 2.2L9 19.6a1.5 1.5 0 0 0 2.2 0l5.5-5.5c.5-.6.5-1.6 0-2.2ZM5.2 13 10 8.2l4.8 4.8H5.2ZM19 14.5s-2 2.2-2 3.5c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.3-2-3.5-2-3.5Z" fill-rule="nonzero"/></svg>',"flip-horizontally":'<svg width="24" height="24"><path d="M14 19h2v-2h-2v2Zm4-8h2V9h-2v2ZM4 7v10c0 1.1.9 2 2 2h3v-2H6V7h3V5H6a2 2 0 0 0-2 2Zm14-2v2h2a2 2 0 0 0-2-2Zm-7 16h2V3h-2v18Zm7-6h2v-2h-2v2Zm-4-8h2V5h-2v2Zm4 12a2 2 0 0 0 2-2h-2v2Z" fill-rule="nonzero"/></svg>',"flip-vertically":'<svg width="24" height="24"><path d="M5 14v2h2v-2H5Zm8 4v2h2v-2h-2Zm4-14H7a2 2 0 0 0-2 2v3h2V6h10v3h2V6a2 2 0 0 0-2-2Zm2 14h-2v2a2 2 0 0 0 2-2ZM3 11v2h18v-2H3Zm6 7v2h2v-2H9Zm8-4v2h2v-2h-2ZM5 18c0 1.1.9 2 2 2v-2H5Z" fill-rule="nonzero"/></svg>',footnote:'<svg width="24" height="24"><path d="M19 13c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2h14Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M19 4v6h-1V5h-1.5V4h2.6Z"/><path d="M12 18c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2h7ZM14 8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2h9Z"/></svg>',"format-code":'<svg width="24" height="24"><path d="m10 22 2-7H6l9-13h2l-2 8h7L12 22h-2ZM6 2h7l-1.4 2H6V2Zm4.2 4H4v2h4.8l1.4-2Zm-2.7 4H2v2h4l1.5-2Z"/></svg>',"format-painter":'<svg width="24" height="24"><path d="M18 5V4c0-.5-.4-1-1-1H5a1 1 0 0 0-1 1v4c0 .6.5 1 1 1h12c.6 0 1-.4 1-1V7h1v4H9v9c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-7h8V5h-3Z" fill-rule="nonzero"/></svg>',format:'<svg width="24" height="24"><path fill-rule="evenodd" d="M17 5a1 1 0 0 1 0 2h-4v11a1 1 0 0 1-2 0V7H7a1 1 0 1 1 0-2h10Z"/></svg>',fullscreen:'<svg width="24" height="24"><path d="m15.3 10-1.2-1.3 2.9-3h-2.3a.9.9 0 1 1 0-1.7H19c.5 0 .9.4.9.9v4.4a.9.9 0 1 1-1.8 0V7l-2.9 3Zm0 4 3 3v-2.3a.9.9 0 1 1 1.7 0V19c0 .5-.4.9-.9.9h-4.4a.9.9 0 1 1 0-1.8H17l-3-2.9 1.3-1.2ZM10 15.4l-2.9 3h2.3a.9.9 0 1 1 0 1.7H5a.9.9 0 0 1-.9-.9v-4.4a.9.9 0 1 1 1.8 0V17l2.9-3 1.2 1.3ZM8.7 10 5.7 7v2.3a.9.9 0 0 1-1.7 0V5c0-.5.4-.9.9-.9h4.4a.9.9 0 0 1 0 1.8H7l3 2.9-1.3 1.2Z" fill-rule="nonzero"/></svg>',gallery:'<svg width="24" height="24"><path fill-rule="nonzero" d="m5 15.7 2.3-2.2c.3-.3.7-.3 1 0L11 16l5.1-5c.3-.4.8-.4 1 0l2 1.9V8H5v7.7ZM5 18V19h3l1.8-1.9-2-2L5 17.9Zm14-3-2.5-2.4-6.4 6.5H19v-4ZM4 6h16c.6 0 1 .4 1 1v13c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V7c0-.6.4-1 1-1Zm6 7a2 2 0 1 1 0-4 2 2 0 0 1 0 4ZM4.5 4h15a.5.5 0 1 1 0 1h-15a.5.5 0 0 1 0-1Zm2-2h11a.5.5 0 1 1 0 1h-11a.5.5 0 0 1 0-1Z"/></svg>',gamma:'<svg height="24" width="24"><path d="M11.5 16.3a.7.7 0 1 0 1.4 0V14l2.7-6a.7.7 0 1 0-1.2-.6l-2.2 5-2.3-4.9C9.6 7 8.7 7 8 7.2v1.1c.8-.2.9 0 1.2 1l2.3 4.7z"/><path d="M4 3h16a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm1 2h14v14H5z" fill-rule="evenodd"/></svg>',help:'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M12 5.5a6.5 6.5 0 0 0-6 9 6.3 6.3 0 0 0 1.4 2l1 1a6.3 6.3 0 0 0 3.6 1 6.5 6.5 0 0 0 6-9 6.3 6.3 0 0 0-1.4-2l-1-1a6.3 6.3 0 0 0-3.6-1ZM12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4Z"/><path d="M9.6 9.7a.7.7 0 0 1-.7-.8c0-1.1 1.5-1.8 3.2-1.8 1.8 0 3.2.8 3.2 2.4 0 1.4-.4 2.1-1.5 2.8-.2 0-.3.1-.3.2a2 2 0 0 0-.8.8.8.8 0 0 1-1.4-.6c.3-.7.8-1 1.3-1.5l.4-.2c.7-.4.8-.6.8-1.5 0-.5-.6-.9-1.7-.9-.5 0-1 .1-1.4.3-.2 0-.3.1-.3.2v-.2c0 .4-.4.8-.8.8Z" fill-rule="nonzero"/><circle cx="12" cy="16" r="1"/></g></svg>',"highlight-bg-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path class="tox-icon-highlight-bg-color__color" d="M3 18h18v3H3z"/><path fill-rule="nonzero" d="M7.7 16.7H3l3.3-3.3-.7-.8L10.2 8l4 4.1-4 4.2c-.2.2-.6.2-.8 0l-.6-.7-1.1 1.1zm5-7.5L11 7.4l3-2.9a2 2 0 0 1 2.6 0L18 6c.7.7.7 2 0 2.7l-2.9 2.9-1.8-1.8-.5-.6"/></g></svg>',home:'<svg width="24" height="24"><path fill-rule="nonzero" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>',"horizontal-rule":'<svg width="24" height="24"><path d="M4 11h16v2H4z" fill-rule="evenodd"/></svg>',"image-options":'<svg width="24" height="24"><path d="M6 10a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Zm12 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Zm-6 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Z" fill-rule="nonzero"/></svg>',image:'<svg width="24" height="24"><path d="m5 15.7 3.3-3.2c.3-.3.7-.3 1 0L12 15l4.1-4c.3-.4.8-.4 1 0l2 1.9V5H5v10.7ZM5 18V19h3l2.8-2.9-2-2L5 17.9Zm14-3-2.5-2.4-6.4 6.5H19v-4ZM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm6 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill-rule="nonzero"/></svg>',indent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 1 1 0-2Zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2Zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2Zm-5 4h12a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2Zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 0 1 1.2-1.6l3 2a1 1 0 0 1 0 1.6l-3 2a1 1 0 1 1-1.2-1.6Z" fill-rule="evenodd"/></svg>',info:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4Zm-1 3v2h2V7h-2Zm3 10v-1h-1v-5h-3v1h1v4h-1v1h4Z" fill-rule="evenodd"/></svg>',"insert-character":'<svg width="24" height="24"><path d="M15 18h4l1-2v4h-6v-3.3l1.4-1a6 6 0 0 0 1.8-2.9 6.3 6.3 0 0 0-.1-4.1 5.8 5.8 0 0 0-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 0 0-3.9 1.8 6.3 6.3 0 0 0-1.3 6 6.2 6.2 0 0 0 1.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 0 1 4 11c0-1 .2-1.9.6-2.7A7 7 0 0 1 6.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 0 1 5.7 2 7 7 0 0 1 1.7 2.3 6 6 0 0 1 .2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 0 1-3.6 2.5v.5Z" fill-rule="evenodd"/></svg>',"insert-time":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M12 19a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm0 2a9 9 0 1 1 0-18 9 9 0 0 1 0 18Z"/><path d="M16 12h-3V7c0-.6-.4-1-1-1a1 1 0 0 0-1 1v7h5c.6 0 1-.4 1-1s-.4-1-1-1Z"/></g></svg>',invert:'<svg height="24" width="24"><path d="M5 4 3.6 5.4l3.9 4C6.6 10.7 6 12.3 6 14a6 6 0 0 0 10.3 4.2l1.9 1.8 1.4-1.4z" fill-rule="evenodd"/><path d="M13.4 8.4c.9 1 1.6 2.1 2 3.2l2.6 2.6V14c0-5-6-10-6-10s-1 .8-2.1 2l1.4 1.5.7-.7 1.4 1.6z"/></svg>',italic:'<svg width="24" height="24"><path d="m16.7 4.7-.1.9h-.3c-.6 0-1 0-1.4.3-.3.3-.4.6-.5 1.1l-2.1 9.8v.6c0 .5.4.8 1.4.8h.2l-.2.8H8l.2-.8h.2c1.1 0 1.8-.5 2-1.5l2-9.8.1-.5c0-.6-.4-.8-1.4-.8h-.3l.2-.9h5.8Z" fill-rule="evenodd"/></svg>',language:'<svg width="24" height="24"><path d="M12 3a9 9 0 1 1 0 18 9 9 0 0 1 0-18Zm4.3 13.3c-.5 1-1.2 2-2 2.9a7.5 7.5 0 0 0 3.2-2.1l-.2-.2a6 6 0 0 0-1-.6Zm-8.6 0c-.5.2-.9.5-1.2.8.9 1 2 1.7 3.2 2a10 10 0 0 1-2-2.8Zm3.6-.8c-.8 0-1.6.1-2.2.3.5 1 1.2 1.9 2.1 2.7Zm1.5 0v3c.9-.8 1.6-1.7 2.1-2.7-.6-.2-1.4-.3-2.1-.3Zm-6-2.7H4.5c.2 1 .5 2.1 1 3h.3l1.3-1a10 10 0 0 1-.3-2Zm12.7 0h-2.3c0 .7-.1 1.4-.3 2l1.6 1.1c.5-1 .9-2 1-3.1Zm-3.8 0h-3V14c1 0 2 .1 2.7.4.2-.5.3-1 .3-1.6Zm-4.4 0h-3l.3 1.6c.8-.3 1.7-.4 2.7-.4v-1.3Zm-5.5-5c-.7 1-1.1 2.2-1.3 3.5h2.3c0-1 .2-1.8.5-2.6l-1.5-1Zm2.9 1.4v.1c-.2.6-.4 1.3-.4 2h3V9.4c-1 0-1.8-.1-2.6-.3Zm6.6 0h-.1l-2.4.3v1.8h3l-.5-2.1Zm3-1.4-.3.1-1.3.8c.3.8.5 1.6.5 2.6h2.3a7.5 7.5 0 0 0-1.3-3.5Zm-9 0 2 .2V5.5a9 9 0 0 0-2 2.2Zm3.5-2.3V8c.6 0 1.3 0 1.9-.2a9 9 0 0 0-2-2.3Zm-3-.7h-.1c-1.1.4-2.1 1-3 1.8l1.2.7a10 10 0 0 1 1.9-2.5Zm4.4 0 .1.1a10 10 0 0 1 1.8 2.4l1.1-.7a7.5 7.5 0 0 0-3-1.8Z"/></svg>',"line-height":'<svg width="24" height="24"><path d="M21 5a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zm0 4a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zm0 4a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zm0 4a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zM7 3.6l3.7 3.7a1 1 0 0 1-1.3 1.5h-.1L8 7.3v9.2l1.3-1.3a1 1 0 0 1 1.3 0h.1c.4.4.4 1 0 1.3v.1L7 20.4l-3.7-3.7a1 1 0 0 1 1.3-1.5h.1L6 16.7V7.4L4.7 8.7a1 1 0 0 1-1.3 0h-.1a1 1 0 0 1 0-1.3v-.1L7 3.6z"/></svg>',line:'<svg width="24" height="24"><path d="m15 9-8 8H4v-3l8-8 3 3Zm1-1-3-3 1-1h1c-.2 0 0 0 0 0l2 2s0 .2 0 0v1l-1 1ZM4 18h16v2H4v-2Z" fill-rule="evenodd"/></svg>',link:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2Zm11.6-.6a1 1 0 0 1-1.4-1.4l2-2a2 2 0 1 0-2.6-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.5 5.5l-2 2Z" fill-rule="nonzero"/></svg>',"list-bull-circle":'<svg height="48" width="48"><path d="M8 14a3 3 0 1 0 6 0 3 3 0 0 0-6 0zm5 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 24a3 3 0 1 0 6 0 3 3 0 0 0-6 0zm5 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 34a3 3 0 1 0 6 0 3 3 0 0 0-6 0zm5 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0z" fill-rule="evenodd"/><path d="M18 12h22v4H18zm0 10h22v4H18zm0 10h22v4H18z" opacity=".2"/></svg>',"list-bull-default":'<svg height="48" width="48"><path d="M14 14a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"/><path d="M12 24a3 3 0 1 0 6 0 3 3 0 0 0-6 0zm5 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0z" fill-rule="evenodd"/><path d="M16 31h6v6h-6z"/><path d="M16 31h6v6h-6z"/><path d="M18 12h22v4H18zm4 10h18v4H22zm4 10h14v4H26z" opacity=".2"/></svg>',"list-bull-disc":'<svg height="48" width="48"><path d="M14 14a3 3 0 1 1-6 0 3 3 0 0 1 6 0zm0 10a3 3 0 1 1-6 0 3 3 0 0 1 6 0zm0 10a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"/><path d="M18 12h22v4H18zm0 10h22v4H18zm0 10h22v4H18z" opacity=".2"/></svg>',"list-bull-square":'<svg height="48" width="48"><path d="M8 21h6v6H8zm0 10h6v6H8zm0-20h6v6H8z"/><path d="M18 12h22v4H18zm0 10h22v4H18zm0 10h22v4H18z" opacity=".2"/></svg>',"list-num-default-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 17v-4.8h-.1l-1.5 1v-1.1l1.6-1.1h1.2v6zM33.3 17.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm1.7 5.7c0-1.2 1-2 2.2-2 1.3 0 2.1.8 2.1 1.8 0 .7-.3 1.2-1.3 2.2l-1.2 1v.2h2.6v1h-4.3v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H35zm-1.7 4.3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm3.2 7.3v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H35c0-1.1 1-1.8 2.2-1.8 1.2 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.7.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .6 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm-3.3 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z"/></g></svg>',"list-num-default":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10 17v-4.8l-1.5 1v-1.1l1.6-1h1.2V17h-1.2Zm3.6.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7Zm-5 5.7c0-1.2.8-2 2.1-2s2.1.8 2.1 1.8c0 .7-.3 1.2-1.4 2.2l-1.1 1v.2h2.6v1H8.6v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H8.5Zm6.3 4.3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7ZM10 34.4v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H8.6c0-1.1 1-1.8 2.2-1.8 1.3 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.8.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .7 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7Zm4.7 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7Z"/></g></svg>',"list-num-lower-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M36.5 16c-.9 0-1.5-.5-1.5-1.3s.6-1.3 1.8-1.4h1v-.4c0-.4-.2-.6-.7-.6-.4 0-.7.1-.8.4h-1.1c0-.8.8-1.4 2-1.4S39 12 39 13V16h-1.2v-.6c-.3.4-.8.7-1.4.7Zm.4-.8c.6 0 1-.4 1-.9V14h-1c-.5.1-.7.3-.7.6 0 .4.3.6.7.6ZM33.1 16.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7ZM37.7 26c-.7 0-1.2-.2-1.5-.7v.7H35v-6.3h1.2v2.5c.3-.5.8-.9 1.5-.9 1.1 0 1.8 1 1.8 2.4 0 1.5-.7 2.4-1.8 2.4Zm-.5-3.6c-.6 0-1 .5-1 1.3s.4 1.4 1 1.4c.7 0 1-.6 1-1.4 0-.8-.3-1.3-1-1.3ZM33.2 26.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm6 7h-1c-.1-.5-.4-.8-1-.8s-1 .5-1 1.4c0 1 .4 1.4 1 1.4.5 0 .9-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm-6.1 3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.3 15.2c.5 0 1-.4 1-.9V14h-1c-.5.1-.8.3-.8.6 0 .4.3.6.8.6Zm-.4.9c-1 0-1.5-.6-1.5-1.4 0-.8.6-1.3 1.7-1.4h1.1v-.4c0-.4-.2-.6-.7-.6-.5 0-.8.1-.9.4h-1c0-.8.8-1.4 2-1.4 1.1 0 1.8.6 1.8 1.6V16h-1.1v-.6h-.1c-.2.4-.7.7-1.3.7Zm4.6 0c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Zm-3.2 10c-.6 0-1.2-.3-1.4-.8v.7H8.5v-6.3H10v2.5c.3-.5.8-.9 1.4-.9 1.2 0 1.9 1 1.9 2.4 0 1.5-.7 2.4-1.9 2.4Zm-.4-3.7c-.7 0-1 .5-1 1.3s.3 1.4 1 1.4c.6 0 1-.6 1-1.4 0-.8-.4-1.3-1-1.3Zm4 3.7c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Zm-2.2 7h-1.2c0-.5-.4-.8-.9-.8-.6 0-1 .5-1 1.4 0 1 .4 1.4 1 1.4.5 0 .8-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7Zm1.8 3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-lower-greek-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 16c-1.2 0-2-.8-2-2.3 0-1.5.8-2.4 2-2.4.6 0 1 .4 1.3 1v-.9H40v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1-.7h-.2c-.2.4-.7.8-1.3.8Zm.3-1c.6 0 1-.5 1-1.3s-.4-1.3-1-1.3-1 .5-1 1.3.4 1.4 1 1.4ZM33.3 16.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7ZM36 21.9c0-1.5.8-2.3 2.1-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.9 1.3.9.3 1.3.8 1.3 1.7 0 1.2-.7 1.9-1.8 1.9-.6 0-1.1-.3-1.4-.8v2.2H36V22Zm1.8 1.2v-1h.3c.5 0 .9-.2.9-.7 0-.5-.3-.8-.9-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1 1.3s1-.4 1-1-.4-1-1.2-1h-.3ZM33.3 26.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7ZM37.1 34.6 34.8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.2.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2Zm.7 1a2 2 0 0 0-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1ZM33.3 36.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-lower-greek":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.5 15c.7 0 1-.5 1-1.3s-.3-1.3-1-1.3c-.5 0-.9.5-.9 1.3s.4 1.4 1 1.4Zm-.3 1c-1.1 0-1.8-.8-1.8-2.3 0-1.5.7-2.4 1.8-2.4.7 0 1.1.4 1.3 1h.1v-.9h1.2v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1.1-.7h-.1c-.2.4-.7.8-1.4.8Zm5 .1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7Zm-4.9 7v-1h.3c.6 0 1-.2 1-.7 0-.5-.4-.8-1-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1.1 1.3.6 0 1-.4 1-1s-.5-1-1.3-1h-.3ZM8.6 22c0-1.5.7-2.3 2-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.8 1.3.8.3 1.3.8 1.3 1.7 0 1.2-.8 1.9-1.9 1.9-.6 0-1.1-.3-1.3-.8v2.2H8.5V22Zm6.2 4.2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7Zm-4.5 8.5L8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.1.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2Zm.7 1a2 2 0 0 0-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1Zm4.5.5c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-lower-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M32.9 16v-1.2h-1.3V16H33Zm0 10v-1.2h-1.3V26H33Zm0 10v-1.2h-1.3V36H33Z"/><path fill-rule="nonzero" d="M36 21h-1.5v5H36zM36 31h-1.5v5H36zM39 21h-1.5v5H39zM39 31h-1.5v5H39zM42 31h-1.5v5H42zM36 11h-1.5v5H36zM36 19h-1.5v1H36zM36 29h-1.5v1H36zM39 19h-1.5v1H39zM39 29h-1.5v1H39zM42 29h-1.5v1H42zM36 9h-1.5v1H36z"/></g></svg>',"list-num-lower-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 16v-1.2h1.3V16H15Zm0 10v-1.2h1.3V26H15Zm0 10v-1.2h1.3V36H15Z"/><path fill-rule="nonzero" d="M12 21h1.5v5H12zM12 31h1.5v5H12zM9 21h1.5v5H9zM9 31h1.5v5H9zM6 31h1.5v5H6zM12 11h1.5v5H12zM12 19h1.5v1H12zM12 29h1.5v1H12zM9 19h1.5v1H9zM9 29h1.5v1H9zM6 29h1.5v1H6zM12 9h1.5v1H12z"/></g></svg>',"list-num-upper-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="m39.3 17-.5-1.4h-2l-.5 1.4H35l2-6h1.6l2 6h-1.3Zm-1.6-4.7-.7 2.3h1.6l-.8-2.3ZM33.4 17c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7Zm4.7 9.9h-2.7v-6H38c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7Zm-1.4-5v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1Zm0 4h1.1c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9h-1.1V26ZM33 27.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Zm4.9 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2Zm-4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-upper-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="m12.6 17-.5-1.4h-2L9.5 17H8.3l2-6H12l2 6h-1.3ZM11 12.3l-.7 2.3h1.6l-.8-2.3Zm4.7 4.8c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7ZM11.4 27H8.7v-6h2.6c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7ZM10 22v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1Zm0 4H11c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9H10V26Zm5.4 1.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Zm-4.1 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2Zm4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-upper-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M31.6 17v-1.2H33V17h-1.3Zm0 10v-1.2H33V27h-1.3Zm0 10v-1.2H33V37h-1.3Z"/><path fill-rule="nonzero" d="M34.5 20H36v7h-1.5zM34.5 30H36v7h-1.5zM37.5 20H39v7h-1.5zM37.5 30H39v7h-1.5zM40.5 30H42v7h-1.5zM34.5 10H36v7h-1.5z"/></g></svg>',"list-num-upper-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 17v-1.2h1.3V17H15Zm0 10v-1.2h1.3V27H15Zm0 10v-1.2h1.3V37H15Z"/><path fill-rule="nonzero" d="M12 20h1.5v7H12zM12 30h1.5v7H12zM9 20h1.5v7H9zM9 30h1.5v7H9zM6 30h1.5v7H6zM12 10h1.5v7H12z"/></g></svg>',lock:'<svg width="24" height="24"><path d="M16.3 11c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H8V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h.3ZM10 8v3h4V8a1 1 0 0 0-.3-.7A1 1 0 0 0 13 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7Z" fill-rule="evenodd"/></svg>',ltr:'<svg width="24" height="24"><path d="M11 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 7.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L11 5ZM4.4 16.2 6.2 15l-1.8-1.2a1 1 0 0 1 1.2-1.6l3 2a1 1 0 0 1 0 1.6l-3 2a1 1 0 1 1-1.2-1.6Z" fill-rule="evenodd"/></svg>',"math-equation":'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M9 4.8c.1-.5.5-.8 1-.8h10a1 1 0 1 1 0 2h-9.2L8.3 19.2a1 1 0 0 1-1.7.4l-3.4-4.2a1 1 0 0 1 1.6-1.2l2 2.5L9 4.8Zm9.7 5.5c.4.4.4 1 0 1.4L17 13.5l1.8 1.8a1 1 0 1 1-1.4 1.4L15.5 15l-1.8 1.8a1 1 0 0 1-1.4-1.4l1.8-1.8-1.8-1.8a1 1 0 0 1 1.4-1.4l1.8 1.8 1.8-1.8a1 1 0 0 1 1.4 0Z"/></svg>',mentions:'<svg height="24" width="24"><path d="M12 21a8.8 8.8 0 0 1-3.5-.7 9 9 0 0 1-2.9-2 9 9 0 0 1-1.9-2.8A8.8 8.8 0 0 1 3 12c0-1.3.2-2.4.7-3.5a9 9 0 0 1 4.8-4.8A8.8 8.8 0 0 1 12 3c1.3 0 2.4.2 3.5.7a9.1 9.1 0 0 1 4.8 4.8A8.7 8.7 0 0 1 21 12v1.4a3 3 0 0 1-.9 2.2 3 3 0 0 1-2.2.9c-.5 0-1-.1-1.5-.4a3.8 3.8 0 0 1-1.1-1 4.8 4.8 0 0 1-1.5 1 4.3 4.3 0 0 1-1.8.4c-1.2 0-2.3-.4-3.2-1.3-.9-.9-1.3-2-1.3-3.2s.4-2.3 1.3-3.2c.9-.9 2-1.3 3.2-1.3s2.3.4 3.2 1.3c.9.9 1.3 2 1.3 3.2v1.4c0 .4.1.7.4 1 .3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1V12c0-2-.7-3.8-2.1-5.2S14 4.7 12 4.7s-3.8.7-5.2 2.1S4.7 10 4.7 12s.7 3.8 2.1 5.2 3.2 2.1 5.2 2.1h4.5V21zm0-6.2c.8 0 1.4-.3 2-.8a2.7 2.7 0 0 0 .8-2c0-.8-.3-1.4-.8-2a2.7 2.7 0 0 0-2-.8c-.8 0-1.4.3-2 .8a2.7 2.7 0 0 0-.8 2c0 .8.3 1.4.8 2a2.7 2.7 0 0 0 2 .8z"/></svg>',minus:'<svg width="24" height="24"><path d="M19 11a1 1 0 0 1 .1 2H5a1 1 0 0 1-.1-2H19Z"/></svg>',"more-drawer":'<svg width="24" height="24"><path d="M6 10a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Zm12 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Zm-6 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Z" fill-rule="nonzero"/></svg>',"new-document":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h10a2 2 0 0 0 2-2V7.6L14.4 3ZM17 19H7V5h6v4h4v10Z" fill-rule="nonzero"/></svg>',"new-tab":'<svg width="24" height="24"><path d="m15 13 2-2v8H5V7h8l-2 2H7v8h8v-4Zm4-8v5.5l-2-2-5.6 5.5H10v-1.4L15.5 7l-2-2H19Z" fill-rule="evenodd"/></svg>',"non-breaking":'<svg width="24" height="24"><path d="M11 11H8a1 1 0 1 1 0-2h3V6c0-.6.4-1 1-1s1 .4 1 1v3h3c.6 0 1 .4 1 1s-.4 1-1 1h-3v3c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-3Zm10 4v5H3v-5c0-.6.4-1 1-1s1 .4 1 1v3h14v-3c0-.6.4-1 1-1s1 .4 1 1Z" fill-rule="evenodd"/></svg>',notice:'<svg width="24" height="24"><path d="M15.5 4 20 8.5v7L15.5 20h-7L4 15.5v-7L8.5 4h7ZM13 17v-2h-2v2h2Zm0-4V7h-2v6h2Z" fill-rule="evenodd" clip-rule="evenodd"/></svg>',"ordered-list-rtl":'<svg width="24" height="24"><path d="M6 17h8a1 1 0 0 1 0 2H6a1 1 0 0 1 0-2Zm0-6h8a1 1 0 0 1 0 2H6a1 1 0 0 1 0-2Zm0-6h8a1 1 0 0 1 0 2H6a1 1 0 1 1 0-2Zm13-1v3.5a.5.5 0 1 1-1 0V5h-.5a.5.5 0 1 1 0-1H19Zm-1 8.8.2.2h1.3a.5.5 0 1 1 0 1h-1.6a1 1 0 0 1-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 0 0-.2-.2h-1.3a.5.5 0 0 1-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3Zm2 4.2v2c0 .6-.4 1-1 1h-1.5a.5.5 0 0 1 0-1h1.2a.3.3 0 1 0 0-.6h-1.3a.4.4 0 1 1 0-.8h1.3a.3.3 0 0 0 0-.6h-1.2a.5.5 0 1 1 0-1H19c.6 0 1 .4 1 1Z" fill-rule="evenodd"/></svg>',"ordered-list":'<svg width="24" height="24"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 1 1 0-2ZM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 0 1-.5-.5V5h-.5a.5.5 0 0 1 0-1H6Zm-1 8.8.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 0 1-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 0 0-.2-.2H4.5a.5.5 0 0 1-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3ZM7 17v2c0 .6-.4 1-1 1H4.5a.5.5 0 0 1 0-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 1 1 0-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 1 1 0-1H6c.6 0 1 .4 1 1Z" fill-rule="evenodd"/></svg>',orientation:'<svg width="24" height="24"><path d="M7.3 6.4 1 13l6.4 6.5 6.5-6.5-6.5-6.5ZM3.7 13l3.6-3.7L11 13l-3.7 3.7-3.6-3.7ZM12 6l2.8 2.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0L9.2 5.7a.8.8 0 0 1 0-1.2L13.6.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L12 4h1a9 9 0 1 1-4.3 16.9l1.5-1.5A7 7 0 1 0 13 6h-1Z" fill-rule="nonzero"/></svg>',outdent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 1 1 0-2Zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2Zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2Zm-5 4h12a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2Zm1.6-3.8a1 1 0 0 1-1.2 1.6l-3-2a1 1 0 0 1 0-1.6l3-2a1 1 0 0 1 1.2 1.6L6.8 12l1.8 1.2Z" fill-rule="evenodd"/></svg>',"export-pdf":'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M7 3h7.4L19 7.6V17h-2V9h-4V5H7v3H5V5c0-1.1.9-2 2-2Z"/><path d="M2.6 15.2v-1.9h1c.6 0 1-.2 1.4-.5.3-.3.5-.7.5-1.2s-.2-.9-.5-1.2a2 2 0 0 0-1.3-.4H1v5.2h1.6Zm.4-3h-.4v-1.1h.5l.6.1.2.5c0 .1 0 .3-.2.4l-.7.1Zm5.7 3 1-.1c.3 0 .5-.2.7-.4l.5-.8c.2-.3.2-.7.2-1.3v-1l-.5-.8c-.2-.3-.4-.5-.7-.6L8.7 10H6.3v5.2h2.4Zm-.4-1.1H8v-3h.4c.5 0 .8.2 1 .4l.2 1.1-.1 1-.3.3-.8.2Zm5.3 1.2V13h2v-1h-2v-1H16V10h-4v5.2h1.6Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M15 17a1 1 0 1 0-2 0v3.1l-1.4-1a1 1 0 1 0-1.2 1.7l3.6 2.4 3.6-2.4a1 1 0 0 0-1.2-1.6l-1.4 1V17Z"/></svg>',"export-word":'<svg width="24" height="24"><path d="M9.5 7A1.5 1.5 0 0 1 11 8.4v7.1A1.5 1.5 0 0 1 9.6 17H2.5A1.5 1.5 0 0 1 1 15.6V8.5A1.5 1.5 0 0 1 2.4 7h7.1Zm-1 2.8-1 2.6-1-2.5v-.1a.6.6 0 0 0-1 0l-.1.1-.9 2.5-1-2.5v-.1a.6.6 0 0 0-1 .4v.1l1.5 4v.1a.6.6 0 0 0 1 0v-.1l1-2.5.9 2.5v.1a.6.6 0 0 0 1 0H8l1.6-4v-.2a.6.6 0 0 0-1.1-.4Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7 3h7.4L19 7.6V17h-2V9h-4V5H5c0-1.1.9-2 2-2ZM15 17a1 1 0 1 0-2 0v3.1l-1.4-1a1 1 0 1 0-1.2 1.7l3.6 2.4 3.6-2.4a1 1 0 0 0-1.2-1.6l-1.4 1V17Z"/></svg>',"import-word":'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M7 3h7.4L19 7.6V15h-2V9h-4V5H5c0-1.1.9-2 2-2Z"/><path d="M9.5 7A1.5 1.5 0 0 1 11 8.4v7.1A1.5 1.5 0 0 1 9.6 17H2.5A1.5 1.5 0 0 1 1 15.6V8.5A1.5 1.5 0 0 1 2.4 7h7.1Zm-1 2.8-1 2.6-1-2.5v-.1a.6.6 0 0 0-1 0l-.1.1-.9 2.5-1-2.5v-.1a.6.6 0 0 0-1 .4v.1l1.5 4v.1a.6.6 0 0 0 1 0v-.1l1-2.5.9 2.5v.1a.6.6 0 0 0 1 0H8l1.6-4v-.2a.6.6 0 0 0-1.1-.4Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M11.4 18.2a1 1 0 0 0 1.2 1.6l1.4-1V22a1 1 0 1 0 2 0v-3.1l1.4 1a1 1 0 0 0 1.2-1.7L15 15.8l-3.6 2.4Z"/></svg>',"page-break":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M5 11c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2Zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2Zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2Zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1h-1a1 1 0 0 1 0-2Zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2ZM7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1ZM6 22a1 1 0 0 1-1-1v-7h14v7c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-5H7v5c0 .6-.4 1-1 1Z"/></g></svg>',paragraph:'<svg width="24" height="24"><path fill-rule="evenodd" d="M10 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 6.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L10 5Z"/></svg>',"paste-column-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h7v2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0 1 12 1Zm8 7v12h-6V8h6Zm-1.5 1.5h-3v9h3v-9ZM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"/></svg>',"paste-column-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V18c0 1-.8 2-1.9 2H11v-2h7V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v2H4V5c0-1 .8-2 1.9-2H9.2A3 3 0 0 1 12 1Zm-2 7v12H4V8h6ZM8.5 9.5h-3v9h3v-9ZM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"/></svg>',"paste-row-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V11h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h14c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0 1 12 1Zm10 11v5H8v-5h14Zm-1.5 1.5h-11v2h11v-2ZM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"/></svg>',"paste-row-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h12v-4h2v4c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0 1 12 1Zm10 7v5H8V8h14Zm-1.5 1.5h-11v2h11v-2ZM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"/></svg>',"paste-text":'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h3V9h9ZM9 20H6a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0 1 12 1a3 3 0 0 1 2.8 2H18a2 2 0 0 1 2 2v4h1v12H9v-1Zm1.5-9.5v9h9v-9h-9ZM12 3a1 1 0 0 0-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1Zm0 9h6v2h-.5l-.5-1h-1v4h.8v1h-3.6v-1h.8v-4h-1l-.5 1H12v-2Z" fill-rule="nonzero"/></svg>',paste:'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h3V9h9ZM9 20H6a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0 1 12 1a3 3 0 0 1 2.8 2H18a2 2 0 0 1 2 2v4h1v12H9v-1Zm1.5-9.5v9h9v-9h-9ZM12 3a1 1 0 0 0-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1Z" fill-rule="nonzero"/></svg>',"permanent-pen":'<svg width="24" height="24"><path d="M10.5 17.5 8 20H3v-3l3.5-3.5a2 2 0 0 1 0-3L14 3l1 1-7.3 7.3a1 1 0 0 0 0 1.4l3.6 3.6c.4.4 1 .4 1.4 0L20 9l1 1-7.6 7.6a2 2 0 0 1-2.8 0l-.1-.1Z" fill-rule="nonzero"/></svg>',plus:'<svg width="24" height="24"><path d="M12 4c.5 0 1 .4 1 .9V11h6a1 1 0 0 1 .1 2H13v6a1 1 0 0 1-2 .1V13H5a1 1 0 0 1-.1-2H11V5c0-.6.4-1 1-1Z"/></svg>',preferences:'<svg width="24" height="24"><path d="m20.1 13.5-1.9.2a5.8 5.8 0 0 1-.6 1.5l1.2 1.5c.4.4.3 1 0 1.4l-.7.7a1 1 0 0 1-1.4 0l-1.5-1.2a6.2 6.2 0 0 1-1.5.6l-.2 1.9c0 .5-.5.9-1 .9h-1a1 1 0 0 1-1-.9l-.2-1.9a5.8 5.8 0 0 1-1.5-.6l-1.5 1.2a1 1 0 0 1-1.4 0l-.7-.7a1 1 0 0 1 0-1.4l1.2-1.5a6.2 6.2 0 0 1-.6-1.5l-1.9-.2a1 1 0 0 1-.9-1v-1c0-.5.4-1 .9-1l1.9-.2a5.8 5.8 0 0 1 .6-1.5L5.2 7.3a1 1 0 0 1 0-1.4l.7-.7a1 1 0 0 1 1.4 0l1.5 1.2a6.2 6.2 0 0 1 1.5-.6l.2-1.9c0-.5.5-.9 1-.9h1c.5 0 1 .4 1 .9l.2 1.9a5.8 5.8 0 0 1 1.5.6l1.5-1.2a1 1 0 0 1 1.4 0l.7.7c.3.4.4 1 0 1.4l-1.2 1.5a6.2 6.2 0 0 1 .6 1.5l1.9.2c.5 0 .9.5.9 1v1c0 .5-.4 1-.9 1ZM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z" fill-rule="evenodd"/></svg>',preview:'<svg width="24" height="24"><path d="M3.5 12.5c.5.8 1.1 1.6 1.8 2.3 2 2 4.2 3.2 6.7 3.2s4.7-1.2 6.7-3.2a16.2 16.2 0 0 0 2.1-2.8 15.7 15.7 0 0 0-2.1-2.8c-2-2-4.2-3.2-6.7-3.2a9.3 9.3 0 0 0-6.7 3.2A16.2 16.2 0 0 0 3.2 12c0 .2.2.3.3.5Zm-2.4-1 .7-1.2L4 7.8C6.2 5.4 8.9 4 12 4c3 0 5.8 1.4 8.1 3.8a18.2 18.2 0 0 1 2.8 3.7v1l-.7 1.2-2.1 2.5c-2.3 2.4-5 3.8-8.1 3.8-3 0-5.8-1.4-8.1-3.8a18.2 18.2 0 0 1-2.8-3.7 1 1 0 0 1 0-1Zm12-3.3a2 2 0 1 0 2.7 2.6 4 4 0 1 1-2.6-2.6Z" fill-rule="nonzero"/></svg>',print:'<svg width="24" height="24"><path d="M18 8H6a3 3 0 0 0-3 3v6h2v3h14v-3h2v-6a3 3 0 0 0-3-3Zm-1 10H7v-4h10v4Zm.5-5c-.8 0-1.5-.7-1.5-1.5s.7-1.5 1.5-1.5 1.5.7 1.5 1.5-.7 1.5-1.5 1.5Zm.5-8H6v2h12V5Z" fill-rule="nonzero"/></svg>',quote:'<svg width="24" height="24"><path d="M7.5 17h.9c.4 0 .7-.2.9-.6L11 13V8c0-.6-.4-1-1-1H6a1 1 0 0 0-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 0 0 .8 1.3Zm8 0h.9c.4 0 .7-.2.9-.6L19 13V8c0-.6-.4-1-1-1h-4a1 1 0 0 0-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 0 0 .8 1.3Z" fill-rule="nonzero"/></svg>',redo:'<svg width="24" height="24"><path d="M17.6 10H12c-2.8 0-4.4 1.4-4.9 3.5-.4 2 .3 4 1.4 4.6a1 1 0 1 1-1 1.8c-2-1.2-2.9-4.1-2.3-6.8.6-3 3-5.1 6.8-5.1h5.6l-3.3-3.3a1 1 0 1 1 1.4-1.4l5 5a1 1 0 0 1 0 1.4l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3Z" fill-rule="nonzero"/></svg>',reload:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="m5 22.1-1.2-4.7v-.2a1 1 0 0 1 1-1l5 .4a1 1 0 1 1-.2 2l-2.2-.2a7.8 7.8 0 0 0 8.4.2 7.5 7.5 0 0 0 3.5-6.4 1 1 0 1 1 2 0 9.5 9.5 0 0 1-4.5 8 9.9 9.9 0 0 1-10.2 0l.4 1.4a1 1 0 1 1-2 .5ZM13.6 7.4c0-.5.5-1 1-.9l2.8.2a8 8 0 0 0-9.5-1 7.5 7.5 0 0 0-3.6 7 1 1 0 0 1-2 0 9.5 9.5 0 0 1 4.5-8.6 10 10 0 0 1 10.9.3l-.3-1a1 1 0 0 1 2-.5l1.1 4.8a1 1 0 0 1-1 1.2l-5-.4a1 1 0 0 1-.9-1Z"/></g></svg>',"remove-formatting":'<svg width="24" height="24"><path d="M13.2 6a1 1 0 0 1 0 .2l-2.6 10a1 1 0 0 1-1 .8h-.2a.8.8 0 0 1-.8-1l2.6-10H8a1 1 0 1 1 0-2h9a1 1 0 0 1 0 2h-3.8ZM5 18h7a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Zm13 1.5L16.5 18 15 19.5a.7.7 0 0 1-1-1l1.5-1.5-1.5-1.5a.7.7 0 0 1 1-1l1.5 1.5 1.5-1.5a.7.7 0 0 1 1 1L17.5 17l1.5 1.5a.7.7 0 0 1-1 1Z" fill-rule="evenodd"/></svg>',remove:'<svg width="24" height="24"><path d="M16 7h3a1 1 0 0 1 0 2h-1v9a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3V9H5a1 1 0 1 1 0-2h3V6a3 3 0 0 1 3-3h2a3 3 0 0 1 3 3v1Zm-2 0V6c0-.6-.4-1-1-1h-2a1 1 0 0 0-1 1v1h4Zm2 2H8v9c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9Zm-7 3a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0v-4Zm4 0a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0v-4Z" fill-rule="nonzero"/></svg>',"resize-handle":'<svg width="10" height="10"><g fill-rule="nonzero"><path d="M8.1 1.1A.5.5 0 1 1 9 2l-7 7A.5.5 0 1 1 1 8l7-7ZM8.1 5.1A.5.5 0 1 1 9 6l-3 3A.5.5 0 1 1 5 8l3-3Z"/></g></svg>',resize:'<svg width="24" height="24"><path d="M4 5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h6c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 0 1-.7.3H7.4L18 16.6V13c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v6c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-6a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3.6L6 7.4V11c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.7-.3A1 1 0 0 1 4 11V5Z" fill-rule="evenodd"/></svg>',"restore-draft":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M17 13c0 .6-.4 1-1 1h-4V8c0-.6.4-1 1-1s1 .4 1 1v4h2c.6 0 1 .4 1 1Z"/><path d="M4.7 10H9a1 1 0 0 1 0 2H3a1 1 0 0 1-1-1V5a1 1 0 1 1 2 0v3l2.5-2.4a9.2 9.2 0 0 1 10.8-1.5A9 9 0 0 1 13.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 1 1 1.3-1.5 7.2 7.2 0 0 0 11.6-3.7 7 7 0 0 0-3.5-7.7A7.2 7.2 0 0 0 8 7L4.7 10Z" fill-rule="nonzero"/></g></svg>',"revision-history":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M17 13c0 .6-.4 1-1 1h-4V8c0-.6.4-1 1-1s1 .4 1 1v4h2c.6 0 1 .4 1 1Z"/><path d="M4.7 10H9a1 1 0 0 1 0 2H3a1 1 0 0 1-1-1V5a1 1 0 1 1 2 0v3l2.5-2.4a9.2 9.2 0 0 1 10.8-1.5A9 9 0 0 1 13.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 1 1 1.3-1.5 7.2 7.2 0 0 0 11.6-3.7 7 7 0 0 0-3.5-7.7A7.2 7.2 0 0 0 8 7L4.7 10Z" fill-rule="nonzero"/></g></svg>',"rotate-left":'<svg width="24" height="24"><path d="M4.7 10H9a1 1 0 0 1 0 2H3a1 1 0 0 1-1-1V5a1 1 0 1 1 2 0v3l2.5-2.4a9.2 9.2 0 0 1 10.8-1.5A9 9 0 0 1 13.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 1 1 1.3-1.5 7.2 7.2 0 0 0 11.6-3.7 7 7 0 0 0-3.5-7.7A7.2 7.2 0 0 0 8 7L4.7 10Z" fill-rule="nonzero"/></svg>',"rotate-right":'<svg width="24" height="24"><path d="M20 8V5a1 1 0 0 1 2 0v6c0 .6-.4 1-1 1h-6a1 1 0 0 1 0-2h4.3L16 7A7.2 7.2 0 0 0 7.7 6a7 7 0 0 0 3 13.1c1.9.1 3.7-.5 5-1.7a1 1 0 0 1 1.4 1.5A9.2 9.2 0 0 1 2.2 14c-.9-3.9 1-8 4.5-9.9 3.5-1.9 8-1.3 10.8 1.5L20 8Z" fill-rule="nonzero"/></svg>',rtl:'<svg width="24" height="24"><path d="M8 5h8v2h-2v12h-2V7h-2v12H8v-7c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 4.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L8 5Zm12 11.2a1 1 0 1 1-1 1.6l-3-2a1 1 0 0 1 0-1.6l3-2a1 1 0 1 1 1 1.6L18.4 15l1.8 1.2Z" fill-rule="evenodd"/></svg>',save:'<svg width="24" height="24"><path d="M5 16h14a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2Zm0 2v2h14v-2H5Zm10 0h2v2h-2v-2Zm-4-6.4L8.7 9.3a1 1 0 1 0-1.4 1.4l4 4c.4.4 1 .4 1.4 0l4-4a1 1 0 1 0-1.4-1.4L13 11.6V4a1 1 0 0 0-2 0v7.6Z" fill-rule="nonzero"/></svg>',search:'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3Zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12Z" fill-rule="nonzero"/></svg>',"select-all":'<svg width="24" height="24"><path d="M3 5h2V3a2 2 0 0 0-2 2Zm0 8h2v-2H3v2Zm4 8h2v-2H7v2ZM3 9h2V7H3v2Zm10-6h-2v2h2V3Zm6 0v2h2a2 2 0 0 0-2-2ZM5 21v-2H3c0 1.1.9 2 2 2Zm-2-4h2v-2H3v2ZM9 3H7v2h2V3Zm2 18h2v-2h-2v2Zm8-8h2v-2h-2v2Zm0 8a2 2 0 0 0 2-2h-2v2Zm0-12h2V7h-2v2Zm0 8h2v-2h-2v2Zm-4 4h2v-2h-2v2Zm0-16h2V3h-2v2ZM7 17h10V7H7v10Zm2-8h6v6H9V9Z" fill-rule="nonzero"/></svg>',selected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2Zm3.6 10.9L7 12.3a.7.7 0 0 0-1 1L9.6 17 18 8.6a.7.7 0 0 0 0-1 .7.7 0 0 0-1 0l-7.4 7.3Z"/></svg>',send:'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="m13.3 22 7-18.3-18.3 7L9 15l4.3 7ZM18 6.8l-.7-.7L9.4 14l.7.7L18 6.8Z"/></svg>',settings:'<svg width="24" height="24"><path d="M11 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V8H5a1 1 0 1 1 0-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.5V6ZM8 8h2V6H8v2Zm9 2.8v.2h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v.3c0 .2 0 .3-.2.5l-.6.2h-2.4c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V13H5a1 1 0 0 1 0-2h8v-.3c0-.2 0-.3.2-.5l.6-.2h2.4c.3 0 .4 0 .6.2l.2.6ZM14 13h2v-2h-2v2Zm-3 2.8v.2h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V18H5a1 1 0 0 1 0-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.6ZM8 18h2v-2H8v2Z" fill-rule="evenodd"/></svg>',sharpen:'<svg width="24" height="24"><path fill-rule="evenodd" d="m16 6 4 4-8 9-8-9 4-4h8Zm-4 10.2 5.5-6.2-.1-.1H12v-.3h5.1l-.2-.2H12V9h4.6l-.2-.2H12v-.3h4.1l-.2-.2H12V8h3.6l-.2-.2H8.7L6.5 10l.1.1H12v.3H6.9l.2.2H12v.3H7.3l.2.2H12v.3H7.7l.3.2h4v.3H8.2l.2.2H12v.3H8.6l.3.2H12v.3H9l.3.2H12v.3H9.5l.2.2H12v.3h-2l.2.2H12v.3h-1.6l.2.2H12v.3h-1.1l.2.2h.9v.3h-.7l.2.2h.5v.3h-.3l.3.2Z"/></svg>',sourcecode:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9.8 15.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0l-4.4-4.1a.8.8 0 0 1 0-1.2l4.4-4.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L6 12l3.8 3.7ZM14.2 15.7c-.3.3-.3.8 0 1 .4.4.9.4 1.2 0l4.4-4.1c.3-.3.3-.9 0-1.2l-4.4-4.2a.8.8 0 0 0-1.2 0c-.3.3-.3.8 0 1.1L18 12l-3.8 3.7Z"/></g></svg>',"spell-check":'<svg width="24" height="24"><path d="M6 8v3H5V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h2c.3 0 .5.1.7.3.2.2.3.4.3.7v6H8V8H6Zm0-3v2h2V5H6Zm13 0h-3v5h3v1h-3a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3v1Zm-5 1.5-.1.7c-.1.2-.3.3-.6.3.3 0 .5.1.6.3l.1.7V10c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-3V4h3c.3 0 .5.1.7.3.2.2.3.4.3.7v1.5ZM13 10V8h-2v2h2Zm0-3V5h-2v2h2Zm3 5 1 1-6.5 7L7 15.5l1.3-1 2.2 2.2L16 12Z" fill-rule="evenodd"/></svg>',"strike-through":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M15.6 8.5c-.5-.7-1-1.1-1.3-1.3-.6-.4-1.3-.6-2-.6-2.7 0-2.8 1.7-2.8 2.1 0 1.6 1.8 2 3.2 2.3 4.4.9 4.6 2.8 4.6 3.9 0 1.4-.7 4.1-5 4.1A6.2 6.2 0 0 1 7 16.4l1.5-1.1c.4.6 1.6 2 3.7 2 1.6 0 2.5-.4 3-1.2.4-.8.3-2-.8-2.6-.7-.4-1.6-.7-2.9-1-1-.2-3.9-.8-3.9-3.6C7.6 6 10.3 5 12.4 5c2.9 0 4.2 1.6 4.7 2.4l-1.5 1.1Z"/><path d="M5 11h14a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z" fill-rule="nonzero"/></g></svg>',subscript:'<svg width="24" height="24"><path d="m10.4 10 4.6 4.6-1.4 1.4L9 11.4 4.4 16 3 14.6 7.6 10 3 5.4 4.4 4 9 8.6 13.6 4 15 5.4 10.4 10ZM21 19h-5v-1l1-.8 1.7-1.6c.3-.4.5-.8.5-1.2 0-.3 0-.6-.2-.7-.2-.2-.5-.3-.9-.3a2 2 0 0 0-.8.2l-.7.3-.4-1.1 1-.6 1.2-.2c.8 0 1.4.3 1.8.7.4.4.6.9.6 1.5s-.2 1.1-.5 1.6a8 8 0 0 1-1.3 1.3l-.6.6h2.6V19Z" fill-rule="nonzero"/></svg>',superscript:'<svg width="24" height="24"><path d="M15 9.4 10.4 14l4.6 4.6-1.4 1.4L9 15.4 4.4 20 3 18.6 7.6 14 3 9.4 4.4 8 9 12.6 13.6 8 15 9.4Zm5.9 1.6h-5v-1l1-.8 1.7-1.6c.3-.5.5-.9.5-1.3 0-.3 0-.5-.2-.7-.2-.2-.5-.3-.9-.3l-.8.2-.7.4-.4-1.2c.2-.2.5-.4 1-.5.3-.2.8-.2 1.2-.2.8 0 1.4.2 1.8.6.4.4.6 1 .6 1.6 0 .5-.2 1-.5 1.5l-1.3 1.4-.6.5h2.6V11Z" fill-rule="nonzero"/></svg>',"table-caption":'<svg width="24" height="24"><g fill-rule="nonzero"><rect width="12" height="2" x="3" y="4" rx="1"/><path d="M19 8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-8c0-1.1.9-2 2-2h14ZM5 15v3h6v-3H5Zm14 0h-6v3h6v-3Zm0-5h-6v3h6v-3ZM5 13h6v-3H5v3Z"/></g></svg>',"table-cell-classes":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M13 4v9H3V6c0-1.1.9-2 2-2h8Zm-2 2H5v5h6V6Z"/><path fill-rule="nonzero" d="M13 4h6a2 2 0 0 1 2 2v7h-8v-2h6V6h-6V4Z" opacity=".2"/><path d="m18 20-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3.1.2-2.4 2 .7 3z"/><path fill-rule="nonzero" d="M3 13v5c0 1.1.9 2 2 2h8v-7h-2v5H5v-5H3Z" opacity=".2"/></g></svg>',"table-cell-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 9H5v5h6v-5Zm8 0h-6v5h6v-5Zm-8-7H5v5h6V6Z"/></svg>',"table-cell-select-all":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm0 2H5v12h14V6Z"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2Z" opacity=".2"/></g></svg>',"table-cell-select-inner":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm0 2H5v12h14V6Z" opacity=".2"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2Z"/></g></svg>',"table-classes":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v7h-8v7H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 9H5v5h6v-5Zm8-7h-6v5h6V6Zm-8 0H5v5h6V6Z"/><path d="m18 20-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3.1.2-2.4 2 .7 3z"/></g></svg>',"table-delete-column":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-4 4h-2V6h-2v2H9V6H5v12h4v-2h2v2h2v-2h2v2h4V6h-4v2Zm.3.5 1 1.2-3 2.3 3 2.3-1 1.2L12 13l-3.3 2.6-1-1.2 3-2.3-3-2.3 1-1.2L12 11l3.3-2.5Z"/></svg>',"table-delete-row":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm0 2H5v3h2.5v2H5v2h2.5v2H5v3h14v-3h-2.5v-2H19v-2h-2.5V9H19V6Zm-4.7 1.8 1.2 1L13 12l2.6 3.3-1.2 1-2.3-3-2.3 3-1.2-1L11 12 8.5 8.7l1.2-1 2.3 3 2.3-3Z"/></svg>',"table-delete-table":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM5 6v12h14V6H5Z"/><path d="m14.4 8.6 1.1 1-2.4 2.4 2.4 2.4-1.1 1.1-2.4-2.4-2.4 2.4-1-1.1 2.3-2.4-2.3-2.4 1-1 2.4 2.3z"/></g></svg>',"table-insert-column-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M20 4c.6 0 1 .4 1 1v2a1 1 0 0 1-2 0V6h-8v12h8v-1a1 1 0 0 1 2 0v2c0 .5-.4 1-.9 1H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h15ZM9 13H5v5h4v-5Zm7-5c.5 0 1 .4 1 .9V11h2a1 1 0 0 1 .1 2H17v2a1 1 0 0 1-2 .1V13h-2a1 1 0 0 1-.1-2H15V9c0-.6.4-1 1-1ZM9 6H5v5h4V6Z"/></svg>',"table-insert-column-before":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a1 1 0 0 1-1-1v-2a1 1 0 0 1 2 0v1h8V6H5v1a1 1 0 1 1-2 0V5c0-.6.4-1 1-1h15Zm0 9h-4v5h4v-5ZM8 8c.5 0 1 .4 1 .9V11h2a1 1 0 0 1 .1 2H9v2a1 1 0 0 1-2 .1V13H5a1 1 0 0 1-.1-2H7V9c0-.6.4-1 1-1Zm11-2h-4v5h4V6Z"/></svg>',"table-insert-row-above":'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4a1 1 0 1 1 0 2H5v6h14V6h-1a1 1 0 0 1 0-2h2c.6 0 1 .4 1 1v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5c0-.6.4-1 1-1h2Zm5 10H5v4h6v-4Zm8 0h-6v4h6v-4ZM12 3c.5 0 1 .4 1 .9V6h2a1 1 0 0 1 0 2h-2v2a1 1 0 0 1-2 .1V8H9a1 1 0 0 1 0-2h2V4c0-.6.4-1 1-1Z"/></svg>',"table-insert-row-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M12 13c.5 0 1 .4 1 .9V16h2a1 1 0 0 1 .1 2H13v2a1 1 0 0 1-2 .1V18H9a1 1 0 0 1-.1-2H11v-2c0-.6.4-1 1-1Zm6 7a1 1 0 0 1 0-2h1v-6H5v6h1a1 1 0 0 1 0 2H4a1 1 0 0 1-1-1V6c0-1.1.9-2 2-2h14a2 2 0 0 1 2 2v13c0 .5-.4 1-.9 1H18ZM11 6H5v4h6V6Zm8 0h-6v4h6V6Z"/></svg>',"table-left-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm0 9h-4v5h4v-5Zm-6 0H9v5h4v-5Zm0-7H9v5h4V6Zm6 0h-4v5h4V6Z"/></svg>',"table-merge-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM5 15.5V18h3v-2.5H5Zm14-5h-9V18h9v-7.5ZM19 6h-4v2.5h4V6ZM8 6H5v2.5h3V6Zm5 0h-3v2.5h3V6Zm-8 7.5h3v-3H5v3Z"/></svg>',"table-row-numbering-rtl":'<svg width="24" height="24"><path d="M6 4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2H6Zm0 12h8v3H6v-3Zm11 0c.6 0 1 .4 1 1v1a1 1 0 0 1-2 0v-1c0-.6.4-1 1-1ZM6 11h8v3H6v-3Zm11 0c.6 0 1 .4 1 1v1a1 1 0 0 1-2 0v-1c0-.6.4-1 1-1ZM6 6h8v3H6V6Zm11 0c.6 0 1 .4 1 1v1a1 1 0 1 1-2 0V7c0-.6.4-1 1-1Z"/></svg>',"table-row-numbering":'<svg width="24" height="24"><path d="M18 4a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h12Zm0 12h-8v3h8v-3ZM7 16a1 1 0 0 0-1 1v1a1 1 0 0 0 2 0v-1c0-.6-.4-1-1-1Zm11-5h-8v3h8v-3ZM7 11a1 1 0 0 0-1 1v1a1 1 0 0 0 2 0v-1c0-.6-.4-1-1-1Zm11-5h-8v3h8V6ZM7 6a1 1 0 0 0-1 1v1a1 1 0 1 0 2 0V7c0-.6-.4-1-1-1Z"/></svg>',"table-row-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM5 15v3h6v-3H5Zm14 0h-6v3h6v-3Zm0-9h-6v3h6V6ZM5 9h6V6H5v3Z"/></svg>',"table-split-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM8 15.5H5V18h3v-2.5Zm11-5h-9V18h9v-7.5Zm-2.5 1 1 1-2 2 2 2-1 1-2-2-2 2-1-1 2-2-2-2 1-1 2 2 2-2Zm-8.5-1H5v3h3v-3ZM19 6h-4v2.5h4V6ZM8 6H5v2.5h3V6Zm5 0h-3v2.5h3V6Z"/></svg>',"table-top-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 11H5v3h6v-3Zm8 0h-6v3h6v-3Zm0-5h-6v3h6v-3ZM5 13h6v-3H5v3Z"/></svg>',table:'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM5 14v4h6v-4H5Zm14 0h-6v4h6v-4Zm0-6h-6v4h6V8ZM5 12h6V8H5v4Z"/></svg>',"template-add":'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M9 12v4H5a2 2 0 0 0-2 2v3h9.3a6 6 0 0 1-.3-2H5v-1h7a6 6 0 0 1 .8-2H11v-5l-.8-.6a3 3 0 1 1 3.6 0l-.8.6v4.7a6 6 0 0 1 2-1.9V12a5 5 0 1 0-6 0Z"/><path d="M18 15c.5 0 1 .4 1 .9V18h2a1 1 0 0 1 .1 2H19v2a1 1 0 0 1-2 .1V20h-2a1 1 0 0 1-.1-2H17v-2c0-.6.4-1 1-1Z"/></svg>',template:'<svg width="24" height="24"><path d="M19 19v-1H5v1h14ZM9 16v-4a5 5 0 1 1 6 0v4h4a2 2 0 0 1 2 2v3H3v-3c0-1.1.9-2 2-2h4Zm4 0v-5l.8-.6a3 3 0 1 0-3.6 0l.8.6v5h2Z" fill-rule="nonzero"/></svg>',"temporary-placeholder":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M9 7.6V6h2.5V4.5a.5.5 0 1 1 1 0V6H15v1.6a8 8 0 1 1-6 0Zm-2.6 5.3a.5.5 0 0 0 .3.6c.3 0 .6 0 .6-.3l.1-.2a5 5 0 0 1 3.3-2.8c.3-.1.4-.4.4-.6-.1-.3-.4-.5-.6-.4a6 6 0 0 0-4.1 3.7Z"/><circle cx="14" cy="4" r="1"/><circle cx="12" cy="2" r="1"/><circle cx="10" cy="4" r="1"/></g></svg>',"text-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path class="tox-icon-text-color__color" d="M3 18h18v3H3z"/><path d="M8.7 16h-.8a.5.5 0 0 1-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 0 1-.5.6h-.8a.5.5 0 0 1-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4Zm2.6-7.6-.6 2a.5.5 0 0 0 .5.6h1.6a.5.5 0 0 0 .5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4Z"/></g></svg>',"text-size-decrease":'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M14 5a1 1 0 1 1 0 2h-4v11a1 1 0 1 1-2 0V7H4a1 1 0 0 1 0-2h10ZM14 12a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-6Z"/></svg>',"text-size-increase":'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M14 5a1 1 0 1 1 0 2h-4v11a1 1 0 1 1-2 0V7H4a1 1 0 0 1 0-2h10ZM17 9a1 1 0 0 0-1 1v2h-2a1 1 0 1 0 0 2h2v2a1 1 0 1 0 2 0v-2h2a1 1 0 1 0 0-2h-2v-2c0-.6-.4-1-1-1Z"/></svg>',toc:'<svg width="24" height="24"><path d="M5 5c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 1 1 0-2Zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 1 1 0-2Zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2Zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2Zm0-4c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 1 1 0-2Zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2Zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',translate:'<svg width="24" height="24"><path d="m12.7 14.3-.3.7-.4.7-2.2-2.2-3.1 3c-.3.4-.8.4-1 0a.7.7 0 0 1 0-1l3.1-3A12.4 12.4 0 0 1 6.7 9H8a10.1 10.1 0 0 0 1.7 2.4c.5-.5 1-1.1 1.4-1.8l.9-2H4.7a.7.7 0 1 1 0-1.5h4.4v-.7c0-.4.3-.8.7-.8.4 0 .7.4.7.8v.7H15c.4 0 .8.3.8.7 0 .4-.4.8-.8.8h-1.4a12.3 12.3 0 0 1-1 2.4 13.5 13.5 0 0 1-1.7 2.3l1.9 1.8Zm4.3-3 2.7 7.3a.5.5 0 0 1-.4.7 1 1 0 0 1-1-.7l-.6-1.5h-3.4l-.6 1.5a1 1 0 0 1-1 .7.5.5 0 0 1-.4-.7l2.7-7.4a1 1 0 0 1 2 0Zm-2.2 4.4h2.4L16 12.5l-1.2 3.2Z" fill-rule="evenodd"/></svg>',typography:'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M17 5a1 1 0 1 1 0 2h-4v11a1 1 0 1 1-2 0V7H7a1 1 0 0 1 0-2h10Z"/><path d="m17.5 14 .8-1.7 1.7-.8-1.7-.8-.8-1.7-.8 1.7-1.7.8 1.7.8.8 1.7ZM7 14l1 2 2 1-2 1-1 2-1-2-2-1 2-1 1-2Z"/></svg>',underline:'<svg width="24" height="24"><path d="M16 5c.6 0 1 .4 1 1v5.5a4 4 0 0 1-.4 1.8l-1 1.4a5.3 5.3 0 0 1-5.5 1 5 5 0 0 1-1.6-1c-.5-.4-.8-.9-1.1-1.4a4 4 0 0 1-.4-1.8V6c0-.6.4-1 1-1s1 .4 1 1v5.5c0 .3 0 .6.2 1l.6.7a3.3 3.3 0 0 0 2.2.8 3.4 3.4 0 0 0 2.2-.8c.3-.2.4-.5.6-.8l.2-.9V6c0-.6.4-1 1-1ZM8 17h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',undo:'<svg width="24" height="24"><path d="M6.4 8H12c3.7 0 6.2 2 6.8 5.1.6 2.7-.4 5.6-2.3 6.8a1 1 0 0 1-1-1.8c1.1-.6 1.8-2.7 1.4-4.6-.5-2.1-2.1-3.5-4.9-3.5H6.4l3.3 3.3a1 1 0 1 1-1.4 1.4l-5-5a1 1 0 0 1 0-1.4l5-5a1 1 0 0 1 1.4 1.4L6.4 8Z" fill-rule="nonzero"/></svg>',unlink:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2Zm11.6-.6a1 1 0 0 1-1.4-1.4l2.1-2a2 2 0 1 0-2.7-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.5 5.5l-2 2ZM7.6 6.3a.8.8 0 0 1-1 1.1L3.3 4.2a.7.7 0 1 1 1-1l3.2 3.1ZM5.1 8.6a.8.8 0 0 1 0 1.5H3a.8.8 0 0 1 0-1.5H5Zm5-3.5a.8.8 0 0 1-1.5 0V3a.8.8 0 0 1 1.5 0V5Zm6 11.8a.8.8 0 0 1 1-1l3.2 3.2a.8.8 0 0 1-1 1L16 17Zm-2.2 2a.8.8 0 0 1 1.5 0V21a.8.8 0 0 1-1.5 0V19Zm5-3.5a.7.7 0 1 1 0-1.5H21a.8.8 0 0 1 0 1.5H19Z" fill-rule="nonzero"/></svg>',unlock:'<svg width="24" height="24"><path d="M16 5c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h-2V8a1 1 0 0 0-.3-.7A1 1 0 0 0 16 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7v3h.3c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H4.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H11V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2Z" fill-rule="evenodd"/></svg>',"unordered-list":'<svg width="24" height="24"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2ZM4.5 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1Zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1Zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1Z" fill-rule="evenodd"/></svg>',unselected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2Zm0 1a1 1 0 0 0-1 1v12c0 .6.4 1 1 1h12c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H6Z"/></svg>',upload:'<svg width="24" height="24"><path d="M18 19v-2a1 1 0 0 1 2 0v3c0 .6-.4 1-1 1H5a1 1 0 0 1-1-1v-3a1 1 0 0 1 2 0v2h12ZM11 6.4 8.7 8.7a1 1 0 0 1-1.4-1.4l4-4a1 1 0 0 1 1.4 0l4 4a1 1 0 1 1-1.4 1.4L13 6.4V16a1 1 0 0 1-2 0V6.4Z" fill-rule="nonzero"/></svg>',"add-file":'<svg height="24" width="24"><path d="M2 7h2V4h3V2H4a2 2 0 0 0-2 2zm20 0h-2V4h-3V2h3a2 2 0 0 1 2 2zm0 2h-2v6h2zm0 8h-2v3h-3v2h3a2 2 0 0 0 2-2zM2 9h2v6H2zm0 8h2v3h3v2H4a2 2 0 0 1-2-2zm7 5v-2h6v2zm6-20v2H9V2zM6 17h12l-4-5-3 3.8-2-2.6z"/><path d="M2 7h2V4h3V2H4a2 2 0 0 0-2 2zm20 0h-2V4h-3V2h3a2 2 0 0 1 2 2zm0 2h-2v6h2zm0 8h-2v3h-3v2h3a2 2 0 0 0 2-2zM2 9h2v6H2zm0 8h2v3h3v2H4a2 2 0 0 1-2-2zm7 5v-2h6v2zm6-20v2H9V2zM6 17h12l-4-5-3 3.8-2-2.6z"/><path d="M6 17h12l-4-5-3 3.8-2-2.6z"/><path d="M6 17h12l-4-5-3 3.8-2-2.6z"/><path d="M6 17h12l-4-5-3 3.8-2-2.6z"/><path d="M6 17h12l-4-5-3 3.8-2-2.6z"/></svg>',adjustments:'<svg width="24" height="24"><path d="M16 11a3 3 0 1 1 2.8-4H21v2h-2.2a3 3 0 0 1-2.8 2Zm0-2a1 1 0 1 1 0-2 1 1 0 0 1 0 2ZM3 9h8V7H3v2Zm5 10a3 3 0 1 0-2.8-4H3v2h2.2A3 3 0 0 0 8 19Zm0-2a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm13 0h-8v-2h8v2Z"/></svg>',"alt-text":'<svg width="24" height="24"><path d="M3 20a2 2 0 0 1-1.4-.6A2 2 0 0 1 1 18V6c0-.6.2-1 .6-1.4A2 2 0 0 1 3 4h18c.6 0 1 .2 1.4.6.4.4.6.9.6 1.4v12c0 .6-.2 1-.6 1.4a2 2 0 0 1-1.4.6H3Zm0-2h18V6H3v12Zm1.5-3H6v-1.5h1.5V15H9v-5a1 1 0 0 0-.3-.7A1 1 0 0 0 8 9H5.5a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7v5ZM6 12v-1.5h1.5V12H6Z"/><path d="M11 15V9h1.3v4.5h2V15H11Zm5.8-4.5V15h1.4v-4.5h1.3V9h-4v1.5h1.3Z"/></svg>',"auto-image-enhancement":'<svg width="24" height="24"><path d="M7.7 10.6a5.8 5.8 0 0 0 5.7 5.7A5.8 5.8 0 0 0 7.7 22 5.8 5.8 0 0 0 2 16.3a5.8 5.8 0 0 0 5.7-5.7ZM15.5 2c.3 3 3.3 6 6.5 6.4-3.2.5-6.2 3.4-6.5 6.5-.3-3.4-3-6-6.4-6.5 3.3-.5 6.1-3 6.4-6.4Z"/></svg>',blur:'<svg width="24" height="24"><path d="M19.3 9.3a1 1 0 0 0-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3s.5-.1.7-.3a1 1 0 0 0 .3-.7 1 1 0 0 0-.3-.7A1 1 0 0 0 20 9a1 1 0 0 0-.7.3Zm-16 0a1 1 0 0 0-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3s.5-.1.7-.3A1 1 0 0 0 5 10a1 1 0 0 0-.3-.7A1 1 0 0 0 4 9a1 1 0 0 0-.7.3Zm16 6a1 1 0 0 0-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3s.5-.1.7-.3a1 1 0 0 0 .3-.7 1 1 0 0 0-.3-.7 1 1 0 0 0-.7-.3 1 1 0 0 0-.7.3Zm-16 0a1 1 0 0 0-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3s.5-.1.7-.3A1 1 0 0 0 5 16a1 1 0 0 0-.3-.7A1 1 0 0 0 4 15a1 1 0 0 0-.7.3Zm5-11A1 1 0 0 0 8 5a1 1 0 0 0 1 1c.3 0 .5-.1.7-.3A1 1 0 0 0 10 5a1 1 0 0 0-.3-.7A1 1 0 0 0 9 4a1 1 0 0 0-.7.3Zm6 0a1 1 0 0 0-.3.7 1 1 0 0 0 1 1c.3 0 .5-.1.7-.3A1 1 0 0 0 16 5a1 1 0 0 0-.3-.7A1 1 0 0 0 15 4a1 1 0 0 0-.7.3Zm-6 16a1 1 0 0 0-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3s.5-.1.7-.3a1 1 0 0 0 .3-.7 1 1 0 0 0-.3-.7A1 1 0 0 0 9 20a1 1 0 0 0-.7.3Zm6 0a1 1 0 0 0-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3s.5-.1.7-.3a1 1 0 0 0 .3-.7 1 1 0 0 0-.3-.7 1 1 0 0 0-.7-.3 1 1 0 0 0-.7.3ZM7.6 8.6A2 2 0 0 0 7 10c0 .6.2 1 .6 1.4.4.4.8.6 1.4.6s1-.2 1.4-.6c.4-.4.6-.8.6-1.4s-.2-1-.6-1.4A2 2 0 0 0 9 8a2 2 0 0 0-1.4.6Zm0 6A2 2 0 0 0 7 16c0 .6.2 1 .6 1.4.4.4.8.6 1.4.6s1-.2 1.4-.6c.4-.4.6-.8.6-1.4s-.2-1-.6-1.4A2 2 0 0 0 9 14a2 2 0 0 0-1.4.6Zm6-6A2 2 0 0 0 13 10c0 .6.2 1 .6 1.4.4.4.8.6 1.4.6s1-.2 1.4-.6c.4-.4.6-.8.6-1.4s-.2-1-.6-1.4A2 2 0 0 0 15 8a2 2 0 0 0-1.4.6Zm0 6A2 2 0 0 0 13 16c0 .6.2 1 .6 1.4.4.4.8.6 1.4.6s1-.2 1.4-.6c.4-.4.6-.8.6-1.4s-.2-1-.6-1.4A2 2 0 0 0 15 14a2 2 0 0 0-1.4.6Z"/></svg>',box:'<svg width="24" height="24"><path d="M3.8 7a1 1 0 0 0-.7.6l-.1 3V13.8a3.5 3.5 0 0 0 4 2.7c.8-.2 1.4-.5 2-1l.3-.3.3.2c.7.7 1.4 1 2.4 1.1 1.2 0 2.4-.6 3-1.6.9-1.2.8-2.8 0-4a3.7 3.7 0 0 0-2-1.2c-.4-.1-1.2-.1-1.6 0a3.4 3.4 0 0 0-1.7 1l-.3.2-.2-.1c-.4-.5-1.2-1-2-1.1-.6-.2-1.5 0-2 .2H5V9c0-1.3 0-1.3-.3-1.6a1 1 0 0 0-1-.3Zm12 2.6c-.3.2-.5.4-.6.8v.6l.9 1 .7 1v.1l-.8 1-.7 1a1 1 0 0 0 0 .7 1 1 0 0 0 1.3.6c.2 0 .3-.2 1-1l.5-.7.6.8.7.8c.4.3 1 .3 1.3 0l.2-.3a1 1 0 0 0 0-.8l-.8-1.2-.7-1a26 26 0 0 0 1.5-2 .8.8 0 0 0 .1-.4c0-.4-.1-.7-.5-.9H20c-.4 0-.5 0-1.2.8l-.7.8-.6-.7-.7-.9a1 1 0 0 0-1 0Zm-9 2 .4.1c.3.1.6.5.7.8l.1.6v.6c-.6 1-2 1.2-2.7.3-.3-.3-.3-.5-.3-1v-.5c.3-.5.7-.8 1.1-1a1.5 1.5 0 0 1 .7 0Zm5.7 0c.4 0 .8.4 1 .8l.2.6-.1.7c-.5.9-1.6 1.1-2.4.6a1.4 1.4 0 0 1-.6-1.1 1.4 1.4 0 0 1 .5-1.2 1.5 1.5 0 0 1 1.4-.4Z"/></svg>',camera:'<svg height="24" width="24"><g clip-rule="evenodd" fill-rule="evenodd"><path d="M10 5.4a1 1 0 0 1 .8-.4h4.4a1 1 0 0 1 .8.4l1.2 1.8h2.3A2.5 2.5 0 0 1 22 9.6v8a2.5 2.5 0 0 1-2.5 2.5h-13A2.5 2.5 0 0 1 4 17.6v-8a2.5 2.5 0 0 1 2.5-2.4h2.3zM11.4 7l-1.2 1.7a1 1 0 0 1-.8.5h-3a.5.5 0 0 0-.4.4v8a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-8a.5.5 0 0 0-.5-.4h-2.9a1 1 0 0 1-.8-.5L14.6 7z"/><path d="M13 11.4a2 2 0 1 0 0 3.8 2 2 0 0 0 0-3.8zm-4 1.9a4 4 0 1 1 8 0 4 4 0 0 1-8 0z"/></g></svg>',caption:'<svg height="24" width="24"><path d="M6 16h8v-2H6zm10 0h2v-2h-2zM4 20a2 2 0 0 1-1.5-.6A2 2 0 0 1 2 18V6c0-.6.2-1 .6-1.4A2 2 0 0 1 4 4h16c.6 0 1 .2 1.4.6.4.4.6.9.6 1.4v12c0 .6-.2 1-.6 1.4a2 2 0 0 1-1.4.6zm0-2h16V6H4z"/></svg>',dropbox:'<svg height="24" width="24"><path clip-rule="evenodd" d="m6.4 9.3-3-2a1 1 0 0 1 0-1.6l4-2.5a1 1 0 0 1 1 0L12 5.5l3.6-2.3a1 1 0 0 1 1 0l4 2.5a1 1 0 0 1 0 1.7l-3 1.9 3 1.9a1 1 0 0 1 0 1.6l-2.9 1.9V16c0 .3-.1.6-.4.8l-4.5 3a1 1 0 0 1-1.2 0l-4.4-3a1 1 0 0 1-.5-.9v-1l-3.2-2.2a1 1 0 0 1 0-1.6zm3 0L12 7.5l2.6 1.8L12 11zM8.9 15v.4l3.3 2.3 3.4-2.3v-.2L12 13l-3.1 2zm-1-10-2 1.4 2 1.3 2-1.3zm8.2 0-2 1.4 2 1.3 2-1.3zm-2 6.9 2-1.3 2 1.3-2 1.3-2-1.3zm-8.3 0 2-1.3L10 12l-2 1.3-2-1.3z" fill-rule="evenodd"/></svg>',evernote:'<svg width="24" height="24"><path fill-rule="evenodd" d="m9.5 3-.3.1-2.6 2.6C3.8 8.5 4 8.2 4 8.7c0 1.3.3 3 .6 4.3.5 2 1.1 3.2 2 3.7l1.2.3c1 .2 1.5.2 2.2.2 1.3 0 1.7 0 2.2-.4.3-.2.3-.4.4-1a38.4 38.4 0 0 1 .3-.4l.3.1 1.8.1h1.6v-1.8H14l-.1-.2a6.8 6.8 0 0 1-.5-1c-.2-.4-.3-.6-.5-.7a.8.8 0 0 0-.5-.1.9.9 0 0 0-.8.5l-.4 1.6-.3 1.5H9.4l-2-.3a1 1 0 0 1-.1-.2A10.1 10.1 0 0 1 6 9.7v-.2h4l.5-.5V5H12c.4.2.7.7.8 1.1a1 1 0 0 0 .2.6c.2.2.3.2 1 .3 1.2 0 2 .2 2.5.6.4.2.8.7 1 1.2.3 1.2.5 4 .3 6.4 0 1.8-.4 3.4-.8 4h-.7a8 8 0 0 1-.8 0c-.2 0-.3-.3-.2-.5a.5.5 0 0 1 .4-.3h.9v-1.8H16c-.7 0-.9 0-1.2.2-.9.4-1.4 1.2-1.4 2.1l.1.4.1.2a1 1 0 0 1 .1.2c.3.7.8 1.2 1.4 1.3l1.2.1h1.2a2 2 0 0 0 1-.8 9 9 0 0 0 1.1-4.3c.2-3 0-6.3-.4-7.7A4.3 4.3 0 0 0 16 5.3a7 7 0 0 0-1.3-.2 7.2 7.2 0 0 1-.4 0 5.5 5.5 0 0 1 0-.3c-.2-.5-.6-1-1.2-1.4a3 3 0 0 0-.5-.2c-.4-.2-.5-.2-1.8-.2a26.5 26.5 0 0 0-1.3 0Zm-.8 4v.7H7.2l.7-.8.8-.7v.7Zm7 3.5c-.4 0-.7.5-.9 1v.7h.3c.7 0 1.1.2 1.5.6l.3.2.3-.6V11a1 1 0 0 0-.6-.4 2 2 0 0 0-.8 0Z" clip-rule="evenodd"/></svg>',exposure:'<svg width="24" height="24"><path d="M5 21a2 2 0 0 1-1.4-.6A2 2 0 0 1 3 19V5c0-.6.2-1 .6-1.4A2 2 0 0 1 5 3h14c.6 0 1 .2 1.4.6.4.4.6.8.6 1.4v14c0 .6-.2 1-.6 1.4a2 2 0 0 1-1.4.6H5Zm0-2h14V5L5 19Zm9.5-1v-2h-2v-1.5h2v-2H16v2h2V16h-2v2h-1.5ZM6 8.5h5V7H6v1.5Z"/></svg>',fb:'<svg width="24" height="24"><path fill-rule="evenodd" d="M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-11 6.7V14H8.1v-2.5h2v-1C10 8.2 11.5 7 12.8 7H16v2.5h-2.4c-.8 0-1 .7-1 1.3v.7h3.2l-1 2.5h-2v5a7 7 0 1 0-2.8-.2Z" clip-rule="evenodd"/></svg>',flickr:'<svg width="24" height="24"><path d="M8.2 15.3c1.7 0 3.1-1.4 3.1-3.1A3.2 3.2 0 0 0 8.1 9 3.2 3.2 0 0 0 5 12.2c0 1.7 1.4 3 3.2 3Zm7.6 0c1.7 0 3.2-1.4 3.2-3.1a3.2 3.2 0 0 0-6.3 0c0 1.7 1.4 3 3.1 3Z"/></svg>',folder:'<svg width="24" height="24"><path fill-rule="evenodd" d="M5.6 6a.6.6 0 0 0-.6.6v11.2a.6.6 0 0 0 .6.6h12.8a.6.6 0 0 0 .6-.6V9a.6.6 0 0 0-.6-.6h-7.2a1 1 0 0 1-.8-.4L9 6H5.6ZM3.8 4.8A2.6 2.6 0 0 1 5.6 4h4a1 1 0 0 1 .8.4l1.3 2h6.7A2.6 2.6 0 0 1 21 9v8.8a2.6 2.6 0 0 1-2.6 2.6H5.6A2.6 2.6 0 0 1 3 17.8V6.6c0-.7.3-1.4.8-1.8Z" clip-rule="evenodd"/></svg>',"google-drive":'<svg height="24" width="24"><path clip-rule="evenodd" d="M8.7 4.5a1 1 0 0 1 .9-.5h4.8a1 1 0 0 1 .9.5l5.6 9.7a1 1 0 0 1 0 1l-2.4 4.2a1 1 0 0 1-.9.5H6.4a1 1 0 0 1-.9-.5l-2.4-4.2a1 1 0 0 1 0-1zM10.2 6l-4.5 7.7h2.5L12.7 6h-2.5zm4.2 1 4.4 7.7-1.2 2.2-4.4-7.7zM12 11.2l-1.5 2.5h3zm2.6 4.5H5.7L7 17.9h8.9l-1.3-2.2z" fill-rule="evenodd"/></svg>',"google-photos":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12.4 3c-.8 0-1.4.7-1.4 1.4v3.2a5 5 0 0 0-8 4c0 .8.6 1.4 1.4 1.4h3.2a5 5 0 0 0-1 3 5 5 0 0 0 5 5c.8 0 1.4-.6 1.4-1.4v-3.2a5 5 0 0 0 8-4c0-.8-.7-1.4-1.4-1.4h-3.2a5 5 0 0 0-4-8Zm.6 8V5a3 3 0 0 1 2.4 3 3 3 0 0 1-2.4 3Zm-2 0H5a3 3 0 0 1 3-2.4 3 3 0 0 1 3 2.4Zm2 2a3 3 0 0 0 3 2.4 3 3 0 0 0 3-2.4h-6Zm-4.4 3a3 3 0 0 1 2.4-3v6a3 3 0 0 1-2.4-3Z" clip-rule="evenodd"/></svg>',grayscale:'<svg height="24" width="24"><path d="M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zm12.4 0H19v3.6zm-2.8 0h-2.2l8.6 8.6v-2.2zm-5 0H5l14 14v-2.6z" fill-rule="evenodd"/></svg>',huddle:'<svg height="24" width="24"><path d="M10.3 5.6V8h.8v-2l3.5 2 4.3-2.5L14.6 3l-4.3 2.6zM14.6 8v5.2l4.3-2.6V5.6L14.6 8zM6 13.3v2.5h.9v-2l3.4 2 4.3-2.5-4.3-2.6zm4.3 2.6V21l4.3-2.6v-5.1l-4.3 2.6z"/></svg>',"image-decorative":'<svg width="24" height="24"><path d="M12 10c.3 0 .5-.1.7-.3A1 1 0 0 0 13 9a1 1 0 0 0-.3-.7A1 1 0 0 0 12 8a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7 1 1 0 0 0 1 1Zm0 6a3 3 0 0 1-1.8-.5A3 3 0 0 1 9.1 14a2 2 0 0 0-.2 0 3 3 0 0 1-2.5-1 3 3 0 0 1-.9-2.2A3 3 0 0 1 6.2 9a3.4 3.4 0 0 1-.5-1 3 3 0 0 1-.2-1 3 3 0 0 1 1-2.2A3 3 0 0 1 8.8 4H9a3 3 0 0 1 1.1-1.4A3 3 0 0 1 12 2a3 3 0 0 1 1.8.5c.5.4.9.9 1.1 1.5h.2a3 3 0 0 1 2.5.8 3 3 0 0 1 .9 2.3c0 .3 0 .7-.2 1a2.8 2.8 0 0 1-.5.9l.5 1 .2 1a3 3 0 0 1-1 2.2 3 3 0 0 1-2.4.9 1.8 1.8 0 0 0-.2 0 3 3 0 0 1-1.1 1.4 3 3 0 0 1-1.8.5Zm0 7a8.7 8.7 0 0 1 .7-3.5 9.2 9.2 0 0 1 2-2.8 9.2 9.2 0 0 1 2.8-2A8.6 8.6 0 0 1 21 14a8.6 8.6 0 0 1-.7 3.5 9.2 9.2 0 0 1-2 2.8 9.2 9.2 0 0 1-2.8 2 8.6 8.6 0 0 1-3.5.7Zm2.5-2.5a6.8 6.8 0 0 0 2.4-1.5 6.8 6.8 0 0 0 1.7-2.6c-1 .4-1.8 1-2.6 1.7a6.8 6.8 0 0 0-1.5 2.4ZM12 23a8.6 8.6 0 0 0-.7-3.5 9.2 9.2 0 0 0-2-2.9 9.2 9.2 0 0 0-2.8-1.9A8.6 8.6 0 0 0 3 14a8.7 8.7 0 0 0 .7 3.5 9.2 9.2 0 0 0 2 2.9 9.2 9.2 0 0 0 2.8 1.9 8.6 8.6 0 0 0 3.5.7Zm-2.5-2.5A6.8 6.8 0 0 1 7.2 19a6.8 6.8 0 0 1-1.6-2.6c.9.4 1.7 1 2.5 1.7a6.8 6.8 0 0 1 1.6 2.4Zm5.9-8.4c.3 0 .5-.1.8-.4.2-.2.3-.5.3-.8 0-.2 0-.4-.2-.6a1.3 1.3 0 0 0-.5-.4l-.8-.4a3 3 0 0 1-.2.5 3.8 3.8 0 0 1-.2.5 2.5 2.5 0 0 1-.3.4 4 4 0 0 1-.4.4l.8.6a.8.8 0 0 0 .3.1h.4ZM15 8.5l.8-.4.5-.4.2-.6a1.1 1.1 0 0 0-.3-.8 1 1 0 0 0-.8-.4 1.1 1.1 0 0 0-.7.2l-.8.6.4.4.3.4a3.9 3.9 0 0 1 .4 1Zm-4-2.3a2.7 2.7 0 0 1 1-.2 2.7 2.7 0 0 1 1 .2l.2-1.1c0-.3-.1-.6-.4-.8A1.2 1.2 0 0 0 12 4c-.3 0-.6.1-.8.3-.3.2-.4.5-.3.8v1.1Zm1 7.8c.3 0 .6-.1.8-.3.3-.2.4-.5.3-.8v-1.1a2.7 2.7 0 0 1-1.1.2 2.7 2.7 0 0 1-1-.2l-.2 1.1c0 .3.1.6.4.8.2.2.5.3.8.3ZM9 8.5a3 3 0 0 1 .4-1l.3-.4.4-.4-.8-.6A.9.9 0 0 0 9 6a1.2 1.2 0 0 0-.3 0c-.4 0-.6 0-.9.3a1.1 1.1 0 0 0-.3.8c0 .2 0 .4.2.6l.5.4.9.4Zm-.3 3.6H9l.3-.2.8-.6a5.5 5.5 0 0 1-.4-.4 2.1 2.1 0 0 1-.3-.4 3.8 3.8 0 0 1-.2-.5 3 3 0 0 1-.1-.5l-1 .4-.4.4a1.1 1.1 0 0 0-.2.6c0 .3.2.6.4.8.2.2.4.4.7.4Z"/></svg>',"image-enhancements":'<svg height="24" width="24"><path d="M5.3 21a2 2 0 0 1-1.5-.6 2 2 0 0 1-.6-1.4V5c0-.6.2-1 .6-1.4A2 2 0 0 1 5.2 3H13v2H5.2v14h14v-8h2v8c0 .6-.1 1-.5 1.4a2 2 0 0 1-1.4.6z"/><path d="M11 9a4 4 0 0 0 4 4 4 4 0 0 0-4 4 4 4 0 0 0-4-4 4 4 0 0 0 4-4zm5.5-6c.2 2.1 2.2 4.1 4.5 4.5-2.3.4-4.3 2.4-4.5 4.5A5.2 5.2 0 0 0 12 7.5 5.2 5.2 0 0 0 16.5 3z"/></svg>',instagram:'<svg height="24" width="24"><path clip-rule="evenodd" d="M10.1 9a4 4 0 1 1 4.4 6.6A4 4 0 0 1 10.1 9zm2.2 1.3a2 2 0 1 0 0 4 2 2 0 0 0 0-4z" fill-rule="evenodd"/><path d="M16 9.3a1.3 1.3 0 1 0 0-2.6 1.3 1.3 0 0 0 0 2.6z"/><path clip-rule="evenodd" d="M3 6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3zm3-1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1z" fill-rule="evenodd"/></svg>',onedrive:'<svg height="24" width="24"><path d="M4 13.7h1zm16 .7h-1zm-11.7-4A4.4 4.4 0 0 1 12.1 8V6a6.4 6.4 0 0 0-5.6 3.4l1.8 1zM12.1 8c2 0 3.6 1.4 4 2.8l2-.5A6.3 6.3 0 0 0 12 6v2zm8.1 6.8-9.8-5.5-1 1.8 9.8 5.5 1-1.8zm-9.8-5.5A5 5 0 0 0 3 13.7h2A3 3 0 0 1 9.5 11l1-1.8zM3 13.7a5 5 0 0 0 1 2.8l1.5-1.1a3 3 0 0 1-.5-1.7zm15.8 1.6a2.3 2.3 0 0 1-2 1.4v2a4.3 4.3 0 0 0 3.9-2.6zm-2 1.4H8v2h8.7zm-8.8 0a3 3 0 0 1-2.5-1.3L4 16.5a5 5 0 0 0 4 2.2v-2zm12.7-.6c.2-.6.3-1.1.3-1.7h-2c0 .3 0 .6-.2.9zm.3-1.7c0-3-3.1-5.1-6-4l.8 1.9a2.3 2.3 0 0 1 3.2 2h2zm-6-4L4.4 15l.8 1.9 10.7-4.6-.7-1.8z"/></svg>',"photo-filter":'<svg height="24" width="24"><path d="M4.4 21c-.3 0-.6-.2-.9-.5-.3-.3-.4-.6-.5-.9L19.6 3c.3 0 .6.3.9.5l.5.9zM3 14.7v-2.8L11.9 3h2.8zM3 7V5c0-.6.2-1 .6-1.4A2 2 0 0 1 5 3h2zm14 14 4-4v2c0 .6-.2 1-.6 1.4a2 2 0 0 1-1.4.6zm-7.7 0L21 9.3v2.8L12 21z"/></svg>',"revert-changes":'<svg height="24" width="24"><path d="m8.9 18.8.4 3.2H13v-2h-2v-2.6a4.6 4.6 0 0 1-1.6-.6 5.9 5.9 0 0 1-1.3-1l-2.5 1-1-1.7 2.2-1.6a4 4 0 0 1-.2-.7 5.9 5.9 0 0 1 0-.8v-.8l.2-.8-2.2-1.6 1-1.7 2.5 1a6 6 0 0 1 1.2-.9l1.4-.6.4-2.6h2l.3 2.6A5.6 5.6 0 0 1 16 8.2l2.5-1 1 1.6-2.2 1.7.2.7v.8a5 5 0 0 1 0 1h2a2.6 2.6 0 0 0 0-.5V11.3l2.6-2-2.8-4.7-3 1.3a8.2 8.2 0 0 0-.5-.4 3.8 3.8 0 0 0-.6-.3L14.8 2H9.3l-.4 3.2a5 5 0 0 0-1.2.7l-3-1.3L2 9.4l2.6 2V12.6l-2.6 2 2.7 4.7 3-1.3a8 8 0 0 0 1.2.7z"/><path d="m14.5 20.3 2.1-2-2.1-2.2 1.4-1.4 2.1 2.1 2.1-2 1.4 1.3-2 2.1 2 2.1-1.4 1.4-2.1-2-2.1 2zM12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/></svg>',saturation:'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 20.5a6 6 0 1 1-5.9-10.2 6 6 0 1 1 11.8 0A6 6 0 1 1 12 20.5Zm-1.1-7.7a6 6 0 0 0-.2.3 4.3 4.3 0 0 1-2-1.3c.9.1 1.6.5 2.2 1Zm2.4.3a6 6 0 0 0-.2-.3 4.3 4.3 0 0 1 2.2-1 4.3 4.3 0 0 1-2 1.3ZM12.2 15a6.3 6.3 0 0 1-.4 0 4.3 4.3 0 0 0 .2 2.5 4.3 4.3 0 0 0 .2-2.5Zm.9 4.2a6 6 0 0 0 .8-4.5 6 6 0 0 0 3.4-2.8 4.3 4.3 0 0 1-1.3 8.4 4.3 4.3 0 0 1-2.9-1.1Zm-2.2 0a4.3 4.3 0 1 1-4.2-7.3 6 6 0 0 0 3.4 2.8 6 6 0 0 0 .8 4.5Zm-3-9.2a4.3 4.3 0 1 1 8.3 0 6 6 0 0 0-4.2 1.5A6 6 0 0 0 7.8 10Z"/></svg>',"transform-image":'<svg height="24" width="24"><path d="M3 21v-6h2V9H3V3h6v2h6V3h6v6h-2v6h2v6h-6v-2H9v2zm6-4h6v-2h2V9h-2V7H9v2H7v6h2zM5 7h2V5H5zm12 0h2V5h-2zm0 12h2v-2h-2zM5 19h2v-2H5z"/></svg>',vibrance:'<svg height="24" width="24"><path d="M12 20 22 4H2zm2.6-8 1.3-2H8l1.3 2h5.2zm-1.2 2h-2.8l1.4 2.2zm5-8L17 8H7L5.6 6h12.8z" fill-rule="evenodd"/></svg>',vk:'<svg width="24" height="24"><path fill-rule="evenodd" d="M14.8 17.4a2 2 0 0 1-1.3.7 8 8 0 0 1-7.7-3.6c-1.4-2-2.2-4.4-2.6-5.7L3 8.6A2 2 0 0 1 5 6h2.5c.4 0 .8.1 1.2.4A2 2 0 0 1 9.8 6h3.5a2 2 0 0 1 1.4.6 2 2 0 0 1 1.5-.6h2.4a2 2 0 0 1 2 2.5c-.5 1.5-1.2 2.6-1.8 3.6a12.5 12.5 0 0 1 2 3.2A2 2 0 0 1 19 18h-2.6a2 2 0 0 1-1.3-.5 6.9 6.9 0 0 1-.3-.2Zm.5-2.5-1.2-1a3 3 0 0 0-.8-.2v2.4h-1.7a5.6 5.6 0 0 1-.3 0c-3-.7-4.7-3.7-5.6-6.1A38.1 38.1 0 0 1 5 8.1V8h2.5a80.5 80.5 0 0 1 1.2 2.5c.6 1.2 1.2 2 2 2.1V9l-.9-1h3.5v4.1a5 5 0 0 0 .4-.3c.7-.7 1.2-1.4 1.6-2.2l.2-.3.7-1.3h2.4a8.5 8.5 0 0 1-.8 2l-1.3 2-.3.3a10.5 10.5 0 0 1 2.8 3.8h-2.6l-.8-.9a20.6 20.6 0 0 0-.3-.3Z" clip-rule="evenodd"/></svg>',warmth:'<svg height="24" width="24"><path d="M12 21.1c-1.4 0-2.6-.5-3.6-1.5s-1.5-2.1-1.5-3.5c0-.8.2-1.6.6-2.2A5 5 0 0 1 8.9 12v-6c0-.8.3-1.5 1-2.1a2.9 2.9 0 0 1 2-.9c.9 0 1.6.3 2.2.9.5.6.8 1.3.8 2.1v6a5 5 0 0 1 1.5 1.8A4.9 4.9 0 0 1 17 16c0 1.4-.5 2.6-1.4 3.5s-2.2 1.5-3.6 1.5zm-3-5h6c0-.5-.2-1-.4-1.4a3 3 0 0 0-.9-1l-.8-.6v-7a1 1 0 0 0-.3-.7A1 1 0 0 0 12 5a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7v7l-.8.6a2.9 2.9 0 0 0-.9 1 3 3 0 0 0-.3 1.4z"/></svg>',user:'<svg width="24" height="24"><path d="M12 24a12 12 0 1 1 0-24 12 12 0 0 1 0 24Zm-8.7-5.3a11 11 0 0 0 17.4 0C19.4 16.3 14.6 15 12 15c-2.6 0-7.4 1.3-8.7 3.7ZM12 13c2.2 0 4-2 4-4.5S14.2 4 12 4 8 6 8 8.5 9.8 13 12 13Z" fill-rule="nonzero"/></svg>',"vertical-align":'<svg width="24" height="24"><g fill-rule="nonzero"><rect width="18" height="2" x="3" y="11" rx="1"/><path d="M12 2c.6 0 1 .4 1 1v4l2-1.3a1 1 0 0 1 1.2 1.5l-.1.1-4.1 3-4-3a1 1 0 0 1 1-1.7l2 1.5V3c0-.6.4-1 1-1zm0 11.8 4 2.9a1 1 0 0 1-1 1.7l-2-1.5V21c0 .5-.4 1-.9 1H12a1 1 0 0 1-1-1v-4l-2 1.3a1 1 0 0 1-1.2-.1l-.1-.1a1 1 0 0 1 .1-1.3l.1-.1 4.1-3z"/></g></svg>',visualblocks:'<svg width="24" height="24"><path d="M9 19v2H7v-2h2Zm-4 0v2a2 2 0 0 1-2-2h2Zm8 0v2h-2v-2h2Zm8 0a2 2 0 0 1-2 2v-2h2Zm-4 0v2h-2v-2h2ZM15 7a1 1 0 0 1 0 2v7a1 1 0 0 1-2 0V9h-1v7a1 1 0 0 1-2 0v-4a2.5 2.5 0 0 1-.2-5H15ZM5 15v2H3v-2h2Zm16 0v2h-2v-2h2ZM5 11v2H3v-2h2Zm16 0v2h-2v-2h2ZM5 7v2H3V7h2Zm16 0v2h-2V7h2ZM5 3v2H3c0-1.1.9-2 2-2Zm8 0v2h-2V3h2Zm6 0a2 2 0 0 1 2 2h-2V3ZM9 3v2H7V3h2Zm8 0v2h-2V3h2Z" fill-rule="evenodd"/></svg>',visualchars:'<svg width="24" height="24"><path d="M10 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 6.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L10 5Z" fill-rule="evenodd"/></svg>',warning:'<svg width="24" height="24"><path d="M19.8 18.3c.2.5.3.9 0 1.2-.1.3-.5.5-1 .5H5.2c-.5 0-.9-.2-1-.5-.3-.3-.2-.7 0-1.2L11 4.7l.5-.5.5-.2c.2 0 .3 0 .5.2.2 0 .3.3.5.5l6.8 13.6ZM12 18c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7a1 1 0 0 0-.3-.7 1 1 0 0 0-.7-.3 1 1 0 0 0-.7.3 1 1 0 0 0-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3Zm.7-3 .3-4a1 1 0 0 0-.3-.7 1 1 0 0 0-.7-.3 1 1 0 0 0-.7.3 1 1 0 0 0-.3.7l.3 4h1.4Z" fill-rule="evenodd"/></svg>',"zoom-in":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3Zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12Zm-1-9a1 1 0 0 1 2 0v6a1 1 0 0 1-2 0V8Zm-2 4a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2H8Z" fill-rule="nonzero"/></svg>',"zoom-out":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3Zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12Zm-3-5a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2H8Z" fill-rule="nonzero"/></svg>'}})},24401:(e,t,o)=>{o(75916)},29375:()=>{!function(){"use strict";const e=Object.getPrototypeOf,t=(e,t,o)=>{var n;return!!o(e,t.prototype)||(null===(n=e.constructor)||void 0===n?void 0:n.name)===t.name},o=e=>o=>(e=>{const o=typeof e;return null===e?"null":"object"===o&&Array.isArray(e)?"array":"object"===o&&t(e,String,(e,t)=>t.isPrototypeOf(e))?"string":o})(o)===e,n=e=>t=>typeof t===e,r=e=>t=>e===t,a=o("string"),s=o("object"),i=o=>((o,n)=>s(o)&&t(o,n,(t,o)=>e(t)===o))(o,Object),l=o("array"),c=r(null),d=n("boolean"),m=r(void 0),u=e=>null==e,g=e=>!u(e),p=n("function"),h=n("number"),f=(e,t)=>{if(l(e)){for(let o=0,n=e.length;o<n;++o)if(!t(e[o]))return!1;return!0}return!1},b=()=>{},x=e=>()=>e(),v=(e,t)=>(...o)=>e(t.apply(null,o)),y=e=>()=>e,w=e=>e,_=(e,t)=>e===t;function C(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const k=e=>t=>!e(t),S=e=>()=>{throw new Error(e)},E=e=>e(),O=y(!1),T=y(!0);class A{constructor(e,t){this.tag=e,this.value=t}static some(e){return new A(!0,e)}static none(){return A.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?A.some(e(this.value)):A.none()}bind(e){return this.tag?e(this.value):A.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:A.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return g(e)?A.some(e):A.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}A.singletonNone=new A(!1);const D=Array.prototype.slice,M=Array.prototype.indexOf,R=Array.prototype.push,N=(e,t)=>M.call(e,t),B=(e,t)=>N(e,t)>-1,z=(e,t)=>{for(let o=0,n=e.length;o<n;o++){if(t(e[o],o))return!0}return!1},H=(e,t)=>{const o=[];for(let n=0;n<e;n++)o.push(t(n));return o},L=(e,t)=>{const o=[];for(let n=0;n<e.length;n+=t){const r=D.call(e,n,n+t);o.push(r)}return o},I=(e,t)=>{const o=e.length,n=new Array(o);for(let r=0;r<o;r++){const o=e[r];n[r]=t(o,r)}return n},P=(e,t)=>{for(let o=0,n=e.length;o<n;o++){t(e[o],o)}},F=(e,t)=>{const o=[],n=[];for(let r=0,a=e.length;r<a;r++){const a=e[r];(t(a,r)?o:n).push(a)}return{pass:o,fail:n}},V=(e,t)=>{const o=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];t(r,n)&&o.push(r)}return o},Z=(e,t,o)=>(((e,t)=>{for(let o=e.length-1;o>=0;o--)t(e[o],o)})(e,(e,n)=>{o=t(o,e,n)}),o),U=(e,t,o)=>(P(e,(e,n)=>{o=t(o,e,n)}),o),j=(e,t)=>((e,t,o)=>{for(let n=0,r=e.length;n<r;n++){const r=e[n];if(t(r,n))return A.some(r);if(o(r,n))break}return A.none()})(e,t,O),W=(e,t)=>{for(let o=0,n=e.length;o<n;o++){if(t(e[o],o))return A.some(o)}return A.none()},$=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!l(e[o]))throw new Error("Arr.flatten item "+o+" was not an array, input: "+e);R.apply(t,e[o])}return t},q=(e,t)=>$(I(e,t)),G=(e,t)=>{for(let o=0,n=e.length;o<n;++o){if(!0!==t(e[o],o))return!1}return!0},K=e=>{const t=D.call(e,0);return t.reverse(),t},Y=(e,t)=>V(e,e=>!B(t,e)),X=(e,t)=>{const o={};for(let n=0,r=e.length;n<r;n++){const r=e[n];o[String(r)]=t(r,n)}return o},J=e=>[e],Q=(e,t)=>{const o=D.call(e,0);return o.sort(t),o},ee=(e,t)=>t>=0&&t<e.length?A.some(e[t]):A.none(),te=e=>ee(e,0),oe=e=>ee(e,e.length-1),ne=p(Array.from)?Array.from:e=>D.call(e),re=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome())return n}return A.none()},ae=Object.keys,se=Object.hasOwnProperty,ie=(e,t)=>{const o=ae(e);for(let n=0,r=o.length;n<r;n++){const r=o[n];t(e[r],r)}},le=(e,t)=>ce(e,(e,o)=>({k:o,v:t(e,o)})),ce=(e,t)=>{const o={};return ie(e,(e,n)=>{const r=t(e,n);o[r.k]=r.v}),o},de=e=>(t,o)=>{e[o]=t},me=(e,t,o,n)=>{ie(e,(e,r)=>{(t(e,r)?o:n)(e,r)})},ue=(e,t)=>{const o={};return me(e,t,de(o),b),o},ge=(e,t)=>{const o=[];return ie(e,(e,n)=>{o.push(t(e,n))}),o},pe=(e,t)=>{const o=ae(e);for(let n=0,r=o.length;n<r;n++){const r=o[n],a=e[r];if(t(a,r,e))return A.some(a)}return A.none()},he=e=>ge(e,w),fe=(e,t)=>be(e,t)?A.from(e[t]):A.none(),be=(e,t)=>se.call(e,t),xe=(e,t)=>be(e,t)&&void 0!==e[t]&&null!==e[t],ve=e=>{if(!l(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");const t=[],o={};return P(e,(n,r)=>{const a=ae(n);if(1!==a.length)throw new Error("one and only one name per case");const s=a[0],i=n[s];if(void 0!==o[s])throw new Error("duplicate key detected:"+s);if("cata"===s)throw new Error("cannot have a case named cata (sorry)");if(!l(i))throw new Error("case arguments must be an array");t.push(s),o[s]=(...o)=>{const n=o.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+s+". Expected "+i.length+" ("+i+"), got "+n);return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[r].apply(null,o)},match:e=>{const n=ae(e);if(t.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","));if(!G(t,e=>B(n,e)))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "));return e[s].apply(null,o)},log:e=>{console.log(e,{constructors:t,constructor:s,params:o})}}}}),o},ye=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},we=e=>{let t=A.none(),o=[];const n=e=>{r()?s(e):o.push(e)},r=()=>t.isSome(),a=e=>{P(e,s)},s=e=>{t.each(t=>{setTimeout(()=>{e(t)},0)})};return e(e=>{r()||(t=A.some(e),a(o),o=[])}),{get:n,map:e=>we(t=>{n(o=>{t(e(o))})}),isReady:r}},_e={nu:we,pure:e=>we(t=>{t(e)})},Ce=e=>{setTimeout(()=>{throw e},0)},ke=e=>{const t=t=>{e().then(t,Ce)};return{map:t=>ke(()=>e().then(t)),bind:t=>ke(()=>e().then(e=>t(e).toPromise())),anonBind:t=>ke(()=>e().then(()=>t.toPromise())),toLazy:()=>_e.nu(t),toCached:()=>{let t=null;return ke(()=>(null===t&&(t=e()),t))},toPromise:e,get:t}},Se=e=>ke(()=>new Promise(e)),Ee=e=>ke(()=>Promise.resolve(e)),Oe=e=>{const t=t=>t(e),o=y(e),n=()=>r,r={tag:!0,inner:e,fold:(t,o)=>o(e),isValue:T,isError:O,map:t=>Ae.value(t(e)),mapError:n,bind:t,exists:t,forall:t,getOr:o,or:n,getOrThunk:o,orThunk:n,getOrDie:o,each:t=>{t(e)},toOptional:()=>A.some(e)};return r},Te=e=>{const t=()=>o,o={tag:!1,inner:e,fold:(t,o)=>t(e),isValue:O,isError:T,map:t,mapError:t=>Ae.error(t(e)),bind:t,exists:O,forall:T,getOr:w,or:w,getOrThunk:E,orThunk:E,getOrDie:S(String(e)),each:b,toOptional:A.none};return o},Ae={value:Oe,error:Te,fromOption:(e,t)=>e.fold(()=>Te(t),Oe)},De=e=>({...e,toCached:()=>De(e.toCached()),bindFuture:t=>De(e.bind(e=>e.fold(e=>Ee(Ae.error(e)),e=>t(e)))),bindResult:t=>De(e.map(e=>e.bind(t))),mapResult:t=>De(e.map(e=>e.map(t))),mapError:t=>De(e.map(e=>e.mapError(t))),foldResult:(t,o)=>e.map(e=>e.fold(t,o)),withTimeout:(t,o)=>De(Se(n=>{let r=!1;const a=setTimeout(()=>{r=!0,n(Ae.error(o()))},t);e.get(e=>{r||(clearTimeout(a),n(e))})}))}),Me=e=>De(Se(e)),Re=Me,Ne="undefined"!=typeof window?window:Function("return this;")(),Be=(e,t,o,n)=>{const r=e+t;return r>n?o:r<o?n:r},ze=(e,t,o)=>Math.min(Math.max(e,t),o);let He=0;const Le=e=>{const t=(new Date).getTime(),o=Math.floor(window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967295*1e9);return He++,e+"_"+o+He+String(t)},Ie=e=>(...t)=>{if(0===t.length)throw new Error("Can't merge zero objects");const o={};for(let n=0;n<t.length;n++){const r=t[n];for(const t in r)be(r,t)&&(o[t]=e(o[t],r[t]))}return o},Pe=Ie((e,t)=>i(e)&&i(t)?Pe(e,t):t),Fe=Ie((e,t)=>t),Ve=(e,t,o=_)=>e.exists(e=>o(e,t)),Ze=e=>{const t=[],o=e=>{t.push(e)};for(let t=0;t<e.length;t++)e[t].each(o);return t},Ue=(e,t,o)=>e.isSome()&&t.isSome()?A.some(o(e.getOrDie(),t.getOrDie())):A.none(),je=(e,t)=>null!=e?A.some(t(e)):A.none(),We=(e,t)=>e?A.some(t):A.none(),$e=(e,t)=>((e,t)=>{let o=null!=t?t:Ne;for(let t=0;t<e.length&&null!=o;++t)o=o[e[t]];return o})(e.split("."),t);ve([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const qe=e=>{const t=ye(A.none()),o=()=>t.get().each(e);return{clear:()=>{o(),t.set(A.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{o(),t.set(A.some(e))}}},Ge=()=>qe(e=>e.unbind()),Ke=()=>{const e=qe(b);return{...e,on:t=>e.get().each(t)}},Ye=(e,t,o)=>""===t||e.length>=t.length&&e.substr(o,o+t.length)===t,Xe=(e,t)=>Qe(e,t)?((e,t)=>e.substring(t))(e,t.length):e,Je=(e,t,o=0,n)=>{const r=e.indexOf(t,o);return-1!==r&&(!!m(n)||r+t.length<=n)},Qe=(e,t)=>Ye(e,t,0),et=(e,t)=>Ye(e,t,e.length-t.length),tt=(e=>t=>t.replace(e,""))(/^\s+|\s+$/g),ot=e=>e.length>0,nt=e=>!ot(e),rt=(e,t)=>{let o=null;const n=()=>{c(o)||(clearTimeout(o),o=null)};return{cancel:n,throttle:(...r)=>{n(),o=setTimeout(()=>{o=null,e.apply(null,r)},t)}}},at=e=>{let t,o=!1;return(...n)=>(o||(o=!0,t=e.apply(null,n)),t)},st=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},it={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return st(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return st(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return st(o)},fromDom:st,fromPoint:(e,t,o)=>A.from(e.dom.elementFromPoint(t,o)).map(st)},lt=(e,t,o)=>{const n=e.document.createRange();var r;return r=n,t.fold(e=>{r.setStartBefore(e.dom)},(e,t)=>{r.setStart(e.dom,t)},e=>{r.setStartAfter(e.dom)}),((e,t)=>{t.fold(t=>{e.setEndBefore(t.dom)},(t,o)=>{e.setEnd(t.dom,o)},t=>{e.setEndAfter(t.dom)})})(n,o),n},ct=(e,t,o,n,r)=>{const a=e.document.createRange();return a.setStart(t.dom,o),a.setEnd(n.dom,r),a},dt=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}),mt=ve([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),ut=(e,t,o)=>t(it.fromDom(o.startContainer),o.startOffset,it.fromDom(o.endContainer),o.endOffset),gt=(e,t)=>{const o=((e,t)=>t.match({domRange:e=>({ltr:y(e),rtl:A.none}),relative:(t,o)=>({ltr:at(()=>lt(e,t,o)),rtl:at(()=>A.some(lt(e,o,t)))}),exact:(t,o,n,r)=>({ltr:at(()=>ct(e,t,o,n,r)),rtl:at(()=>A.some(ct(e,n,r,t,o)))})}))(e,t);return((e,t)=>{const o=t.ltr();if(o.collapsed)return t.rtl().filter(e=>!1===e.collapsed).map(e=>mt.rtl(it.fromDom(e.endContainer),e.endOffset,it.fromDom(e.startContainer),e.startOffset)).getOrThunk(()=>ut(0,mt.ltr,o));return ut(0,mt.ltr,o)})(0,o)},pt=(e,t)=>gt(e,t).match({ltr:(t,o,n,r)=>{const a=e.document.createRange();return a.setStart(t.dom,o),a.setEnd(n.dom,r),a},rtl:(t,o,n,r)=>{const a=e.document.createRange();return a.setStart(n.dom,r),a.setEnd(t.dom,o),a}});mt.ltr,mt.rtl;const ht=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},ft=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,bt=(e,t)=>{const o=void 0===t?document:t.dom;return ft(o)?A.none():A.from(o.querySelector(e)).map(it.fromDom)},xt=(e,t)=>e.dom===t.dom,vt=(e,t)=>{const o=e.dom,n=t.dom;return o!==n&&o.contains(n)},yt=()=>wt(0,0),wt=(e,t)=>({major:e,minor:t}),_t={nu:wt,detect:(e,t)=>{const o=String(t).toLowerCase();return 0===e.length?yt():((e,t)=>{const o=((e,t)=>{for(let o=0;o<e.length;o++){const n=e[o];if(n.test(t))return n}})(e,t);if(!o)return{major:0,minor:0};const n=e=>Number(t.replace(o,"$"+e));return wt(n(1),n(2))})(e,o)},unknown:yt},Ct=(e,t)=>{const o=String(t).toLowerCase();return j(e,e=>e.search(o))},kt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,St=e=>t=>Je(t,e),Et=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>Je(e,"edge/")&&Je(e,"chrome")&&Je(e,"safari")&&Je(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,kt],search:e=>Je(e,"chrome")&&!Je(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>Je(e,"msie")||Je(e,"trident")},{name:"Opera",versionRegexes:[kt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:St("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:St("firefox")},{name:"Safari",versionRegexes:[kt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(Je(e,"safari")||Je(e,"mobile/"))&&Je(e,"applewebkit")}],Ot=[{name:"Windows",search:St("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>Je(e,"iphone")||Je(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:St("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:St("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:St("linux"),versionRegexes:[]},{name:"Solaris",search:St("sunos"),versionRegexes:[]},{name:"FreeBSD",search:St("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:St("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Tt={browsers:y(Et),oses:y(Ot)},At="Edge",Dt="Chromium",Mt="Opera",Rt="Firefox",Nt="Safari",Bt=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isEdge:n(At),isChromium:n(Dt),isIE:n("IE"),isOpera:n(Mt),isFirefox:n(Rt),isSafari:n(Nt)}},zt={unknown:()=>Bt({current:void 0,version:_t.unknown()}),nu:Bt,edge:y(At),chromium:y(Dt),ie:y("IE"),opera:y(Mt),firefox:y(Rt),safari:y(Nt)},Ht="Windows",Lt="Android",It="Linux",Pt="macOS",Ft="Solaris",Vt="FreeBSD",Zt="ChromeOS",Ut=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isWindows:n(Ht),isiOS:n("iOS"),isAndroid:n(Lt),isMacOS:n(Pt),isLinux:n(It),isSolaris:n(Ft),isFreeBSD:n(Vt),isChromeOS:n(Zt)}},jt={unknown:()=>Ut({current:void 0,version:_t.unknown()}),nu:Ut,windows:y(Ht),ios:y("iOS"),android:y(Lt),linux:y(It),macos:y(Pt),solaris:y(Ft),freebsd:y(Vt),chromeos:y(Zt)},Wt=(e,t,o)=>{const n=Tt.browsers(),r=Tt.oses(),a=t.bind(e=>((e,t)=>re(t.brands,t=>{const o=t.brand.toLowerCase();return j(e,e=>{var t;return o===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())}).map(e=>({current:e.name,version:_t.nu(parseInt(t.version,10),0)}))}))(n,e)).orThunk(()=>((e,t)=>Ct(e,t).map(e=>{const o=_t.detect(e.versionRegexes,t);return{current:e.name,version:o}}))(n,e)).fold(zt.unknown,zt.nu),s=((e,t)=>Ct(e,t).map(e=>{const o=_t.detect(e.versionRegexes,t);return{current:e.name,version:o}}))(r,e).fold(jt.unknown,jt.nu),i=((e,t,o,n)=>{const r=e.isiOS()&&!0===/ipad/i.test(o),a=e.isiOS()&&!r,s=e.isiOS()||e.isAndroid(),i=s||n("(pointer:coarse)"),l=r||!a&&s&&n("(min-device-width:768px)"),c=a||s&&!l,d=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),m=!c&&!l&&!d;return{isiPad:y(r),isiPhone:y(a),isTablet:y(l),isPhone:y(c),isTouch:y(i),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:y(d),isDesktop:y(m)}})(s,a,e,o);return{browser:a,os:s,deviceType:i}},$t=e=>window.matchMedia(e).matches;let qt=at(()=>Wt(window.navigator.userAgent,A.from(window.navigator.userAgentData),$t));const Gt=()=>qt(),Kt=(e,t)=>{const o=((e,t)=>$e(e,t))(e,t);if(null==o)throw new Error(e+" not available on this browser");return o},Yt=Object.getPrototypeOf,Xt=e=>{const t=$e("ownerDocument.defaultView",e);return s(e)&&((e=>Kt("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(Yt(e).constructor.name))},Jt=e=>e.dom.nodeName.toLowerCase(),Qt=e=>t=>(e=>e.dom.nodeType)(t)===e,eo=e=>to(e)&&Xt(e.dom),to=Qt(1),oo=Qt(3),no=Qt(9),ro=Qt(11),ao=e=>t=>to(t)&&Jt(t)===e,so=e=>it.fromDom(e.dom.ownerDocument),io=e=>no(e)?e:so(e),lo=e=>it.fromDom(io(e).dom.documentElement),co=e=>it.fromDom(io(e).dom.defaultView),mo=e=>A.from(e.dom.parentNode).map(it.fromDom),uo=e=>A.from(e.dom.parentElement).map(it.fromDom),go=e=>A.from(e.dom.offsetParent).map(it.fromDom),po=e=>I(e.dom.childNodes,it.fromDom),ho=(e,t)=>{const o=e.dom.childNodes;return A.from(o[t]).map(it.fromDom)},fo=e=>ho(e,0),bo=(e,t)=>({element:e,offset:t}),xo=(e,t)=>{const o=po(e);return o.length>0&&t<o.length?bo(o[t],0):bo(e,t)},vo=(e,t,o,n)=>{const r=((e,t,o,n)=>{const r=so(e).dom.createRange();return r.setStart(e.dom,t),r.setEnd(o.dom,n),r})(e,t,o,n),a=xt(e,o)&&t===n;return r.collapsed&&!a},yo=e=>ro(e)&&g(e.dom.host),wo=e=>it.fromDom(e.dom.getRootNode()),_o=e=>yo(e)?e:it.fromDom(io(e).dom.body),Co=e=>{const t=wo(e);return yo(t)?A.some(t):A.none()},ko=e=>it.fromDom(e.dom.host),So=e=>g(e.dom.shadowRoot),Eo=e=>{const t=it.fromDom((e=>{if(g(e.target)){const t=it.fromDom(e.target);if(to(t)&&So(t)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return te(t)}}return A.from(e.target)})(e).getOr(e.target)),o=()=>e.stopPropagation(),n=()=>e.preventDefault(),r=v(n,o);return((e,t,o,n,r,a,s)=>({target:e,x:t,y:o,stop:n,prevent:r,kill:a,raw:s}))(t,e.clientX,e.clientY,o,n,r,e)},Oo=(e,t,o,n,r)=>{const a=((e,t)=>o=>{e(o)&&t(Eo(o))})(o,n);return e.dom.addEventListener(t,a,r),{unbind:C(To,e,t,a,r)}},To=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)},Ao=T,Do=(e,t,o)=>((e,t,o,n)=>Oo(e,t,o,n,!1))(e,t,Ao,o),Mo=(e,t,o)=>((e,t,o,n)=>Oo(e,t,o,n,!0))(e,t,Ao,o),Ro=Eo,No=()=>it.fromDom(document),Bo=(e,t=!1)=>e.dom.focus({preventScroll:t}),zo=e=>e.dom.blur(),Ho=e=>{const t=wo(e).dom;return e.dom===t.activeElement},Lo=(e=No())=>A.from(e.dom.activeElement).map(it.fromDom),Io=e=>Lo(wo(e)).filter(t=>e.dom.contains(t.dom)),Po=(e,t)=>{mo(e).each(o=>{o.dom.insertBefore(t.dom,e.dom)})},Fo=(e,t)=>{const o=(e=>A.from(e.dom.nextSibling).map(it.fromDom))(e);o.fold(()=>{mo(e).each(e=>{Zo(e,t)})},e=>{Po(e,t)})},Vo=(e,t)=>{fo(e).fold(()=>{Zo(e,t)},o=>{e.dom.insertBefore(t.dom,o.dom)})},Zo=(e,t)=>{e.dom.appendChild(t.dom)},Uo=(e,t)=>{P(t,t=>{Zo(e,t)})},jo=(e,t,o)=>{if(!(a(o)||d(o)||h(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")},Wo=(e,t,o)=>{jo(e.dom,t,o)},$o=(e,t)=>{const o=e.dom;ie(t,(e,t)=>{jo(o,t,e)})},qo=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},Go=(e,t)=>A.from(qo(e,t)),Ko=(e,t)=>{const o=e.dom;return!(!o||!o.hasAttribute)&&o.hasAttribute(t)},Yo=(e,t)=>{e.dom.removeAttribute(t)},Xo=e=>{e.dom.textContent="",P(po(e),e=>{Jo(e)})},Jo=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},Qo=(e,t)=>it.fromDom(e.dom.cloneNode(t)),en=e=>e.dom.innerHTML,tn=(e,t)=>{const o=so(e).dom,n=it.fromDom(o.createDocumentFragment()),r=((e,t)=>{const o=(t||document).createElement("div");return o.innerHTML=e,po(it.fromDom(o))})(t,o);Uo(n,r),Xo(e),Zo(e,n)},on=e=>{if(yo(e))return"#shadow-root";{const t=(e=>Qo(e,!1))(e);return(e=>{const t=it.fromTag("div"),o=it.fromDom(e.dom.cloneNode(!0));return Zo(t,o),en(t)})(t)}},nn=e=>new Promise((t,o)=>{const n=()=>{a(),t(e)},r=[Do(e,"load",n),Do(e,"error",()=>{a(),o("Unable to load data from image: "+e.dom.src)})],a=()=>P(r,e=>e.unbind());e.dom.complete&&n()}),rn=e=>void 0!==e.style&&p(e.style.getPropertyValue),an=e=>{const t=oo(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return Co(it.fromDom(t)).fold(()=>o.body.contains(t),(n=an,r=ko,e=>n(r(e))));var n,r},sn=()=>ln(it.fromDom(document)),ln=e=>{const t=e.dom.body;if(null==t)throw new Error("Body is not available yet");return it.fromDom(t)},cn=(e,t,o)=>{if(!a(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);rn(e)&&e.style.setProperty(t,o)},dn=(e,t)=>{rn(e)&&e.style.removeProperty(t)},mn=(e,t,o)=>{const n=e.dom;cn(n,t,o)},un=(e,t)=>{const o=e.dom;ie(t,(e,t)=>{cn(o,t,e)})},gn=(e,t)=>{const o=e.dom;ie(t,(e,t)=>{e.fold(()=>{dn(o,t)},e=>{cn(o,t,e)})})},pn=(e,t)=>{const o=e.dom,n=window.getComputedStyle(o).getPropertyValue(t);return""!==n||an(e)?n:hn(o,t)},hn=(e,t)=>rn(e)?e.style.getPropertyValue(t):"",fn=(e,t)=>{const o=e.dom,n=hn(o,t);return A.from(n).filter(e=>e.length>0)},bn=e=>{const t={},o=e.dom;if(rn(o))for(let e=0;e<o.style.length;e++){const n=o.style.item(e);t[n]=o.style[n]}return t},xn=(e,t,o)=>{const n=it.fromTag(e);mn(n,t,o);return fn(n,t).isSome()},vn=(e,t)=>{const o=e.dom;dn(o,t),Ve(Go(e,"style").map(tt),"")&&Yo(e,"style")},yn=e=>e.dom.offsetWidth,wn=(e,t)=>{const o=o=>{const n=t(o);if(n<=0||null===n){const t=pn(o,e);return parseFloat(t)||0}return n},n=(e,t)=>U(t,(t,o)=>{const n=pn(e,o),r=void 0===n?0:parseInt(n,10);return isNaN(r)?t:t+r},0);return{set:(t,o)=>{if(!h(o)&&!o.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+o);const n=t.dom;rn(n)&&(n.style[e]=o+"px")},get:o,getOuter:o,aggregate:n,max:(e,t,o)=>{const r=n(e,o);return t>r?t-r:0}}},_n=wn("height",e=>{const t=e.dom;return an(e)?t.getBoundingClientRect().height:t.offsetHeight}),Cn=e=>_n.get(e),kn=e=>_n.getOuter(e),Sn=e=>!(e=>e.offsetWidth<=0&&e.offsetHeight<=0)(e.dom),En=wn("width",e=>e.dom.offsetWidth),On=wn("width",e=>{const t=e.dom;return an(e)?t.getBoundingClientRect().width:t.offsetWidth}),Tn=e=>En.get(e),An=e=>En.getOuter(e),Dn=e=>On.getOuter(e),Mn=(e,t)=>({left:e,top:t,translate:(o,n)=>Mn(e+o,t+n)}),Rn=Mn,Nn=(e,t)=>void 0!==e?e:void 0!==t?t:0,Bn=e=>{const t=e.dom.ownerDocument,o=t.body,n=t.defaultView,r=t.documentElement;if(o===e.dom)return Rn(o.offsetLeft,o.offsetTop);const a=Nn(null==n?void 0:n.pageYOffset,r.scrollTop),s=Nn(null==n?void 0:n.pageXOffset,r.scrollLeft),i=Nn(r.clientTop,o.clientTop),l=Nn(r.clientLeft,o.clientLeft);return zn(e).translate(s-l,a-i)},zn=e=>{const t=e.dom,o=t.ownerDocument.body;return o===t?Rn(o.offsetLeft,o.offsetTop):an(e)?(e=>{const t=e.getBoundingClientRect();return Rn(t.left,t.top)})(t):Rn(0,0)},Hn=e=>{const t=void 0!==e?e.dom:document,o=t.body.scrollLeft||t.documentElement.scrollLeft,n=t.body.scrollTop||t.documentElement.scrollTop;return Rn(o,n)},Ln=(e,t,o)=>{const n=(void 0!==o?o.dom:document).defaultView;n&&n.scrollTo(e,t)},In=((e,t)=>{const o=t=>e(t)?A.from(t.dom.nodeValue):A.none();return{get:n=>{if(!e(n))throw new Error("Can only get "+t+" value of a "+t+" node");return o(n).getOr("")},getOption:o,set:(o,n)=>{if(!e(o))throw new Error("Can only set raw "+t+" value of a "+t+" node");o.dom.nodeValue=n}}})(oo,"text"),Pn=(e,t)=>o=>"rtl"===Fn(o)?t:e,Fn=e=>"rtl"===pn(e,"direction")?"rtl":"ltr",Vn=(e,t)=>{const o=qo(e,t);return void 0===o||""===o?[]:o.split(" ")};var Zn=(e,t,o,n,r)=>e(o,n)?A.some(o):p(r)&&r(o)?A.none():t(o,n,r);const Un=(e,t,o)=>{let n=e.dom;const r=p(o)?o:O;for(;n.parentNode;){n=n.parentNode;const e=it.fromDom(n);if(t(e))return A.some(e);if(r(e))break}return A.none()},jn=(e,t,o)=>Zn((e,t)=>t(e),Un,e,t,o),Wn=(e,t)=>j(e.dom.childNodes,e=>t(it.fromDom(e))).map(it.fromDom),$n=(e,t,o)=>Un(e,e=>ht(e,t),o),qn=(e,t)=>((e,t)=>{const o=e.dom;return o.parentNode?Wn(it.fromDom(o.parentNode),o=>!xt(e,o)&&t(o)):A.none()})(e,e=>ht(e,t)),Gn=(e,t)=>Wn(e,e=>ht(e,t)),Kn=(e,t)=>bt(t,e),Yn=(e,t,o)=>Zn((e,t)=>ht(e,t),$n,e,t,o),Xn=(e,t)=>{e.dom.checked=t},Jn=e=>e.dom.checked,Qn=e=>void 0!==e.dom.classList,er=e=>Vn(e,"class"),tr=(e,t)=>((e,t,o)=>{const n=Vn(e,t).concat([o]);return Wo(e,t,n.join(" ")),!0})(e,"class",t),or=(e,t)=>((e,t,o)=>{const n=V(Vn(e,t),e=>e!==o);return n.length>0?Wo(e,t,n.join(" ")):Yo(e,t),!1})(e,"class",t),nr=(e,t)=>{Qn(e)?e.dom.classList.add(t):tr(e,t)},rr=e=>{0===(Qn(e)?e.dom.classList:er(e)).length&&Yo(e,"class")},ar=(e,t)=>{if(Qn(e)){e.dom.classList.remove(t)}else or(e,t);rr(e)},sr=(e,t)=>{const o=Qn(e)?e.dom.classList.toggle(t):((e,t)=>B(er(e),t)?or(e,t):tr(e,t))(e,t);return rr(e),o},ir=(e,t)=>Qn(e)&&e.dom.classList.contains(t),lr=(e,t)=>{P(t,t=>{nr(e,t)})},cr=(e,t)=>{P(t,t=>{ar(e,t)})},dr=e=>Qn(e)?(e=>{const t=e.dom.classList,o=new Array(t.length);for(let e=0;e<t.length;e++){const n=t.item(e);null!==n&&(o[e]=n)}return o})(e):er(e),mr=e=>e.dom.value,ur=(e,t)=>{if(void 0===t)throw new Error("Value.set was undefined");e.dom.value=t},gr=(e,t,o)=>V(((e,t)=>{const o=p(t)?t:O;let n=e.dom;const r=[];for(;null!==n.parentNode&&void 0!==n.parentNode;){const e=n.parentNode,t=it.fromDom(e);if(r.push(t),!0===o(t))break;n=e}return r})(e,o),t),pr=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return ft(o)?[]:I(o.querySelectorAll(e),it.fromDom)})(t,e),hr=(e,t,o)=>jn(e,t,o).isSome(),fr=(e,t,o)=>Yn(e,t,o).isSome(),br=e=>p(e)?e:O,xr=(e,t,o)=>{let n=e.dom;const r=br(o);for(;n.parentNode;){n=n.parentNode;const e=it.fromDom(n),o=t(e);if(o.isSome())return o;if(r(e))break}return A.none()},vr=(e,t,o)=>{const n=t(e),r=br(o);return n.orThunk(()=>r(e)?A.none():xr(e,t,r))},yr=(e,t,o,n)=>({start:e,soffset:t,finish:o,foffset:n}),wr=ve([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),_r=(wr.before,wr.on,wr.after,e=>e.fold(w,w,w)),Cr=ve([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),kr={domRange:Cr.domRange,relative:Cr.relative,exact:Cr.exact,exactFromRange:e=>Cr.exact(e.start,e.soffset,e.finish,e.foffset),getWin:e=>{const t=(e=>e.match({domRange:e=>it.fromDom(e.startContainer),relative:(e,t)=>_r(e),exact:(e,t,o,n)=>e}))(e);return co(t)},range:yr},Sr=e=>{if(e.rangeCount>0){const t=e.getRangeAt(0),o=e.getRangeAt(e.rangeCount-1);return A.some(yr(it.fromDom(t.startContainer),t.startOffset,it.fromDom(o.endContainer),o.endOffset))}return A.none()},Er=e=>{if(null===e.anchorNode||null===e.focusNode)return Sr(e);{const t=it.fromDom(e.anchorNode),o=it.fromDom(e.focusNode);return vo(t,e.anchorOffset,o,e.focusOffset)?A.some(yr(t,e.anchorOffset,o,e.focusOffset)):Sr(e)}},Or=e=>(e=>A.from(e.getSelection()))(e).filter(e=>e.rangeCount>0).bind(Er),Tr=(e,t)=>(e=>{const t=e.getClientRects(),o=t.length>0?t[0]:e.getBoundingClientRect();return o.width>0||o.height>0?A.some(o).map(dt):A.none()})(pt(e,t)),Ar=(e,t)=>(e=>{const t=e.getBoundingClientRect();return t.width>0||t.height>0?A.some(t).map(dt):A.none()})(pt(e,t)),Dr={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},Mr=(()=>{const e="[0-9]+",t="[eE]"+("[+-]?"+e),o=e=>`(?:${e})?`,n=["Infinity",e+"\\."+o(e)+o(t),"\\."+e+o(t),e+o(t)].join("|");return new RegExp(`^(${`[+-]?(?:${n})`})(.*)$`)})(),Rr=(e,t)=>A.from(Mr.exec(e)).bind(e=>{const o=Number(e[1]),n=e[2];return((e,t)=>z(t,t=>z(Dr[t],t=>e===t)))(n,t)?A.some({value:o,unit:n}):A.none()}),Nr=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n}),Br=e=>{const t=void 0===e?window:e,o=t.document,n=Hn(it.fromDom(o));return(e=>{const t=void 0===e?window:e;return Gt().browser.isFirefox()?A.none():A.from(t.visualViewport)})(t).fold(()=>{const e=t.document.documentElement,o=e.clientWidth,r=e.clientHeight;return Nr(n.left,n.top,o,r)},e=>Nr(Math.max(e.pageLeft,n.left),Math.max(e.pageTop,n.top),e.width,e.height))},zr=(e,t)=>e.view(t).fold(y([]),t=>{const o=e.owner(t),n=zr(e,o);return[t].concat(n)});var Hr=Object.freeze({__proto__:null,view:e=>{var t;return(e.dom===document?A.none():A.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement)).map(it.fromDom)},owner:e=>so(e)});const Lr=e=>{const t=No(),o=Hn(t),n=((e,t)=>{const o=t.owner(e),n=zr(t,o);return A.some(n)})(e,Hr);return n.fold(C(Bn,e),t=>{const n=zn(e),r=Z(t,(e,t)=>{const o=zn(t);return{left:e.left+o.left,top:e.top+o.top}},{left:0,top:0});return Rn(r.left+n.left+o.left,r.top+n.top+o.top)})},Ir=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n}),Pr=e=>{const t=Bn(e),o=An(e),n=kn(e);return Ir(t.left,t.top,o,n)},Fr=e=>{const t=Lr(e),o=An(e),n=kn(e);return Ir(t.left,t.top,o,n)},Vr=(e,t)=>{const o=Math.max(e.x,t.x),n=Math.max(e.y,t.y),r=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom);return Ir(o,n,r-o,a-n)},Zr=()=>Br(window),Ur=(e,t)=>xt(e.element,t.event.target),jr=e=>(Ve(fn(e,"position"),"fixed")?A.none():go(e)).orThunk(()=>{const t=it.fromTag("span");return mo(e).bind(e=>{Zo(e,t);const o=go(t);return Jo(t),o})}),Wr=e=>jr(e).map(Bn).getOrThunk(()=>Rn(0,0));var $r;!function(e){e[e.Error=0]="Error",e[e.Value=1]="Value"}($r||($r={}));const qr=(e,t,o)=>e.stype===$r.Error?t(e.serror):o(e.svalue),Gr=e=>({stype:$r.Value,svalue:e}),Kr=e=>({stype:$r.Error,serror:e}),Yr=e=>e.fold(Kr,Gr),Xr=e=>qr(e,Ae.error,Ae.value),Jr=Gr,Qr=e=>{const t=[],o=[];return P(e,e=>{qr(e,e=>o.push(e),e=>t.push(e))}),{values:t,errors:o}},ea=Kr,ta=(e,t)=>e.stype===$r.Value?t(e.svalue):e,oa=(e,t)=>e.stype===$r.Error?t(e.serror):e,na=(e,t)=>e.stype===$r.Value?{stype:$r.Value,svalue:t(e.svalue)}:e,ra=(e,t)=>e.stype===$r.Error?{stype:$r.Error,serror:t(e.serror)}:e,aa=qr,sa=e=>s(e)&&ae(e).length>100?" removed due to size":JSON.stringify(e,null,2),ia=(e,t)=>ea([{path:e,getErrorInfo:t}]),la=e=>({extract:(t,o)=>oa(e(o),e=>((e,t)=>ia(e,y(t)))(t,e)),toString:y("val")}),ca=la(Jr),da=y(ca),ma=(e,t)=>la(o=>{const n=typeof o;return e(o)?Jr(o):ea(`Expected type: ${t} but got: ${n}`)}),ua=ma(h,"number"),ga=ma(a,"string"),pa=ma(d,"boolean"),ha=ma(p,"function"),fa=e=>{if(Object(e)!==e)return!0;switch({}.toString.call(e).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(e).every(t=>fa(e[t]));default:return!1}},ba=la(e=>fa(e)?Jr(e):ea("Expected value to be acceptable for sending via postMessage")),xa=e=>({tag:"defaultedThunk",process:e}),va=e=>xa(y(e)),ya=e=>({tag:"mergeWithThunk",process:e}),wa=(e,t,o,n)=>({tag:"field",key:e,newKey:t,presence:o,prop:n}),_a=(e,t,o)=>{switch(e.tag){case"field":return t(e.key,e.newKey,e.presence,e.prop);case"custom":return o(e.newKey,e.instantiator)}},Ca=e=>v(ea,$)(e),ka=e=>{const t=Qr(e);return t.errors.length>0?Ca(t.errors):Jr(t.values)},Sa=(e,t,o,n)=>fe(t,o).fold(()=>((e,t,o)=>ia(e,()=>'Could not find valid *required* value for "'+t+'" in '+sa(o)))(e,o,t),n),Ea=(e,t,o,n)=>n(fe(e,t).getOrThunk(()=>o(e))),Oa=(e,t,o,n,r)=>{const a=e=>r.extract(t.concat([n]),e),s=e=>e.fold(()=>Jr(A.none()),e=>{const o=r.extract(t.concat([n]),e);return na(o,A.some)});switch(e.tag){case"required":return Sa(t,o,n,a);case"defaultedThunk":return Ea(o,n,e.process,a);case"option":return((e,t,o)=>o(fe(e,t)))(o,n,s);case"defaultedOptionThunk":return((e,t,o,n)=>n(fe(e,t).map(t=>!0===t?o(e):t)))(o,n,e.process,s);case"mergeWithThunk":return Ea(o,n,y({}),t=>{const n=Pe(e.process(o),t);return a(n)})}},Ta=e=>({extract:(t,o)=>e().extract(t,o),toString:()=>e().toString()}),Aa=e=>ae(ue(e,g)),Da=e=>{const t=Ma(e),o=Z(e,(e,t)=>_a(t,t=>Pe(e,{[t]:!0}),y(e)),{});return{extract:(e,n)=>{const r=d(n)?[]:Aa(n),a=V(r,e=>!xe(o,e));return 0===a.length?t.extract(e,n):((e,t)=>ia(e,()=>"There are unsupported fields: ["+t.join(", ")+"] specified"))(e,a)},toString:t.toString}},Ma=e=>({extract:(t,o)=>((e,t,o)=>{const n={},r=[];for(const a of o)_a(a,(o,a,s,i)=>{const l=Oa(s,e,t,o,i);aa(l,e=>{r.push(...e)},e=>{n[a]=e})},(e,o)=>{n[e]=o(t)});return r.length>0?ea(r):Jr(n)})(t,o,e),toString:()=>{const t=I(e,e=>_a(e,(e,t,o,n)=>e+" -> "+n.toString(),(e,t)=>"state("+e+")"));return"obj{\n"+t.join("\n")+"}"}}),Ra=e=>({extract:(t,o)=>{const n=I(o,(o,n)=>e.extract(t.concat(["["+n+"]"]),o));return ka(n)},toString:()=>"array("+e.toString()+")"}),Na=(e,t)=>{const o=void 0!==t?t:w;return{extract:(t,n)=>{const r=[];for(const a of e){const e=a.extract(t,n);if(e.stype===$r.Value)return{stype:$r.Value,svalue:o(e.svalue)};r.push(e)}return ka(r)},toString:()=>"oneOf("+I(e,e=>e.toString()).join(", ")+")"}},Ba=(e,t)=>({extract:(o,n)=>{const r=ae(n),a=((t,o)=>Ra(la(e)).extract(t,o))(o,r);return ta(a,e=>{const r=I(e,e=>wa(e,e,{tag:"required",process:{}},t));return Ma(r).extract(o,n)})},toString:()=>"setOf("+t.toString()+")"}),za=v(Ra,Ma),Ha=(e,t,o,n)=>fe(o,n).fold(()=>((e,t,o)=>ia(e,()=>'The chosen schema: "'+o+'" did not exist in branches: '+sa(t)))(e,o,n),o=>o.extract(e.concat(["branch: "+n]),t)),La=(e,t)=>({extract:(o,n)=>fe(n,e).fold(()=>((e,t)=>ia(e,()=>'Choice schema did not contain choice key: "'+t+'"'))(o,e),e=>Ha(o,n,t,e)),toString:()=>"chooseOn("+e+"). Possible values: "+ae(t)}),Ia=e=>la(t=>e(t).fold(ea,Jr)),Pa=(e,t)=>Ba(t=>Yr(e(t)),t),Fa=(e,t,o)=>Xr(((e,t,o)=>{const n=t.extract([e],o);return ra(n,e=>({input:o,errors:e}))})(e,t,o)),Va=e=>e.fold(e=>{throw new Error(Ua(e))},w),Za=(e,t,o)=>Va(Fa(e,t,o)),Ua=e=>"Errors: \n"+(e=>{const t=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:y("... (only showing first ten failures)")}]):e;return I(t,e=>"Failed path: ("+e.path.join(" > ")+")\n"+e.getErrorInfo())})(e.errors).join("\n")+"\n\nInput object: "+sa(e.input),ja=(e,t)=>La(e,le(t,Ma)),Wa=(e,t)=>((e,t)=>{const o=at(t);return{extract:(e,t)=>o().extract(e,t),toString:()=>o().toString()}})(0,t),$a=wa,qa=(e,t)=>({tag:"custom",newKey:e,instantiator:t}),Ga=e=>Ia(t=>B(e,t)?Ae.value(t):Ae.error(`Unsupported value: "${t}", choose one of "${e.join(", ")}".`)),Ka=e=>$a(e,e,{tag:"required",process:{}},da()),Ya=(e,t)=>$a(e,e,{tag:"required",process:{}},t),Xa=e=>Ya(e,ua),Ja=e=>Ya(e,ga),Qa=(e,t)=>$a(e,e,{tag:"required",process:{}},Ga(t)),es=e=>Ya(e,ha),ts=(e,t)=>$a(e,e,{tag:"required",process:{}},Ma(t)),os=(e,t)=>$a(e,e,{tag:"required",process:{}},za(t)),ns=(e,t)=>$a(e,e,{tag:"required",process:{}},Ra(t)),rs=e=>$a(e,e,{tag:"option",process:{}},da()),as=(e,t)=>$a(e,e,{tag:"option",process:{}},t),ss=e=>as(e,ua),is=e=>as(e,ga),ls=(e,t)=>as(e,Ga(t)),cs=e=>as(e,ha),ds=(e,t)=>as(e,Ra(t)),ms=(e,t)=>as(e,Ma(t)),us=(e,t)=>$a(e,e,va(t),da()),gs=(e,t,o)=>$a(e,e,va(t),o),ps=(e,t)=>gs(e,t,ua),hs=(e,t)=>gs(e,t,ga),fs=(e,t,o)=>gs(e,t,Ga(o)),bs=(e,t)=>gs(e,t,pa),xs=(e,t)=>gs(e,t,ha),vs=(e,t,o)=>gs(e,t,Ra(o)),ys=(e,t,o)=>gs(e,t,Ma(o)),ws=(e,t)=>((e,t)=>{const o={};return ie(e,(e,n)=>{B(t,n)||(o[n]=e)}),o})(e,t),_s=(e,t)=>((e,t)=>({[e]:t}))(e,t),Cs=e=>(e=>{const t={};return P(e,e=>{t[e.key]=e.value}),t})(e),ks=(e,t)=>{const o=(e=>{const t=[],o=[];return P(e,e=>{e.fold(e=>{t.push(e)},e=>{o.push(e)})}),{errors:t,values:o}})(e);return o.errors.length>0?(n=o.errors,Ae.error($(n))):((e,t)=>0===e.length?Ae.value(t):Ae.value(Pe(t,Fe.apply(void 0,e))))(o.values,t);var n},Ss=y,Es=Ss("touchstart"),Os=Ss("touchmove"),Ts=Ss("touchend"),As=Ss("touchcancel"),Ds=Ss("mousedown"),Ms=Ss("mousemove"),Rs=Ss("mouseout"),Ns=Ss("mouseup"),Bs=Ss("mouseover"),zs=Ss("focusin"),Hs=Ss("focusout"),Ls=Ss("keydown"),Is=Ss("keyup"),Ps=Ss("input"),Fs=Ss("change"),Vs=Ss("click"),Zs=Ss("transitioncancel"),Us=Ss("transitionend"),js=Ss("transitionstart"),Ws=Ss("selectstart"),$s=e=>y("alloy."+e),qs={tap:$s("tap")},Gs=$s("focus"),Ks=$s("blur.post"),Ys=$s("paste.post"),Xs=$s("receive"),Js=$s("execute"),Qs=$s("focus.item"),ei=qs.tap,ti=$s("longpress"),oi=$s("sandbox.close"),ni=$s("typeahead.cancel"),ri=$s("system.init"),ai=$s("system.touchmove"),si=$s("system.touchend"),ii=$s("system.scroll"),li=$s("system.resize"),ci=$s("system.attached"),di=$s("system.detached"),mi=$s("system.dismissRequested"),ui=$s("system.repositionRequested"),gi=$s("focusmanager.shifted"),pi=$s("slotcontainer.visibility"),hi=$s("system.external.element.scroll"),fi=$s("change.tab"),bi=$s("dismiss.tab"),xi=$s("highlight"),vi=$s("dehighlight"),yi=e=>on(e),wi="unknown";var _i;!function(e){e[e.STOP=0]="STOP",e[e.NORMAL=1]="NORMAL",e[e.LOGGING=2]="LOGGING"}(_i||(_i={}));const Ci=ye({}),ki=(e,t,o)=>{switch(fe(Ci.get(),e).orThunk(()=>{const t=ae(Ci.get());return re(t,t=>e.indexOf(t)>-1?A.some(Ci.get()[t]):A.none())}).getOr(_i.NORMAL)){case _i.NORMAL:return o(Oi());case _i.LOGGING:{const n=((e,t)=>{const o=[],n=(new Date).getTime();return{logEventCut:(e,t,n)=>{o.push({outcome:"cut",target:t,purpose:n})},logEventStopped:(e,t,n)=>{o.push({outcome:"stopped",target:t,purpose:n})},logNoParent:(e,t,n)=>{o.push({outcome:"no-parent",target:t,purpose:n})},logEventNoHandlers:(e,t)=>{o.push({outcome:"no-handlers-left",target:t})},logEventResponse:(e,t,n)=>{o.push({outcome:"response",purpose:n,target:t})},write:()=>{const r=(new Date).getTime();B(["mousemove","mouseover","mouseout",ri()],e)||console.log(e,{event:e,time:r-n,target:t.dom,sequence:I(o,e=>B(["cut","stopped","response"],e.outcome)?"{"+e.purpose+"} "+e.outcome+" at ("+yi(e.target)+")":e.outcome)})}}})(e,t),r=o(n);return n.write(),r}case _i.STOP:return!0}},Si=["alloy/data/Fields","alloy/debugging/Debugging"],Ei=(e,t,o)=>ki(e,t,o),Oi=y({logEventCut:b,logEventStopped:b,logNoParent:b,logEventNoHandlers:b,logEventResponse:b,write:b}),Ti=y([Ka("menu"),Ka("selectedMenu")]),Ai=y([Ka("item"),Ka("selectedItem")]);y(Ma(Ai().concat(Ti())));const Di=y(Ma(Ai())),Mi=ts("initSize",[Ka("numColumns"),Ka("numRows")]),Ri=()=>ts("markers",[Ka("backgroundMenu")].concat(Ti()).concat(Ai())),Ni=e=>ts("markers",I(e,Ka)),Bi=(e,t,o)=>((()=>{const e=new Error;if(void 0!==e.stack){const t=e.stack.split("\n");return j(t,e=>e.indexOf("alloy")>0&&!z(Si,t=>e.indexOf(t)>-1)).getOr(wi)}})(),$a(t,t,o,Ia(e=>Ae.value((...t)=>e.apply(void 0,t))))),zi=e=>Bi(0,e,va(b)),Hi=e=>Bi(0,e,va(A.none)),Li=e=>Bi(0,e,{tag:"required",process:{}}),Ii=e=>Bi(0,e,{tag:"required",process:{}}),Pi=(e,t)=>qa(e,y(t)),Fi=e=>qa(e,w),Vi=y(Mi),Zi=e=>I(e,e=>et(e,"/*")?e.substring(0,e.length-2):e),Ui=(e,t)=>{const o=e.toString(),n=o.indexOf(")")+1,r=o.indexOf("("),a=o.substring(r+1,n-1).split(/,\s*/);return e.toFunctionAnnotation=()=>({name:t,parameters:Zi(a)}),e},ji=(e,t)=>{let o=null;return{cancel:()=>{null!==o&&(clearTimeout(o),o=null)},schedule:(...n)=>{o=setTimeout(()=>{e.apply(null,n),o=null},t)}}},Wi=e=>{const t=e.raw;return void 0===t.touches||1!==t.touches.length?A.none():A.some(t.touches[0])},$i=e=>{const t=Ke(),o=ye(!1),n=ji(t=>{e.triggerEvent(ti(),t),o.set(!0)},400),r=Cs([{key:Es(),value:e=>(Wi(e).each(r=>{n.cancel();const a={x:r.clientX,y:r.clientY,target:e.target};n.schedule(e),o.set(!1),t.set(a)}),A.none())},{key:Os(),value:e=>(n.cancel(),Wi(e).each(e=>{t.on(o=>{((e,t)=>{const o=Math.abs(e.clientX-t.x),n=Math.abs(e.clientY-t.y);return o>5||n>5})(e,o)&&t.clear()})}),A.none())},{key:Ts(),value:r=>{n.cancel();return t.get().filter(e=>xt(e.target,r.target)).map(t=>o.get()?(r.prevent(),!1):e.triggerEvent(ei(),r))}}]);return{fireIfReady:(e,t)=>fe(r,t).bind(t=>t(e))}};var qi;!function(e){e.OnFocusMode="onFocus",e.OnEnterOrSpaceMode="onEnterOrSpace",e.OnApiMode="onApi"}(qi||(qi={}));const Gi="placeholder",Ki=ve([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Yi=e=>be(e,"uiType"),Xi=(e,t,o,n)=>Yi(o)&&o.uiType===Gi?((e,t,o,n)=>e.exists(e=>e!==o.owner)?Ki.single(!0,y(o)):fe(n,o.name).fold(()=>{throw new Error("Unknown placeholder component: "+o.name+"\nKnown: ["+ae(n)+"]\nNamespace: "+e.getOr("none")+"\nSpec: "+JSON.stringify(o,null,2))},e=>e.replace()))(e,0,o,n):Ki.single(!1,y(o)),Ji=(e,t,o,n)=>Xi(e,0,o,n).fold((r,a)=>{const s=Yi(o)?a(t,o.config,o.validated):a(t),i=fe(s,"components").getOr([]),l=q(i,o=>Ji(e,t,o,n));return[{...s,components:l}]},(e,n)=>{if(Yi(o)){const e=n(t,o.config,o.validated);return o.validated.preprocess.getOr(w)(e)}return n(t)}),Qi=(e,t,o,n)=>{const r=le(n,(e,t)=>((e,t)=>{let o=!1;return{name:y(e),required:()=>t.fold((e,t)=>e,(e,t)=>e),used:()=>o,replace:()=>{if(o)throw new Error("Trying to use the same placeholder more than once: "+e);return o=!0,t}}})(t,e)),a=((e,t,o,n)=>q(o,o=>Ji(e,t,o,n)))(e,t,o,r);return ie(r,o=>{if(!1===o.used()&&o.required())throw new Error("Placeholder: "+o.name()+" was not found in components list\nNamespace: "+e.getOr("none")+"\nComponents: "+JSON.stringify(t.components,null,2))}),a},el=Ki.single,tl=Ki.multiple,ol=y(Gi),nl=ve([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),rl=us("factory",{sketch:w}),al=us("schema",[]),sl=Ka("name"),il=$a("pname","pname",xa(e=>"<alloy."+Le(e.name)+">"),da()),ll=qa("schema",()=>[rs("preprocess")]),cl=us("defaults",y({})),dl=us("overrides",y({})),ml=Ma([rl,al,sl,il,cl,dl]),ul=Ma([rl,al,sl,cl,dl]),gl=Ma([rl,al,sl,il,cl,dl]),pl=Ma([rl,ll,sl,Ka("unit"),il,cl,dl]),hl=e=>e.fold(A.some,A.none,A.some,A.some),fl=e=>{const t=e=>e.name;return e.fold(t,t,t,t)},bl=(e,t)=>o=>{const n=Za("Converting part type",t,o);return e(n)},xl=bl(nl.required,ml),vl=bl(nl.external,ul),yl=bl(nl.optional,gl),wl=bl(nl.group,pl),_l=y("entirety");var Cl=Object.freeze({__proto__:null,required:xl,external:vl,optional:yl,group:wl,asNamedPart:hl,name:fl,asCommon:e=>e.fold(w,w,w,w),original:_l});const kl=(e,t,o,n)=>Pe(t.defaults(e,o,n),o,{uid:e.partUids[t.name]},t.overrides(e,o,n)),Sl=(e,t)=>{const o={};return P(t,t=>{hl(t).each(t=>{const n=El(e,t.pname);o[t.name]=o=>{const r=Za("Part: "+t.name+" in "+e,Ma(t.schema),o);return{...n,config:o,validated:r}}})}),o},El=(e,t)=>({uiType:ol(),owner:e,name:t}),Ol=(e,t,o)=>({uiType:ol(),owner:e,name:t,config:o,validated:{}}),Tl=e=>q(e,e=>e.fold(A.none,A.some,A.none,A.none).map(e=>ts(e.name,e.schema.concat([Fi(_l())]))).toArray()),Al=e=>I(e,fl),Dl=(e,t,o)=>((e,t,o)=>{const n={},r={};return P(o,e=>{e.fold(e=>{n[e.pname]=el(!0,(t,o,n)=>e.factory.sketch(kl(t,e,o,n)))},e=>{const o=t.parts[e.name];r[e.name]=y(e.factory.sketch(kl(t,e,o[_l()]),o))},e=>{n[e.pname]=el(!1,(t,o,n)=>e.factory.sketch(kl(t,e,o,n)))},e=>{n[e.pname]=tl(!0,(t,o,n)=>{const r=t[e.name];return I(r,o=>e.factory.sketch(Pe(e.defaults(t,o,n),o,e.overrides(t,o))))})})}),{internals:y(n),externals:y(r)}})(0,t,o),Ml=(e,t,o)=>Qi(A.some(e),t,t.components,o),Rl=(e,t,o)=>{const n=t.partUids[o];return e.getSystem().getByUid(n).toOptional()},Nl=(e,t,o)=>Rl(e,t,o).getOrDie("Could not find part: "+o),Bl=(e,t,o)=>{const n={},r=t.partUids,a=e.getSystem();return P(o,e=>{n[e]=y(a.getByUid(r[e]))}),n},zl=(e,t)=>{const o=e.getSystem();return le(t.partUids,(e,t)=>y(o.getByUid(e)))},Hl=e=>ae(e.partUids),Ll=(e,t,o)=>{const n={},r=t.partUids,a=e.getSystem();return P(o,e=>{n[e]=y(a.getByUid(r[e]).getOrDie())}),n},Il=(e,t)=>{const o=Al(t);return Cs(I(o,t=>({key:t,value:e+"-"+t})))},Pl=e=>$a("partUids","partUids",ya(t=>Il(t.uid,e)),da());var Fl=Object.freeze({__proto__:null,generate:Sl,generateOne:Ol,schemas:Tl,names:Al,substitutes:Dl,components:Ml,defaultUids:Il,defaultUidsSchema:Pl,getAllParts:zl,getAllPartNames:Hl,getPart:Rl,getPartOrDie:Nl,getParts:Bl,getPartsOrDie:Ll});const Vl=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],Zl=(e,t,o,n=1)=>{const r=e*n,a=t*n,s=e=>fe(o,e).getOr([]),i=(e,t,o)=>{const n=Y(Vl,o);return{offset:Rn(e,t),classesOn:q(o,s),classesOff:q(n,s)}};return{southeast:()=>i(-e,t,["top","alignLeft"]),southwest:()=>i(e,t,["top","alignRight"]),south:()=>i(-e/2,t,["top","alignCentre"]),northeast:()=>i(-e,-t,["bottom","alignLeft"]),northwest:()=>i(e,-t,["bottom","alignRight"]),north:()=>i(-e/2,-t,["bottom","alignCentre"]),east:()=>i(e,-t/2,["valignCentre","left"]),west:()=>i(-e,-t/2,["valignCentre","right"]),insetNortheast:()=>i(r,a,["top","alignLeft","inset"]),insetNorthwest:()=>i(-r,a,["top","alignRight","inset"]),insetNorth:()=>i(-r/2,a,["top","alignCentre","inset"]),insetSoutheast:()=>i(r,-a,["bottom","alignLeft","inset"]),insetSouthwest:()=>i(-r,-a,["bottom","alignRight","inset"]),insetSouth:()=>i(-r/2,-a,["bottom","alignCentre","inset"]),insetEast:()=>i(-r,-a/2,["valignCentre","right","inset"]),insetWest:()=>i(r,-a/2,["valignCentre","left","inset"])}},Ul=()=>Zl(0,0,{}),jl=(e,t,o,n,r,a,s,i=!1)=>({x:e,y:t,bubble:o,direction:n,placement:r,restriction:a,label:`${s}-${r}`,alwaysFit:i}),Wl=ve([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),$l=Wl.southeast,ql=Wl.southwest,Gl=Wl.northeast,Kl=Wl.northwest,Yl=Wl.south,Xl=Wl.north,Jl=Wl.east,Ql=Wl.west,ec=(e,t)=>X(["left","right","top","bottom"],o=>fe(t,o).map(t=>((e,t)=>{switch(t){case 1:return e.x;case 0:return e.x+e.width;case 2:return e.y;case 3:return e.y+e.height}})(e,t))),tc="layout",oc=e=>e.x,nc=(e,t)=>e.x+e.width/2-t.width/2,rc=(e,t)=>e.x+e.width-t.width,ac=(e,t)=>e.y-t.height,sc=e=>e.y+e.height,ic=(e,t)=>e.y+e.height/2-t.height/2,lc=(e,t,o)=>jl(oc(e),sc(e),o.southeast(),$l(),"southeast",ec(e,{left:1,top:3}),tc),cc=(e,t,o)=>jl(rc(e,t),sc(e),o.southwest(),ql(),"southwest",ec(e,{right:0,top:3}),tc),dc=(e,t,o)=>jl(oc(e),ac(e,t),o.northeast(),Gl(),"northeast",ec(e,{left:1,bottom:2}),tc),mc=(e,t,o)=>jl(rc(e,t),ac(e,t),o.northwest(),Kl(),"northwest",ec(e,{right:0,bottom:2}),tc),uc=(e,t,o)=>jl(nc(e,t),ac(e,t),o.north(),Xl(),"north",ec(e,{bottom:2}),tc),gc=(e,t,o)=>jl(nc(e,t),sc(e),o.south(),Yl(),"south",ec(e,{top:3}),tc),pc=(e,t,o)=>jl((e=>e.x+e.width)(e),ic(e,t),o.east(),Jl(),"east",ec(e,{left:0}),tc),hc=(e,t,o)=>jl(((e,t)=>e.x-t.width)(e,t),ic(e,t),o.west(),Ql(),"west",ec(e,{right:1}),tc),fc=()=>[lc,cc,dc,mc,gc,uc,pc,hc],bc=()=>[cc,lc,mc,dc,gc,uc,pc,hc],xc=()=>[dc,mc,lc,cc,uc,gc],vc=()=>[mc,dc,cc,lc,uc,gc],yc=()=>[lc,cc,dc,mc,gc,uc],wc=()=>[cc,lc,mc,dc,gc,uc],_c="data-alloy-placement",Cc=e=>Go(e,_c),kc="layout-inset",Sc=e=>e.x,Ec=(e,t)=>e.x+e.width/2-t.width/2,Oc=(e,t)=>e.x+e.width-t.width,Tc=e=>e.y,Ac=(e,t)=>e.y+e.height-t.height,Dc=(e,t)=>e.y+e.height/2-t.height/2,Mc=(e,t,o)=>jl(Oc(e,t),Ac(e,t),o.insetSouthwest(),Kl(),"southwest",ec(e,{right:0,bottom:3}),kc),Rc=(e,t,o)=>jl(Sc(e),Ac(e,t),o.insetSoutheast(),Gl(),"southeast",ec(e,{left:1,bottom:3}),kc),Nc=(e,t,o)=>jl(Oc(e,t),Tc(e),o.insetNorthwest(),ql(),"northwest",ec(e,{right:0,top:2}),kc),Bc=(e,t,o)=>jl(Sc(e),Tc(e),o.insetNortheast(),$l(),"northeast",ec(e,{left:1,top:2}),kc),zc=(e,t,o)=>jl(Ec(e,t),Tc(e),o.insetNorth(),Yl(),"north",ec(e,{top:2}),kc),Hc=(e,t,o)=>jl(Ec(e,t),Ac(e,t),o.insetSouth(),Xl(),"south",ec(e,{bottom:3}),kc),Lc=(e,t,o)=>jl(Oc(e,t),Dc(e,t),o.insetEast(),Ql(),"east",ec(e,{right:0}),kc),Ic=(e,t,o)=>jl(Sc(e),Dc(e,t),o.insetWest(),Jl(),"west",ec(e,{left:1}),kc),Pc=e=>{switch(e){case"north":return zc;case"northeast":return Bc;case"northwest":return Nc;case"south":return Hc;case"southeast":return Rc;case"southwest":return Mc;case"east":return Lc;case"west":return Ic}},Fc=(e,t,o,n,r)=>Cc(n).map(Pc).getOr(zc)(e,t,o,n,r),Vc=e=>{switch(e){case"north":return Hc;case"northeast":return Rc;case"northwest":return Mc;case"south":return zc;case"southeast":return Bc;case"southwest":return Nc;case"east":return Ic;case"west":return Lc}},Zc=(e,t,o,n,r)=>Cc(n).map(Vc).getOr(zc)(e,t,o,n,r),Uc=(e,t)=>{((e,t)=>{const o=_n.max(e,t,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);mn(e,"max-height",o+"px")})(e,Math.floor(t))},jc=y((e,t)=>{Uc(e,t),un(e,{"overflow-x":"hidden","overflow-y":"auto"})}),Wc=y((e,t)=>{Uc(e,t)}),$c=y((e,t)=>{((e,t)=>{const o=En.max(e,t,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);mn(e,"max-width",o+"px")})(e,Math.floor(t))});var qc;!function(e){e.TopToBottom="toptobottom",e.BottomToTop="bottomtotop"}(qc||(qc={}));const Gc="data-alloy-vertical-dir",Kc=e=>hr(e,e=>to(e)&&qo(e,"data-alloy-vertical-dir")===qc.BottomToTop);var Yc;!function(e){e[e.HighlightMenuAndItem=0]="HighlightMenuAndItem",e[e.HighlightJustMenu=1]="HighlightJustMenu",e[e.HighlightNone=2]="HighlightNone"}(Yc||(Yc={}));const Xc={init:()=>Jc({readState:y("No State required")})},Jc=e=>e,Qc={can:T,abort:O,run:b},ed=e=>{if(!xe(e,"can")&&!xe(e,"abort")&&!xe(e,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(e,null,2)+" does not have can, abort, or run!");return{...Qc,...e}},td=e=>{const t=((e,t)=>(...o)=>U(e,(e,n)=>e&&t(n).apply(void 0,o),!0))(e,e=>e.can),o=((e,t)=>(...o)=>U(e,(e,n)=>e||t(n).apply(void 0,o),!1))(e,e=>e.abort);return{can:t,abort:o,run:(...t)=>{P(e,e=>{e.run.apply(void 0,t)})}}},od=(e,t)=>{sd(e,e.element,t,{})},nd=(e,t,o)=>{sd(e,e.element,t,o)},rd=e=>{od(e,Js())},ad=(e,t,o)=>{sd(e,t,o,{})},sd=(e,t,o,n)=>{const r={target:t,...n};e.getSystem().triggerEvent(o,t,r)},id=(e,t,o,n)=>{e.getSystem().triggerEvent(o,t,n.event)},ld=e=>Cs(e),cd=(e,t)=>({key:e,value:ed({abort:t})}),dd=e=>({key:e,value:ed({run:(e,t)=>{t.event.prevent()}})}),md=(e,t)=>({key:e,value:ed({run:t})}),ud=(e,t,o)=>({key:e,value:ed({run:(e,n)=>{t.apply(void 0,[e,n].concat(o))}})}),gd=e=>t=>({key:e,value:ed({run:(e,o)=>{Ur(e,o)&&t(e,o)}})}),pd=(e,t,o)=>((e,t)=>md(e,(o,n)=>{o.getSystem().getByUid(t).each(t=>{id(t,t.element,e,n)})}))(e,t.partUids[o]),hd=(e,t)=>md(e,(e,o)=>{const n=o.event,r=e.getSystem().getByDom(n.target).getOrThunk(()=>vr(n.target,t=>e.getSystem().getByDom(t).toOptional(),O).getOr(e));t(e,r,o)}),fd=e=>md(e,(e,t)=>{t.cut()}),bd=e=>md(e,(e,t)=>{t.stop()}),xd=(e,t)=>gd(e)(t),vd=gd(ci()),yd=gd(di()),wd=gd(ri()),_d=(e=>t=>md(e,t))(Js()),Cd=e=>({classes:m(e.classes)?[]:e.classes,attributes:m(e.attributes)?{}:e.attributes,styles:m(e.styles)?{}:e.styles}),kd=(e,t,o)=>wd((n,r)=>{o(n,e,t)}),Sd=(e,t,o)=>((e,t,o)=>{const n=o.toString(),r=n.indexOf(")")+1,a=n.indexOf("("),s=n.substring(a+1,r-1).split(/,\s*/);return e.toFunctionAnnotation=()=>({name:t,parameters:Zi(s.slice(0,1).concat(s.slice(3)))}),e})((n,...r)=>{const a=[n].concat(r);return n.config({name:y(e)}).fold(()=>{throw new Error("We could not find any behaviour configuration for: "+e+". Using API: "+o)},e=>{const o=Array.prototype.slice.call(a,1);return t.apply(void 0,[n,e.config,e.state].concat(o))})},o,t),Ed=e=>({key:e,value:void 0}),Od=(e,t,o,n,r,a,s)=>{const i=e=>xe(e,o)?e[o]():A.none(),l=le(r,(e,t)=>Sd(o,e,t)),c={...le(a,(e,t)=>Ui(e,t)),...l,revoke:C(Ed,o),config:t=>{const n=Za(o+"-config",e,t);return{key:o,value:{config:n,me:c,configAsRaw:at(()=>Za(o+"-config",e,t)),initialConfig:t,state:s}}},schema:y(t),exhibit:(e,t)=>Ue(i(e),fe(n,"exhibit"),(e,o)=>o(t,e.config,e.state)).getOrThunk(()=>Cd({})),name:y(o),handlers:e=>i(e).map(e=>fe(n,"events").getOr(()=>({}))(e.config,e.state)).getOr({})};return c},Td=e=>Cs(e),Ad=Da([Ka("fields"),Ka("name"),us("active",{}),us("apis",{}),us("state",Xc),us("extra",{})]),Dd=e=>{const t=Za("Creating behaviour: "+e.name,Ad,e);return((e,t,o,n,r,a)=>{const s=Da(e),i=ms(t,[(l="config",c=e,as(l,Da(c)))]);var l,c;return Od(s,i,t,o,n,r,a)})(t.fields,t.name,t.active,t.apis,t.extra,t.state)},Md=Da([Ka("branchKey"),Ka("branches"),Ka("name"),us("active",{}),us("apis",{}),us("state",Xc),us("extra",{})]),Rd=e=>{const t=Za("Creating behaviour: "+e.name,Md,e);return((e,t,o,n,r,a)=>{const s=e,i=ms(t,[as("config",e)]);return Od(s,i,t,o,n,r,a)})(ja(t.branchKey,t.branches),t.name,t.active,t.apis,t.extra,t.state)},Nd=y(void 0),Bd=(e,t)=>{const o=((e,t)=>{const o=ld(t);return Dd({fields:[Ka("enabled")],name:e,active:{events:y(o)}})})(e,t);return{key:e,value:{config:{},me:o,configAsRaw:y({}),initialConfig:{},state:Xc}}},zd=(e,t)=>{t.ignore||(Bo(e.element),t.onFocus(e))};var Hd=Object.freeze({__proto__:null,focus:zd,blur:(e,t)=>{t.ignore||zo(e.element)},isFocused:e=>Ho(e.element)});var Ld=Object.freeze({__proto__:null,exhibit:(e,t)=>{const o=t.ignore?{}:{attributes:{tabindex:"-1"}};return Cd(o)},events:e=>ld([md(Gs(),(t,o)=>{zd(t,e),o.stop()})].concat(e.stopMousedown?[md(Ds(),(e,t)=>{t.event.prevent()})]:[]))}),Id=[zi("onFocus"),us("stopMousedown",!1),us("ignore",!1)];const Pd=Dd({fields:Id,name:"focusing",active:Ld,apis:Hd}),Fd=[8],Vd=[9],Zd=[13],Ud=[27],jd=[32],Wd=[37],$d=[38],qd=[39],Gd=[40],Kd=(e,t,o)=>{const n=K(e.slice(0,t)),r=K(e.slice(t+1));return j(n.concat(r),o)},Yd=(e,t,o)=>{const n=K(e.slice(0,t));return j(n,o)},Xd=(e,t,o)=>{const n=e.slice(0,t),r=e.slice(t+1);return j(r.concat(n),o)},Jd=(e,t,o)=>{const n=e.slice(t+1);return j(n,o)},Qd=e=>t=>{const o=t.raw;return B(e,o.which)},em=e=>t=>G(e,e=>e(t)),tm=e=>!0===e.raw.shiftKey,om=e=>!0===e.raw.ctrlKey,nm=k(tm),rm=(e,t)=>({matches:e,classification:t}),am=(e,t,o,n)=>{const r=pr(e.element,"."+t.highlightClass);P(r,o=>{z(n,e=>xt(e.element,o))||(ar(o,t.highlightClass),e.getSystem().getByDom(o).each(o=>{t.onDehighlight(e,o),od(o,vi())}))})},sm=(e,t,o,n)=>{am(e,t,0,[n]),im(e,t,o,n)||(nr(n.element,t.highlightClass),t.onHighlight(e,n),od(n,xi()))},im=(e,t,o,n)=>ir(n.element,t.highlightClass),lm=(e,t,o,n)=>{const r=pr(e.element,"."+t.itemClass);return A.from(r[n]).fold(()=>Ae.error(new Error("No element found with index "+n)),e.getSystem().getByDom)},cm=(e,t,o)=>Kn(e.element,"."+t.itemClass).bind(t=>e.getSystem().getByDom(t).toOptional()),dm=(e,t,o)=>{const n=pr(e.element,"."+t.itemClass);return(n.length>0?A.some(n[n.length-1]):A.none()).bind(t=>e.getSystem().getByDom(t).toOptional())},mm=(e,t,o,n)=>{const r=pr(e.element,"."+t.itemClass),a=W(r,e=>ir(e,t.highlightClass));return a.bind(t=>{const o=Be(t,n,0,r.length-1);return e.getSystem().getByDom(r[o]).toOptional()})},um=(e,t,o)=>{const n=pr(e.element,"."+t.itemClass);return Ze(I(n,t=>e.getSystem().getByDom(t).toOptional()))};var gm=Object.freeze({__proto__:null,dehighlightAll:(e,t,o)=>am(e,t,0,[]),dehighlight:(e,t,o,n)=>{im(e,t,o,n)&&(ar(n.element,t.highlightClass),t.onDehighlight(e,n),od(n,vi()))},highlight:sm,highlightFirst:(e,t,o)=>{cm(e,t).each(n=>{sm(e,t,o,n)})},highlightLast:(e,t,o)=>{dm(e,t).each(n=>{sm(e,t,o,n)})},highlightAt:(e,t,o,n)=>{lm(e,t,o,n).fold(e=>{throw e},n=>{sm(e,t,o,n)})},highlightBy:(e,t,o,n)=>{const r=um(e,t);j(r,n).each(n=>{sm(e,t,o,n)})},isHighlighted:im,getHighlighted:(e,t,o)=>Kn(e.element,"."+t.highlightClass).bind(t=>e.getSystem().getByDom(t).toOptional()),getFirst:cm,getLast:dm,getPrevious:(e,t,o)=>mm(e,t,0,-1),getNext:(e,t,o)=>mm(e,t,0,1),getCandidates:um}),pm=[Ka("highlightClass"),Ka("itemClass"),zi("onHighlight"),zi("onDehighlight")];const hm=Dd({fields:pm,name:"highlighting",apis:gm}),fm=(e,t,o)=>{t.exists(e=>o.exists(t=>xt(t,e)))||nd(e,gi(),{prevFocus:t,newFocus:o})},bm=()=>{const e=e=>Io(e.element);return{get:e,set:(t,o)=>{const n=e(t);t.getSystem().triggerFocus(o,t.element);const r=e(t);fm(t,n,r)}}},xm=()=>{const e=e=>hm.getHighlighted(e).map(e=>e.element);return{get:e,set:(t,o)=>{const n=e(t);t.getSystem().getByDom(o).fold(b,e=>{hm.highlight(t,e)});const r=e(t);fm(t,n,r)}}},vm=(e,t,o,n,r)=>{const a=(e,t,o,n,r)=>((e,t)=>{const o=j(e,e=>e.matches(t));return o.map(e=>e.classification)})(o(e,t,n,r),t.event).bind(o=>o(e,t,n,r)),s={schema:()=>e.concat([us("focusManager",bm()),gs("focusInside","onFocus",Ia(e=>B(["onFocus","onEnterOrSpace","onApi"],e)?Ae.value(e):Ae.error("Invalid value for focusInside"))),Pi("handler",s),Pi("state",t),Pi("sendFocusIn",r)]),processKey:a,toEvents:(e,t)=>{const s=e.focusInside!==qi.OnFocusMode?A.none():r(e).map(o=>md(Gs(),(n,r)=>{o(n,e,t),r.stop()})),i=[md(Ls(),(n,s)=>{a(n,s,o,e,t).fold(()=>{((o,n)=>{const a=Qd(jd.concat(Zd))(n.event);e.focusInside===qi.OnEnterOrSpaceMode&&a&&Ur(o,n)&&r(e).each(r=>{r(o,e,t),n.stop()})})(n,s)},e=>{s.stop()})}),md(Is(),(o,r)=>{a(o,r,n,e,t).each(e=>{r.stop()})})];return ld(s.toArray().concat(i))}};return s},ym=e=>{const t=[rs("onEscape"),rs("onEnter"),us("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),us("firstTabstop",0),us("useTabstopAt",T),rs("visibilitySelector")].concat([e]),o=(e,t)=>{const o=e.visibilitySelector.bind(e=>Yn(t,e)).getOr(t);return Cn(o)>0},n=(e,t)=>t.focusManager.get(e).bind(e=>Yn(e,t.selector)),r=(e,t,n)=>{((e,t)=>{const n=pr(e.element,t.selector),r=V(n,e=>o(t,e));return A.from(r[t.firstTabstop])})(e,t).each(o=>{t.focusManager.set(e,o)})},a=(e,t,n,r,a)=>a(t,n,e=>((e,t)=>o(e,t)&&e.useTabstopAt(t))(r,e)).fold(()=>r.cyclic?A.some(!0):A.none(),t=>(r.focusManager.set(e,t),A.some(!0))),s=(e,t,r,s)=>{const i=V(pr(e.element,r.selector),e=>o(r,e));return n(e,r).bind(t=>W(i,C(xt,t)).bind(t=>a(e,i,t,r,s)))},i=(e,t,o)=>{const n=o.cyclic?Kd:Yd;return s(e,0,o,n)},l=(e,t,o)=>{const n=o.cyclic?Xd:Jd;return s(e,0,o,n)},c=e=>(e=>mo(e))(e).bind(fo).exists(t=>xt(t,e)),d=y([rm(em([tm,Qd(Vd)]),i),rm(Qd(Vd),l),rm(em([nm,Qd(Zd)]),(e,t,o)=>o.onEnter.bind(o=>o(e,t)))]),m=y([rm(Qd(Ud),(e,t,o)=>o.onEscape.bind(o=>o(e,t))),rm(Qd(Vd),(e,t,o)=>n(e,o).filter(e=>!o.useTabstopAt(e)).bind(n=>(c(n)?i:l)(e,t,o)))]);return vm(t,Xc.init,d,m,()=>A.some(r))};var wm=ym(qa("cyclic",O)),_m=ym(qa("cyclic",T));const Cm=e=>ao("input")(e)&&"radio"!==qo(e,"type")||ao("textarea")(e),km=(e,t,o)=>Cm(o)&&Qd(jd)(t.event)?A.none():((e,t,o)=>(ad(e,o,Js()),A.some(!0)))(e,0,o),Sm=(e,t)=>A.some(!0),Em=[us("execute",km),us("useSpace",!1),us("useEnter",!0),us("useControlEnter",!1),us("useDown",!1)],Om=(e,t,o)=>o.execute(e,t,e.element);var Tm=vm(Em,Xc.init,(e,t,o,n)=>{const r=o.useSpace&&!Cm(e.element)?jd:[],a=o.useEnter?Zd:[],s=o.useDown?Gd:[],i=r.concat(a).concat(s);return[rm(Qd(i),Om)].concat(o.useControlEnter?[rm(em([om,Qd(Zd)]),Om)]:[])},(e,t,o,n)=>o.useSpace&&!Cm(e.element)?[rm(Qd(jd),Sm)]:[],()=>A.none());const Am=()=>{const e=Ke();return Jc({readState:()=>e.get().map(e=>({numRows:String(e.numRows),numColumns:String(e.numColumns)})).getOr({numRows:"?",numColumns:"?"}),setGridSize:(t,o)=>{e.set({numRows:t,numColumns:o})},getNumRows:()=>e.get().map(e=>e.numRows),getNumColumns:()=>e.get().map(e=>e.numColumns)})};var Dm=Object.freeze({__proto__:null,flatgrid:Am,init:e=>e.state(e)});const Mm=e=>(t,o,n,r)=>{const a=e(t.element);return zm(a,t,o,n,r)},Rm=(e,t)=>{const o=Pn(e,t);return Mm(o)},Nm=(e,t)=>{const o=Pn(t,e);return Mm(o)},Bm=e=>(t,o,n,r)=>zm(e,t,o,n,r),zm=(e,t,o,n,r)=>n.focusManager.get(t).bind(o=>e(t.element,o,n,r)).map(e=>(n.focusManager.set(t,e),!0)),Hm=Bm,Lm=Bm,Im=Bm,Pm=(e,t,o)=>{const n=pr(e,o);return((e,t)=>W(e,t).map(t=>({index:t,candidates:e})))(V(n,Sn),e=>xt(e,t))},Fm=(e,t)=>W(e,e=>xt(t,e)),Vm=(e,t,o,n)=>n(Math.floor(t/o),t%o).bind(t=>{const n=t.row*o+t.column;return n>=0&&n<e.length?A.some(e[n]):A.none()}),Zm=(e,t,o,n,r)=>Vm(e,t,n,(t,a)=>{const s=t===o-1?e.length-t*n:n,i=Be(a,r,0,s-1);return A.some({row:t,column:i})}),Um=(e,t,o,n,r)=>Vm(e,t,n,(t,a)=>{const s=Be(t,r,0,o-1),i=s===o-1?e.length-s*n:n,l=ze(a,0,i-1);return A.some({row:s,column:l})}),jm=[Ka("selector"),us("execute",km),Hi("onEscape"),us("captureTab",!1),Vi()],Wm=(e,t,o)=>{Kn(e.element,t.selector).each(o=>{t.focusManager.set(e,o)})},$m=e=>(t,o,n,r)=>Pm(t,o,n.selector).bind(t=>e(t.candidates,t.index,r.getNumRows().getOr(n.initSize.numRows),r.getNumColumns().getOr(n.initSize.numColumns))),qm=(e,t,o)=>o.captureTab?A.some(!0):A.none(),Gm=$m((e,t,o,n)=>Zm(e,t,o,n,-1)),Km=$m((e,t,o,n)=>Zm(e,t,o,n,1)),Ym=$m((e,t,o,n)=>Um(e,t,o,n,-1)),Xm=$m((e,t,o,n)=>Um(e,t,o,n,1)),Jm=y([rm(Qd(Wd),Rm(Gm,Km)),rm(Qd(qd),Nm(Gm,Km)),rm(Qd($d),Hm(Ym)),rm(Qd(Gd),Lm(Xm)),rm(em([tm,Qd(Vd)]),qm),rm(em([nm,Qd(Vd)]),qm),rm(Qd(jd.concat(Zd)),(e,t,o,n)=>((e,t)=>t.focusManager.get(e).bind(e=>Yn(e,t.selector)))(e,o).bind(n=>o.execute(e,t,n)))]),Qm=y([rm(Qd(Ud),(e,t,o)=>o.onEscape(e,t)),rm(Qd(jd),Sm)]);var eu=vm(jm,Am,Jm,Qm,()=>A.some(Wm));const tu=(e,t,o,n,r)=>{const a=(e,t,o)=>r(e,t,n,0,o.length-1,o[t],t=>{return n=o[t],"button"===Jt(n)&&"disabled"===qo(n,"disabled")?a(e,t,o):A.from(o[t]);var n});return Pm(e,o,t).bind(e=>{const t=e.index,o=e.candidates;return a(t,t,o)})},ou=(e,t,o,n)=>tu(e,t,o,n,(e,t,o,n,r,a,s)=>{const i=ze(t+o,n,r);return i===e?A.from(a):s(i)}),nu=(e,t,o,n)=>tu(e,t,o,n,(e,t,o,n,r,a,s)=>{const i=Be(t,o,n,r);return i===e?A.none():s(i)}),ru=[Ka("selector"),us("getInitial",A.none),us("execute",km),Hi("onEscape"),us("executeOnMove",!1),us("allowVertical",!0),us("allowHorizontal",!0),us("cycles",!0)],au=(e,t,o)=>((e,t)=>t.focusManager.get(e).bind(e=>Yn(e,t.selector)))(e,o).bind(n=>o.execute(e,t,n)),su=(e,t,o)=>{t.getInitial(e).orThunk(()=>Kn(e.element,t.selector)).each(o=>{t.focusManager.set(e,o)})},iu=(e,t,o)=>(o.cycles?nu:ou)(e,o.selector,t,-1),lu=(e,t,o)=>(o.cycles?nu:ou)(e,o.selector,t,1),cu=e=>(t,o,n,r)=>e(t,o,n,r).bind(()=>n.executeOnMove?au(t,o,n):A.some(!0)),du=y([rm(Qd(jd),Sm),rm(Qd(Ud),(e,t,o)=>o.onEscape(e,t))]);var mu=vm(ru,Xc.init,(e,t,o,n)=>{const r=[...o.allowHorizontal?Wd:[]].concat(o.allowVertical?$d:[]),a=[...o.allowHorizontal?qd:[]].concat(o.allowVertical?Gd:[]);return[rm(Qd(r),cu(Rm(iu,lu))),rm(Qd(a),cu(Nm(iu,lu))),rm(Qd(Zd),au),rm(Qd(jd),au)]},du,()=>A.some(su));const uu=(e,t,o)=>A.from(e[t]).bind(e=>A.from(e[o]).map(e=>({rowIndex:t,columnIndex:o,cell:e}))),gu=(e,t,o,n)=>{const r=e[t].length,a=Be(o,n,0,r-1);return uu(e,t,a)},pu=(e,t,o,n)=>{const r=Be(o,n,0,e.length-1),a=e[r].length,s=ze(t,0,a-1);return uu(e,r,s)},hu=(e,t,o,n)=>{const r=e[t].length,a=ze(o+n,0,r-1);return uu(e,t,a)},fu=(e,t,o,n)=>{const r=ze(o+n,0,e.length-1),a=e[r].length,s=ze(t,0,a-1);return uu(e,r,s)},bu=[ts("selectors",[Ka("row"),Ka("cell")]),us("cycles",!0),us("previousSelector",A.none),us("execute",km)],xu=(e,t,o)=>{t.previousSelector(e).orThunk(()=>{const o=t.selectors;return Kn(e.element,o.cell)}).each(o=>{t.focusManager.set(e,o)})},vu=(e,t)=>(o,n,r)=>{const a=r.cycles?e:t;return Yn(n,r.selectors.row).bind(e=>{const t=pr(e,r.selectors.cell);return Fm(t,n).bind(t=>{const n=pr(o,r.selectors.row);return Fm(n,e).bind(e=>{const o=((e,t)=>I(e,e=>pr(e,t.selectors.cell)))(n,r);return a(o,e,t).map(e=>e.cell)})})})},yu=vu((e,t,o)=>gu(e,t,o,-1),(e,t,o)=>hu(e,t,o,-1)),wu=vu((e,t,o)=>gu(e,t,o,1),(e,t,o)=>hu(e,t,o,1)),_u=vu((e,t,o)=>pu(e,o,t,-1),(e,t,o)=>fu(e,o,t,-1)),Cu=vu((e,t,o)=>pu(e,o,t,1),(e,t,o)=>fu(e,o,t,1)),ku=y([rm(Qd(Wd),Rm(yu,wu)),rm(Qd(qd),Nm(yu,wu)),rm(Qd($d),Hm(_u)),rm(Qd(Gd),Lm(Cu)),rm(Qd(jd.concat(Zd)),(e,t,o)=>Io(e.element).bind(n=>o.execute(e,t,n)))]),Su=y([rm(Qd(jd),Sm)]);var Eu=vm(bu,Xc.init,ku,Su,()=>A.some(xu));const Ou=[Ka("selector"),us("execute",km),us("moveOnTab",!1)],Tu=(e,t,o)=>o.focusManager.get(e).bind(n=>o.execute(e,t,n)),Au=(e,t,o)=>{Kn(e.element,t.selector).each(o=>{t.focusManager.set(e,o)})},Du=(e,t,o)=>nu(e,o.selector,t,-1),Mu=(e,t,o)=>nu(e,o.selector,t,1),Ru=y([rm(Qd($d),Im(Du)),rm(Qd(Gd),Im(Mu)),rm(em([tm,Qd(Vd)]),(e,t,o,n)=>o.moveOnTab?Im(Du)(e,t,o,n):A.none()),rm(em([nm,Qd(Vd)]),(e,t,o,n)=>o.moveOnTab?Im(Mu)(e,t,o,n):A.none()),rm(Qd(Zd),Tu),rm(Qd(jd),Tu)]),Nu=y([rm(Qd(jd),Sm)]);var Bu=vm(Ou,Xc.init,Ru,Nu,()=>A.some(Au));const zu=[Hi("onSpace"),Hi("onEnter"),Hi("onShiftEnter"),Hi("onLeft"),Hi("onRight"),Hi("onTab"),Hi("onShiftTab"),Hi("onUp"),Hi("onDown"),Hi("onEscape"),us("stopSpaceKeyup",!1),rs("focusIn")];var Hu=vm(zu,Xc.init,(e,t,o)=>[rm(Qd(jd),o.onSpace),rm(em([nm,Qd(Zd)]),o.onEnter),rm(em([tm,Qd(Zd)]),o.onShiftEnter),rm(em([tm,Qd(Vd)]),o.onShiftTab),rm(em([nm,Qd(Vd)]),o.onTab),rm(Qd($d),o.onUp),rm(Qd(Gd),o.onDown),rm(Qd(Wd),o.onLeft),rm(Qd(qd),o.onRight),rm(Qd(jd),o.onSpace)],(e,t,o)=>[...o.stopSpaceKeyup?[rm(Qd(jd),Sm)]:[],rm(Qd(Ud),o.onEscape)],e=>e.focusIn);const Lu=wm.schema(),Iu=_m.schema(),Pu=mu.schema(),Fu=eu.schema(),Vu=Eu.schema(),Zu=Tm.schema(),Uu=Bu.schema(),ju=Hu.schema();const Wu=Rd({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:Lu,cyclic:Iu,flow:Pu,flatgrid:Fu,matrix:Vu,execution:Zu,menu:Uu,special:ju}),name:"keying",active:{events:(e,t)=>e.handler.toEvents(e,t)},apis:{focusIn:(e,t,o)=>{t.sendFocusIn(t).fold(()=>{e.getSystem().triggerFocus(e.element,e.element)},n=>{n(e,t,o)})},setGridSize:(e,t,o,n,r)=>{(e=>xe(e,"setGridSize"))(o)?o.setGridSize(n,r):console.error("Layout does not support setGridSize")}},state:Dm}),$u=Le("alloy-premade"),qu=e=>(Object.defineProperty(e.element.dom,$u,{value:e.uid,writable:!0}),_s($u,e)),Gu=e=>fe(e,$u),Ku=e=>((e,t)=>{const o=t.toString(),n=o.indexOf(")")+1,r=o.indexOf("("),a=o.substring(r+1,n-1).split(/,\s*/);return e.toFunctionAnnotation=()=>({name:"OVERRIDE",parameters:Zi(a.slice(1))}),e})((t,...o)=>e(t.getApis(),t,...o),e),Yu=e=>e.getSystem().isConnected(),Xu=e=>{od(e,di());const t=e.components();P(t,Xu)},Ju=e=>{const t=e.components();P(t,Ju),od(e,ci())},Qu=(e,t)=>{e.getSystem().addToWorld(t),an(e.element)&&Ju(t)},eg=e=>{Xu(e),e.getSystem().removeFromWorld(e)},tg=(e,t)=>{Zo(e.element,t.element)},og=(e,t,o)=>{const n=e.components();(e=>{P(e.components(),e=>Jo(e.element)),Xo(e.element),e.syncComponents()})(e);const r=o(t),a=Y(n,r);P(a,t=>{Xu(t),e.getSystem().removeFromWorld(t)}),P(r,t=>{Yu(t)?tg(e,t):(e.getSystem().addToWorld(t),tg(e,t),an(e.element)&&Ju(t))}),e.syncComponents()},ng=(e,t)=>{rg(e,t,Zo)},rg=(e,t,o)=>{e.getSystem().addToWorld(t),o(e.element,t.element),an(e.element)&&Ju(t),e.syncComponents()},ag=e=>{Xu(e),Jo(e.element),e.getSystem().removeFromWorld(e)},sg=e=>{const t=mo(e.element).bind(t=>e.getSystem().getByDom(t).toOptional());ag(e),t.each(e=>{e.syncComponents()})},ig=e=>{const t=e.components();P(t,ag),Xo(e.element),e.syncComponents()},lg=(e,t)=>{dg(e,t,Zo)},cg=(e,t)=>{dg(e,t,Fo)},dg=(e,t,o)=>{o(e,t.element);const n=po(t.element);P(n,e=>{t.getByDom(e).each(Ju)})},mg=e=>{const t=po(e.element);P(t,t=>{e.getByDom(t).each(Xu)}),Jo(e.element)},ug=(e,t,o)=>{o.fold(()=>Zo(e,t),e=>{xt(e,t)||(Po(e,t),Jo(e))})},gg=(e,t,o)=>{const n=I(t,o),r=po(e);return P(r.slice(n.length),Jo),n},pg=(e,t,o,n)=>{const r=ho(e,t),a=n(o,r),s=((e,t,o)=>ho(e,t).map(e=>{if(o.exists(t=>!xt(t,e))){const t=o.map(Jt).getOr("span"),n=it.fromTag(t);return Po(e,n),n}return e}))(e,t,r);return ug(e,a.element,s),a},hg=(e,t)=>{const o=wo(t),n=Lo(o).bind(e=>{const o=t=>xt(e,t);return o(t)?A.some(t):((e,t)=>{const o=e=>{for(let n=0;n<e.childNodes.length;n++){const r=it.fromDom(e.childNodes[n]);if(t(r))return A.some(r);const a=o(e.childNodes[n]);if(a.isSome())return a}return A.none()};return o(e.dom)})(t,o)}),r=e(t);return n.each(e=>{Lo(o).filter(t=>xt(t,e)).fold(()=>{Bo(e)},b)}),r},fg=(e,t)=>{hg(()=>{og(e,t,()=>I(t,e.getSystem().build))},e.element)},bg=(e,t)=>{hg(()=>{((e,t,o)=>{const n=e.components(),r=q(t,e=>Gu(e).toArray());P(n,e=>{B(r,e)||eg(e)});const a=o(t),s=Y(n,a);P(s,e=>{Yu(e)&&eg(e)}),P(a,t=>{Yu(t)||Qu(e,t)}),e.syncComponents()})(e,t,()=>((e,t,o)=>gg(e,t,(t,n)=>pg(e,n,t,o)))(e.element,t,e.getSystem().buildOrPatch))},e.element)},xg=(e,t,o,n)=>{eg(t);const r=pg(e.element,o,n,e.getSystem().buildOrPatch);Qu(e,r),e.syncComponents()},vg=(e,t,o)=>{const n=e.getSystem().build(o);rg(e,n,t)},yg=(e,t,o,n)=>{sg(t),vg(e,(e,t)=>((e,t,o)=>{ho(e,o).fold(()=>{Zo(e,t)},e=>{Po(e,t)})})(e,t,o),n)},wg=(e,t)=>e.components(),_g=(e,t,o,n,r)=>{const a=wg(e);return A.from(a[n]).map(o=>(r.fold(()=>sg(o),r=>{(t.reuseDom?xg:yg)(e,o,n,r)}),o))};var Cg=Object.freeze({__proto__:null,append:(e,t,o,n)=>{vg(e,Zo,n)},prepend:(e,t,o,n)=>{vg(e,Vo,n)},remove:(e,t,o,n)=>{const r=wg(e),a=j(r,e=>xt(n.element,e.element));a.each(sg)},replaceAt:_g,replaceBy:(e,t,o,n,r)=>{const a=wg(e);return W(a,n).bind(o=>_g(e,t,0,o,r))},set:(e,t,o,n)=>(t.reuseDom?bg:fg)(e,n),contents:wg});const kg=Dd({fields:[bs("reuseDom",!0)],name:"replacing",apis:Cg}),Sg=ld([((e,t)=>({key:e,value:ed({can:t})}))(Gs(),(e,t)=>{const o=t.event,n=o.originator,r=o.target;return!((e,t,o)=>xt(t,e.element)&&!xt(t,o))(e,n,r)||(console.warn(Gs()+" did not get interpreted by the desired target. \nOriginator: "+yi(n)+"\nTarget: "+yi(r)+"\nCheck the "+Gs()+" event handlers"),!1)})]);var Eg=Object.freeze({__proto__:null,events:Sg});const Og=y("alloy-id-"),Tg=y("data-alloy-id"),Ag=Og(),Dg=Tg(),Mg=(e,t)=>{Object.defineProperty(e.dom,Dg,{value:t,writable:!0})},Rg=e=>{const t=to(e)?e.dom[Dg]:null;return A.from(t)},Ng=e=>Le(e),Bg=w,zg=e=>{const t=t=>`The component must be in a context to execute: ${t}`+(e?"\n"+yi(e().element)+" is not in context.":""),o=e=>()=>{throw new Error(t(e))},n=e=>()=>{console.warn(t(e))};return{debugInfo:y("fake"),triggerEvent:n("triggerEvent"),triggerFocus:n("triggerFocus"),triggerEscape:n("triggerEscape"),broadcast:n("broadcast"),broadcastOn:n("broadcastOn"),broadcastEvent:n("broadcastEvent"),build:o("build"),buildOrPatch:o("buildOrPatch"),addToWorld:o("addToWorld"),removeFromWorld:o("removeFromWorld"),addToGui:o("addToGui"),removeFromGui:o("removeFromGui"),getByUid:o("getByUid"),getByDom:o("getByDom"),isConnected:O}},Hg=zg(),Lg=(e,t)=>{const o={};return ie(e,(e,n)=>{ie(e,(e,r)=>{const a=fe(o,r).getOr([]);o[r]=a.concat([t(n,e)])})}),o},Ig=e=>e.cHandler,Pg=(e,t)=>({name:e,handler:t}),Fg=(e,t)=>{const o={};return P(e,e=>{o[e.name()]=e.handlers(t)}),o},Vg=(e,t,o,n)=>{const r=((e,t,o)=>{const n={...o,...Fg(t,e)};return Lg(n,Pg)})(e,o,n);return jg(r,t)},Zg=e=>{const t=(e=>p(e)?{can:T,abort:O,run:e}:e)(e);return(e,o,...n)=>{const r=[e,o].concat(n);t.abort.apply(void 0,r)?o.stop():t.can.apply(void 0,r)&&t.run.apply(void 0,r)}},Ug=(e,t,o)=>{const n=t[o];return n?((e,t,o,n)=>{try{const r=Q(o,(o,r)=>{const a=o[t],s=r[t],i=n.indexOf(a),l=n.indexOf(s);if(-1===i)throw new Error("The ordering for "+e+" does not have an entry for "+a+".\nOrder specified: "+JSON.stringify(n,null,2));if(-1===l)throw new Error("The ordering for "+e+" does not have an entry for "+s+".\nOrder specified: "+JSON.stringify(n,null,2));return i<l?-1:l<i?1:0});return Ae.value(r)}catch(e){return Ae.error([e])}})("Event: "+o,"name",e,n).map(e=>{const t=I(e,e=>e.handler);return td(t)}):((e,t)=>Ae.error(["The event ("+e+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(I(t,e=>e.name),null,2)]))(o,e)},jg=(e,t)=>{const o=ge(e,(e,o)=>(1===e.length?Ae.value(e[0].handler):Ug(e,t,o)).map(n=>{const r=Zg(n),a=e.length>1?V(t[o],t=>z(e,e=>e.name===t)).join(" > "):e[0].name;return _s(o,((e,t)=>({handler:e,purpose:t}))(r,a))}));return ks(o,{})},Wg="alloy.base.behaviour",$g=Ma([$a("dom","dom",{tag:"required",process:{}},Ma([Ka("tag"),us("styles",{}),us("classes",[]),us("attributes",{}),rs("value"),rs("innerHtml")])),Ka("components"),Ka("uid"),us("events",{}),us("apis",{}),$a("eventOrder","eventOrder",(e=>ya(y(e)))({[Js()]:["disabling",Wg,"toggling","typeaheadevents"],[Gs()]:[Wg,"focusing","keying"],[ri()]:[Wg,"disabling","toggling","representing","tooltipping"],[Ps()]:[Wg,"representing","streaming","invalidating"],[di()]:[Wg,"representing","item-events","toolbar-button-events","tooltipping"],[Ds()]:["focusing",Wg,"item-type-events"],[Es()]:["focusing",Wg,"item-type-events"],[Bs()]:["item-type-events","tooltipping"],[Xs()]:["receiving","reflecting","tooltipping"]}),da()),rs("domModification")]),qg=e=>e.events,Gg=(e,t)=>{const o=ae(e),n=ae(t),r=Y(n,o),a=((e,t)=>{const o={},n={};return me(e,t,de(o),de(n)),{t:o,f:n}})(e,(e,o)=>!be(t,o)||e!==t[o]).t;return{toRemove:r,toSet:a}},Kg=(e,t)=>{const{class:o,style:n,...r}=(e=>U(e.dom.attributes,(e,t)=>(e[t.name]=t.value,e),{}))(t),{toSet:a,toRemove:s}=Gg(e.attributes,r),i=bn(t),{toSet:l,toRemove:c}=Gg(e.styles,i),d=dr(t),m=Y(d,e.classes),u=Y(e.classes,d);return P(s,e=>Yo(t,e)),$o(t,a),lr(t,u),cr(t,m),P(c,e=>vn(t,e)),un(t,l),e.innerHtml.fold(()=>{const o=e.domChildren;((e,t)=>{gg(e,t,(t,o)=>{const n=ho(e,o);return ug(e,t,n),t})})(t,o)},e=>{tn(t,e)}),(()=>{const o=t,n=e.value.getOrUndefined();n!==mr(o)&&ur(o,null!=n?n:"")})(),t},Yg=(e,t)=>{const o=t.filter(t=>Jt(t)===e.tag&&!(e=>e.innerHtml.isSome()&&e.domChildren.length>0)(e)&&!(e=>be(e.dom,$u))(t)).bind(t=>((e,t)=>{try{const o=Kg(e,t);return A.some(o)}catch(e){return A.none()}})(e,t)).getOrThunk(()=>(e=>{const t=it.fromTag(e.tag);$o(t,e.attributes),lr(t,e.classes),un(t,e.styles),e.innerHtml.each(e=>tn(t,e));const o=e.domChildren;return Uo(t,o),e.value.each(e=>{ur(t,e)}),t})(e));return Mg(o,e.uid),o},Xg=(e,t)=>((e,t)=>{const o=I(t,e=>ms(e.name(),[Ka("config"),us("state",Xc)])),n=Fa("component.behaviours",Ma(o),e.behaviours).fold(t=>{throw new Error(Ua(t)+"\nComplete spec:\n"+JSON.stringify(e,null,2))},w);return{list:t,data:le(n,e=>{const t=e.map(e=>({config:e.config,state:e.state.init(e.config)}));return y(t)})}})(e,t),Jg=e=>{const t=(e=>{const t=fe(e,"behaviours").getOr({});return q(ae(t),e=>{const o=t[e];return g(o)?[o.me]:[]})})(e);return Xg(e,t)},Qg=(e,t,o)=>{const n={...(r=e).dom,uid:r.uid,domChildren:I(r.components,e=>e.element)};var r;const a=(e=>e.domModification.fold(()=>Cd({}),Cd))(e),s={"alloy.base.modification":a},i=t.length>0?((e,t,o,n)=>{const r={...t};P(o,t=>{r[t.name()]=t.exhibit(e,n)});const a=Lg(r,(e,t)=>({name:e,modification:t})),s=e=>Z(e,(e,t)=>({...t.modification,...e}),{}),i=Z(a.classes,(e,t)=>t.modification.concat(e),[]),l=s(a.attributes),c=s(a.styles);return Cd({classes:i,attributes:l,styles:c})})(o,s,t,n):a;return l=n,c=i,{...l,attributes:{...l.attributes,...c.attributes},styles:{...l.styles,...c.styles},classes:l.classes.concat(c.classes)};var l,c},ep=(e,t)=>{const o=()=>u,n=ye(Hg),r=Va((e=>Fa("custom.definition",$g,e))(e)),a=Jg(e),s=(e=>e.list)(a),i=(e=>e.data)(a),l=Qg(r,s,i),c=Yg(l,t),d=((e,t,o)=>{const n={"alloy.base.behaviour":qg(e)};return Vg(o,e.eventOrder,t,n).getOrDie()})(r,s,i),m=ye(r.components),u={uid:e.uid,getSystem:n.get,config:t=>{const o=i;return(p(o[t.name()])?o[t.name()]:()=>{throw new Error("Could not find "+t.name()+" in "+JSON.stringify(e,null,2))})()},hasConfigured:e=>p(i[e.name()]),spec:e,readState:e=>i[e]().map(e=>e.state.readState()).getOr("not enabled"),getApis:()=>r.apis,connect:e=>{n.set(e)},disconnect:()=>{n.set(zg(o))},element:c,syncComponents:()=>{const e=po(c),t=q(e,e=>n.get().getByDom(e).fold(()=>[],J));m.set(t)},components:m.get,events:d};return u},tp=(e,t)=>{const{events:o,...n}=Bg(e),r=((e,t)=>{const o=fe(e,"components").getOr([]);return t.fold(()=>I(o,sp),e=>I(o,(t,o)=>ap(t,ho(e,o))))})(n,t),a={...n,events:{...Eg,...o},components:r};return Ae.value(ep(a,t))},op=e=>{const t=it.fromText(e);return np({element:t})},np=e=>{const t=Za("external.component",Da([Ka("element"),rs("uid")]),e),o=ye(zg()),n=t.uid.getOrThunk(()=>Ng("external"));Mg(t.element,n);const r={uid:n,getSystem:o.get,config:A.none,hasConfigured:O,connect:e=>{o.set(e)},disconnect:()=>{o.set(zg(()=>r))},getApis:()=>({}),element:t.element,spec:e,readState:y("No state"),syncComponents:b,components:y([]),events:{}};return qu(r)},rp=Ng,ap=(e,t)=>Gu(e).getOrThunk(()=>{const o=(e=>be(e,"uid"))(e)?e:{uid:rp(""),...e};return tp(o,t).getOrDie()}),sp=e=>ap(e,A.none()),ip=qu;var lp=Object.freeze({__proto__:null,block:(e,t,o,n)=>{Wo(e.element,"aria-busy",!0);const r=t.getRoot(e).getOr(e),a=Td([Wu.config({mode:"special",onTab:()=>A.some(!0),onShiftTab:()=>A.some(!0)}),Pd.config({})]),s=n(r,a),i=r.getSystem().build(s);kg.append(r,ip(i)),i.hasConfigured(Wu)&&t.focus&&Wu.focusIn(i),o.isBlocked()||t.onBlock(e),o.blockWith(()=>kg.remove(r,i))},unblock:(e,t,o)=>{Yo(e.element,"aria-busy"),o.isBlocked()&&t.onUnblock(e),o.clear()},isBlocked:(e,t,o)=>o.isBlocked()}),cp=[xs("getRoot",A.none),bs("focus",!0),zi("onBlock"),zi("onUnblock")];const dp=Dd({fields:cp,name:"blocking",apis:lp,state:Object.freeze({__proto__:null,init:()=>{const e=qe(e=>e.destroy());return Jc({readState:e.isSet,blockWith:t=>{e.set({destroy:t})},clear:e.clear,isBlocked:e.isSet})}})});var mp=Object.freeze({__proto__:null,getCurrent:(e,t,o)=>t.find(e)});const up=[Ka("find")],gp=Dd({fields:up,name:"composing",apis:mp});var pp=Object.freeze({__proto__:null,getCoupled:(e,t,o,n)=>o.getOrCreate(e,t,n),getExistingCoupled:(e,t,o,n)=>o.getExisting(e,t,n)}),hp=[Ya("others",Pa(Ae.value,da()))];var fp=Object.freeze({__proto__:null,init:()=>{const e={},t=(t,o)=>{if(0===ae(t.others).length)throw new Error("Cannot find any known coupled components");return fe(e,o)},o=y({});return Jc({readState:o,getExisting:(e,o,n)=>t(o,n).orThunk(()=>(fe(o.others,n).getOrDie("No information found for coupled component: "+n),A.none())),getOrCreate:(o,n,r)=>t(n,r).getOrThunk(()=>{const t=fe(n.others,r).getOrDie("No information found for coupled component: "+r)(o),a=o.getSystem().build(t);return e[r]=a,a})})}});const bp=Dd({fields:hp,name:"coupling",apis:pp,state:fp}),xp=["input","button","textarea","select"],vp=(e,t,o)=>{(t.disabled()?Sp:Ep)(e,t)},yp=(e,t)=>!0===t.useNative&&B(xp,Jt(e.element)),wp=e=>{Wo(e.element,"disabled","disabled")},_p=e=>{Yo(e.element,"disabled")},Cp=e=>{Wo(e.element,"aria-disabled","true")},kp=e=>{Wo(e.element,"aria-disabled","false")},Sp=(e,t,o)=>{t.disableClass.each(t=>{nr(e.element,t)});(yp(e,t)?wp:Cp)(e),t.onDisabled(e)},Ep=(e,t,o)=>{t.disableClass.each(t=>{ar(e.element,t)});(yp(e,t)?_p:kp)(e),t.onEnabled(e)},Op=(e,t)=>yp(e,t)?(e=>Ko(e.element,"disabled"))(e):(e=>"true"===qo(e.element,"aria-disabled"))(e);var Tp=Object.freeze({__proto__:null,enable:Ep,disable:Sp,isDisabled:Op,onLoad:vp,set:(e,t,o,n)=>{(n?Sp:Ep)(e,t)}});var Ap=Object.freeze({__proto__:null,exhibit:(e,t)=>Cd({classes:t.disabled()?t.disableClass.toArray():[]}),events:(e,t)=>ld([cd(Js(),(t,o)=>Op(t,e)),kd(e,t,vp)])}),Dp=[xs("disabled",O),us("useNative",!0),rs("disableClass"),zi("onDisabled"),zi("onEnabled")];const Mp=Dd({fields:Dp,name:"disabling",active:Ap,apis:Tp}),Rp=(e,t,o,n,r)=>{const a=e=>e+"px";return{position:e,left:t.map(a),top:o.map(a),right:n.map(a),bottom:r.map(a)}},Np=(e,t)=>{gn(e,(e=>({...e,position:A.some(e.position)}))(t))},Bp=(e,t)=>{const o=e.element;nr(o,t.transitionClass),ar(o,t.fadeOutClass),nr(o,t.fadeInClass),t.onShow(e)},zp=(e,t)=>{const o=e.element;nr(o,t.transitionClass),ar(o,t.fadeInClass),nr(o,t.fadeOutClass),t.onHide(e)},Hp=(e,t)=>e.y>=t.y,Lp=(e,t)=>e.bottom<=t.bottom,Ip=(e,t,o)=>({location:"top",leftX:t,topY:o.bounds.y-e.y}),Pp=(e,t,o)=>({location:"bottom",leftX:t,bottomY:e.bottom-o.bounds.bottom}),Fp=e=>e.box.x-e.win.x,Vp=(e,t,o)=>o.getInitialPos().map(o=>{const n=((e,t)=>{const o=t.optScrollEnv.fold(y(e.bounds.y),t=>t.scrollElmTop+(e.bounds.y-t.currentScrollTop));return Rn(e.bounds.x,o)})(o,t);return{box:Ir(n.left,n.top,Tn(e),Cn(e)),location:o.location}}),Zp=(e,t,o,n,r)=>{const a=((e,t)=>{const o=t.optScrollEnv.fold(y(e.y),t=>e.y+t.currentScrollTop-t.scrollElmTop);return Rn(e.x,o)})(t,o),s=Ir(a.left,a.top,t.width,t.height);n.setInitialPos({style:bn(e),position:pn(e,"position")||"static",bounds:s,location:r.location})},Up=(e,t,o)=>o.getInitialPos().bind(n=>{var r;switch(o.clearInitialPos(),n.position){case"static":return A.some({morph:"static"});case"absolute":const o=jr(e).getOr(sn()),a=Pr(o),s=null!==(r=o.dom.scrollTop)&&void 0!==r?r:0;return A.some({morph:"absolute",positionCss:Rp("absolute",fe(n.style,"left").map(e=>t.x-a.x),fe(n.style,"top").map(e=>t.y-a.y+s),fe(n.style,"right").map(e=>a.right-t.right),fe(n.style,"bottom").map(e=>a.bottom-t.bottom))});default:return A.none()}}),jp=(e,t,o)=>Vp(e,t,o).filter(({box:e})=>((e,t,o)=>G(e,e=>{switch(e){case"bottom":return Lp(t,o.bounds);case"top":return Hp(t,o.bounds)}}))(o.getModes(),e,t)).bind(({box:t})=>Up(e,t,o)),Wp=e=>{switch(e.location){case"top":return A.some({morph:"fixed",positionCss:Rp("fixed",A.some(e.leftX),A.some(e.topY),A.none(),A.none())});case"bottom":return A.some({morph:"fixed",positionCss:Rp("fixed",A.some(e.leftX),A.none(),A.none(),A.some(e.bottomY))});default:return A.none()}},$p=(e,t,o)=>{const n=Pr(e),r=Zr(),a=((e,t,o)=>{const n=t.win,r=t.box,a=Fp(t);return re(e,e=>{switch(e){case"bottom":return Lp(r,o.bounds)?A.none():A.some(Pp(n,a,o));case"top":return Hp(r,o.bounds)?A.none():A.some(Ip(n,a,o));default:return A.none()}}).getOr({location:"no-dock"})})(o.getModes(),{win:r,box:n},t);return"top"===a.location||"bottom"===a.location?(Zp(e,n,t,o,a),Wp(a)):A.none()},qp=(e,t,o)=>{const n=e.element;return Ve(fn(n,"position"),"fixed")?((e,t,o)=>jp(e,t,o).orThunk(()=>t.optScrollEnv.bind(n=>Vp(e,t,o)).bind(({box:e,location:o})=>{const n=Zr(),r=Fp({win:n,box:e}),a="top"===o?Ip(n,r,t):Pp(n,r,t);return Wp(a)})))(n,t,o):$p(n,t,o)},Gp=(e,t,o,n)=>{const r=Pr(e),a=Zr(),s=n(a,Fp({win:a,box:r}),t);return"bottom"===s.location||"top"===s.location?(((e,t,o,n,r)=>{n.getInitialPos().fold(()=>Zp(e,t,o,n,r),()=>b)})(e,r,t,o,s),Wp(s)):A.none()},Kp=(e,t,o)=>{o.setDocked(!1),P(["left","right","top","bottom","position"],t=>vn(e.element,t)),t.onUndocked(e)},Yp=(e,t,o,n)=>{const r="fixed"===n.position;o.setDocked(r),Np(e.element,n);(r?t.onDocked:t.onUndocked)(e)},Xp=(e,t,o,n,r=!1)=>{t.contextual.each(t=>{t.lazyContext(e).each(a=>{const s=((e,t)=>e.y<t.bottom&&e.bottom>t.y)(a,n.bounds);if(s!==o.isVisible())if(o.setVisible(s),r&&!s)lr(e.element,[t.fadeOutClass]),t.onHide(e);else{(s?Bp:zp)(e,t)}})})},Jp=(e,t,o,n,r)=>{Xp(e,t,o,n,!0),Yp(e,t,o,r.positionCss)},Qp=(e,t,o)=>{const n=t.lazyViewport(e);Xp(e,t,o,n),qp(e,n,o).each(r=>{((e,t,o,n,r)=>{switch(r.morph){case"static":return Kp(e,t,o);case"absolute":return Yp(e,t,o,r.positionCss);case"fixed":Jp(e,t,o,n,r)}})(e,t,o,n,r)})},eh=(e,t,o)=>{const n=e.element;o.setDocked(!1);const r=t.lazyViewport(e);((e,t,o)=>{const n=e.element;return Vp(n,t,o).bind(({box:e})=>Up(n,e,o))})(e,r,o).each(n=>{switch(n.morph){case"static":Kp(e,t,o);break;case"absolute":Yp(e,t,o,n.positionCss)}}),o.setVisible(!0),t.contextual.each(t=>{cr(n,[t.fadeInClass,t.fadeOutClass,t.transitionClass]),t.onShow(e)}),th(e,t,o)},th=(e,t,o)=>{e.getSystem().isConnected()&&Qp(e,t,o)},oh=(e,t,o)=>{o.isDocked()&&eh(e,t,o)},nh=e=>(t,o,n)=>{const r=o.lazyViewport(t);Gp(t.element,r,n,e).each(e=>{Jp(t,o,n,r,e)})},rh=nh(Ip),ah=nh(Pp);var sh=Object.freeze({__proto__:null,refresh:th,reset:oh,isDocked:(e,t,o)=>o.isDocked(),getModes:(e,t,o)=>o.getModes(),setModes:(e,t,o,n)=>o.setModes(n),forceDockToTop:rh,forceDockToBottom:ah});var ih=Object.freeze({__proto__:null,events:(e,t)=>ld([xd(Us(),(o,n)=>{e.contextual.each(e=>{if(ir(o.element,e.transitionClass)){cr(o.element,[e.transitionClass,e.fadeInClass]);(t.isVisible()?e.onShown:e.onHidden)(o)}n.stop()})}),md(ii(),(o,n)=>{th(o,e,t)}),md(hi(),(o,n)=>{th(o,e,t)}),md(li(),(o,n)=>{oh(o,e,t)})])}),lh=[ms("contextual",[Ja("fadeInClass"),Ja("fadeOutClass"),Ja("transitionClass"),es("lazyContext"),zi("onShow"),zi("onShown"),zi("onHide"),zi("onHidden")]),xs("lazyViewport",()=>({bounds:Zr(),optScrollEnv:A.none()})),vs("modes",["top","bottom"],ga),zi("onDocked"),zi("onUndocked")];const ch=Dd({fields:lh,name:"docking",active:ih,apis:sh,state:Object.freeze({__proto__:null,init:e=>{const t=ye(!1),o=ye(!0),n=Ke(),r=ye(e.modes);return Jc({isDocked:t.get,setDocked:t.set,getInitialPos:n.get,setInitialPos:n.set,clearInitialPos:n.clear,isVisible:o.get,setVisible:o.set,getModes:r.get,setModes:r.set,readState:()=>`docked:  ${t.get()}, visible: ${o.get()}, modes: ${r.get().join(",")}`})}})}),dh=ve([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),mh=e=>t=>t.translate(-e.left,-e.top),uh=e=>t=>t.translate(e.left,e.top),gh=e=>(t,o)=>U(e,(e,t)=>t(e),Rn(t,o)),ph=(e,t,o)=>e.fold(gh([uh(o),mh(t)]),gh([mh(t)]),gh([])),hh=(e,t,o)=>e.fold(gh([uh(o)]),gh([]),gh([uh(t)])),fh=(e,t,o)=>e.fold(gh([]),gh([mh(o)]),gh([uh(t),mh(o)])),bh=(e,t,o)=>{const n=e.fold((e,t)=>({position:A.some("absolute"),left:A.some(e+"px"),top:A.some(t+"px")}),(e,t)=>({position:A.some("absolute"),left:A.some(e-o.left+"px"),top:A.some(t-o.top+"px")}),(e,t)=>({position:A.some("fixed"),left:A.some(e+"px"),top:A.some(t+"px")}));return{right:A.none(),bottom:A.none(),...n}},xh=(e,t,o,n)=>{const r=(e,r)=>(a,s)=>{const i=e(t,o,n);return r(a.getOr(i.left),s.getOr(i.top))};return e.fold(r(fh,vh),r(hh,yh),r(ph,wh))},vh=dh.offset,yh=dh.absolute,wh=dh.fixed,_h=(e,t)=>{const o=qo(e,t);return m(o)?NaN:parseInt(o,10)},Ch=(e,t,o,n)=>((e,t)=>{const o=e.element,n=_h(o,t.leftAttr),r=_h(o,t.topAttr);return isNaN(n)||isNaN(r)?A.none():A.some(Rn(n,r))})(e,t).fold(()=>o,e=>wh(e.left+n.left,e.top+n.top)),kh=(e,t,o,n,r,a)=>{const s=Ch(e,t,o,n),i=t.mustSnap?Oh(e,t,s,r,a):Th(e,t,s,r,a),l=ph(s,r,a);return((e,t,o)=>{const n=e.element;Wo(n,t.leftAttr,o.left+"px"),Wo(n,t.topAttr,o.top+"px")})(e,t,l),i.fold(()=>({coord:wh(l.left,l.top),extra:A.none()}),e=>({coord:e.output,extra:e.extra}))},Sh=(e,t)=>{((e,t)=>{const o=e.element;Yo(o,t.leftAttr),Yo(o,t.topAttr)})(e,t)},Eh=(e,t,o,n)=>re(e,e=>{const r=e.sensor,a=((e,t,o,n,r,a)=>{const s=hh(e,r,a),i=hh(t,r,a);return Math.abs(s.left-i.left)<=o&&Math.abs(s.top-i.top)<=n})(t,r,e.range.left,e.range.top,o,n);return a?A.some({output:xh(e.output,t,o,n),extra:e.extra}):A.none()}),Oh=(e,t,o,n,r)=>{const a=t.getSnapPoints(e);return Eh(a,o,n,r).orThunk(()=>{const e=U(a,(e,t)=>{const a=t.sensor,s=((e,t,o,n,r,a)=>{const s=hh(e,r,a),i=hh(t,r,a),l=Math.abs(s.left-i.left),c=Math.abs(s.top-i.top);return Rn(l,c)})(o,a,t.range.left,t.range.top,n,r);return e.deltas.fold(()=>({deltas:A.some(s),snap:A.some(t)}),o=>(s.left+s.top)/2<=(o.left+o.top)/2?{deltas:A.some(s),snap:A.some(t)}:e)},{deltas:A.none(),snap:A.none()});return e.snap.map(e=>({output:xh(e.output,o,n,r),extra:e.extra}))})},Th=(e,t,o,n,r)=>{const a=t.getSnapPoints(e);return Eh(a,o,n,r)};var Ah=Object.freeze({__proto__:null,snapTo:(e,t,o,n)=>{const r=t.getTarget(e.element);if(t.repositionTarget){const t=so(e.element),o=Hn(t),a=Wr(r),s=((e,t,o)=>({coord:xh(e.output,e.output,t,o),extra:e.extra}))(n,o,a),i=bh(s.coord,0,a);gn(r,i)}}});const Dh=(e,t)=>ys(e,{},I(t,t=>{return o=t.name(),n="Cannot configure "+t.name()+" for "+e,$a(o,o,{tag:"option",process:{}},la(e=>ea("The field: "+o+" is forbidden. "+n)));var o,n}).concat([qa("dump",w)])),Mh=e=>e.dump,Rh=(e,t)=>({...Td(t),...e.dump}),Nh=Dh,Bh=Rh,zh=(e,t,o,n,r)=>{const a=((e,t)=>(e.length>0?[ts("parts",e)]:[]).concat([Ka("uid"),us("dom",{}),us("components",[]),Fi("originalSpec"),us("debug.sketcher",{})]).concat(t))(n,r);return Za(e+" [SpecSchema]",Da(a.concat(t)),o)},Hh=(e,t,o,n,r)=>{const a=Lh(r),s=Tl(o),i=Pl(o),l=zh(e,t,a,s,[i]),c=Dl(0,l,o);return n(l,Ml(e,l,c.internals()),a,c.externals())},Lh=e=>(e=>be(e,"uid"))(e)?e:{...e,uid:Ng("uid")},Ih=Da([Ka("name"),Ka("factory"),Ka("configFields"),us("apis",{}),us("extraApis",{})]),Ph=Da([Ka("name"),Ka("factory"),Ka("configFields"),Ka("partFields"),us("apis",{}),us("extraApis",{})]),Fh=e=>{const t=Za("Sketcher for "+e.name,Ih,e),o=le(t.apis,Ku),n=le(t.extraApis,(e,t)=>Ui(e,t));return{name:t.name,configFields:t.configFields,sketch:e=>((e,t,o,n)=>{const r=Lh(n);return o(zh(e,t,r,[],[]),r)})(t.name,t.configFields,t.factory,e),...o,...n}},Vh=e=>{const t=Za("Sketcher for "+e.name,Ph,e),o=Sl(t.name,t.partFields),n=le(t.apis,Ku),r=le(t.extraApis,(e,t)=>Ui(e,t));return{name:t.name,partFields:t.partFields,configFields:t.configFields,sketch:e=>Hh(t.name,t.configFields,t.partFields,t.factory,e),parts:o,...n,...r}},Zh=Fh({name:"Container",factory:e=>{const{attributes:t,...o}=e.dom;return{uid:e.uid,dom:{tag:"div",attributes:{role:"presentation",...t},...o},components:e.components,behaviours:Mh(e.containerBehaviours),events:e.events,domModification:e.domModification,eventOrder:e.eventOrder}},configFields:[us("components",[]),Dh("containerBehaviours",[]),us("events",{}),us("domModification",{}),us("eventOrder",{})]}),Uh="data-initial-z-index",jh=(e,t)=>{e.getSystem().addToGui(t),(e=>{mo(e.element).filter(to).each(t=>{fn(t,"z-index").each(e=>{Wo(t,Uh,e)}),mn(t,"z-index",pn(e.element,"z-index"))})})(t)},Wh=e=>{(e=>{mo(e.element).filter(to).each(e=>{Go(e,Uh).fold(()=>vn(e,"z-index"),t=>mn(e,"z-index",t)),Yo(e,Uh)})})(e),e.getSystem().removeFromGui(e)},$h=(e,t,o)=>e.getSystem().build(Zh.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[t]},events:o}));var qh=ms("snaps",[Ka("getSnapPoints"),zi("onSensor"),Ka("leftAttr"),Ka("topAttr"),us("lazyViewport",Zr),us("mustSnap",!1)]);const Gh=[us("useFixed",O),Ka("blockerClass"),us("getTarget",w),us("onDrag",b),us("repositionTarget",!0),us("onDrop",b),xs("getBounds",Zr),qh],Kh=e=>((e,t,o,n)=>e.isSome()&&t.isSome()&&o.isSome()?A.some(n(e.getOrDie(),t.getOrDie(),o.getOrDie())):A.none())(fn(e,"left"),fn(e,"top"),fn(e,"position"),(e,t,o)=>("fixed"===o?wh:vh)(parseInt(e,10),parseInt(t,10))).getOrThunk(()=>{const t=Bn(e);return yh(t.left,t.top)}),Yh=(e,t,o,n,r,a,s)=>((e,t,o,n,r)=>{const a=r.bounds,s=hh(t,o,n),i=ze(s.left,a.x,a.x+a.width-r.width),l=ze(s.top,a.y,a.y+a.height-r.height),c=yh(i,l);return t.fold(()=>{const e=fh(c,o,n);return vh(e.left,e.top)},y(c),()=>{const e=ph(c,o,n);return wh(e.left,e.top)})})(0,t.fold(()=>{const e=(t=o,s=a.left,i=a.top,t.fold((e,t)=>vh(e+s,t+i),(e,t)=>yh(e+s,t+i),(e,t)=>wh(e+s,t+i)));var t,s,i;const l=ph(e,n,r);return wh(l.left,l.top)},t=>{const s=kh(e,t,o,a,n,r);return s.extra.each(o=>{t.onSensor(e,o)}),s.coord}),n,r,s),Xh=(e,t)=>({bounds:e.getBounds(),height:kn(t.element),width:An(t.element)}),Jh=(e,t,o,n,r)=>{const a=o.update(n,r),s=o.getStartData().getOrThunk(()=>Xh(t,e));a.each(o=>{((e,t,o,n)=>{const r=t.getTarget(e.element);if(t.repositionTarget){const a=so(e.element),s=Hn(a),i=Wr(r),l=Kh(r),c=Yh(e,t.snaps,l,s,i,n,o),d=bh(c,0,i);gn(r,d)}t.onDrag(e,r,n)})(e,t,s,o)})},Qh=(e,t,o,n)=>{t.each(Wh),o.snaps.each(t=>{Sh(e,t)});const r=o.getTarget(e.element);n.reset(),o.onDrop(e,r)},ef=e=>(t,o)=>{const n=e=>{o.setStartData(Xh(t,e))};return ld([md(ii(),e=>{o.getStartData().each(()=>n(e))}),...e(t,o,n)])};var tf=Object.freeze({__proto__:null,getData:e=>A.from(Rn(e.x,e.y)),getDelta:(e,t)=>Rn(t.left-e.left,t.top-e.top)});const of=(e,t,o)=>[md(Ds(),(n,r)=>{if(0!==r.event.raw.button)return;r.stop();const a=()=>Qh(n,A.some(l),e,t),s=ji(a,200),i={drop:a,delayDrop:s.schedule,forceDrop:a,move:o=>{s.cancel(),Jh(n,e,t,tf,o)}},l=$h(n,e.blockerClass,(e=>ld([md(Ds(),e.forceDrop),md(Ns(),e.drop),md(Ms(),(t,o)=>{e.move(o.event)}),md(Rs(),e.delayDrop)]))(i));o(n),jh(n,l)})],nf=[...Gh,Pi("dragger",{handlers:ef(of)})];var rf=Object.freeze({__proto__:null,getData:e=>{const t=e.raw.touches;return 1===t.length?(e=>{const t=e[0];return A.some(Rn(t.clientX,t.clientY))})(t):A.none()},getDelta:(e,t)=>Rn(t.left-e.left,t.top-e.top)});const af=(e,t,o)=>{const n=Ke(),r=o=>{Qh(o,n.get(),e,t),n.clear()};return[md(Es(),(a,s)=>{s.stop();const i=()=>r(a),l={drop:i,delayDrop:b,forceDrop:i,move:o=>{Jh(a,e,t,rf,o)}},c=$h(a,e.blockerClass,(e=>ld([md(Es(),e.forceDrop),md(Ts(),e.drop),md(As(),e.drop),md(Os(),(t,o)=>{e.move(o.event)})]))(l));n.set(c);o(a),jh(a,c)}),md(Os(),(o,n)=>{n.stop(),Jh(o,e,t,rf,n.event)}),md(Ts(),(e,t)=>{t.stop(),r(e)}),md(As(),r)]},sf=nf,lf=[...Gh,Pi("dragger",{handlers:ef(af)})],cf=[...Gh,Pi("dragger",{handlers:ef((e,t,o)=>[...of(e,t,o),...af(e,t,o)])})];var df=Object.freeze({__proto__:null,mouse:sf,touch:lf,mouseOrTouch:cf});var mf=Object.freeze({__proto__:null,init:()=>{let e=A.none(),t=A.none();const o=y({});return Jc({readState:o,reset:()=>{e=A.none(),t=A.none()},update:(t,o)=>t.getData(o).bind(o=>((t,o)=>{const n=e.map(e=>t.getDelta(e,o));return e=A.some(o),n})(t,o)),getStartData:()=>t,setStartData:e=>{t=A.some(e)}})}});const uf=Rd({branchKey:"mode",branches:df,name:"dragging",active:{events:(e,t)=>e.dragger.handlers(e,t)},extra:{snap:e=>({sensor:e.sensor,range:e.range,output:e.output,extra:A.from(e.extra)})},state:mf,apis:Ah}),gf=["input","textarea"],pf=e=>{const t=Jt(e);return B(gf,t)},hf=(e,t)=>{const o=t.getRoot(e).getOr(e.element);ar(o,t.invalidClass),t.notify.each(t=>{pf(e.element)&&Wo(e.element,"aria-invalid",!1),t.getContainer(e).each(e=>{tn(e,t.validHtml)}),t.onValid(e)})},ff=(e,t,o,n)=>{const r=t.getRoot(e).getOr(e.element);nr(r,t.invalidClass),t.notify.each(t=>{pf(e.element)&&Wo(e.element,"aria-invalid",!0),t.getContainer(e).each(e=>{tn(e,n)}),t.onInvalid(e,n)})},bf=(e,t,o)=>t.validator.fold(()=>Ee(Ae.value(!0)),t=>t.validate(e)),xf=(e,t,o)=>(t.notify.each(t=>{t.onValidate(e)}),bf(e,t).map(o=>e.getSystem().isConnected()?o.fold(o=>(ff(e,t,0,o),Ae.error(o)),o=>(hf(e,t),Ae.value(o))):Ae.error("No longer in system")));var vf=Object.freeze({__proto__:null,markValid:hf,markInvalid:ff,query:bf,run:xf,isInvalid:(e,t)=>{const o=t.getRoot(e).getOr(e.element);return ir(o,t.invalidClass)}});var yf=Object.freeze({__proto__:null,events:(e,t)=>e.validator.map(t=>ld([md(t.onEvent,t=>{xf(t,e).get(w)})].concat(t.validateOnLoad?[vd(t=>{xf(t,e).get(b)})]:[]))).getOr({})}),wf=[Ka("invalidClass"),us("getRoot",A.none),ms("notify",[us("aria","alert"),us("getContainer",A.none),us("validHtml",""),zi("onValid"),zi("onInvalid"),zi("onValidate")]),ms("validator",[Ka("validate"),us("onEvent","input"),us("validateOnLoad",!0)])];const _f=(e,t,o)=>{t.store.manager.onLoad(e,t,o)},Cf=(e,t,o)=>{t.store.manager.onUnload(e,t,o)};var kf=Object.freeze({__proto__:null,onLoad:_f,onUnload:Cf,setValue:(e,t,o,n)=>{t.store.manager.setValue(e,t,o,n)},getValue:(e,t,o)=>t.store.manager.getValue(e,t,o),getState:(e,t,o)=>o});var Sf=Object.freeze({__proto__:null,events:(e,t)=>{const o=e.resetOnDom?[vd((o,n)=>{_f(o,e,t)}),yd((o,n)=>{Cf(o,e,t)})]:[kd(e,t,_f)];return ld(o)}});const Ef=()=>{const e=ye(null);return Jc({set:e.set,get:e.get,isNotSet:()=>null===e.get(),clear:()=>{e.set(null)},readState:()=>({mode:"memory",value:e.get()})})},Of=()=>{const e=ye({}),t=ye({});return Jc({readState:()=>({mode:"dataset",dataByValue:e.get(),dataByText:t.get()}),lookup:o=>fe(e.get(),o).orThunk(()=>fe(t.get(),o)),update:o=>{const n=e.get(),r=t.get(),a={},s={};P(o,e=>{a[e.value]=e,fe(e,"meta").each(t=>{fe(t,"text").each(t=>{s[t]=e})})}),e.set({...n,...a}),t.set({...r,...s})},clear:()=>{e.set({}),t.set({})}})};var Tf=Object.freeze({__proto__:null,memory:Ef,dataset:Of,manual:()=>Jc({readState:b}),init:e=>e.store.manager.state(e)});const Af=(e,t,o,n)=>{const r=t.store;o.update([n]),r.setValue(e,n),t.onSetValue(e,n)};var Df=[rs("initialValue"),Ka("getFallbackEntry"),Ka("getDataKey"),Ka("setValue"),Pi("manager",{setValue:Af,getValue:(e,t,o)=>{const n=t.store,r=n.getDataKey(e);return o.lookup(r).getOrThunk(()=>n.getFallbackEntry(r))},onLoad:(e,t,o)=>{t.store.initialValue.each(n=>{Af(e,t,o,n)})},onUnload:(e,t,o)=>{o.clear()},state:Of})];var Mf=[Ka("getValue"),us("setValue",b),rs("initialValue"),Pi("manager",{setValue:(e,t,o,n)=>{t.store.setValue(e,n),t.onSetValue(e,n)},getValue:(e,t,o)=>t.store.getValue(e),onLoad:(e,t,o)=>{t.store.initialValue.each(o=>{t.store.setValue(e,o)})},onUnload:b,state:Xc.init})];var Rf=[rs("initialValue"),Pi("manager",{setValue:(e,t,o,n)=>{o.set(n),t.onSetValue(e,n)},getValue:(e,t,o)=>o.get(),onLoad:(e,t,o)=>{t.store.initialValue.each(e=>{o.isNotSet()&&o.set(e)})},onUnload:(e,t,o)=>{o.clear()},state:Ef})],Nf=[gs("store",{mode:"memory"},ja("mode",{memory:Rf,manual:Mf,dataset:Df})),zi("onSetValue"),us("resetOnDom",!1)];const Bf=Dd({fields:Nf,name:"representing",active:Sf,apis:kf,extra:{setValueFrom:(e,t)=>{const o=Bf.getValue(t);Bf.setValue(e,o)}},state:Tf}),zf=Dd({fields:wf,name:"invalidating",active:yf,apis:vf,extra:{validation:e=>t=>{const o=Bf.getValue(t);return Ee(e(o))}}});var Hf=Object.freeze({__proto__:null,exhibit:(e,t)=>Cd({classes:[],styles:t.useFixed()?{}:{position:"relative"}})});const Lf=ve([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),If=(e,t,o,n,r,a)=>{const s=t.rect,i=s.x-o,l=s.y-n,c=r-(i+s.width),d=a-(l+s.height),m=A.some(i),u=A.some(l),g=A.some(c),p=A.some(d),h=A.none();return((e,t,o,n,r,a,s,i,l)=>e.fold(t,o,n,r,a,s,i,l))(t.direction,()=>Rp(e,m,u,h,h),()=>Rp(e,h,u,g,h),()=>Rp(e,m,h,h,p),()=>Rp(e,h,h,g,p),()=>Rp(e,m,u,h,h),()=>Rp(e,m,h,h,p),()=>Rp(e,m,u,h,h),()=>Rp(e,h,u,g,h))},Pf=(e,t)=>e.fold(()=>{const e=t.rect;return Rp("absolute",A.some(e.x),A.some(e.y),A.none(),A.none())},(e,o,n,r)=>If("absolute",t,e,o,n,r),(e,o,n,r)=>If("fixed",t,e,o,n,r)),Ff=(e,t)=>{const o=C(Lr,t),n=e.fold(o,o,()=>{const e=Hn();return Lr(t).translate(-e.left,-e.top)}),r=An(t),a=kn(t);return Ir(n.left,n.top,r,a)},Vf=(e,t)=>t.fold(()=>e.fold(Zr,Zr,Ir),t=>e.fold(y(t),y(t),()=>{const o=Zf(e,t.x,t.y);return Ir(o.left,o.top,t.width,t.height)})),Zf=(e,t,o)=>{const n=Rn(t,o);return e.fold(y(n),y(n),()=>{const e=Hn();return n.translate(-e.left,-e.top)})};Lf.none;const Uf=Lf.relative,jf=Lf.fixed,Wf=(e,t)=>((e,t)=>({anchorBox:e,origin:t}))(e,t),$f=ve([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),qf=(e,t,o,n)=>{const r=e.bubble,a=r.offset,s=((e,t,o)=>{const n=(n,r)=>t[n].map(t=>{const a="top"===n||"bottom"===n,s=a?o.top:o.left,i=("left"===n||"top"===n?Math.max:Math.min)(t,r)+s;return a?ze(i,e.y,e.bottom):ze(i,e.x,e.right)}).getOr(r),r=n("left",e.x),a=n("top",e.y),s=n("right",e.right),i=n("bottom",e.bottom);return Ir(r,a,s-r,i-a)})(n,e.restriction,a),i=e.x+a.left,l=e.y+a.top,c=Ir(i,l,t,o),{originInBounds:d,sizeInBounds:m,visibleW:u,visibleH:g}=((e,t)=>{const{x:o,y:n,right:r,bottom:a}=t,{x:s,y:i,right:l,bottom:c,width:d,height:m}=e;return{originInBounds:s>=o&&s<=r&&i>=n&&i<=a,sizeInBounds:l<=r&&l>=o&&c<=a&&c>=n,visibleW:Math.min(d,s>=o?r-s:l-o),visibleH:Math.min(m,i>=n?a-i:c-n)}})(c,s),p=d&&m,h=p?c:((e,t)=>{const{x:o,y:n,right:r,bottom:a}=t,{x:s,y:i,width:l,height:c}=e,d=Math.max(o,r-l),m=Math.max(n,a-c),u=ze(s,o,d),g=ze(i,n,m),p=Math.min(u+l,r)-u,h=Math.min(g+c,a)-g;return Ir(u,g,p,h)})(c,s),f=h.width>0&&h.height>0,{maxWidth:b,maxHeight:x}=((e,t,o)=>{const n=y(t.bottom-o.y),r=y(o.bottom-t.y),a=((e,t,o,n)=>e.fold(t,t,n,n,t,n,o,o))(e,r,r,n),s=y(t.right-o.x),i=y(o.right-t.x),l=((e,t,o,n)=>e.fold(t,n,t,n,o,o,t,n))(e,i,i,s);return{maxWidth:l,maxHeight:a}})(e.direction,h,n),v={rect:h,maxHeight:x,maxWidth:b,direction:e.direction,placement:e.placement,classes:{on:r.classesOn,off:r.classesOff},layout:e.label,testY:l};return p||e.alwaysFit?$f.fit(v):$f.nofit(v,u,g,f)},Gf=["top","bottom","right","left"],Kf="data-alloy-transition-timer",Yf=(e,t)=>((e,t)=>G(t,t=>ir(e,t)))(e,t.classes),Xf=(e,t)=>{const o=e=>parseFloat(e).toFixed(3);return pe(t,(t,n)=>!((e,t,o=_)=>Ue(e,t,o).getOr(e.isNone()&&t.isNone()))(e[n].map(o),t.map(o))).isSome()},Jf=(e,t)=>{const o=Ge(),n=Ge();let r;const s=t=>{var o;const n=null!==(o=t.raw.pseudoElement)&&void 0!==o?o:"";return xt(t.target,e)&&nt(n)&&B(Gf,t.raw.propertyName)},i=a=>{if(u(a)||s(a)){o.clear(),n.clear();const s=null==a?void 0:a.raw.type;(u(s)||s===Us())&&(clearTimeout(r),Yo(e,Kf),cr(e,t.classes))}},l=Do(e,js(),t=>{s(t)&&(l.unbind(),o.set(Do(e,Us(),i)),n.set(Do(e,Zs(),i)))}),c=(e=>{const t=t=>{const o=pn(e,t).split(/\s*,\s*/);return V(o,ot)},o=e=>{if(a(e)&&/^[\d.]+/.test(e)){const t=parseFloat(e);return et(e,"ms")?t:1e3*t}return 0},n=t("transition-delay"),r=t("transition-duration");return U(r,(e,t,r)=>{const a=o(n[r])+o(t);return Math.max(e,a)},0)})(e);requestAnimationFrame(()=>{r=setTimeout(i,c+17),Wo(e,Kf,r)})},Qf=(e,t,o,n,r,a)=>{const s=((e,t,o)=>o.exists(o=>{const n=e.mode;return"all"===n||o[n]!==t[n]}))(n,r,a);if(s||Yf(e,n)){mn(e,"position",o.position);const a=Ff(t,e),i=Pf(t,{...r,rect:a}),l=X(Gf,e=>i[e]);Xf(o,l)&&(gn(e,l),s&&((e,t)=>{lr(e,t.classes),Go(e,Kf).each(t=>{clearTimeout(parseInt(t,10)),Yo(e,Kf)}),Jf(e,t)})(e,n),yn(e))}else cr(e,n.classes)},eb=(e,t,o,n)=>{vn(t,"max-height"),vn(t,"max-width");const r=(a=t,{width:Math.ceil(Dn(a)),height:kn(a)});var a;return((e,t,o,n,r,a)=>{const s=n.width,i=n.height,l=(t,l,c,d,m)=>{const u=t(o,n,r,e,a),g=qf(u,s,i,a);return g.fold(y(g),(e,t,o,n)=>(m===n?o>d||t>c:!m&&n)?g:$f.nofit(l,c,d,m))},c=U(t,(e,t)=>{const o=C(l,t);return e.fold(y(e),o)},$f.nofit({rect:o,maxHeight:n.height,maxWidth:n.width,direction:$l(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:o.y},-1,-1,!1));return c.fold(w,w)})(t,n.preference,e,r,o,n.bounds)},tb=(e,t)=>{((e,t)=>{Wo(e,_c,t)})(e,t.placement)},ob=(e,t,o)=>void 0===e[t]?o:e[t],nb=(e,t,o,n)=>{const r=eb(e,t,o,n);return((e,t,o)=>{const n=Pf(o.origin,t);o.transition.each(r=>{Qf(e,o.origin,n,r,t,o.lastPlacement)}),Np(e,n)})(t,r,n),tb(t,r),((e,t)=>{const o=t.classes;cr(e,o.off),lr(e,o.on)})(t,r),((e,t,o)=>{(0,o.maxHeightFunction)(e,t.maxHeight)})(t,r,n),((e,t,o)=>{(0,o.maxWidthFunction)(e,t.maxWidth)})(t,r,n),{layout:r.layout,placement:r.placement}},rb=w,ab=()=>ms("layouts",[Ka("onLtr"),Ka("onRtl"),rs("onBottomLtr"),rs("onBottomRtl")]),sb=(e,t,o,n,r,a,s)=>{const i=s.map(Kc).getOr(!1),l=t.layouts.map(t=>t.onLtr(e)),c=t.layouts.map(t=>t.onRtl(e)),d=i?t.layouts.bind(t=>t.onBottomLtr.map(t=>t(e))).or(l).getOr(r):l.getOr(o),m=i?t.layouts.bind(t=>t.onBottomRtl.map(t=>t(e))).or(c).getOr(a):c.getOr(n);return Pn(d,m)(e)};var ib=[Ka("hotspot"),rs("bubble"),us("overrides",{}),ab(),Pi("placement",(e,t,o)=>{const n=t.hotspot,r=Ff(o,n.element),a=sb(e.element,t,yc(),wc(),xc(),vc(),A.some(t.hotspot.element));return A.some(rb({anchorBox:r,bubble:t.bubble.getOr(Ul()),overrides:t.overrides,layouts:a}))})];var lb=[Ka("x"),Ka("y"),us("height",0),us("width",0),us("bubble",Ul()),us("overrides",{}),ab(),Pi("placement",(e,t,o)=>{const n=Zf(o,t.x,t.y),r=Ir(n.left,n.top,t.width,t.height),a=sb(e.element,t,fc(),bc(),fc(),bc(),A.none());return A.some(rb({anchorBox:r,bubble:t.bubble,overrides:t.overrides,layouts:a}))})];const cb=ve([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),db=e=>e.fold(w,(e,t,o)=>e.translate(-t,-o)),mb=e=>e.fold(w,w),ub=e=>U(e,(e,t)=>e.translate(t.left,t.top),Rn(0,0)),gb=e=>{const t=I(e,mb);return ub(t)},pb=cb.screen,hb=cb.absolute,fb=(e,t,o)=>{const n=so(e.element),r=Hn(n),a=((e,t,o)=>{const n=co(o.root).dom;return A.from(n.frameElement).map(it.fromDom).filter(t=>{const o=so(t),n=so(e.element);return xt(o,n)}).map(Bn)})(e,0,o).getOr(r);return hb(a,r.left,r.top)},bb=(e,t,o,n)=>{const r=pb(Rn(e,t));return A.some(((e,t,o)=>({point:e,width:t,height:o}))(r,o,n))},xb=(e,t,o,n,r)=>e.map(e=>{const a=[t,e.point],s=(i=()=>gb(a),l=()=>gb(a),c=()=>(e=>{const t=I(e,db);return ub(t)})(a),n.fold(i,l,c));var i,l,c;const d=((e,t,o,n)=>({x:e,y:t,width:o,height:n}))(s.left,s.top,e.width,e.height),m=o.showAbove?xc():yc(),u=o.showAbove?vc():wc(),g=sb(r,o,m,u,m,u,A.none());return rb({anchorBox:d,bubble:o.bubble.getOr(Ul()),overrides:o.overrides,layouts:g})});var vb=[Ka("node"),Ka("root"),rs("bubble"),ab(),us("overrides",{}),us("showAbove",!1),Pi("placement",(e,t,o)=>{const n=fb(e,0,t);return t.node.filter(an).bind(r=>{const a=r.dom.getBoundingClientRect(),s=bb(a.left,a.top,a.width,a.height),i=t.node.getOr(e.element);return xb(s,n,t,o,i)})})];const yb=(e,t)=>({element:e,offset:t}),wb=(e,t)=>{const o=po(e);if(0===o.length)return yb(e,t);if(t<o.length)return yb(o[t],0);{const e=o[o.length-1],t=oo(e)?(e=>In.get(e))(e).length:po(e).length;return yb(e,t)}},_b=(e,t)=>oo(e)?yb(e,t):wb(e,t),Cb=e=>void 0!==e.foffset,kb=(e,t)=>t.getSelection.getOrThunk(()=>()=>Or(e))().map(e=>{if(Cb(e)){const t=_b(e.start,e.soffset),o=_b(e.finish,e.foffset);return kr.range(t.element,t.offset,o.element,o.offset)}return e});var Sb=[rs("getSelection"),Ka("root"),rs("bubble"),ab(),us("overrides",{}),us("showAbove",!1),Pi("placement",(e,t,o)=>{const n=co(t.root).dom,r=fb(e,0,t),a=kb(n,t).bind(e=>{if(Cb(e)){const t=Ar(n,kr.exactFromRange(e)).orThunk(()=>{const t=it.fromText("\ufeff");Po(e.start,t);const o=Tr(n,kr.exact(t,0,t,1));return Jo(t),o});return t.bind(e=>bb(e.left,e.top,e.width,e.height))}{const t=le(e,e=>e.dom.getBoundingClientRect()),o={left:Math.min(t.firstCell.left,t.lastCell.left),right:Math.max(t.firstCell.right,t.lastCell.right),top:Math.min(t.firstCell.top,t.lastCell.top),bottom:Math.max(t.firstCell.bottom,t.lastCell.bottom)};return bb(o.left,o.top,o.right-o.left,o.bottom-o.top)}}),s=kb(n,t).bind(e=>Cb(e)?to(e.start)?A.some(e.start):uo(e.start):A.some(e.firstCell)).getOr(e.element);return xb(a,r,t,o,s)})];const Eb="link-layout",Ob=e=>e.x+e.width,Tb=(e,t)=>e.x-t.width,Ab=(e,t)=>e.y-t.height+e.height,Db=e=>e.y,Mb=(e,t,o)=>jl(Ob(e),Db(e),o.southeast(),$l(),"southeast",ec(e,{left:0,top:2}),Eb),Rb=(e,t,o)=>jl(Tb(e,t),Db(e),o.southwest(),ql(),"southwest",ec(e,{right:1,top:2}),Eb),Nb=(e,t,o)=>jl(Ob(e),Ab(e,t),o.northeast(),Gl(),"northeast",ec(e,{left:0,bottom:3}),Eb),Bb=(e,t,o)=>jl(Tb(e,t),Ab(e,t),o.northwest(),Kl(),"northwest",ec(e,{right:1,bottom:3}),Eb),zb=()=>[Mb,Rb,Nb,Bb],Hb=()=>[Rb,Mb,Bb,Nb];var Lb=[Ka("item"),ab(),us("overrides",{}),Pi("placement",(e,t,o)=>{const n=Ff(o,t.item.element),r=sb(e.element,t,zb(),Hb(),zb(),Hb(),A.none());return A.some(rb({anchorBox:n,bubble:Ul(),overrides:t.overrides,layouts:r}))})],Ib=ja("type",{selection:Sb,node:vb,hotspot:ib,submenu:Lb,makeshift:lb});const Pb=[ns("classes",ga),fs("mode","all",["all","layout","placement"])],Fb=[us("useFixed",O),rs("getBounds")],Vb=[Ya("anchor",Ib),ms("transition",Pb)],Zb=(e,t,o,n,r,a)=>((e,t,o,n,r,a,s,i)=>{const l=ob(s,"maxHeightFunction",jc()),c=ob(s,"maxWidthFunction",b),d=e.anchorBox,m=e.origin,u={bounds:Vf(m,a),origin:m,preference:n,maxHeightFunction:l,maxWidthFunction:c,lastPlacement:r,transition:i};return nb(d,t,o,u)})(Wf(t.anchorBox,e),n.element,t.bubble,t.layouts,r,o,t.overrides,a),Ub=(e,t,o,n,r,a)=>{const s=Za("placement.info",Ma(Vb),r),i=s.anchor,l=n.element,c=o.get(n.uid);hg(()=>{mn(l,"position","fixed");const r=fn(l,"visibility");mn(l,"visibility","hidden");const d=t.useFixed()?(()=>{const e=document.documentElement;return jf(0,0,e.clientWidth,e.clientHeight)})():(e=>{const t=Bn(e.element),o=e.element.dom.getBoundingClientRect();return Uf(t.left,t.top,o.width,o.height)})(e);i.placement(e,i,d).each(e=>{const r=a.orThunk(()=>t.getBounds.map(E)),i=Zb(d,e,r,n,c,s.transition);o.set(n.uid,i)}),r.fold(()=>{vn(l,"visibility")},e=>{mn(l,"visibility",e)}),fn(l,"left").isNone()&&fn(l,"top").isNone()&&fn(l,"right").isNone()&&fn(l,"bottom").isNone()&&Ve(fn(l,"position"),"fixed")&&vn(l,"position")},l)};var jb=Object.freeze({__proto__:null,position:(e,t,o,n,r)=>{const a=A.none();Ub(e,t,o,n,r,a)},positionWithinBounds:Ub,getMode:(e,t,o)=>t.useFixed()?"fixed":"absolute",reset:(e,t,o,n)=>{const r=n.element;P(["position","left","right","top","bottom"],e=>vn(r,e)),(e=>{Yo(e,_c)})(r),o.clear(n.uid)}});const Wb=Dd({fields:Fb,name:"positioning",active:Hf,apis:jb,state:Object.freeze({__proto__:null,init:()=>{let e={};return Jc({readState:()=>e,clear:t=>{g(t)?delete e[t]:e={}},set:(t,o)=>{e[t]=o},get:t=>fe(e,t)})}})});var $b=Object.freeze({__proto__:null,events:e=>ld([md(Xs(),(t,o)=>{const n=e.channels,r=ae(n),a=o,s=((e,t)=>t.universal?e:V(e,e=>B(t.channels,e)))(r,a);P(s,e=>{const o=n[e],r=o.schema,s=Za("channel["+e+"] data\nReceiver: "+yi(t.element),r,a.data);o.onReceive(t,s)})})])}),qb=[Ya("channels",Pa(Ae.value,Da([Li("onReceive"),us("schema",da())])))];const Gb=Dd({fields:qb,name:"receiving",active:$b});var Kb=Object.freeze({__proto__:null,events:(e,t)=>{const o=(o,n)=>{e.updateState.each(e=>{const r=e(o,n);t.set(r)}),e.renderComponents.each(r=>{const a=r(n,t.get());(e.reuseDom?bg:fg)(o,a)})};return ld([md(Xs(),(t,n)=>{const r=n;if(!r.universal){const n=e.channel;B(r.channels,n)&&o(t,r.data)}}),vd((t,n)=>{e.initialData.each(e=>{o(t,e)})})])}});var Yb=Object.freeze({__proto__:null,getState:(e,t,o)=>o}),Xb=[Ka("channel"),rs("renderComponents"),rs("updateState"),rs("initialData"),bs("reuseDom",!0)];const Jb=Dd({fields:Xb,name:"reflecting",active:Kb,apis:Yb,state:Object.freeze({__proto__:null,init:()=>{const e=ye(A.none());return{readState:()=>e.get().getOr("none"),get:e.get,set:e.set,clear:()=>e.set(A.none())}}})}),Qb=(e,t,o,n)=>{o.get().each(t=>{ig(e)});const r=t.getAttachPoint(e);ng(r,e);const a=e.getSystem().build(n);return ng(e,a),o.set(a),a},ex=(e,t,o,n)=>{const r=Qb(e,t,o,n);return t.onOpen(e,r),r},tx=(e,t,o)=>{o.get().each(n=>{ig(e),sg(e),t.onClose(e,n),o.clear()})},ox=(e,t,o)=>o.isOpen(),nx=(e,t,o)=>{const n=t.getAttachPoint(e);mn(e.element,"position",Wb.getMode(n)),((e,t,o,n)=>{fn(e.element,t).fold(()=>{Yo(e.element,o)},t=>{Wo(e.element,o,t)}),mn(e.element,t,n)})(e,"visibility",t.cloakVisibilityAttr,"hidden")},rx=(e,t,o)=>{(e=>z(["top","left","right","bottom"],t=>fn(e,t).isSome()))(e.element)||vn(e.element,"position"),((e,t,o)=>{Go(e.element,o).fold(()=>vn(e.element,t),o=>mn(e.element,t,o))})(e,"visibility",t.cloakVisibilityAttr)};var ax=Object.freeze({__proto__:null,cloak:nx,decloak:rx,open:ex,openWhileCloaked:(e,t,o,n,r)=>{nx(e,t),ex(e,t,o,n),r(),rx(e,t)},close:tx,isOpen:ox,isPartOf:(e,t,o,n)=>ox(0,0,o)&&o.get().exists(o=>t.isPartOf(e,o,n)),getState:(e,t,o)=>o.get(),setContent:(e,t,o,n)=>o.get().map(()=>Qb(e,t,o,n))});var sx=Object.freeze({__proto__:null,events:(e,t)=>ld([md(oi(),(o,n)=>{tx(o,e,t)})])}),ix=[zi("onOpen"),zi("onClose"),Ka("isPartOf"),Ka("getAttachPoint"),us("cloakVisibilityAttr","data-precloak-visibility")];var lx=Object.freeze({__proto__:null,init:()=>{const e=Ke(),t=y("not-implemented");return Jc({readState:t,isOpen:e.isSet,clear:e.clear,set:e.set,get:e.get})}});const cx=Dd({fields:ix,name:"sandboxing",active:sx,apis:ax,state:lx}),dx=(e,t)=>t.getAnimationRoot.fold(()=>e.element,t=>t(e)),mx=e=>e.dimension.property,ux=(e,t)=>e.dimension.getDimension(t),gx=(e,t)=>{const o=dx(e,t);cr(o,[t.shrinkingClass,t.growingClass])},px=(e,t)=>{ar(e.element,t.openClass),nr(e.element,t.closedClass),mn(e.element,mx(t),"0px"),yn(e.element)},hx=(e,t)=>{ar(e.element,t.closedClass),nr(e.element,t.openClass),vn(e.element,mx(t))},fx=(e,t,o,n)=>{o.setCollapsed(),mn(e.element,mx(t),ux(t,e.element)),gx(e,t),px(e,t),t.onStartShrink(e),t.onShrunk(e)},bx=(e,t,o,n)=>{const r=n.getOrThunk(()=>ux(t,e.element));o.setCollapsed(),mn(e.element,mx(t),r),yn(e.element);const a=dx(e,t);ar(a,t.growingClass),nr(a,t.shrinkingClass),px(e,t),t.onStartShrink(e)},xx=(e,t,o)=>{const n=ux(t,e.element);("0px"===n?fx:bx)(e,t,o,A.some(n))},vx=(e,t,o)=>{const n=dx(e,t),r=ir(n,t.shrinkingClass),a=ux(t,e.element);hx(e,t);const s=ux(t,e.element);(r?()=>{mn(e.element,mx(t),a),yn(e.element)}:()=>{px(e,t)})(),ar(n,t.shrinkingClass),nr(n,t.growingClass),hx(e,t),mn(e.element,mx(t),s),o.setExpanded(),t.onStartGrow(e)},yx=(e,t,o)=>{const n=dx(e,t);return!0===ir(n,t.growingClass)},wx=(e,t,o)=>{const n=dx(e,t);return!0===ir(n,t.shrinkingClass)};var _x=Object.freeze({__proto__:null,refresh:(e,t,o)=>{if(o.isExpanded()){vn(e.element,mx(t));const o=ux(t,e.element);mn(e.element,mx(t),o)}},grow:(e,t,o)=>{o.isExpanded()||vx(e,t,o)},shrink:(e,t,o)=>{o.isExpanded()&&xx(e,t,o)},immediateShrink:(e,t,o)=>{o.isExpanded()&&fx(e,t,o)},hasGrown:(e,t,o)=>o.isExpanded(),hasShrunk:(e,t,o)=>o.isCollapsed(),isGrowing:yx,isShrinking:wx,isTransitioning:(e,t,o)=>yx(e,t)||wx(e,t),toggleGrow:(e,t,o)=>{(o.isExpanded()?xx:vx)(e,t,o)},disableTransitions:gx,immediateGrow:(e,t,o)=>{o.isExpanded()||(hx(e,t),mn(e.element,mx(t),ux(t,e.element)),gx(e,t),o.setExpanded(),t.onStartGrow(e),t.onGrown(e))}});var Cx=Object.freeze({__proto__:null,exhibit:(e,t,o)=>{const n=t.expanded;return Cd(n?{classes:[t.openClass],styles:{}}:{classes:[t.closedClass],styles:_s(t.dimension.property,"0px")})},events:(e,t)=>ld([xd(Us(),(o,n)=>{if(n.event.raw.propertyName===e.dimension.property){gx(o,e),t.isExpanded()&&vn(o.element,e.dimension.property);(t.isExpanded()?e.onGrown:e.onShrunk)(o)}})])}),kx=[Ka("closedClass"),Ka("openClass"),Ka("shrinkingClass"),Ka("growingClass"),rs("getAnimationRoot"),zi("onShrunk"),zi("onStartShrink"),zi("onGrown"),zi("onStartGrow"),us("expanded",!1),Ya("dimension",ja("property",{width:[Pi("property","width"),Pi("getDimension",e=>Tn(e)+"px")],height:[Pi("property","height"),Pi("getDimension",e=>Cn(e)+"px")]}))];const Sx=Dd({fields:kx,name:"sliding",active:Cx,apis:_x,state:Object.freeze({__proto__:null,init:e=>{const t=ye(e.expanded);return Jc({isExpanded:()=>!0===t.get(),isCollapsed:()=>!1===t.get(),setCollapsed:C(t.set,!1),setExpanded:C(t.set,!0),readState:()=>"expanded: "+t.get()})}})});var Ex=Object.freeze({__proto__:null,events:(e,t)=>{const o=e.stream.streams.setup(e,t);return ld([md(e.event,o),yd(()=>t.cancel())].concat(e.cancelEvent.map(e=>[md(e,()=>t.cancel())]).getOr([])))}});const Ox=e=>{const t=ye(null);return Jc({readState:()=>({timer:null!==t.get()?"set":"unset"}),setTimer:e=>{t.set(e)},cancel:()=>{const e=t.get();null!==e&&e.cancel()}})};var Tx=Object.freeze({__proto__:null,throttle:Ox,init:e=>e.stream.streams.state(e)});var Ax=[Ya("stream",ja("mode",{throttle:[Ka("delay"),us("stopEvent",!0),Pi("streams",{setup:(e,t)=>{const o=e.stream,n=rt(e.onStream,o.delay);return t.setTimer(n),(e,t)=>{n.throttle(e,t),o.stopEvent&&t.stop()}},state:Ox})]})),us("event","input"),rs("cancelEvent"),Li("onStream")];const Dx=Dd({fields:Ax,name:"streaming",active:Ex,state:Tx});var Mx=Object.freeze({__proto__:null,exhibit:(e,t)=>Cd({attributes:Cs([{key:t.tabAttr,value:"true"}])})}),Rx=[us("tabAttr","data-alloy-tabstop")];const Nx=Dd({fields:Rx,name:"tabstopping",active:Mx}),Bx=(e,t,o,n)=>{const r=o.get();o.set(n),((e,t,o)=>{t.toggleClass.each(t=>{o.get()?nr(e.element,t):ar(e.element,t)})})(e,t,o),((e,t,o)=>{const n=t.aria;n.update(e,n,o.get())})(e,t,o),r!==n&&t.onToggled(e,n)},zx=(e,t,o)=>{Bx(e,t,o,!o.get())},Hx=(e,t,o)=>{Bx(e,t,o,t.selected)};var Lx=Object.freeze({__proto__:null,onLoad:Hx,toggle:zx,isOn:(e,t,o)=>o.get(),on:(e,t,o)=>{Bx(e,t,o,!0)},off:(e,t,o)=>{Bx(e,t,o,!1)},set:Bx});var Ix=Object.freeze({__proto__:null,exhibit:()=>Cd({}),events:(e,t)=>{const o=(n=e,r=t,a=zx,_d(e=>{a(e,n,r)}));var n,r,a;const s=kd(e,t,Hx);return ld($([e.toggleOnExecute?[o]:[],[s]]))}});const Px=(e,t,o)=>{Wo(e.element,"aria-expanded",o)};var Fx=[us("selected",!1),rs("toggleClass"),us("toggleOnExecute",!0),zi("onToggled"),gs("aria",{mode:"none"},ja("mode",{pressed:[us("syncWithExpanded",!1),Pi("update",(e,t,o)=>{Wo(e.element,"aria-pressed",o),t.syncWithExpanded&&Px(e,t,o)})],checked:[Pi("update",(e,t,o)=>{Wo(e.element,"aria-checked",o)})],expanded:[Pi("update",Px)],selected:[Pi("update",(e,t,o)=>{Wo(e.element,"aria-selected",o)})],none:[Pi("update",b)]}))];const Vx=Dd({fields:Fx,name:"toggling",active:Ix,apis:Lx,state:(Zx=!1,{init:()=>{const e=ye(Zx);return{get:()=>e.get(),set:t=>e.set(t),clear:()=>e.set(Zx),readState:()=>e.get()}}})});var Zx;const Ux=Le("tooltip.exclusive"),jx=Le("tooltip.show"),Wx=Le("tooltip.hide"),$x=Le("tooltip.immediateHide"),qx=Le("tooltip.immediateShow"),Gx=(e,t,o)=>{e.getSystem().broadcastOn([Ux],{})};var Kx=Object.freeze({__proto__:null,hideAllExclusive:Gx,immediateOpenClose:(e,t,o,n)=>od(e,n?qx:$x),isEnabled:(e,t,o)=>o.isEnabled(),setComponents:(e,t,o,n)=>{o.getTooltip().each(e=>{e.getSystem().isConnected()&&kg.set(e,n)})},setEnabled:(e,t,o,n)=>o.setEnabled(n)});var Yx=Object.freeze({__proto__:null,events:(e,t)=>{const o=o=>{t.getTooltip().each(n=>{n.getSystem().isConnected()&&(sg(n),e.onHide(o,n),t.clearTooltip())}),t.clearTimer()},n=o=>{if(!t.isShowing()&&t.isEnabled()){Gx(o);const n=e.lazySink(o).getOrDie(),r=o.getSystem().build({dom:e.tooltipDom,components:e.tooltipComponents,events:ld("normal"===e.mode?[md(Bs(),e=>{od(o,jx)}),md(Rs(),e=>{od(o,Wx)})]:[]),behaviours:Td([kg.config({})])});t.setTooltip(r),ng(n,r),e.onShow(o,r),Wb.position(n,r,{anchor:e.anchor(o)})}},r=o=>{t.getTooltip().each(t=>{const n=e.lazySink(o).getOrDie();Wb.position(n,t,{anchor:e.anchor(o)})})};return ld($([[wd(t=>{e.onSetup(t)}),md(jx,o=>{t.resetTimer(()=>{n(o)},e.delayForShow())}),md(Wx,n=>{t.resetTimer(()=>{o(n)},e.delayForHide())}),md(qx,e=>{t.resetTimer(()=>{n(e)},0)}),md($x,e=>{t.resetTimer(()=>{o(e)},0)}),md(Xs(),(e,t)=>{const n=t;n.universal||B(n.channels,Ux)&&o(e)}),yd(e=>{o(e)})],(()=>{switch(e.mode){case"normal":return[md(zs(),e=>{od(e,qx)}),md(Ks(),e=>{od(e,$x)}),md(Bs(),e=>{od(e,jx)}),md(Rs(),e=>{od(e,Wx)})];case"follow-highlight":return[md(xi(),(e,t)=>{od(e,jx)}),md(vi(),e=>{od(e,Wx)})];case"children-normal":return[md(zs(),(o,n)=>{Io(o.element).each(a=>{ht(n.event.target,"[data-mce-tooltip]")&&t.getTooltip().fold(()=>{od(o,qx)},n=>{t.isShowing()&&(e.onShow(o,n),r(o))})})}),md(Ks(),e=>{Io(e.element).fold(()=>{od(e,$x)},b)}),md(Bs(),o=>{Kn(o.element,"[data-mce-tooltip]:hover").each(n=>{t.getTooltip().fold(()=>{od(o,jx)},n=>{t.isShowing()&&(e.onShow(o,n),r(o))})})}),md(Rs(),e=>{Kn(e.element,"[data-mce-tooltip]:hover").fold(()=>{od(e,Wx)},b)})];default:return[md(zs(),(o,n)=>{Io(o.element).each(a=>{ht(n.event.target,"[data-mce-tooltip]")&&t.getTooltip().fold(()=>{od(o,qx)},n=>{t.isShowing()&&(e.onShow(o,n),r(o))})})}),md(Ks(),e=>{Io(e.element).fold(()=>{od(e,$x)},b)})]}})()]))}}),Xx=[Ka("lazySink"),Ka("tooltipDom"),us("exclusive",!0),us("tooltipComponents",[]),xs("delayForShow",y(300)),xs("delayForHide",y(100)),xs("onSetup",b),fs("mode","normal",["normal","follow-highlight","children-keyboard-focus","children-normal"]),us("anchor",e=>({type:"hotspot",hotspot:e,layouts:{onLtr:y([gc,uc,lc,dc,cc,mc]),onRtl:y([gc,uc,lc,dc,cc,mc])},bubble:Zl(0,-2,{})})),zi("onHide"),zi("onShow")];var Jx=Object.freeze({__proto__:null,init:()=>{const e=ye(!0),t=Ke(),o=Ke(),n=()=>{t.on(clearTimeout)},r=y("not-implemented");return Jc({getTooltip:o.get,isShowing:o.isSet,setTooltip:o.set,clearTooltip:o.clear,clearTimer:n,resetTimer:(e,o)=>{n(),t.set(setTimeout(e,o))},readState:r,isEnabled:()=>e.get(),setEnabled:t=>e.set(t)})}});const Qx=Dd({fields:Xx,name:"tooltipping",active:Yx,state:Jx,apis:Kx});const ev=Dd({fields:[],name:"unselecting",active:Object.freeze({__proto__:null,events:()=>ld([cd(Ws(),T)]),exhibit:()=>Cd({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})})}),tv=e=>{const t=it.fromHtml(e),o=po(t),n=(e=>{const t=void 0!==e.dom.attributes?e.dom.attributes:[];return U(t,(e,t)=>"class"===t.name?e:{...e,[t.name]:t.value},{})})(t),r=(e=>Array.prototype.slice.call(e.dom.classList,0))(t),a=0===o.length?{}:{innerHtml:en(t)};return{tag:Jt(t),classes:r,attributes:n,...a}},ov=e=>{const t=(e=>void 0!==e.uid)(e)&&xe(e,"uid")?e.uid:Ng("memento");return{get:e=>e.getSystem().getByUid(t).getOrDie(),getOpt:e=>e.getSystem().getByUid(t).toOptional(),asSpec:()=>({...e,uid:t})}},nv=Fl,rv=Cl,av=y("dismiss.popups"),sv=y("reposition.popups"),iv=y("mouse.released"),lv=(e,t)=>{const o={stopBackspace:!0,...t},n=$i(o),r=I(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),t=>Do(e,t,e=>{n.fireIfReady(e,t).each(t=>{t&&e.kill()});o.triggerEvent(t,e)&&e.kill()})),a=Ke(),s=Do(e,"paste",e=>{n.fireIfReady(e,"paste").each(t=>{t&&e.kill()});o.triggerEvent("paste",e)&&e.kill(),a.set(setTimeout(()=>{o.triggerEvent(Ys(),e)},0))}),i=Do(e,"keydown",e=>{o.triggerEvent("keydown",e)?e.kill():o.stopBackspace&&(e=>e.raw.which===Fd[0]&&!B(["input","textarea"],Jt(e.target))&&!fr(e.target,'[contenteditable="true"]'))(e)&&e.prevent()}),l=Do(e,"focusin",e=>{o.triggerEvent("focusin",e)&&e.kill()}),c=Ke(),d=Do(e,"focusout",e=>{o.triggerEvent("focusout",e)&&e.kill(),c.set(setTimeout(()=>{o.triggerEvent(Ks(),e)},0))});return{unbind:()=>{P(r,e=>{e.unbind()}),i.unbind(),l.unbind(),d.unbind(),s.unbind(),a.on(clearTimeout),c.on(clearTimeout)}}},cv=(e,t)=>{const o=fe(e,"target").getOr(t);return ye(o)},dv=ve([{stopped:[]},{resume:["element"]},{complete:[]}]),mv=(e,t,o,n,r,a)=>{const s=e(t,n),i=((e,t)=>{const o=ye(!1),n=ye(!1);return{stop:()=>{o.set(!0)},cut:()=>{n.set(!0)},isStopped:o.get,isCut:n.get,event:e,setSource:t.set,getSource:t.get}})(o,r);return s.fold(()=>(a.logEventNoHandlers(t,n),dv.complete()),e=>{const o=e.descHandler;return Ig(o)(i),i.isStopped()?(a.logEventStopped(t,e.element,o.purpose),dv.stopped()):i.isCut()?(a.logEventCut(t,e.element,o.purpose),dv.complete()):mo(e.element).fold(()=>(a.logNoParent(t,e.element,o.purpose),dv.complete()),n=>(a.logEventResponse(t,e.element,o.purpose),dv.resume(n)))})},uv=(e,t,o,n,r,a)=>mv(e,t,o,n,r,a).fold(T,n=>uv(e,t,o,n,r,a),O),gv=(e,t,o)=>{const n=(e=>{const t=ye(!1);return{stop:()=>{t.set(!0)},cut:b,isStopped:t.get,isCut:O,event:e,setSource:S("Cannot set source of a broadcasted event"),getSource:S("Cannot get source of a broadcasted event")}})(t);return P(e,e=>{const t=e.descHandler;Ig(t)(n)}),n.isStopped()},pv=(e,t,o,n,r)=>{const a=cv(o,n);return uv(e,t,o,n,a,r)},hv=()=>{const e={};return{registerId:(t,o,n)=>{ie(n,(n,r)=>{const a=void 0!==e[r]?e[r]:{};a[o]=((e,t)=>{return o=C.apply(void 0,[e.handler].concat(t)),n=e.purpose,{cHandler:o,purpose:n};var o,n})(n,t),e[r]=a})},unregisterId:t=>{ie(e,(e,o)=>{be(e,t)&&delete e[t]})},filterByType:t=>fe(e,t).map(e=>ge(e,(e,t)=>((e,t)=>({id:e,descHandler:t}))(t,e))).getOr([]),find:(t,o,n)=>fe(e,o).bind(e=>vr(n,t=>((e,t)=>Rg(t).bind(t=>fe(e,t)).map(e=>((e,t)=>({element:e,descHandler:t}))(t,e)))(e,t),t))}},fv=()=>{const e=hv(),t={},o=e=>{const t=e.element;return Rg(t).getOrThunk(()=>((e,t)=>{const o=Le(Ag+e);return Mg(t,o),o})("uid-",e.element))},n=o=>{Rg(o.element).each(o=>{delete t[o],e.unregisterId(o)})};return{find:(t,o,n)=>e.find(t,o,n),filter:t=>e.filterByType(t),register:r=>{const a=o(r);xe(t,a)&&((e,o)=>{const r=t[o];if(r!==e)throw new Error('The tagId "'+o+'" is already used by: '+yi(r.element)+"\nCannot use it for: "+yi(e.element)+"\nThe conflicting element is"+(an(r.element)?" ":" not ")+"already in the DOM");n(e)})(r,a);const s=[r];e.registerId(s,a,r.events),t[a]=r},unregister:n,getById:e=>fe(t,e)}},bv=e=>{const t=t=>mo(e.element).fold(T,e=>xt(t,e)),o=fv(),n=(e,n)=>o.find(t,e,n),r=lv(e.element,{triggerEvent:(e,t)=>Ei(e,t.target,o=>((e,t,o,n)=>pv(e,t,o,o.target,n))(n,e,t,o))}),a={debugInfo:y("real"),triggerEvent:(e,t,o)=>{Ei(e,t,r=>pv(n,e,o,t,r))},triggerFocus:(e,t)=>{Rg(e).fold(()=>{Bo(e)},o=>{Ei(Gs(),e,o=>(((e,t,o,n,r)=>{const a=cv(o,n);mv(e,t,o,n,a,r)})(n,Gs(),{originator:t,kill:b,prevent:b,target:e},e,o),!1))})},triggerEscape:(e,t)=>{a.triggerEvent("keydown",e.element,t.event)},getByUid:e=>p(e),getByDom:e=>h(e),build:sp,buildOrPatch:ap,addToGui:e=>{l(e)},removeFromGui:e=>{c(e)},addToWorld:e=>{s(e)},removeFromWorld:e=>{i(e)},broadcast:e=>{m(e)},broadcastOn:(e,t)=>{u(e,t)},broadcastEvent:(e,t)=>{g(e,t)},isConnected:T},s=e=>{e.connect(a),oo(e.element)||(o.register(e),P(e.components(),s),a.triggerEvent(ri(),e.element,{target:e.element}))},i=e=>{oo(e.element)||(P(e.components(),i),o.unregister(e)),e.disconnect()},l=t=>{ng(e,t)},c=e=>{sg(e)},d=e=>{const t=o.filter(Xs());P(t,t=>{const o=t.descHandler;Ig(o)(e)})},m=e=>{d({universal:!0,data:e})},u=(e,t)=>{d({universal:!1,channels:e,data:t})},g=(e,t)=>{const n=o.filter(e);return gv(n,t)},p=e=>o.getById(e).fold(()=>Ae.error(new Error('Could not find component with uid: "'+e+'" in system.')),Ae.value),h=e=>{const t=Rg(e).getOr("not found");return p(t)};return s(e),{root:e,element:e.element,destroy:()=>{r.unbind(),Jo(e.element)},add:l,remove:c,getByUid:p,getByDom:h,addToWorld:s,removeFromWorld:i,broadcast:m,broadcastOn:u,broadcastEvent:g}},xv=()=>{const e=(e,t)=>{t.stop(),rd(e)};return[md(Vs(),e),md(ei(),e),fd(Es()),fd(Ds())]},vv=e=>ld($([e.map(e=>_d((t,o)=>{e(t),o.stop()})).toArray(),xv()])),yv=Fh({name:"Button",factory:e=>{const t=vv(e.action),o=e.dom.tag,n=t=>fe(e.dom,"attributes").bind(e=>fe(e,t));return{uid:e.uid,dom:e.dom,components:e.components,events:t,behaviours:Bh(e.buttonBehaviours,[Pd.config({}),Wu.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:(()=>{if("button"===o){return{type:n("type").getOr("button"),...n("role").map(e=>({role:e})).getOr({})}}return{role:e.role.getOr(n("role").getOr("button"))}})()},eventOrder:e.eventOrder}},configFields:[us("uid",void 0),Ka("dom"),us("components",[]),Nh("buttonBehaviours",[Pd,Wu]),rs("action"),rs("role"),us("eventOrder",{})]}),wv=y([us("shell",!1),Ka("makeItem"),us("setupItem",b),Nh("listBehaviours",[kg])]),_v=yl({name:"items",overrides:()=>({behaviours:Td([kg.config({})])})}),Cv=y([_v]),kv=Vh({name:y("CustomList")(),configFields:wv(),partFields:Cv(),factory:(e,t,o,n)=>{const r=e.shell?{behaviours:[kg.config({})],components:[]}:{behaviours:[],components:t},a=t=>e.shell?A.some(t):Rl(t,e,"items");return{uid:e.uid,dom:e.dom,components:r.components,behaviours:Rh(e.listBehaviours,r.behaviours),apis:{setItems:(t,o)=>{a(t).fold(()=>{throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")},n=>{const r=kg.contents(n),a=o.length,s=a-r.length,i=s>0?H(s,()=>e.makeItem()):[],l=r.slice(a);P(l,e=>kg.remove(n,e)),P(i,e=>kg.append(n,e));const c=kg.contents(n);P(c,(n,r)=>{e.setupItem(t,n,o[r],r)})})}}}},apis:{setItems:(e,t,o)=>{e.setItems(t,o)}}}),Sv="aria-controls",Ev=()=>{const e=Le(Sv);return{id:e,link:t=>{Wo(t,Sv,e)},unlink:e=>{Yo(e,Sv)}}},Ov=(e,t)=>(e=>jn(e,e=>{if(!to(e))return!1;const t=qo(e,"id");return void 0!==t&&t.indexOf(Sv)>-1}).bind(e=>{const t=qo(e,"id"),o=wo(e);return Kn(o,`[${Sv}="${t}"]`)}))(t).exists(t=>Tv(e,t)),Tv=(e,t)=>hr(t,t=>xt(t,e.element),O)||Ov(e,t),Av="alloy.item-hover",Dv="alloy.item-focus",Mv="alloy.item-toggled",Rv=e=>{(Io(e.element).isNone()||Pd.isFocused(e))&&(Pd.isFocused(e)||Pd.focus(e),nd(e,Av,{item:e}))},Nv=e=>{nd(e,Dv,{item:e})},Bv=y(Av),zv=y(Dv),Hv=y(Mv),Lv=e=>e.role.fold(()=>e.toggling.map(e=>e.exclusive?"menuitemradio":"menuitemcheckbox").getOr("menuitem"),w),Iv=(e,t)=>({aria:{mode:t?"selected":"checked"},...ue(e,(e,t)=>"exclusive"!==t),onToggled:(t,o)=>{p(e.onToggled)&&e.onToggled(t,o),((e,t)=>{nd(e,Mv,{item:e,state:t})})(t,o)}});var Pv=[Ka("data"),Ka("components"),Ka("dom"),us("hasSubmenu",!1),rs("toggling"),rs("role"),Nh("itemBehaviours",[Vx,Pd,Wu,Bf]),us("ignoreFocus",!1),us("domModification",{}),Pi("builder",e=>({dom:e.dom,domModification:{...e.domModification,attributes:{role:Lv(e),...e.domModification.attributes,"aria-haspopup":e.hasSubmenu,...e.hasSubmenu?{"aria-expanded":!1}:{}}},behaviours:Bh(e.itemBehaviours,[e.toggling.fold(Vx.revoke,t=>Vx.config(Iv(t,e.role.exists(e=>"option"===e)))),Pd.config({ignore:e.ignoreFocus,stopMousedown:e.ignoreFocus,onFocus:e=>{Nv(e)}}),Wu.config({mode:"execution"}),Bf.config({store:{mode:"memory",initialValue:e.data}}),Bd("item-type-events",[...xv(),md(Bs(),Rv),md(Qs(),Pd.focus)])]),components:e.components,eventOrder:e.eventOrder})),us("eventOrder",{})];var Fv=[Ka("dom"),Ka("components"),Pi("builder",e=>({dom:e.dom,components:e.components,events:ld([bd(Qs())])}))];const Vv=y("item-widget"),Zv=y([xl({name:"widget",overrides:e=>({behaviours:Td([Bf.config({store:{mode:"manual",getValue:t=>e.data,setValue:b}})])})})]),Uv=[Ka("uid"),Ka("data"),Ka("components"),Ka("dom"),us("autofocus",!1),us("ignoreFocus",!1),Nh("widgetBehaviours",[Bf,Pd,Wu]),us("domModification",{}),Pl(Zv()),Pi("builder",e=>{const t=Dl(Vv(),e,Zv()),o=Ml(Vv(),e,t.internals()),n=t=>Rl(t,e,"widget").map(e=>(Wu.focusIn(e),e)),r=(t,o)=>Cm(o.event.target)?A.none():e.autofocus?(o.setSource(t.element),A.none()):A.none();return{dom:e.dom,components:o,domModification:e.domModification,events:ld([_d((e,t)=>{n(e).each(e=>{t.stop()})}),md(Bs(),Rv),md(Qs(),(t,o)=>{e.autofocus?n(t):Pd.focus(t)})]),behaviours:Bh(e.widgetBehaviours,[Bf.config({store:{mode:"memory",initialValue:e.data}}),Pd.config({ignore:e.ignoreFocus,onFocus:e=>{Nv(e)}}),Wu.config({mode:"special",focusIn:e.autofocus?e=>{n(e)}:Nd(),onLeft:r,onRight:r,onEscape:(t,o)=>Pd.isFocused(t)||e.autofocus?e.autofocus?(o.setSource(t.element),A.none()):A.none():(Pd.focus(t),A.some(!0))})])}})];const jv=ja("type",{widget:Uv,item:Pv,separator:Fv}),Wv=y([wl({factory:{sketch:e=>{const t=Za("menu.spec item",jv,e);return t.builder(t)}},name:"items",unit:"item",defaults:(e,t)=>be(t,"uid")?t:{...t,uid:Ng("item")},overrides:(e,t)=>({type:t.type,ignoreFocus:e.fakeFocus,domModification:{classes:[e.markers.item]}})})]),$v=y([is("role"),Ka("value"),Ka("items"),Ka("dom"),Ka("components"),us("eventOrder",{}),Dh("menuBehaviours",[hm,Bf,gp,Wu]),gs("movement",{mode:"menu",moveOnTab:!0},ja("mode",{grid:[Vi(),Pi("config",(e,t)=>({mode:"flatgrid",selector:"."+e.markers.item,initSize:{numColumns:t.initSize.numColumns,numRows:t.initSize.numRows},focusManager:e.focusManager}))],matrix:[Pi("config",(e,t)=>({mode:"matrix",selectors:{row:t.rowSelector,cell:"."+e.markers.item},previousSelector:t.previousSelector,focusManager:e.focusManager})),Ka("rowSelector"),us("previousSelector",A.none)],menu:[us("moveOnTab",!0),Pi("config",(e,t)=>({mode:"menu",selector:"."+e.markers.item,moveOnTab:t.moveOnTab,focusManager:e.focusManager}))]})),Ya("markers",Di()),us("fakeFocus",!1),us("focusManager",bm()),zi("onHighlight"),zi("onDehighlight"),us("showMenuRole",!0)]),qv=y("alloy.menu-focus"),Gv=Vh({name:"Menu",configFields:$v(),partFields:Wv(),factory:(e,t,o,n)=>({uid:e.uid,dom:e.dom,markers:e.markers,behaviours:Rh(e.menuBehaviours,[hm.config({highlightClass:e.markers.selectedItem,itemClass:e.markers.item,onHighlight:e.onHighlight,onDehighlight:e.onDehighlight}),Bf.config({store:{mode:"memory",initialValue:e.value}}),gp.config({find:A.some}),Wu.config(e.movement.config(e,e.movement))]),events:ld([md(zv(),(e,t)=>{const o=t.event;e.getSystem().getByDom(o.target).each(o=>{hm.highlight(e,o),t.stop(),nd(e,qv(),{menu:e,item:o})})}),md(Bv(),(e,t)=>{const o=t.event.item;hm.highlight(e,o)}),md(Hv(),(e,t)=>{const{item:o,state:n}=t.event;n&&"menuitemradio"===qo(o.element,"role")&&((e,t)=>{const o=pr(e.element,'[role="menuitemradio"][aria-checked="true"]');P(o,o=>{xt(o,t.element)||e.getSystem().getByDom(o).each(e=>{Vx.off(e)})})})(e,o)})]),components:t,eventOrder:e.eventOrder,...e.showMenuRole?{domModification:{attributes:{role:e.role.getOr("menu")}}}:{}})}),Kv=(e,t,o,n)=>fe(o,n).bind(n=>fe(e,n).bind(n=>{const r=Kv(e,t,o,n);return A.some([n].concat(r))})).getOr([]),Yv=(e,t)=>{const o={};ie(e,(e,t)=>{P(e,e=>{o[e]=t})});const n=t,r=ce(t,(e,t)=>({k:e,v:t}));const a=le(r,(e,t)=>[t].concat(Kv(o,n,r,t)));return le(o,e=>fe(a,e).getOr([e]))},Xv=e=>"prepared"===e.type?A.some(e.menu):A.none(),Jv={init:()=>{const e=ye({}),t=ye({}),o=ye({}),n=Ke(),r=ye({}),a=(t,o,n)=>s(t).bind(r=>(t=>pe(e.get(),(e,o)=>e===t))(t).bind(e=>o(e).map(e=>({triggeredMenu:r,triggeringItem:e,triggeringPath:n})))),s=e=>i(e).bind(Xv),i=e=>fe(t.get(),e),l=t=>fe(e.get(),t);return{setMenuBuilt:(e,o)=>{t.set({...t.get(),[e]:{type:"prepared",menu:o}})},setContents:(a,s,i,l)=>{n.set(a),e.set(i),t.set(s),r.set(l);const c=Yv(l,i);o.set(c)},expand:t=>fe(e.get(),t).map(e=>{const n=fe(o.get(),t).getOr([]);return[e].concat(n)}),refresh:e=>fe(o.get(),e),collapse:e=>fe(o.get(),e).bind(e=>e.length>1?A.some(e.slice(1)):A.none()),lookupMenu:i,lookupItem:l,otherMenus:e=>{const t=r.get();return Y(ae(t),e)},getPrimary:()=>n.get().bind(s),getMenus:()=>t.get(),clear:()=>{e.set({}),t.set({}),o.set({}),n.clear()},isClear:()=>n.get().isNone(),getTriggeringPath:(e,t)=>{const r=V(l(e).toArray(),e=>s(e).isSome());return fe(o.get(),e).bind(e=>{const o=K(r.concat(e));return(e=>{const t=[];for(let o=0;o<e.length;o++){const n=e[o];if(!n.isSome())return A.none();t.push(n.getOrDie())}return A.some(t)})(q(o,(e,r)=>a(e,t,o.slice(0,r+1)).fold(()=>Ve(n.get(),e)?[]:[A.none()],e=>[A.some(e)])))})}}},extractPreparedMenu:Xv},Qv=Le("tiered-menu-item-highlight"),ey=Le("tiered-menu-item-dehighlight"),ty=y("collapse-item"),oy=Fh({name:"TieredMenu",configFields:[Ii("onExecute"),Ii("onEscape"),Li("onOpenMenu"),Li("onOpenSubmenu"),zi("onRepositionMenu"),zi("onCollapseMenu"),us("highlightOnOpen",Yc.HighlightMenuAndItem),ts("data",[Ka("primary"),Ka("menus"),Ka("expansions")]),us("fakeFocus",!1),zi("onHighlightItem"),zi("onDehighlightItem"),zi("onHover"),Ri(),Ka("dom"),us("navigateOnHover",!0),us("stayInDom",!1),Dh("tmenuBehaviours",[Wu,hm,gp,kg]),us("eventOrder",{})],apis:{collapseMenu:(e,t)=>{e.collapseMenu(t)},highlightPrimary:(e,t)=>{e.highlightPrimary(t)},repositionMenus:(e,t)=>{e.repositionMenus(t)}},factory:(e,t)=>{const o=Ke(),n=Jv.init(),r=t=>{const o=((t,o,n)=>le(n,(n,r)=>{const a=()=>Gv.sketch({...n,value:r,markers:e.markers,fakeFocus:e.fakeFocus,onHighlight:(e,t)=>{nd(e,Qv,{menuComp:e,itemComp:t})},onDehighlight:(e,t)=>{nd(e,ey,{menuComp:e,itemComp:t})},focusManager:e.fakeFocus?xm():bm()});return r===o?{type:"prepared",menu:t.getSystem().build(a())}:{type:"notbuilt",nbMenu:a}}))(t,e.data.primary,e.data.menus),r=s();return n.setContents(e.data.primary,o,e.data.expansions,r),n.getPrimary()},a=e=>Bf.getValue(e).value,s=t=>le(e.data.menus,(e,t)=>q(e.items,e=>"separator"===e.type?[]:[e.data.value])),i=hm.highlight,l=(t,o)=>{i(t,o),hm.getHighlighted(o).orThunk(()=>hm.getFirst(o)).each(n=>{e.fakeFocus?hm.highlight(o,n):ad(t,n.element,Qs())})},c=(e,t)=>Ze(I(t,t=>e.lookupMenu(t).bind(e=>"prepared"===e.type?A.some(e.menu):A.none()))),d=(t,o,n)=>{const r=c(o,o.otherMenus(n));P(r,o=>{cr(o.element,[e.markers.backgroundMenu]),e.stayInDom||kg.remove(t,o)})},m=(t,n)=>{const r=(t=>o.get().getOrThunk(()=>{const n={},r=pr(t.element,`.${e.markers.item}`),s=V(r,e=>"true"===qo(e,"aria-haspopup"));return P(s,e=>{t.getSystem().getByDom(e).each(e=>{const t=a(e);n[t]=e})}),o.set(n),n}))(t);ie(r,(e,t)=>{const o=B(n,t);Wo(e.element,"aria-expanded",o)})},u=(t,o,n)=>A.from(n[0]).bind(r=>o.lookupMenu(r).bind(r=>{if("notbuilt"===r.type)return A.none();{const a=r.menu,s=c(o,n.slice(1));return P(s,t=>{nr(t.element,e.markers.backgroundMenu)}),an(a.element)||kg.append(t,ip(a)),cr(a.element,[e.markers.backgroundMenu]),l(t,a),d(t,o,n),A.some(a)}}));let g;!function(e){e[e.HighlightSubmenu=0]="HighlightSubmenu",e[e.HighlightParent=1]="HighlightParent"}(g||(g={}));const p=(t,o,r=g.HighlightSubmenu)=>{if(o.hasConfigured(Mp)&&Mp.isDisabled(o))return A.some(o);{const s=a(o);return n.expand(s).bind(a=>(m(t,a),A.from(a[0]).bind(s=>n.lookupMenu(s).bind(i=>{const l=((e,t,o)=>{if("notbuilt"===o.type){const r=e.getSystem().build(o.nbMenu());return n.setMenuBuilt(t,r),r}return o.menu})(t,s,i);return an(l.element)||kg.append(t,ip(l)),e.onOpenSubmenu(t,o,l,K(a)),r===g.HighlightSubmenu?(hm.highlightFirst(l),u(t,n,a)):(hm.dehighlightAll(l),A.some(o))}))))}},h=(t,o)=>{const r=a(o);return n.collapse(r).bind(r=>(m(t,r),u(t,n,r).map(n=>(e.onCollapseMenu(t,o,n),n))))},f=t=>(o,n)=>Yn(n.getSource(),`.${e.markers.item}`).bind(e=>o.getSystem().getByDom(e).toOptional().bind(e=>t(o,e).map(T))),x=ld([md(qv(),(e,t)=>{const o=t.event.item;n.lookupItem(a(o)).each(()=>{const o=t.event.menu;hm.highlight(e,o);const r=a(t.event.item);n.refresh(r).each(t=>d(e,n,t))})}),_d((t,o)=>{const n=o.event.target;t.getSystem().getByDom(n).each(o=>{0===a(o).indexOf("collapse-item")&&h(t,o),p(t,o,g.HighlightSubmenu).fold(()=>{e.onExecute(t,o)},b)})}),vd((t,o)=>{r(t).each(o=>{kg.append(t,ip(o)),e.onOpenMenu(t,o),e.highlightOnOpen===Yc.HighlightMenuAndItem?l(t,o):e.highlightOnOpen===Yc.HighlightJustMenu&&i(t,o)})}),md(Qv,(t,o)=>{e.onHighlightItem(t,o.event.menuComp,o.event.itemComp)}),md(ey,(t,o)=>{e.onDehighlightItem(t,o.event.menuComp,o.event.itemComp)}),...e.navigateOnHover?[md(Bv(),(t,o)=>{const r=o.event.item;((e,t)=>{const o=a(t);n.refresh(o).bind(t=>(m(e,t),u(e,n,t)))})(t,r),p(t,r,g.HighlightParent),e.onHover(t,r)})]:[]]),v=e=>hm.getHighlighted(e).bind(hm.getHighlighted),y={collapseMenu:e=>{v(e).each(t=>{h(e,t)})},highlightPrimary:e=>{n.getPrimary().each(t=>{l(e,t)})},repositionMenus:t=>{const o=n.getPrimary().bind(e=>v(t).bind(e=>{const t=a(e),o=he(n.getMenus()),r=Ze(I(o,Jv.extractPreparedMenu));return n.getTriggeringPath(t,e=>((e,t,o)=>re(t,e=>{if(!e.getSystem().isConnected())return A.none();const t=hm.getCandidates(e);return j(t,e=>a(e)===o)}))(0,r,e))}).map(t=>({primary:e,triggeringPath:t})));o.fold(()=>{(e=>A.from(e.components()[0]).filter(e=>"menu"===qo(e.element,"role")))(t).each(o=>{e.onRepositionMenu(t,o,[])})},({primary:o,triggeringPath:n})=>{e.onRepositionMenu(t,o,n)})}};return{uid:e.uid,dom:e.dom,markers:e.markers,behaviours:Rh(e.tmenuBehaviours,[Wu.config({mode:"special",onRight:f((e,t)=>Cm(t.element)?A.none():p(e,t,g.HighlightSubmenu)),onLeft:f((e,t)=>Cm(t.element)?A.none():h(e,t)),onEscape:f((t,o)=>h(t,o).orThunk(()=>e.onEscape(t,o).map(()=>t))),focusIn:(e,t)=>{n.getPrimary().each(t=>{ad(e,t.element,Qs())})}}),hm.config({highlightClass:e.markers.selectedMenu,itemClass:e.markers.menu}),gp.config({find:e=>hm.getHighlighted(e)}),kg.config({})]),eventOrder:e.eventOrder,apis:y,events:x}},extraApis:{tieredData:(e,t,o)=>({primary:e,menus:t,expansions:o}),singleData:(e,t)=>({primary:e,menus:_s(e,t),expansions:{}}),collapseItem:e=>({value:Le(ty()),meta:{text:e}})}}),ny=y("sink"),ry=y(yl({name:ny(),overrides:y({dom:{tag:"div"},behaviours:Td([Wb.config({useFixed:T})]),events:ld([fd(Ls()),fd(Ds()),fd(Vs())])})})),ay=Da([us("isExtraPart",O),ms("fireEventInstead",[us("event",mi())])]),sy=e=>{const t=Za("Dismissal",ay,e);return{[av()]:{schema:Da([Ka("target")]),onReceive:(e,o)=>{if(cx.isOpen(e)){cx.isPartOf(e,o.target)||t.isExtraPart(e,o.target)||t.fireEventInstead.fold(()=>cx.close(e),t=>od(e,t.event))}}}}},iy=Da([ms("fireEventInstead",[us("event",ui())]),es("doReposition")]),ly=e=>{const t=Za("Reposition",iy,e);return{[sv()]:{onReceive:e=>{cx.isOpen(e)&&t.fireEventInstead.fold(()=>t.doReposition(e),t=>od(e,t.event))}}}},cy=(e,t)=>{const o=e.getHotspot(t).getOr(t),n="hotspot",r=e.getAnchorOverrides();return e.layouts.fold(()=>({type:n,hotspot:o,overrides:r}),e=>({type:n,hotspot:o,overrides:r,layouts:e}))},dy=(e,t,o,n,r,a,s)=>{const i=((e,t,o,n,r,a,s)=>{const i=((e,t,o)=>(0,e.fetch)(o).map(t))(e,t,n),l=py(n,e);return i.map(t=>t.bind(t=>{const i=t.menus[t.primary];return A.from(i).each(t=>{e.listRole.each(e=>{t.role=e})}),A.from(oy.sketch({...a.menu(),uid:Ng(""),data:t,highlightOnOpen:s,onOpenMenu:(e,t)=>{const n=l().getOrDie();Wb.position(n,t,{anchor:o}),cx.decloak(r)},onOpenSubmenu:(e,t,o)=>{const n=l().getOrDie();Wb.position(n,o,{anchor:{type:"submenu",item:t}}),cx.decloak(r)},onRepositionMenu:(e,t,n)=>{const r=l().getOrDie();Wb.position(r,t,{anchor:o}),P(n,e=>{Wb.position(r,e.triggeredMenu,{anchor:{type:"submenu",item:e.triggeringItem}})})},onEscape:()=>(Pd.focus(n),cx.close(r),A.some(!0))}))}))})(e,t,cy(e,o),o,n,r,s);return i.map(e=>(e.fold(()=>{cx.isOpen(n)&&cx.close(n)},e=>{cx.cloak(n),cx.open(n,e),a(n)}),n))},my=(e,t,o,n,r,a,s)=>(cx.close(n),Ee(n)),uy=(e,t,o,n,r,a)=>{const s=bp.getCoupled(o,"sandbox");return(cx.isOpen(s)?my:dy)(e,t,o,s,n,r,a)},gy=(e,t,o)=>{const n=gp.getCurrent(t).getOr(t),r=Tn(e.element);o?mn(n.element,"min-width",r+"px"):((e,t)=>{En.set(e,t)})(n.element,r)},py=(e,t)=>e.getSystem().getByUid(t.uid+"-"+ny()).map(e=>()=>Ae.value(e)).getOrThunk(()=>t.lazySink.fold(()=>()=>Ae.error(new Error("No internal sink is specified, nor could an external sink be found")),t=>()=>t(e))),hy=e=>{cx.getState(e).each(e=>{oy.repositionMenus(e)})},fy=(e,t,o)=>{const n=Ev(),r=py(t,e);return{dom:{tag:"div",classes:e.sandboxClasses,attributes:{id:n.id}},behaviours:Bh(e.sandboxBehaviours,[Bf.config({store:{mode:"memory",initialValue:t}}),cx.config({onOpen:(r,a)=>{const s=cy(e,t);n.link(t.element),e.matchWidth&&gy(s.hotspot,a,e.useMinWidth),e.onOpen(s,r,a),void 0!==o&&void 0!==o.onOpen&&o.onOpen(r,a)},onClose:(e,a)=>{n.unlink(t.element),r().getOr(a).element.dom.dispatchEvent(new window.FocusEvent("focusout")),void 0!==o&&void 0!==o.onClose&&o.onClose(e,a)},isPartOf:(e,o,n)=>Tv(o,n)||Tv(t,n),getAttachPoint:()=>r().getOrDie()}),gp.config({find:e=>cx.getState(e).bind(e=>gp.getCurrent(e))}),Gb.config({channels:{...sy({isExtraPart:O}),...ly({doReposition:hy})}})])}},by=e=>{const t=bp.getCoupled(e,"sandbox");hy(t)},xy=()=>[us("sandboxClasses",[]),Nh("sandboxBehaviours",[gp,Gb,cx,Bf])],vy=y([Ka("dom"),Ka("fetch"),zi("onOpen"),Hi("onExecute"),us("getHotspot",A.some),us("getAnchorOverrides",y({})),ab(),Dh("dropdownBehaviours",[Vx,bp,Wu,Pd]),Ka("toggleClass"),us("eventOrder",{}),rs("lazySink"),us("matchWidth",!1),us("useMinWidth",!1),rs("role"),rs("listRole")].concat(xy())),yy=y([vl({schema:[Ri(),us("fakeFocus",!1)],name:"menu",defaults:e=>({onExecute:e.onExecute})}),ry()]),wy=Vh({name:"Dropdown",configFields:vy(),partFields:yy(),factory:(e,t,o,n)=>{const r=e=>{cx.getState(e).each(e=>{oy.highlightPrimary(e)})},a=(t,o,r)=>uy(e,w,t,n,o,r),s={expand:e=>{Vx.isOn(e)||a(e,b,Yc.HighlightNone).get(b)},open:e=>{Vx.isOn(e)||a(e,b,Yc.HighlightMenuAndItem).get(b)},refetch:t=>bp.getExistingCoupled(t,"sandbox").fold(()=>a(t,b,Yc.HighlightMenuAndItem).map(b),o=>dy(e,w,t,o,n,b,Yc.HighlightMenuAndItem).map(b)),isOpen:Vx.isOn,close:e=>{Vx.isOn(e)&&a(e,b,Yc.HighlightMenuAndItem).get(b)},repositionMenus:e=>{Vx.isOn(e)&&by(e)}},i=(e,t)=>(rd(e),A.some(!0));return{uid:e.uid,dom:e.dom,components:t,behaviours:Rh(e.dropdownBehaviours,[Vx.config({toggleClass:e.toggleClass,aria:{mode:"expanded"}}),bp.config({others:{sandbox:t=>fy(e,t,{onOpen:()=>Vx.on(t),onClose:()=>Vx.off(t)})}}),Wu.config({mode:"special",onSpace:i,onEnter:i,onDown:(e,t)=>{if(wy.isOpen(e)){const t=bp.getCoupled(e,"sandbox");r(t)}else wy.open(e);return A.some(!0)},onEscape:(e,t)=>wy.isOpen(e)?(wy.close(e),A.some(!0)):A.none()}),Pd.config({})]),events:vv(A.some(e=>{a(e,r,Yc.HighlightMenuAndItem).get(b)})),eventOrder:{...e.eventOrder,[Js()]:["disabling","toggling","alloy.base.behaviour"]},apis:s,domModification:{attributes:{"aria-haspopup":e.listRole.getOr("true"),...e.role.fold(()=>({}),e=>({role:e})),..."button"===e.dom.tag?{type:(l="type",fe(e.dom,"attributes").bind(e=>fe(e,l))).getOr("button")}:{}}}};var l},apis:{open:(e,t)=>e.open(t),refetch:(e,t)=>e.refetch(t),expand:(e,t)=>e.expand(t),close:(e,t)=>e.close(t),isOpen:(e,t)=>e.isOpen(t),repositionMenus:(e,t)=>e.repositionMenus(t)}}),_y="form",Cy=[Dh("formBehaviours",[Bf])],ky=e=>"<alloy.field."+e+">",Sy=(e,t)=>({uid:e.uid,dom:e.dom,components:t,behaviours:Rh(e.formBehaviours,[Bf.config({store:{mode:"manual",getValue:t=>{const o=zl(t,e);return le(o,(e,t)=>e().bind(e=>{const o=gp.getCurrent(e);return n=o,r=new Error(`Cannot find a current component to extract the value from for form part '${t}': `+yi(e.element)),n.fold(()=>Ae.error(r),Ae.value);var n,r}).map(Bf.getValue))},setValue:(t,o)=>{ie(o,(o,n)=>{Rl(t,e,n).each(e=>{gp.getCurrent(e).each(e=>{Bf.setValue(e,o)})})})}}})]),apis:{getField:(t,o)=>Rl(t,e,o).bind(gp.getCurrent)}}),Ey={getField:Ku((e,t,o)=>e.getField(t,o)),sketch:e=>{const t=(()=>{const e=[];return{field:(t,o)=>(e.push(t),Ol(_y,ky(t),o)),record:y(e)}})(),o=e(t),n=t.record(),r=I(n,e=>xl({name:e,pname:ky(e)}));return Hh(_y,Cy,r,Sy,o)}},Oy=y([Ka("dom"),us("shell",!0),Dh("toolbarBehaviours",[kg])]),Ty=y([yl({name:"groups",overrides:()=>({behaviours:Td([kg.config({})])})})]),Ay=Vh({name:"Toolbar",configFields:Oy(),partFields:Ty(),factory:(e,t,o,n)=>{const r=t=>e.shell?A.some(t):Rl(t,e,"groups"),a=e.shell?{behaviours:[kg.config({})],components:[]}:{behaviours:[],components:t};return{uid:e.uid,dom:e.dom,components:a.components,behaviours:Rh(e.toolbarBehaviours,a.behaviours),apis:{setGroups:(e,t)=>{r(e).fold(()=>{throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},e=>{kg.set(e,t)})},refresh:b},domModification:{attributes:{role:"group"}}}},apis:{setGroups:(e,t,o)=>{e.setGroups(t,o)}}}),Dy=y([Ni(["toggledClass"]),Ka("lazySink"),es("fetch"),cs("getBounds"),ms("fireDismissalEventInstead",[us("event",mi())]),ab(),zi("onToggled")]),My=y([vl({name:"button",overrides:e=>({dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:Td([Vx.config({toggleClass:e.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1,onToggled:e.onToggled})])})}),vl({factory:Ay,schema:Oy(),name:"toolbar",overrides:e=>({toolbarBehaviours:Td([Wu.config({mode:"cyclic",onEscape:t=>(Rl(t,e,"button").each(Pd.focus),A.none())})])})})]),Ry=Ke(),Ny=(e,t)=>{const o=bp.getCoupled(e,"toolbarSandbox");cx.isOpen(o)?cx.close(o):cx.open(o,t.toolbar())},By=(e,t,o,n)=>{const r=o.getBounds.map(e=>e()),a=o.lazySink(e).getOrDie();Wb.positionWithinBounds(a,t,{anchor:{type:"hotspot",hotspot:e,layouts:n,overrides:{maxWidthFunction:$c()}}},r)},zy=(e,t,o,n,r)=>{Ay.setGroups(t,r),By(e,t,o,n),Vx.on(e)},Hy=Vh({name:"FloatingToolbarButton",factory:(e,t,o,n)=>({...yv.sketch({...n.button(),action:e=>{Ny(e,n)},buttonBehaviours:Bh({dump:n.button().buttonBehaviours},[bp.config({others:{toolbarSandbox:t=>((e,t,o)=>{const n=Ev();return{dom:{tag:"div",attributes:{id:n.id}},behaviours:Td([Wu.config({mode:"special",onEscape:e=>(cx.close(e),A.some(!0))}),cx.config({onOpen:(r,a)=>{const s=Ry.get().getOr(!1);o.fetch().get(r=>{zy(e,a,o,t.layouts,r),n.link(e.element),s||Wu.focusIn(a)})},onClose:()=>{Vx.off(e),Ry.get().getOr(!1)||Pd.focus(e),n.unlink(e.element)},isPartOf:(t,o,n)=>Tv(o,n)||Tv(e,n),getAttachPoint:()=>o.lazySink(e).getOrDie()}),Gb.config({channels:{...sy({isExtraPart:O,...o.fireDismissalEventInstead.map(e=>({fireEventInstead:{event:e.event}})).getOr({})}),...ly({doReposition:()=>{cx.getState(bp.getCoupled(e,"toolbarSandbox")).each(n=>{By(e,n,o,t.layouts)})}})}})])}})(t,o,e)}})])}),apis:{setGroups:(t,n)=>{cx.getState(bp.getCoupled(t,"toolbarSandbox")).each(r=>{zy(t,r,e,o.layouts,n)})},reposition:t=>{cx.getState(bp.getCoupled(t,"toolbarSandbox")).each(n=>{By(t,n,e,o.layouts)})},toggle:e=>{Ny(e,n)},toggleWithoutFocusing:e=>{((e,t)=>{Ry.set(!0),Ny(e,t),Ry.clear()})(e,n)},getToolbar:e=>cx.getState(bp.getCoupled(e,"toolbarSandbox")),isOpen:e=>cx.isOpen(bp.getCoupled(e,"toolbarSandbox"))}}),configFields:Dy(),partFields:My(),apis:{setGroups:(e,t,o)=>{e.setGroups(t,o)},reposition:(e,t)=>{e.reposition(t)},toggle:(e,t)=>{e.toggle(t)},toggleWithoutFocusing:(e,t)=>{e.toggleWithoutFocusing(t)},getToolbar:(e,t)=>e.getToolbar(t),isOpen:(e,t)=>e.isOpen(t)}}),Ly=y([us("prefix","form-field"),Dh("fieldBehaviours",[gp,Bf])]),Iy=y([yl({schema:[Ka("dom")],name:"label"}),yl({factory:{sketch:e=>({uid:e.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:e.text}})},schema:[Ka("text")],name:"aria-descriptor"}),xl({factory:{sketch:e=>{const t=ws(e,["factory"]);return e.factory.sketch(t)}},schema:[Ka("factory")],name:"field"})]),Py=Vh({name:"FormField",configFields:Ly(),partFields:Iy(),factory:(e,t,o,n)=>{const r=Rh(e.fieldBehaviours,[gp.config({find:t=>Rl(t,e,"field")}),Bf.config({store:{mode:"manual",getValue:e=>gp.getCurrent(e).bind(Bf.getValue),setValue:(e,t)=>{gp.getCurrent(e).each(e=>{Bf.setValue(e,t)})}}})]),a=ld([vd((t,o)=>{const n=Bl(t,e,["label","field","aria-descriptor"]);n.field().each(t=>{const o=Le(e.prefix);n.label().each(e=>{Wo(e.element,"for",o),Wo(t.element,"id",o)}),n["aria-descriptor"]().each(o=>{const n=Le(e.prefix);Wo(o.element,"id",n),Wo(t.element,"aria-describedby",n)})})})]),s={getField:t=>Rl(t,e,"field"),getLabel:t=>Rl(t,e,"label")};return{uid:e.uid,dom:e.dom,components:t,behaviours:r,events:a,apis:s}},apis:{getField:(e,t)=>e.getField(t),getLabel:(e,t)=>e.getLabel(t)}}),Fy=y([us("field1Name","field1"),us("field2Name","field2"),Li("onLockedChange"),Ni(["lockClass"]),us("locked",!1),Nh("coupledFieldBehaviours",[gp,Bf]),xs("onInput",b)]),Vy=(e,t)=>xl({factory:Py,name:e,overrides:e=>({fieldBehaviours:Td([Bd("coupled-input-behaviour",[md(Ps(),o=>{((e,t,o)=>Rl(e,t,o).bind(gp.getCurrent))(o,e,t).each(t=>{Rl(o,e,"lock").each(n=>{Vx.isOn(n)&&e.onLockedChange(o,t,n),e.onInput(o)})})})])])})}),Zy=y([Vy("field1","field2"),Vy("field2","field1"),xl({factory:yv,schema:[Ka("dom")],name:"lock",overrides:e=>({buttonBehaviours:Td([Vx.config({selected:e.locked,toggleClass:e.markers.lockClass,aria:{mode:"pressed"}})])})})]),Uy=Vh({name:"FormCoupledInputs",configFields:Fy(),partFields:Zy(),factory:(e,t,o,n)=>({uid:e.uid,dom:e.dom,components:t,behaviours:Bh(e.coupledFieldBehaviours,[gp.config({find:A.some}),Bf.config({store:{mode:"manual",getValue:t=>{const o=Ll(t,e,["field1","field2"]);return{[e.field1Name]:Bf.getValue(o.field1()),[e.field2Name]:Bf.getValue(o.field2())}},setValue:(t,o)=>{const n=Ll(t,e,["field1","field2"]);xe(o,e.field1Name)&&Bf.setValue(n.field1(),o[e.field1Name]),xe(o,e.field2Name)&&Bf.setValue(n.field2(),o[e.field2Name])}}})]),apis:{getField1:t=>Rl(t,e,"field1"),getField2:t=>Rl(t,e,"field2"),getLock:t=>Rl(t,e,"lock")}}),apis:{getField1:(e,t)=>e.getField1(t),getField2:(e,t)=>e.getField2(t),getLock:(e,t)=>e.getLock(t)}}),jy=Fh({name:"HtmlSelect",configFields:[Ka("options"),Dh("selectBehaviours",[Pd,Bf]),us("selectClasses",[]),us("selectAttributes",{}),rs("data")],factory:(e,t)=>{const o=I(e.options,e=>({dom:{tag:"option",value:e.value,innerHtml:e.text}})),n=e.data.map(e=>_s("initialValue",e)).getOr({});return{uid:e.uid,dom:{tag:"select",classes:e.selectClasses,attributes:e.selectAttributes},components:o,behaviours:Rh(e.selectBehaviours,[Pd.config({}),Bf.config({store:{mode:"manual",getValue:e=>mr(e.element),setValue:(t,o)=>{const n=te(e.options);j(e.options,e=>e.value===o).isSome()?ur(t.element,o):-1===t.element.dom.selectedIndex&&""===o&&n.each(e=>ur(t.element,e.value))},...n}})])}}}),Wy=Fh({name:"InlineView",configFields:[Ka("lazySink"),zi("onShow"),zi("onHide"),cs("onEscape"),Dh("inlineBehaviours",[cx,Bf,Gb]),ms("fireDismissalEventInstead",[us("event",mi())]),ms("fireRepositionEventInstead",[us("event",ui())]),us("getRelated",A.none),us("isExtraPart",O),us("eventOrder",A.none)],factory:(e,t)=>{const o=(t,o,n,r)=>{const a=e.lazySink(t).getOrDie();cx.openWhileCloaked(t,o,()=>Wb.positionWithinBounds(a,t,n,r())),Bf.setValue(t,A.some({mode:"position",config:n,getBounds:r}))},n=(t,o,n,r)=>{const a=((e,t,o,n,r)=>{const a=()=>e.lazySink(t),s="horizontal"===n.type?{layouts:{onLtr:()=>yc(),onRtl:()=>wc()}}:{},i=e=>(e=>2===e.length)(e)?s:{};return oy.sketch({dom:{tag:"div"},data:n.data,markers:n.menu.markers,highlightOnOpen:n.menu.highlightOnOpen,fakeFocus:n.menu.fakeFocus,onEscape:()=>(cx.close(t),e.onEscape.map(e=>e(t)),A.some(!0)),onExecute:()=>A.some(!0),onOpenMenu:(e,t)=>{Wb.positionWithinBounds(a().getOrDie(),t,o,r())},onOpenSubmenu:(e,t,o,n)=>{const r=a().getOrDie();Wb.position(r,o,{anchor:{type:"submenu",item:t,...i(n)}})},onRepositionMenu:(e,t,n)=>{const s=a().getOrDie();Wb.positionWithinBounds(s,t,o,r()),P(n,e=>{const t=i(e.triggeringPath);Wb.position(s,e.triggeredMenu,{anchor:{type:"submenu",item:e.triggeringItem,...t}})})}})})(e,t,o,n,r);cx.open(t,a),Bf.setValue(t,A.some({mode:"menu",menu:a}))},r=t=>{cx.isOpen(t)&&Bf.getValue(t).each(o=>{switch(o.mode){case"menu":cx.getState(t).each(oy.repositionMenus);break;case"position":const n=e.lazySink(t).getOrDie();Wb.positionWithinBounds(n,t,o.config,o.getBounds())}})},a={setContent:(e,t)=>{cx.setContent(e,t)},showAt:(e,t,n)=>{const r=A.none;o(e,t,n,r)},showWithinBounds:o,showMenuAt:(e,t,o)=>{n(e,t,o,A.none)},showMenuWithinBounds:n,hide:e=>{cx.isOpen(e)&&(Bf.setValue(e,A.none()),cx.close(e))},getContent:e=>cx.getState(e),reposition:r,isOpen:cx.isOpen};return{uid:e.uid,dom:e.dom,behaviours:Rh(e.inlineBehaviours,[cx.config({isPartOf:(t,o,n)=>Tv(o,n)||((t,o)=>e.getRelated(t).exists(e=>Tv(e,o)))(t,n),getAttachPoint:t=>e.lazySink(t).getOrDie(),onOpen:t=>{e.onShow(t)},onClose:t=>{e.onHide(t)}}),Bf.config({store:{mode:"memory",initialValue:A.none()}}),Gb.config({channels:{...sy({isExtraPart:t.isExtraPart,...e.fireDismissalEventInstead.map(e=>({fireEventInstead:{event:e.event}})).getOr({})}),...ly({...e.fireRepositionEventInstead.map(e=>({fireEventInstead:{event:e.event}})).getOr({}),doReposition:r})}})]),eventOrder:e.eventOrder,apis:a}},apis:{showAt:(e,t,o,n)=>{e.showAt(t,o,n)},showWithinBounds:(e,t,o,n,r)=>{e.showWithinBounds(t,o,n,r)},showMenuAt:(e,t,o,n)=>{e.showMenuAt(t,o,n)},showMenuWithinBounds:(e,t,o,n,r)=>{e.showMenuWithinBounds(t,o,n,r)},hide:(e,t)=>{e.hide(t)},isOpen:(e,t)=>e.isOpen(t),getContent:(e,t)=>e.getContent(t),setContent:(e,t,o)=>{e.setContent(t,o)},reposition:(e,t)=>{e.reposition(t)}}}),$y=y([hs("type","text"),rs("data"),us("inputAttributes",{}),us("inputStyles",{}),us("tag","input"),us("inputClasses",[]),zi("onSetValue"),xs("fromInputValue",w),xs("toInputValue",w),us("styles",{}),us("eventOrder",{}),Dh("inputBehaviours",[Bf,Pd]),us("selectOnFocus",!0)]),qy=e=>Td([Pd.config({onFocus:e.selectOnFocus?t=>{const o=t.element,n=mr(o);"range"!==e.type&&o.dom.setSelectionRange(0,n.length)}:b})]),Gy=e=>({...qy(e),...Rh(e.inputBehaviours,[Bf.config({store:{mode:"manual",...e.data.map(e=>({initialValue:e})).getOr({}),getValue:t=>e.fromInputValue(mr(t.element)),setValue:(t,o)=>{mr(t.element)!==o&&ur(t.element,e.toInputValue(o))}},onSetValue:e.onSetValue})])}),Ky=e=>({tag:e.tag,attributes:{type:e.type,...e.inputAttributes},styles:e.inputStyles,classes:e.inputClasses}),Yy=Fh({name:"Input",configFields:$y(),factory:(e,t)=>({uid:e.uid,dom:Ky(e),components:[],behaviours:Gy(e),eventOrder:e.eventOrder})}),Xy=Sl(Vv(),Zv()),Jy=y([Ka("lazySink"),rs("dragBlockClass"),xs("getBounds",Zr),us("useTabstopAt",T),us("firstTabstop",0),us("eventOrder",{}),Dh("modalBehaviours",[Wu]),Hi("onExecute"),Ii("onEscape")]),Qy={sketch:w},ew=y([yl({name:"draghandle",overrides:(e,t)=>({behaviours:Td([uf.config({mode:"mouse",getTarget:e=>$n(e,'[role="dialog"]').getOr(e),blockerClass:e.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(t,null,2)).message),getBounds:e.getDragBounds})])})}),xl({schema:[Ka("dom")],name:"title"}),xl({factory:Qy,schema:[Ka("dom")],name:"close"}),xl({factory:Qy,schema:[Ka("dom")],name:"body"}),yl({factory:Qy,schema:[Ka("dom")],name:"footer"}),vl({factory:{sketch:(e,t)=>({...e,dom:t.dom,components:t.components})},schema:[us("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),us("components",[])],name:"blocker"})]),tw=Vh({name:"ModalDialog",configFields:Jy(),partFields:ew(),factory:(e,t,o,n)=>{const r=Ke(),a=Le("modal-events"),s={...e.eventOrder,[ci()]:[a].concat(e.eventOrder["alloy.system.attached"]||[])},i=Gt();return{uid:e.uid,dom:e.dom,components:t,apis:{show:t=>{r.set(t);const o=e.lazySink(t).getOrDie(),a=n.blocker(),s=o.getSystem().build({...a,components:a.components.concat([ip(t)]),behaviours:Td([Pd.config({}),Bd("dialog-blocker-events",[xd(zs(),()=>{dp.isBlocked(t)||Wu.focusIn(t)})])])});ng(o,s),Wu.focusIn(t)},hide:e=>{r.clear(),mo(e.element).each(t=>{e.getSystem().getByDom(t).each(e=>{sg(e)})})},getBody:t=>Nl(t,e,"body"),getFooter:t=>Rl(t,e,"footer"),setIdle:e=>{dp.unblock(e)},setBusy:(e,t)=>{dp.block(e,t)}},eventOrder:s,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:Rh(e.modalBehaviours,[kg.config({}),Wu.config({mode:"cyclic",onEnter:e.onExecute,onEscape:e.onEscape,useTabstopAt:e.useTabstopAt,firstTabstop:e.firstTabstop}),dp.config({getRoot:r.get}),Bd(a,[vd(t=>{const o=Nl(t,e,"title").element,n=(e=>e.dom.textContent)(o);i.os.isMacOS()&&g(n)?Wo(t.element,"aria-label",n):((e,t)=>{const o=Go(e,"id").fold(()=>{const e=Le("dialog-label");return Wo(t,"id",e),e},w);Wo(e,"aria-labelledby",o)})(t.element,o)})])])}},apis:{show:(e,t)=>{e.show(t)},hide:(e,t)=>{e.hide(t)},getBody:(e,t)=>e.getBody(t),getFooter:(e,t)=>e.getFooter(t),setBusy:(e,t,o)=>{e.setBusy(t,o)},setIdle:(e,t)=>{e.setIdle(t)}}}),ow=yl({schema:[Ka("dom")],name:"label"}),nw=e=>yl({name:e+"-edge",overrides:t=>t.model.manager.edgeActions[e].fold(()=>({}),e=>({events:ld([ud(Es(),(t,o,n)=>e(t,n),[t]),ud(Ds(),(t,o,n)=>e(t,n),[t]),ud(Ms(),(t,o,n)=>{n.mouseIsDown.get()&&e(t,n)},[t])])}))}),rw=nw("top-left"),aw=nw("top"),sw=nw("top-right"),iw=nw("right"),lw=nw("bottom-right"),cw=nw("bottom"),dw=nw("bottom-left"),mw=nw("left"),uw=xl({name:"thumb",defaults:y({dom:{styles:{position:"absolute"}}}),overrides:e=>({events:ld([pd(Es(),e,"spectrum"),pd(Os(),e,"spectrum"),pd(Ts(),e,"spectrum"),pd(Ds(),e,"spectrum"),pd(Ms(),e,"spectrum"),pd(Ns(),e,"spectrum")])})}),gw=e=>tm(e.event),pw=xl({schema:[qa("mouseIsDown",()=>ye(!1))],name:"spectrum",overrides:e=>{const t=e.model.manager,o=(o,n)=>t.getValueFromEvent(n).map(n=>t.setValueFrom(o,e,n));return{behaviours:Td([Wu.config({mode:"special",onLeft:(o,n)=>t.onLeft(o,e,gw(n)),onRight:(o,n)=>t.onRight(o,e,gw(n)),onUp:(o,n)=>t.onUp(o,e,gw(n)),onDown:(o,n)=>t.onDown(o,e,gw(n))}),Nx.config({}),Pd.config({})]),events:ld([md(Es(),o),md(Os(),o),md(Ds(),o),md(Ms(),(t,n)=>{e.mouseIsDown.get()&&o(t,n)})])}}});var hw=[ow,mw,iw,aw,cw,rw,sw,dw,lw,uw,pw];const fw=y("slider.change.value"),bw=e=>{const t=e.event.raw;if((e=>-1!==e.type.indexOf("touch"))(t)){const e=t;return void 0!==e.touches&&1===e.touches.length?A.some(e.touches[0]).map(e=>Rn(e.clientX,e.clientY)):A.none()}{const e=t;return void 0!==e.clientX?A.some(e).map(e=>Rn(e.clientX,e.clientY)):A.none()}},xw=e=>e.model.minX,vw=e=>e.model.minY,yw=e=>e.model.minX-1,ww=e=>e.model.minY-1,_w=e=>e.model.maxX,Cw=e=>e.model.maxY,kw=e=>e.model.maxX+1,Sw=e=>e.model.maxY+1,Ew=(e,t,o)=>t(e)-o(e),Ow=e=>Ew(e,_w,xw),Tw=e=>Ew(e,Cw,vw),Aw=e=>Ow(e)/2,Dw=e=>Tw(e)/2,Mw=(e,t)=>t?e.stepSize*e.speedMultiplier:e.stepSize,Rw=e=>e.snapToGrid,Nw=e=>e.snapStart,Bw=e=>e.rounded,zw=(e,t)=>void 0!==e[t+"-edge"],Hw=e=>zw(e,"left"),Lw=e=>zw(e,"right"),Iw=e=>zw(e,"top"),Pw=e=>zw(e,"bottom"),Fw=e=>e.model.value.get(),Vw=(e,t)=>({x:e,y:t}),Zw=(e,t)=>{nd(e,fw(),{value:t})},Uw=(e,t,o,n)=>e<t?e:e>o?o:e===t?t-1:Math.max(t,e-n),jw=(e,t,o,n)=>e>o?e:e<t?t:e===o?o+1:Math.min(o,e+n),Ww=(e,t,o)=>Math.max(t,Math.min(o,e)),$w=e=>{const{min:t,max:o,range:n,value:r,step:a,snap:s,snapStart:i,rounded:l,hasMinEdge:c,hasMaxEdge:d,minBound:m,maxBound:u,screenRange:g}=e,p=c?t-1:t,h=d?o+1:o;if(r<m)return p;if(r>u)return h;{const e=((e,t,o)=>Math.min(o,Math.max(e,t))-t)(r,m,u),c=Ww(e/g*n+t,p,h);return s&&c>=t&&c<=o?((e,t,o,n,r)=>r.fold(()=>{const r=e-t,a=Math.round(r/n)*n;return Ww(t+a,t-1,o+1)},t=>{const r=(e-t)%n,a=Math.round(r/n),s=Math.floor((e-t)/n),i=Math.floor((o-t)/n),l=t+Math.min(i,s+a)*n;return Math.max(t,l)}))(c,t,o,a,i):l?Math.round(c):c}},qw=e=>{const{min:t,max:o,range:n,value:r,hasMinEdge:a,hasMaxEdge:s,maxBound:i,maxOffset:l,centerMinEdge:c,centerMaxEdge:d}=e;return r<t?a?0:c:r>o?s?i:d:(r-t)/n*l},Gw="top",Kw="right",Yw="bottom",Xw="left",Jw=e=>e.element.dom.getBoundingClientRect(),Qw=(e,t)=>e[t],e_=e=>{const t=Jw(e);return Qw(t,Xw)},t_=e=>{const t=Jw(e);return Qw(t,Kw)},o_=e=>{const t=Jw(e);return Qw(t,Gw)},n_=e=>{const t=Jw(e);return Qw(t,Yw)},r_=e=>{const t=Jw(e);return Qw(t,"width")},a_=e=>{const t=Jw(e);return Qw(t,"height")},s_=(e,t,o)=>(e+t)/2-o,i_=(e,t)=>{const o=Jw(e),n=Jw(t),r=Qw(o,Xw),a=Qw(o,Kw),s=Qw(n,Xw);return s_(r,a,s)},l_=(e,t)=>{const o=Jw(e),n=Jw(t),r=Qw(o,Gw),a=Qw(o,Yw),s=Qw(n,Gw);return s_(r,a,s)},c_=(e,t)=>{nd(e,fw(),{value:t})},d_=(e,t,o)=>{const n={min:xw(t),max:_w(t),range:Ow(t),value:o,step:Mw(t),snap:Rw(t),snapStart:Nw(t),rounded:Bw(t),hasMinEdge:Hw(t),hasMaxEdge:Lw(t),minBound:e_(e),maxBound:t_(e),screenRange:r_(e)};return $w(n)},m_=e=>(t,o,n)=>((e,t,o,n)=>{const r=(e>0?jw:Uw)(Fw(o),xw(o),_w(o),Mw(o,n));return c_(t,r),A.some(r)})(e,t,o,n).map(T),u_=(e,t,o,n,r,a)=>{const s=((e,t,o,n,r)=>{const a=r_(e),s=n.bind(t=>A.some(i_(t,e))).getOr(0),i=r.bind(t=>A.some(i_(t,e))).getOr(a),l={min:xw(t),max:_w(t),range:Ow(t),value:o,hasMinEdge:Hw(t),hasMaxEdge:Lw(t),minBound:e_(e),minOffset:0,maxBound:t_(e),maxOffset:a,centerMinEdge:s,centerMaxEdge:i};return qw(l)})(t,a,o,n,r);return e_(t)-e_(e)+s},g_=m_(-1),p_=m_(1),h_=A.none,f_=A.none,b_={"top-left":A.none(),top:A.none(),"top-right":A.none(),right:A.some((e,t)=>{Zw(e,kw(t))}),"bottom-right":A.none(),bottom:A.none(),"bottom-left":A.none(),left:A.some((e,t)=>{Zw(e,yw(t))})};var x_=Object.freeze({__proto__:null,setValueFrom:(e,t,o)=>{const n=d_(e,t,o);return c_(e,n),n},setToMin:(e,t)=>{const o=xw(t);c_(e,o)},setToMax:(e,t)=>{const o=_w(t);c_(e,o)},findValueOfOffset:d_,getValueFromEvent:e=>bw(e).map(e=>e.left),findPositionOfValue:u_,setPositionFromValue:(e,t,o,n)=>{const r=Fw(o),a=u_(e,n.getSpectrum(e),r,n.getLeftEdge(e),n.getRightEdge(e),o),s=Tn(t.element)/2;mn(t.element,"left",a-s+"px")},onLeft:g_,onRight:p_,onUp:h_,onDown:f_,edgeActions:b_});const v_=(e,t)=>{nd(e,fw(),{value:t})},y_=(e,t,o)=>{const n={min:vw(t),max:Cw(t),range:Tw(t),value:o,step:Mw(t),snap:Rw(t),snapStart:Nw(t),rounded:Bw(t),hasMinEdge:Iw(t),hasMaxEdge:Pw(t),minBound:o_(e),maxBound:n_(e),screenRange:a_(e)};return $w(n)},w_=e=>(t,o,n)=>((e,t,o,n)=>{const r=(e>0?jw:Uw)(Fw(o),vw(o),Cw(o),Mw(o,n));return v_(t,r),A.some(r)})(e,t,o,n).map(T),__=(e,t,o,n,r,a)=>{const s=((e,t,o,n,r)=>{const a=a_(e),s=n.bind(t=>A.some(l_(t,e))).getOr(0),i=r.bind(t=>A.some(l_(t,e))).getOr(a),l={min:vw(t),max:Cw(t),range:Tw(t),value:o,hasMinEdge:Iw(t),hasMaxEdge:Pw(t),minBound:o_(e),minOffset:0,maxBound:n_(e),maxOffset:a,centerMinEdge:s,centerMaxEdge:i};return qw(l)})(t,a,o,n,r);return o_(t)-o_(e)+s},C_=A.none,k_=A.none,S_=w_(-1),E_=w_(1),O_={"top-left":A.none(),top:A.some((e,t)=>{Zw(e,ww(t))}),"top-right":A.none(),right:A.none(),"bottom-right":A.none(),bottom:A.some((e,t)=>{Zw(e,Sw(t))}),"bottom-left":A.none(),left:A.none()};var T_=Object.freeze({__proto__:null,setValueFrom:(e,t,o)=>{const n=y_(e,t,o);return v_(e,n),n},setToMin:(e,t)=>{const o=vw(t);v_(e,o)},setToMax:(e,t)=>{const o=Cw(t);v_(e,o)},findValueOfOffset:y_,getValueFromEvent:e=>bw(e).map(e=>e.top),findPositionOfValue:__,setPositionFromValue:(e,t,o,n)=>{const r=Fw(o),a=__(e,n.getSpectrum(e),r,n.getTopEdge(e),n.getBottomEdge(e),o),s=Cn(t.element)/2;mn(t.element,"top",a-s+"px")},onLeft:C_,onRight:k_,onUp:S_,onDown:E_,edgeActions:O_});const A_=(e,t)=>{nd(e,fw(),{value:t})},D_=(e,t)=>({x:e,y:t}),M_=(e,t)=>(o,n,r)=>((e,t,o,n,r)=>{const a=e>0?jw:Uw,s=t?Fw(n).x:a(Fw(n).x,xw(n),_w(n),Mw(n,r)),i=t?a(Fw(n).y,vw(n),Cw(n),Mw(n,r)):Fw(n).y;return A_(o,D_(s,i)),A.some(s)})(e,t,o,n,r).map(T),R_=M_(-1,!1),N_=M_(1,!1),B_=M_(-1,!0),z_=M_(1,!0),H_={"top-left":A.some((e,t)=>{Zw(e,Vw(yw(t),ww(t)))}),top:A.some((e,t)=>{Zw(e,Vw(Aw(t),ww(t)))}),"top-right":A.some((e,t)=>{Zw(e,Vw(kw(t),ww(t)))}),right:A.some((e,t)=>{Zw(e,Vw(kw(t),Dw(t)))}),"bottom-right":A.some((e,t)=>{Zw(e,Vw(kw(t),Sw(t)))}),bottom:A.some((e,t)=>{Zw(e,Vw(Aw(t),Sw(t)))}),"bottom-left":A.some((e,t)=>{Zw(e,Vw(yw(t),Sw(t)))}),left:A.some((e,t)=>{Zw(e,Vw(yw(t),Dw(t)))})};var L_=Object.freeze({__proto__:null,setValueFrom:(e,t,o)=>{const n=d_(e,t,o.left),r=y_(e,t,o.top),a=D_(n,r);return A_(e,a),a},setToMin:(e,t)=>{const o=xw(t),n=vw(t);A_(e,D_(o,n))},setToMax:(e,t)=>{const o=_w(t),n=Cw(t);A_(e,D_(o,n))},getValueFromEvent:e=>bw(e),setPositionFromValue:(e,t,o,n)=>{const r=Fw(o),a=u_(e,n.getSpectrum(e),r.x,n.getLeftEdge(e),n.getRightEdge(e),o),s=__(e,n.getSpectrum(e),r.y,n.getTopEdge(e),n.getBottomEdge(e),o),i=Tn(t.element)/2,l=Cn(t.element)/2;mn(t.element,"left",a-i+"px"),mn(t.element,"top",s-l+"px")},onLeft:R_,onRight:N_,onUp:B_,onDown:z_,edgeActions:H_});const I_=Vh({name:"Slider",configFields:[us("stepSize",1),us("speedMultiplier",10),us("onChange",b),us("onChoose",b),us("onInit",b),us("onDragStart",b),us("onDragEnd",b),us("snapToGrid",!1),us("rounded",!0),rs("snapStart"),Ya("model",ja("mode",{x:[us("minX",0),us("maxX",100),qa("value",e=>ye(e.mode.minX)),Ka("getInitialValue"),Pi("manager",x_)],y:[us("minY",0),us("maxY",100),qa("value",e=>ye(e.mode.minY)),Ka("getInitialValue"),Pi("manager",T_)],xy:[us("minX",0),us("maxX",100),us("minY",0),us("maxY",100),qa("value",e=>ye({x:e.mode.minX,y:e.mode.minY})),Ka("getInitialValue"),Pi("manager",L_)]})),Dh("sliderBehaviours",[Wu,Bf]),qa("mouseIsDown",()=>ye(!1))],partFields:hw,factory:(e,t,o,n)=>{const r=t=>Nl(t,e,"thumb"),a=t=>Nl(t,e,"spectrum"),s=t=>Rl(t,e,"left-edge"),i=t=>Rl(t,e,"right-edge"),l=t=>Rl(t,e,"top-edge"),c=t=>Rl(t,e,"bottom-edge"),d=e.model,m=d.manager,u=(t,o)=>{m.setPositionFromValue(t,o,e,{getLeftEdge:s,getRightEdge:i,getTopEdge:l,getBottomEdge:c,getSpectrum:a})},g=(e,t)=>{d.value.set(t);const o=r(e);u(e,o)},p=t=>{const o=e.mouseIsDown.get();e.mouseIsDown.set(!1),o&&Rl(t,e,"thumb").each(o=>{const n=d.value.get();e.onChoose(t,o,n)})},h=(t,o)=>{o.stop(),e.mouseIsDown.set(!0),e.onDragStart(t,r(t))},f=(t,o)=>{o.stop(),e.onDragEnd(t,r(t)),p(t)},b=t=>{Rl(t,e,"spectrum").map(Wu.focusIn)};return{uid:e.uid,dom:e.dom,components:t,behaviours:Rh(e.sliderBehaviours,[Wu.config({mode:"special",focusIn:b}),Bf.config({store:{mode:"manual",getValue:e=>d.value.get(),setValue:g}}),Gb.config({channels:{[iv()]:{onReceive:p}}})]),events:ld([md(fw(),(t,o)=>{((t,o)=>{g(t,o);const n=r(t);e.onChange(t,n,o),A.some(!0)})(t,o.event.value)}),vd((t,o)=>{const n=d.getInitialValue();d.value.set(n);const s=r(t);u(t,s);const i=a(t);e.onInit(t,s,i,d.value.get())}),md(Es(),h),md(Ts(),f),md(Ds(),(e,t)=>{b(e),h(e,t)}),md(Ns(),f)]),apis:{resetToMin:t=>{m.setToMin(t,e)},resetToMax:t=>{m.setToMax(t,e)},setValue:g,refresh:u},domModification:{styles:{position:"relative"}}}},apis:{setValue:(e,t,o)=>{e.setValue(t,o)},resetToMin:(e,t)=>{e.resetToMin(t)},resetToMax:(e,t)=>{e.resetToMax(t)},refresh:(e,t)=>{e.refresh(t)}}}),P_="container",F_=[Dh("slotBehaviours",[])],V_=e=>"<alloy.field."+e+">",Z_=(e,t)=>{const o=t=>Hl(e),n=(t,o)=>(n,r)=>Rl(n,e,r).map(e=>t(e,r)).getOr(o),r=(e,t)=>"true"!==qo(e.element,"aria-hidden"),a=n(r,!1),s=n((e,t)=>{if(r(e)){const o=e.element;mn(o,"display","none"),Wo(o,"aria-hidden","true"),nd(e,pi(),{name:t,visible:!1})}}),i=(e=>(t,o)=>{P(o,o=>e(t,o))})(s),l=n((e,t)=>{if(!r(e)){const o=e.element;vn(o,"display"),Yo(o,"aria-hidden"),nd(e,pi(),{name:t,visible:!0})}}),c={getSlotNames:o,getSlot:(t,o)=>Rl(t,e,o),isShowing:a,hideSlot:s,hideAllSlots:e=>i(e,o()),showSlot:l};return{uid:e.uid,dom:e.dom,components:t,behaviours:Mh(e.slotBehaviours),apis:c}},U_=le({getSlotNames:(e,t)=>e.getSlotNames(t),getSlot:(e,t,o)=>e.getSlot(t,o),isShowing:(e,t,o)=>e.isShowing(t,o),hideSlot:(e,t,o)=>e.hideSlot(t,o),hideAllSlots:(e,t)=>e.hideAllSlots(t),showSlot:(e,t,o)=>e.showSlot(t,o)},e=>Ku(e)),j_={...U_,sketch:e=>{const t=(()=>{const e=[];return{slot:(t,o)=>(e.push(t),Ol(P_,V_(t),o)),record:y(e)}})(),o=e(t),n=t.record(),r=I(n,e=>xl({name:e,pname:V_(e)}));return Hh(P_,F_,r,Z_,o)}},W_=y([Ka("toggleClass"),Ka("fetch"),Li("onExecute"),us("getHotspot",A.some),us("getAnchorOverrides",y({})),ab(),Li("onItemExecute"),rs("lazySink"),Ka("dom"),zi("onOpen"),Dh("splitDropdownBehaviours",[bp,Wu,Pd]),us("matchWidth",!1),us("useMinWidth",!1),us("eventOrder",{}),rs("role"),rs("listRole")].concat(xy())),$_=xl({factory:yv,schema:[Ka("dom")],name:"arrow",defaults:()=>({buttonBehaviours:Td([Pd.revoke()])}),overrides:e=>({dom:{tag:"span",attributes:{role:"presentation"}},action:t=>{t.getSystem().getByUid(e.uid).each(rd)},buttonBehaviours:Td([Vx.config({toggleOnExecute:!1,toggleClass:e.toggleClass})])})}),q_=xl({factory:yv,schema:[Ka("dom")],name:"button",defaults:()=>({buttonBehaviours:Td([Pd.revoke()])}),overrides:e=>({dom:{tag:"span",attributes:{role:"presentation"}},action:t=>{t.getSystem().getByUid(e.uid).each(o=>{e.onExecute(o,t)})}})}),G_=y([$_,q_,yl({factory:{sketch:e=>({uid:e.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:e.text}})},schema:[Ka("text")],name:"aria-descriptor"}),vl({schema:[Ri()],name:"menu",defaults:e=>({onExecute:(t,o)=>{t.getSystem().getByUid(e.uid).each(n=>{e.onItemExecute(n,t,o)})}})}),ry()]),K_=Vh({name:"SplitDropdown",configFields:W_(),partFields:G_(),factory:(e,t,o,n)=>{const r=e=>{gp.getCurrent(e).each(e=>{hm.highlightFirst(e),Wu.focusIn(e)})},a=t=>{uy(e,w,t,n,r,Yc.HighlightMenuAndItem).get(b)},s=t=>{const o=Nl(t,e,"button");return rd(o),A.some(!0)},i={...ld([vd((t,o)=>{Rl(t,e,"aria-descriptor").each(e=>{const o=Le("aria");Wo(e.element,"id",o),Wo(t.element,"aria-describedby",o)})})]),...vv(A.some(a))},l={repositionMenus:e=>{Vx.isOn(e)&&by(e)}};return{uid:e.uid,dom:e.dom,components:t,apis:l,eventOrder:{...e.eventOrder,[Js()]:["disabling","toggling","alloy.base.behaviour"]},events:i,behaviours:Rh(e.splitDropdownBehaviours,[bp.config({others:{sandbox:t=>{const o=Nl(t,e,"arrow");return fy(e,t,{onOpen:()=>{Vx.on(o),Vx.on(t)},onClose:()=>{Vx.off(o),Vx.off(t)}})}}}),Wu.config({mode:"special",onSpace:s,onEnter:s,onDown:e=>(a(e),A.some(!0))}),Pd.config({}),Vx.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:e.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:(e,t)=>e.repositionMenus(t)}}),Y_=(e,t,o)=>({within:e,extra:t,withinWidth:o}),X_=(e,t,o)=>{const n=((e,t)=>{const o=U(e,(e,o)=>t(o,e.len).fold(y(e),t=>({len:t.finish,list:e.list.concat([t])})),{len:0,list:[]});return o.list})(e,(e,t)=>{const n=o(e);return A.some({element:e,start:t,finish:t+n,width:n})}),r=V(n,e=>e.finish<=t),a=Z(r,(e,t)=>e+t.width,0);return{within:r,extra:n.slice(r.length),withinWidth:a}},J_=e=>I(e,e=>e.element),Q_=(e,t,o,n)=>{const r=((e,t,o)=>{const n=X_(t,e,o);return 0===n.extra.length?A.some(n):A.none()})(e,t,o).getOrThunk(()=>X_(t,e-o(n),o)),a=r.within,s=r.extra,i=r.withinWidth;return 1===s.length&&s[0].width<=o(n)?((e,t,o)=>{const n=J_(e.concat(t));return Y_(n,[],o)})(a,s,i):s.length>=1?((e,t,o,n)=>{const r=J_(e).concat([o]);return Y_(r,J_(t),n)})(a,s,n,i):((e,t,o)=>Y_(J_(e),[],o))(a,0,i)},eC=(e,t)=>{const o=I(t,e=>ip(e));Ay.setGroups(e,o)},tC=(e,t,o)=>{const n=t.builtGroups.get();if(0===n.length)return;const r=Nl(e,t,"primary"),a=bp.getCoupled(e,"overflowGroup");mn(r.element,"visibility","hidden");const s=n.concat([a]),i=re(s,e=>Io(e.element).bind(t=>e.getSystem().getByDom(t).toOptional()));o([]),eC(r,s);const l=Tn(r.element),c=Q_(l,t.builtGroups.get(),e=>Math.ceil(e.element.dom.getBoundingClientRect().width),a);0===c.extra.length?(kg.remove(r,a),o([])):(eC(r,c.within),o(c.extra)),vn(r.element,"visibility"),yn(r.element),i.each(Pd.focus)},oC=y([Dh("splitToolbarBehaviours",[bp]),qa("builtGroups",()=>ye([]))]),nC=y([Ni(["overflowToggledClass"]),cs("getOverflowBounds"),Ka("lazySink"),qa("overflowGroups",()=>ye([])),zi("onOpened"),zi("onClosed")].concat(oC())),rC=y([xl({factory:Ay,schema:Oy(),name:"primary"}),vl({schema:Oy(),name:"overflow"}),vl({name:"overflow-button"}),vl({name:"overflow-group"})]),aC=y([Ka("items"),Ni(["itemSelector"]),Dh("tgroupBehaviours",[Wu])]),sC=y([wl({name:"items",unit:"item"})]),iC=Vh({name:"ToolbarGroup",configFields:aC(),partFields:sC(),factory:(e,t,o,n)=>({uid:e.uid,dom:e.dom,components:t,behaviours:Rh(e.tgroupBehaviours,[Wu.config({mode:"flow",selector:e.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}})}),lC=e=>I(e,e=>ip(e)),cC=(e,t,o)=>{tC(e,o,n=>{o.overflowGroups.set(n),t.getOpt(e).each(e=>{Hy.setGroups(e,lC(n))})})},dC=Vh({name:"SplitFloatingToolbar",configFields:nC(),partFields:rC(),factory:(e,t,o,n)=>{const r=ov(Hy.sketch({fetch:()=>Se(t=>{t(lC(e.overflowGroups.get()))}),layouts:{onLtr:()=>[cc,lc],onRtl:()=>[lc,cc],onBottomLtr:()=>[mc,dc],onBottomRtl:()=>[dc,mc]},getBounds:o.getOverflowBounds,lazySink:e.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:e.markers.overflowToggledClass},parts:{button:n["overflow-button"](),toolbar:n.overflow()},onToggled:(t,o)=>e[o?"onOpened":"onClosed"](t)}));return{uid:e.uid,dom:e.dom,components:t,behaviours:Rh(e.splitToolbarBehaviours,[bp.config({others:{overflowGroup:()=>iC.sketch({...n["overflow-group"](),items:[r.asSpec()]})}})]),apis:{setGroups:(t,o)=>{e.builtGroups.set(I(o,t.getSystem().build)),cC(t,r,e)},refresh:t=>cC(t,r,e),toggle:e=>{r.getOpt(e).each(e=>{Hy.toggle(e)})},toggleWithoutFocusing:e=>{r.getOpt(e).each(Hy.toggleWithoutFocusing)},isOpen:e=>r.getOpt(e).map(Hy.isOpen).getOr(!1),reposition:e=>{r.getOpt(e).each(e=>{Hy.reposition(e)})},getOverflow:e=>r.getOpt(e).bind(Hy.getToolbar)},domModification:{attributes:{role:"group"}}}},apis:{setGroups:(e,t,o)=>{e.setGroups(t,o)},refresh:(e,t)=>{e.refresh(t)},reposition:(e,t)=>{e.reposition(t)},toggle:(e,t)=>{e.toggle(t)},toggleWithoutFocusing:(e,t)=>{e.toggle(t)},isOpen:(e,t)=>e.isOpen(t),getOverflow:(e,t)=>e.getOverflow(t)}}),mC=y([Ni(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),zi("onOpened"),zi("onClosed")].concat(oC())),uC=y([xl({factory:Ay,schema:Oy(),name:"primary"}),xl({factory:Ay,schema:Oy(),name:"overflow",overrides:e=>({toolbarBehaviours:Td([Sx.config({dimension:{property:"height"},closedClass:e.markers.closedClass,openClass:e.markers.openClass,shrinkingClass:e.markers.shrinkingClass,growingClass:e.markers.growingClass,onShrunk:t=>{Rl(t,e,"overflow-button").each(e=>{Vx.off(e)}),e.onClosed(t)},onGrown:t=>{e.onOpened(t)},onStartGrow:t=>{Rl(t,e,"overflow-button").each(Vx.on)}}),Wu.config({mode:"acyclic",onEscape:t=>(Rl(t,e,"overflow-button").each(Pd.focus),A.some(!0))})])})}),vl({name:"overflow-button",overrides:e=>({buttonBehaviours:Td([Vx.config({toggleClass:e.markers.overflowToggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])})}),vl({name:"overflow-group"})]),gC=(e,t,o)=>{Rl(e,t,"overflow-button").each(n=>{Rl(e,t,"overflow").each(r=>{if(pC(e,t),Sx.hasShrunk(r)){const e=t.onOpened;t.onOpened=n=>{o||Wu.focusIn(r),e(n),t.onOpened=e}}else{const e=t.onClosed;t.onClosed=r=>{o||Pd.focus(n),e(r),t.onClosed=e}}Sx.toggleGrow(r)})})},pC=(e,t)=>{Rl(e,t,"overflow").each(o=>{tC(e,t,e=>{const t=I(e,e=>ip(e));Ay.setGroups(o,t)}),Rl(e,t,"overflow-button").each(e=>{Sx.hasGrown(o)&&Vx.on(e)}),Sx.refresh(o)})},hC=Vh({name:"SplitSlidingToolbar",configFields:mC(),partFields:uC(),factory:(e,t,o,n)=>{const r="alloy.toolbar.toggle";return{uid:e.uid,dom:e.dom,components:t,behaviours:Rh(e.splitToolbarBehaviours,[bp.config({others:{overflowGroup:e=>iC.sketch({...n["overflow-group"](),items:[yv.sketch({...n["overflow-button"](),action:t=>{od(e,r)}})]})}}),Bd("toolbar-toggle-events",[md(r,t=>{gC(t,e,!1)})])]),apis:{setGroups:(t,o)=>{((t,o)=>{const n=I(o,t.getSystem().build);e.builtGroups.set(n)})(t,o),pC(t,e)},refresh:t=>pC(t,e),toggle:t=>{gC(t,e,!1)},toggleWithoutFocusing:t=>{gC(t,e,!0)},isOpen:t=>((e,t)=>Rl(e,t,"overflow").map(Sx.hasGrown).getOr(!1))(t,e)},domModification:{attributes:{role:"group"}}}},apis:{setGroups:(e,t,o)=>{e.setGroups(t,o)},refresh:(e,t)=>{e.refresh(t)},toggle:(e,t)=>{e.toggle(t)},isOpen:(e,t)=>e.isOpen(t)}}),fC=Fh({name:"TabButton",configFields:[us("uid",void 0),Ka("value"),$a("dom","dom",ya(()=>({attributes:{role:"tab",id:Le("aria"),"aria-selected":"false"}})),da()),rs("action"),us("domModification",{}),Dh("tabButtonBehaviours",[Pd,Wu,Bf]),Ka("view")],factory:(e,t)=>({uid:e.uid,dom:e.dom,components:e.components,events:vv(e.action),behaviours:Rh(e.tabButtonBehaviours,[Pd.config({}),Wu.config({mode:"execution",useSpace:!0,useEnter:!0}),Bf.config({store:{mode:"memory",initialValue:e.value}})]),domModification:e.domModification})}),bC=y([Ka("tabs"),Ka("dom"),us("clickToDismiss",!1),Dh("tabbarBehaviours",[hm,Wu]),Ni(["tabClass","selectedClass"])]),xC=wl({factory:fC,name:"tabs",unit:"tab",overrides:e=>{const t=(e,t)=>{hm.dehighlight(e,t),nd(e,bi(),{tabbar:e,button:t})},o=(e,t)=>{hm.highlight(e,t),nd(e,fi(),{tabbar:e,button:t})};return{action:n=>{const r=n.getSystem().getByUid(e.uid).getOrDie(),a=hm.isHighlighted(r,n);(a&&e.clickToDismiss?t:a?b:o)(r,n)},domModification:{classes:[e.markers.tabClass]}}}}),vC=y([xC]),yC=Vh({name:"Tabbar",configFields:bC(),partFields:vC(),factory:(e,t,o,n)=>({uid:e.uid,dom:e.dom,components:t,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Rh(e.tabbarBehaviours,[hm.config({highlightClass:e.markers.selectedClass,itemClass:e.markers.tabClass,onHighlight:(e,t)=>{Wo(t.element,"aria-selected","true")},onDehighlight:(e,t)=>{Wo(t.element,"aria-selected","false")}}),Wu.config({mode:"flow",getInitial:e=>hm.getHighlighted(e).map(e=>e.element),selector:"."+e.markers.tabClass,executeOnMove:!0})])})}),wC=Fh({name:"Tabview",configFields:[Dh("tabviewBehaviours",[kg])],factory:(e,t)=>({uid:e.uid,dom:e.dom,behaviours:Rh(e.tabviewBehaviours,[kg.config({})]),domModification:{attributes:{role:"tabpanel"}}})}),_C=y([us("selectFirst",!0),zi("onChangeTab"),zi("onDismissTab"),us("tabs",[]),Dh("tabSectionBehaviours",[])]),CC=xl({factory:yC,schema:[Ka("dom"),ts("markers",[Ka("tabClass"),Ka("selectedClass")])],name:"tabbar",defaults:e=>({tabs:e.tabs})}),kC=xl({factory:wC,name:"tabview"}),SC=y([CC,kC]),EC=Vh({name:"TabSection",configFields:_C(),partFields:SC(),factory:(e,t,o,n)=>{const r=(t,o)=>{Rl(t,e,"tabbar").each(e=>{o(e).each(rd)})};return{uid:e.uid,dom:e.dom,components:t,behaviours:Mh(e.tabSectionBehaviours),events:ld($([e.selectFirst?[vd((e,t)=>{r(e,hm.getFirst)})]:[],[md(fi(),(t,o)=>{(t=>{const o=Bf.getValue(t);Rl(t,e,"tabview").each(n=>{const r=j(e.tabs,e=>e.value===o);r.each(o=>{const r=o.view();Go(t.element,"id").each(e=>{Wo(n.element,"aria-labelledby",e)}),kg.set(n,r),e.onChangeTab(n,t,r)})})})(o.event.button)}),md(bi(),(t,o)=>{const n=o.event.button;e.onDismissTab(t,n)})]])),apis:{getViewItems:t=>Rl(t,e,"tabview").map(e=>kg.contents(e)).getOr([]),showTab:(e,t)=>{r(e,e=>{const o=hm.getCandidates(e);return j(o,e=>Bf.getValue(e)===t).filter(t=>!hm.isHighlighted(e,t))})}}}},apis:{getViewItems:(e,t)=>e.getViewItems(t),showTab:(e,t,o)=>{e.showTab(t,o)}}}),OC=(e,t,o)=>{const n=Bf.getValue(o);Bf.setValue(t,n),AC(t)},TC=(e,t)=>{const o=e.element,n=mr(o),r=o.dom;"number"!==qo(o,"type")&&t(r,n)},AC=e=>{TC(e,(e,t)=>e.setSelectionRange(t.length,t.length))},DC=(e,t,o)=>{if(e.selectsOver){const n=Bf.getValue(t),r=e.getDisplayText(n),a=Bf.getValue(o);return 0===e.getDisplayText(a).indexOf(r)?A.some(()=>{OC(0,t,o),((e,t)=>{TC(e,(e,o)=>e.setSelectionRange(t,o.length))})(t,r.length)}):A.none()}return A.none()},MC=y("alloy.typeahead.itemexecute"),RC=y([rs("lazySink"),Ka("fetch"),us("minChars",5),us("responseTime",1e3),zi("onOpen"),us("getHotspot",A.some),us("getAnchorOverrides",y({})),us("layouts",A.none()),us("eventOrder",{}),ys("model",{},[us("getDisplayText",e=>void 0!==e.meta&&void 0!==e.meta.text?e.meta.text:e.value),us("selectsOver",!0),us("populateFromBrowse",!0)]),zi("onSetValue"),Hi("onExecute"),zi("onItemExecute"),us("inputClasses",[]),us("inputAttributes",{}),us("inputStyles",{}),us("matchWidth",!0),us("useMinWidth",!1),us("dismissOnBlur",!0),Ni(["openClass"]),rs("initialData"),rs("listRole"),Dh("typeaheadBehaviours",[Pd,Bf,Dx,Wu,Vx,bp]),qa("lazyTypeaheadComp",()=>ye(A.none)),qa("previewing",()=>ye(!0))].concat($y()).concat(xy())),NC=y([vl({schema:[Ri()],name:"menu",overrides:e=>({fakeFocus:!0,onHighlightItem:(t,o,n)=>{e.previewing.get()?e.lazyTypeaheadComp.get().each(t=>{DC(e.model,t,n).fold(()=>{e.model.selectsOver?(hm.dehighlight(o,n),e.previewing.set(!0)):e.previewing.set(!1)},t=>{t(),e.previewing.set(!1)})}):e.lazyTypeaheadComp.get().each(t=>{e.model.populateFromBrowse&&OC(e.model,t,n),Go(n.element,"id").each(e=>Wo(t.element,"aria-activedescendant",e))})},onExecute:(t,o)=>e.lazyTypeaheadComp.get().map(e=>(nd(e,MC(),{item:o}),!0)),onHover:(t,o)=>{e.previewing.set(!1),e.lazyTypeaheadComp.get().each(t=>{e.model.populateFromBrowse&&OC(e.model,t,o)})}})})]),BC=Vh({name:"Typeahead",configFields:RC(),partFields:NC(),factory:(e,t,o,n)=>{const r=(t,o,r)=>{e.previewing.set(!1);const a=bp.getCoupled(t,"sandbox");if(cx.isOpen(a))gp.getCurrent(a).each(e=>{hm.getHighlighted(e).fold(()=>{r(e)},()=>{id(a,e.element,"keydown",o)})});else{const o=e=>{gp.getCurrent(e).each(r)};dy(e,s(t),t,a,n,o,Yc.HighlightMenuAndItem).get(b)}},a=qy(e),s=e=>t=>t.map(t=>{const o=he(t.menus),n=q(o,e=>V(e.items,e=>"item"===e.type));return Bf.getState(e).update(I(n,e=>e.data)),t}),i=e=>gp.getCurrent(e),l="typeaheadevents",c=[Pd.config({}),Bf.config({onSetValue:e.onSetValue,store:{mode:"dataset",getDataKey:e=>mr(e.element),getFallbackEntry:e=>({value:e,meta:{}}),setValue:(t,o)=>{ur(t.element,e.model.getDisplayText(o))},...e.initialData.map(e=>_s("initialValue",e)).getOr({})}}),Dx.config({stream:{mode:"throttle",delay:e.responseTime,stopEvent:!1},onStream:(t,o)=>{const r=bp.getCoupled(t,"sandbox");if(Pd.isFocused(t)&&mr(t.element).length>=e.minChars){const o=i(r).bind(e=>hm.getHighlighted(e).map(Bf.getValue));e.previewing.set(!0);const a=t=>{i(r).each(t=>{o.fold(()=>{e.model.selectsOver&&hm.highlightFirst(t)},e=>{hm.highlightBy(t,t=>Bf.getValue(t).value===e.value),hm.getHighlighted(t).orThunk(()=>(hm.highlightFirst(t),A.none()))})})};dy(e,s(t),t,r,n,a,Yc.HighlightJustMenu).get(b)}},cancelEvent:ni()}),Wu.config({mode:"special",onDown:(e,t)=>(r(e,t,hm.highlightFirst),A.some(!0)),onEscape:e=>{const t=bp.getCoupled(e,"sandbox");return cx.isOpen(t)?(cx.close(t),A.some(!0)):A.none()},onUp:(e,t)=>(r(e,t,hm.highlightLast),A.some(!0)),onEnter:t=>{const o=bp.getCoupled(t,"sandbox"),n=cx.isOpen(o);if(n&&!e.previewing.get())return i(o).bind(e=>hm.getHighlighted(e)).map(e=>(nd(t,MC(),{item:e}),!0));{const r=Bf.getValue(t);return od(t,ni()),e.onExecute(o,t,r),n&&cx.close(o),A.some(!0)}}}),Vx.config({toggleClass:e.markers.openClass,aria:{mode:"expanded"}}),bp.config({others:{sandbox:t=>fy(e,t,{onOpen:()=>Vx.on(t),onClose:()=>{e.lazyTypeaheadComp.get().each(e=>Yo(e.element,"aria-activedescendant")),Vx.off(t)}})}}),Bd(l,[vd(t=>{e.lazyTypeaheadComp.set(A.some(t))}),yd(t=>{e.lazyTypeaheadComp.set(A.none())}),_d(t=>{const o=b;uy(e,s(t),t,n,o,Yc.HighlightMenuAndItem).get(b)}),md(MC(),(t,o)=>{const n=bp.getCoupled(t,"sandbox");OC(e.model,t,o.event.item),od(t,ni()),e.onItemExecute(t,n,o.event.item,Bf.getValue(t)),cx.close(n),AC(t)})].concat(e.dismissOnBlur?[md(Ks(),e=>{const t=bp.getCoupled(e,"sandbox");Io(t.element).isNone()&&cx.close(t)})]:[]))],d={[di()]:[Bf.name(),Dx.name(),l],...e.eventOrder};return{uid:e.uid,dom:Ky(Pe(e,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:{...a,...Rh(e.typeaheadBehaviours,c)},eventOrder:d}}});var zC,HC,LC=tinymce.util.Tools.resolve("tinymce.ThemeManager"),IC=tinymce.util.Tools.resolve("tinymce.util.Delay"),PC=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),FC=tinymce.util.Tools.resolve("tinymce.EditorManager"),VC=tinymce.util.Tools.resolve("tinymce.Env");!function(e){e.default="wrap",e.floating="floating",e.sliding="sliding",e.scrolling="scrolling"}(zC||(zC={})),function(e){e.auto="auto",e.top="top",e.bottom="bottom"}(HC||(HC={}));const ZC=e=>t=>t.options.get(e),UC=e=>t=>A.from(e(t)),jC=e=>{const t=VC.deviceType.isPhone(),o=VC.deviceType.isTablet()||t,n=e.options.register,r=e=>a(e)||!1===e,s=e=>a(e)||h(e);n("skin",{processor:e=>a(e)||!1===e,default:"oxide"}),n("skin_url",{processor:"string"}),n("height",{processor:s,default:Math.max(e.getElement().offsetHeight,400)}),n("width",{processor:s,default:PC.DOM.getStyle(e.getElement(),"width")}),n("min_height",{processor:"number",default:100}),n("min_width",{processor:"number"}),n("max_height",{processor:"number"}),n("max_width",{processor:"number"}),n("style_formats",{processor:"object[]"}),n("style_formats_merge",{processor:"boolean",default:!1}),n("style_formats_autohide",{processor:"boolean",default:!1}),n("line_height_formats",{processor:"string",default:"1 1.1 1.2 1.3 1.4 1.5 2"}),n("font_family_formats",{processor:"string",default:"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats"}),n("font_size_formats",{processor:"string",default:"8pt 10pt 12pt 14pt 18pt 24pt 36pt"}),n("font_size_input_default_unit",{processor:"string",default:"pt"}),n("block_formats",{processor:"string",default:"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre"}),n("content_langs",{processor:"object[]"}),n("removed_menuitems",{processor:"string",default:""}),n("menubar",{processor:e=>a(e)||d(e),default:!t}),n("menu",{processor:"object",default:{}}),n("toolbar",{processor:e=>d(e)||a(e)||l(e)?{value:e,valid:!0}:{valid:!1,message:"Must be a boolean, string or array."},default:!0}),H(9,e=>{n("toolbar"+(e+1),{processor:"string"})}),n("toolbar_mode",{processor:"string",default:o?"scrolling":"floating"}),n("toolbar_groups",{processor:"object",default:{}}),n("toolbar_location",{processor:"string",default:HC.auto}),n("toolbar_persist",{processor:"boolean",default:!1}),n("toolbar_sticky",{processor:"boolean",default:e.inline}),n("toolbar_sticky_offset",{processor:"number",default:0}),n("fixed_toolbar_container",{processor:"string",default:""}),n("fixed_toolbar_container_target",{processor:"object"}),n("ui_mode",{processor:"string",default:"combined"}),n("file_picker_callback",{processor:"function"}),n("file_picker_validator_handler",{processor:"function"}),n("file_picker_types",{processor:"string"}),n("typeahead_urls",{processor:"boolean",default:!0}),n("anchor_top",{processor:r,default:"#top"}),n("anchor_bottom",{processor:r,default:"#bottom"}),n("draggable_modal",{processor:"boolean",default:!1}),n("statusbar",{processor:"boolean",default:!0}),n("elementpath",{processor:"boolean",default:!0}),n("branding",{processor:"boolean",default:!0}),n("promotion",{processor:"boolean",default:!0}),n("resize",{processor:e=>"both"===e||d(e),default:!VC.deviceType.isTouch()}),n("sidebar_show",{processor:"string"}),n("help_accessibility",{processor:"boolean",default:e.hasPlugin("help")}),n("default_font_stack",{processor:"string[]",default:[]})},WC=ZC("readonly"),$C=ZC("disabled"),qC=ZC("height"),GC=ZC("width"),KC=UC(ZC("min_width")),YC=UC(ZC("min_height")),XC=UC(ZC("max_width")),JC=UC(ZC("max_height")),QC=UC(ZC("style_formats")),ek=ZC("style_formats_merge"),tk=ZC("style_formats_autohide"),ok=ZC("content_langs"),nk=ZC("removed_menuitems"),rk=ZC("toolbar_mode"),ak=ZC("toolbar_groups"),sk=ZC("toolbar_location"),ik=ZC("fixed_toolbar_container"),lk=ZC("fixed_toolbar_container_target"),ck=ZC("toolbar_persist"),dk=ZC("toolbar_sticky_offset"),mk=ZC("menubar"),uk=ZC("toolbar"),gk=ZC("file_picker_callback"),pk=ZC("file_picker_validator_handler"),hk=ZC("font_size_input_default_unit"),fk=ZC("file_picker_types"),bk=ZC("typeahead_urls"),xk=ZC("anchor_top"),vk=ZC("anchor_bottom"),yk=ZC("draggable_modal"),wk=ZC("statusbar"),_k=ZC("elementpath"),Ck=ZC("branding"),kk=ZC("resize"),Sk=ZC("paste_as_text"),Ek=ZC("sidebar_show"),Ok=ZC("promotion"),Tk=ZC("help_accessibility"),Ak=ZC("default_font_stack"),Dk=ZC("skin"),Mk=e=>!1===e.options.get("skin"),Rk=e=>!1!==e.options.get("menubar"),Nk=e=>{const t=e.options.get("skin_url");if(Mk(e))return t;if(t)return e.documentBaseURI.toAbsolute(t);{const t=e.options.get("skin");return FC.baseURL+"/skins/ui/"+t}},Bk=e=>e.options.get("line_height_formats").split(" "),zk=e=>{const t=uk(e),o=a(t),n=l(t)&&t.length>0;return!Lk(e)&&(n||o||!0===t)},Hk=e=>{const t=H(9,t=>e.options.get("toolbar"+(t+1))),o=V(t,a);return We(o.length>0,o)},Lk=e=>Hk(e).fold(()=>{const t=uk(e);return f(t,a)&&t.length>0},T),Ik=e=>sk(e)===HC.bottom,Pk=e=>{var t;if(!e.inline)return A.none();const o=null!==(t=ik(e))&&void 0!==t?t:"";if(o.length>0)return Kn(sn(),o);const n=lk(e);return g(n)?A.some(it.fromDom(n)):A.none()},Fk=e=>e.inline&&Pk(e).isSome(),Vk=e=>Pk(e).getOrThunk(()=>_o(wo(it.fromDom(e.getElement())))),Zk=e=>e.inline&&!Rk(e)&&!zk(e)&&!Lk(e),Uk=e=>(e.options.get("toolbar_sticky")||e.inline)&&!Fk(e)&&!Zk(e),jk=e=>!Fk(e)&&"split"===e.options.get("ui_mode"),Wk=e=>{const t=e.options.get("menu");return le(t,e=>({...e,items:e.items}))};var $k=Object.freeze({__proto__:null,get ToolbarMode(){return zC},get ToolbarLocation(){return HC},register:jC,getSkinUrl:Nk,getSkinUrlOption:e=>A.from(e.options.get("skin_url")),isReadOnly:WC,isDisabled:$C,getSkin:Dk,isSkinDisabled:Mk,getHeightOption:qC,getWidthOption:GC,getMinWidthOption:KC,getMinHeightOption:YC,getMaxWidthOption:XC,getMaxHeightOption:JC,getUserStyleFormats:QC,shouldMergeStyleFormats:ek,shouldAutoHideStyleFormats:tk,getLineHeightFormats:Bk,getContentLanguages:ok,getRemovedMenuItems:nk,isMenubarEnabled:Rk,isMultipleToolbars:Lk,isToolbarEnabled:zk,isToolbarPersist:ck,getMultipleToolbarsOption:Hk,getUiContainer:Vk,useFixedContainer:Fk,isSplitUiMode:jk,getToolbarMode:rk,isDraggableModal:yk,isDistractionFree:Zk,isStickyToolbar:Uk,getStickyToolbarOffset:dk,getToolbarLocation:sk,isToolbarLocationBottom:Ik,getToolbarGroups:ak,getMenus:Wk,getMenubar:mk,getToolbar:uk,getFilePickerCallback:gk,getFilePickerTypes:fk,useTypeaheadUrls:bk,getAnchorTop:xk,getAnchorBottom:vk,getFilePickerValidatorHandler:pk,getFontSizeInputDefaultUnit:hk,useStatusBar:wk,useElementPath:_k,promotionEnabled:Ok,useBranding:Ck,getResize:kk,getPasteAsText:Sk,getSidebarShow:Ek,useHelpAccessibility:Tk,getDefaultFontStack:Ak});const qk=["visible","hidden","clip"],Gk=e=>tt(e).length>0&&!B(qk,e),Kk=e=>{if(eo(e)){const t=pn(e,"overflow-x"),o=pn(e,"overflow-y");return Gk(t)||Gk(o)}return!1},Yk=e=>e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen(),Xk=(e,t)=>jk(e)?((e,t)=>{const o=gr(t,Kk),n=0===o.length?Co(t).map(ko).map(e=>gr(e,Kk)).getOr([]):o;return te(n).map(t=>({element:t,others:n.slice(1),isFullscreen:()=>Yk(e)}))})(e,t):A.none(),Jk=e=>{const t=[...I(e.others,Pr),Zr()];return e.isFullscreen()?Zr():((e,t)=>U(t,(e,t)=>Vr(e,t),e))(Pr(e.element),t)},{entries:Qk,setPrototypeOf:eS,isFrozen:tS,getPrototypeOf:oS,getOwnPropertyDescriptor:nS}=Object;let{freeze:rS,seal:aS,create:sS}=Object,{apply:iS,construct:lS}="undefined"!=typeof Reflect&&Reflect;rS||(rS=function(e){return e}),aS||(aS=function(e){return e}),iS||(iS=function(e,t,o){return e.apply(t,o)}),lS||(lS=function(e,t){return new e(...t)});const cS=kS(Array.prototype.forEach),dS=kS(Array.prototype.lastIndexOf),mS=kS(Array.prototype.pop),uS=kS(Array.prototype.push),gS=kS(Array.prototype.splice),pS=kS(String.prototype.toLowerCase),hS=kS(String.prototype.toString),fS=kS(String.prototype.match),bS=kS(String.prototype.replace),xS=kS(String.prototype.indexOf),vS=kS(String.prototype.trim),yS=kS(Object.prototype.hasOwnProperty),wS=kS(RegExp.prototype.test),_S=(CS=TypeError,function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return lS(CS,t)});var CS;function kS(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return iS(e,t,n)}}function SS(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:pS;eS&&eS(e,null);let n=t.length;for(;n--;){let r=t[n];if("string"==typeof r){const e=o(r);e!==r&&(tS(t)||(t[n]=e),r=e)}e[r]=!0}return e}function ES(e){for(let t=0;t<e.length;t++){yS(e,t)||(e[t]=null)}return e}function OS(e){const t=sS(null);for(const[o,n]of Qk(e)){yS(e,o)&&(Array.isArray(n)?t[o]=ES(n):n&&"object"==typeof n&&n.constructor===Object?t[o]=OS(n):t[o]=n)}return t}function TS(e,t){for(;null!==e;){const o=nS(e,t);if(o){if(o.get)return kS(o.get);if("function"==typeof o.value)return kS(o.value)}e=oS(e)}return function(){return null}}const AS=rS(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),DS=rS(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),MS=rS(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),RS=rS(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),NS=rS(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),BS=rS(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),zS=rS(["#text"]),HS=rS(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),LS=rS(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),IS=rS(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),PS=rS(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),FS=aS(/\{\{[\w\W]*|[\w\W]*\}\}/gm),VS=aS(/<%[\w\W]*|[\w\W]*%>/gm),ZS=aS(/\$\{[\w\W]*/gm),US=aS(/^data-[\-\w.\u00B7-\uFFFF]+$/),jS=aS(/^aria-[\-\w]+$/),WS=aS(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$S=aS(/^(?:\w+script|data):/i),qS=aS(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),GS=aS(/^html$/i),KS=aS(/^[a-z][.\w]*(-[.\w]+)+$/i);var YS=Object.freeze({__proto__:null,ARIA_ATTR:jS,ATTR_WHITESPACE:qS,CUSTOM_ELEMENT:KS,DATA_ATTR:US,DOCTYPE_NAME:GS,ERB_EXPR:VS,IS_ALLOWED_URI:WS,IS_SCRIPT_OR_DATA:$S,MUSTACHE_EXPR:FS,TMPLIT_EXPR:ZS});const XS=1,JS=3,QS=7,eE=8,tE=9,oE=function(){return"undefined"==typeof window?null:window};var nE=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oE();const o=t=>e(t);if(o.version="3.2.6",o.removed=[],!t||!t.document||t.document.nodeType!==tE||!t.Element)return o.isSupported=!1,o;let{document:n}=t;const r=n,a=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:i,Node:l,Element:c,NodeFilter:d,NamedNodeMap:m=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:u,DOMParser:g,trustedTypes:p}=t,h=c.prototype,f=TS(h,"cloneNode"),b=TS(h,"remove"),x=TS(h,"nextSibling"),v=TS(h,"childNodes"),y=TS(h,"parentNode");if("function"==typeof i){const e=n.createElement("template");e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let w,_="";const{implementation:C,createNodeIterator:k,createDocumentFragment:S,getElementsByTagName:E}=n,{importNode:O}=r;let T={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof Qk&&"function"==typeof y&&C&&void 0!==C.createHTMLDocument;const{MUSTACHE_EXPR:A,ERB_EXPR:D,TMPLIT_EXPR:M,DATA_ATTR:R,ARIA_ATTR:N,IS_SCRIPT_OR_DATA:B,ATTR_WHITESPACE:z,CUSTOM_ELEMENT:H}=YS;let{IS_ALLOWED_URI:L}=YS,I=null;const P=SS({},[...AS,...DS,...MS,...NS,...zS]);let F=null;const V=SS({},[...HS,...LS,...IS,...PS]);let Z=Object.seal(sS(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),U=null,j=null,W=!0,$=!0,q=!1,G=!0,K=!1,Y=!0,X=!1,J=!1,Q=!1,ee=!1,te=!1,oe=!1,ne=!0,re=!1,ae=!0,se=!1,ie={},le=null;const ce=SS({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let de=null;const me=SS({},["audio","video","img","source","image","track"]);let ue=null;const ge=SS({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pe="http://www.w3.org/1998/Math/MathML",he="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml";let be=fe,xe=!1,ve=null;const ye=SS({},[pe,he,fe],hS);let we=SS({},["mi","mo","mn","ms","mtext"]),_e=SS({},["annotation-xml"]);const Ce=SS({},["title","style","font","a","script"]);let ke=null;const Se=["application/xhtml+xml","text/html"];let Ee=null,Oe=null;const Te=n.createElement("form"),Ae=function(e){return e instanceof RegExp||e instanceof Function},De=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Oe||Oe!==e){if(e&&"object"==typeof e||(e={}),e=OS(e),ke=-1===Se.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ee="application/xhtml+xml"===ke?hS:pS,I=yS(e,"ALLOWED_TAGS")?SS({},e.ALLOWED_TAGS,Ee):P,F=yS(e,"ALLOWED_ATTR")?SS({},e.ALLOWED_ATTR,Ee):V,ve=yS(e,"ALLOWED_NAMESPACES")?SS({},e.ALLOWED_NAMESPACES,hS):ye,ue=yS(e,"ADD_URI_SAFE_ATTR")?SS(OS(ge),e.ADD_URI_SAFE_ATTR,Ee):ge,de=yS(e,"ADD_DATA_URI_TAGS")?SS(OS(me),e.ADD_DATA_URI_TAGS,Ee):me,le=yS(e,"FORBID_CONTENTS")?SS({},e.FORBID_CONTENTS,Ee):ce,U=yS(e,"FORBID_TAGS")?SS({},e.FORBID_TAGS,Ee):OS({}),j=yS(e,"FORBID_ATTR")?SS({},e.FORBID_ATTR,Ee):OS({}),ie=!!yS(e,"USE_PROFILES")&&e.USE_PROFILES,W=!1!==e.ALLOW_ARIA_ATTR,$=!1!==e.ALLOW_DATA_ATTR,q=e.ALLOW_UNKNOWN_PROTOCOLS||!1,G=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,K=e.SAFE_FOR_TEMPLATES||!1,Y=!1!==e.SAFE_FOR_XML,X=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,oe=e.RETURN_TRUSTED_TYPE||!1,Q=e.FORCE_BODY||!1,ne=!1!==e.SANITIZE_DOM,re=e.SANITIZE_NAMED_PROPS||!1,ae=!1!==e.KEEP_CONTENT,se=e.IN_PLACE||!1,L=e.ALLOWED_URI_REGEXP||WS,be=e.NAMESPACE||fe,we=e.MATHML_TEXT_INTEGRATION_POINTS||we,_e=e.HTML_INTEGRATION_POINTS||_e,Z=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ae(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Z.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ae(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Z.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Z.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),K&&($=!1),te&&(ee=!0),ie&&(I=SS({},zS),F=[],!0===ie.html&&(SS(I,AS),SS(F,HS)),!0===ie.svg&&(SS(I,DS),SS(F,LS),SS(F,PS)),!0===ie.svgFilters&&(SS(I,MS),SS(F,LS),SS(F,PS)),!0===ie.mathMl&&(SS(I,NS),SS(F,IS),SS(F,PS))),e.ADD_TAGS&&(I===P&&(I=OS(I)),SS(I,e.ADD_TAGS,Ee)),e.ADD_ATTR&&(F===V&&(F=OS(F)),SS(F,e.ADD_ATTR,Ee)),e.ADD_URI_SAFE_ATTR&&SS(ue,e.ADD_URI_SAFE_ATTR,Ee),e.FORBID_CONTENTS&&(le===ce&&(le=OS(le)),SS(le,e.FORBID_CONTENTS,Ee)),ae&&(I["#text"]=!0),X&&SS(I,["html","head","body"]),I.table&&(SS(I,["tbody"]),delete U.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw _S('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw _S('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=e.TRUSTED_TYPES_POLICY,_=w.createHTML("")}else void 0===w&&(w=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let o=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(o=t.getAttribute(n));const r="dompurify"+(o?"#"+o:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(p,a)),null!==w&&"string"==typeof _&&(_=w.createHTML(""));rS&&rS(e),Oe=e}},Me=SS({},[...DS,...MS,...RS]),Re=SS({},[...NS,...BS]),Ne=function(e){uS(o.removed,{element:e});try{y(e).removeChild(e)}catch(t){b(e)}},Be=function(e,t){try{uS(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){uS(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ee||te)try{Ne(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ze=function(e){let t=null,o=null;if(Q)e="<remove></remove>"+e;else{const t=fS(e,/^[\r\n\t ]+/);o=t&&t[0]}"application/xhtml+xml"===ke&&be===fe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=w?w.createHTML(e):e;if(be===fe)try{t=(new g).parseFromString(r,ke)}catch(e){}if(!t||!t.documentElement){t=C.createDocument(be,"template",null);try{t.documentElement.innerHTML=xe?_:r}catch(e){}}const a=t.body||t.documentElement;return e&&o&&a.insertBefore(n.createTextNode(o),a.childNodes[0]||null),be===fe?E.call(t,X?"html":"body")[0]:X?t.documentElement:a},He=function(e){return k.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Le=function(e){return e instanceof u&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof m)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Ie=function(e){return"function"==typeof l&&e instanceof l};function Pe(e,t,n){cS(e,e=>{e.call(o,t,n,Oe)})}const Fe=function(e){let t=null;if(Pe(T.beforeSanitizeElements,e,null),Le(e))return Ne(e),!0;const n=Ee(e.nodeName);if(Pe(T.uponSanitizeElement,e,{tagName:n,allowedTags:I}),Y&&e.hasChildNodes()&&!Ie(e.firstElementChild)&&wS(/<[/\w!]/g,e.innerHTML)&&wS(/<[/\w!]/g,e.textContent))return Ne(e),!0;if(e.nodeType===QS)return Ne(e),!0;if(Y&&e.nodeType===eE&&wS(/<[/\w]/g,e.data))return Ne(e),!0;if(!I[n]||U[n]){if(!U[n]&&Ze(n)){if(Z.tagNameCheck instanceof RegExp&&wS(Z.tagNameCheck,n))return!1;if(Z.tagNameCheck instanceof Function&&Z.tagNameCheck(n))return!1}if(ae&&!le[n]){const t=y(e)||e.parentNode,o=v(e)||e.childNodes;if(o&&t){for(let n=o.length-1;n>=0;--n){const r=f(o[n],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,x(e))}}}return Ne(e),!0}return e instanceof c&&!function(e){let t=y(e);t&&t.tagName||(t={namespaceURI:be,tagName:"template"});const o=pS(e.tagName),n=pS(t.tagName);return!!ve[e.namespaceURI]&&(e.namespaceURI===he?t.namespaceURI===fe?"svg"===o:t.namespaceURI===pe?"svg"===o&&("annotation-xml"===n||we[n]):Boolean(Me[o]):e.namespaceURI===pe?t.namespaceURI===fe?"math"===o:t.namespaceURI===he?"math"===o&&_e[n]:Boolean(Re[o]):e.namespaceURI===fe?!(t.namespaceURI===he&&!_e[n])&&!(t.namespaceURI===pe&&!we[n])&&!Re[o]&&(Ce[o]||!Me[o]):!("application/xhtml+xml"!==ke||!ve[e.namespaceURI]))}(e)?(Ne(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!wS(/<\/no(script|embed|frames)/i,e.innerHTML)?(K&&e.nodeType===JS&&(t=e.textContent,cS([A,D,M],e=>{t=bS(t,e," ")}),e.textContent!==t&&(uS(o.removed,{element:e.cloneNode()}),e.textContent=t)),Pe(T.afterSanitizeElements,e,null),!1):(Ne(e),!0)},Ve=function(e,t,o){if(ne&&("id"===t||"name"===t)&&(o in n||o in Te))return!1;if($&&!j[t]&&wS(R,t));else if(W&&wS(N,t));else if(!F[t]||j[t]){if(!(Ze(e)&&(Z.tagNameCheck instanceof RegExp&&wS(Z.tagNameCheck,e)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(e))&&(Z.attributeNameCheck instanceof RegExp&&wS(Z.attributeNameCheck,t)||Z.attributeNameCheck instanceof Function&&Z.attributeNameCheck(t))||"is"===t&&Z.allowCustomizedBuiltInElements&&(Z.tagNameCheck instanceof RegExp&&wS(Z.tagNameCheck,o)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(o))))return!1}else if(ue[t]);else if(wS(L,bS(o,z,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==xS(o,"data:")||!de[e]){if(q&&!wS(B,bS(o,z,"")));else if(o)return!1}else;return!0},Ze=function(e){return"annotation-xml"!==e&&fS(e,H)},Ue=function(e){Pe(T.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Le(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:F,forceKeepAttr:void 0};let r=t.length;for(;r--;){const a=t[r],{name:s,namespaceURI:i,value:l}=a,c=Ee(s),d=l;let m="value"===s?d:vS(d);if(n.attrName=c,n.attrValue=m,n.keepAttr=!0,n.forceKeepAttr=void 0,Pe(T.uponSanitizeAttribute,e,n),m=n.attrValue,!re||"id"!==c&&"name"!==c||(Be(s,e),m="user-content-"+m),Y&&wS(/((--!?|])>)|<\/(style|title)/i,m)){Be(s,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){Be(s,e);continue}if(!G&&wS(/\/>/i,m)){Be(s,e);continue}K&&cS([A,D,M],e=>{m=bS(m,e," ")});const u=Ee(e.nodeName);if(Ve(u,c,m)){if(w&&"object"==typeof p&&"function"==typeof p.getAttributeType)if(i);else switch(p.getAttributeType(u,c)){case"TrustedHTML":m=w.createHTML(m);break;case"TrustedScriptURL":m=w.createScriptURL(m)}if(m!==d)try{i?e.setAttributeNS(i,s,m):e.setAttribute(s,m),Le(e)?Ne(e):mS(o.removed)}catch(t){Be(s,e)}}else Be(s,e)}Pe(T.afterSanitizeAttributes,e,null)},je=function e(t){let o=null;const n=He(t);for(Pe(T.beforeSanitizeShadowDOM,t,null);o=n.nextNode();)Pe(T.uponSanitizeShadowNode,o,null),Fe(o),Ue(o),o.content instanceof s&&e(o.content);Pe(T.afterSanitizeShadowDOM,t,null)};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,a=null,i=null,c=null;if(xe=!e,xe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ie(e)){if("function"!=typeof e.toString)throw _S("toString is not a function");if("string"!=typeof(e=e.toString()))throw _S("dirty is not a string, aborting")}if(!o.isSupported)return e;if(J||De(t),o.removed=[],"string"==typeof e&&(se=!1),se){if(e.nodeName){const t=Ee(e.nodeName);if(!I[t]||U[t])throw _S("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)n=ze("\x3c!----\x3e"),a=n.ownerDocument.importNode(e,!0),a.nodeType===XS&&"BODY"===a.nodeName||"HTML"===a.nodeName?n=a:n.appendChild(a);else{if(!ee&&!K&&!X&&-1===e.indexOf("<"))return w&&oe?w.createHTML(e):e;if(n=ze(e),!n)return ee?null:oe?_:""}n&&Q&&Ne(n.firstChild);const d=He(se?e:n);for(;i=d.nextNode();)Fe(i),Ue(i),i.content instanceof s&&je(i.content);if(se)return e;if(ee){if(te)for(c=S.call(n.ownerDocument);n.firstChild;)c.appendChild(n.firstChild);else c=n;return(F.shadowroot||F.shadowrootmode)&&(c=O.call(r,c,!0)),c}let m=X?n.outerHTML:n.innerHTML;return X&&I["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&wS(GS,n.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+m),K&&cS([A,D,M],e=>{m=bS(m,e," ")}),w&&oe?w.createHTML(m):m},o.setConfig=function(){De(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),J=!0},o.clearConfig=function(){Oe=null,J=!1},o.isValidAttribute=function(e,t,o){Oe||De({});const n=Ee(e),r=Ee(t);return Ve(n,r,o)},o.addHook=function(e,t){"function"==typeof t&&uS(T[e],t)},o.removeHook=function(e,t){if(void 0!==t){const o=dS(T[e],t);return-1===o?void 0:gS(T[e],o,1)[0]}return mS(T[e])},o.removeHooks=function(e){T[e]=[]},o.removeAllHooks=function(){T={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();const rE=e=>nE().sanitize(e);var aE=tinymce.util.Tools.resolve("tinymce.util.I18n");const sE={indent:!0,outdent:!0,"table-insert-column-after":!0,"table-insert-column-before":!0,"paste-column-after":!0,"paste-column-before":!0,"unordered-list":!0,"list-bull-circle":!0,"list-bull-disc":!0,"list-bull-default":!0,"list-bull-square":!0},iE="temporary-placeholder",lE=e=>()=>fe(e,iE).getOr("!not found!"),cE=(e,t)=>{const o=e.toLowerCase();if(aE.isRtl()){const e=((e,t)=>et(e,t)?e:((e,t)=>e+t)(e,t))(o,"-rtl");return be(t,e)?e:o}return o},dE=(e,t)=>fe(t,cE(e,t)),mE=(e,t)=>{const o=t();return dE(e,o).getOrThunk(lE(o))},uE=()=>Bd("add-focusable",[vd(e=>{Gn(e.element,"svg").each(e=>Wo(e,"focusable","false"))})]),gE=(e,t,o,n)=>{var r,a;const s=(e=>!!aE.isRtl()&&be(sE,e))(t)?["tox-icon--flip"]:[],i=fe(o,cE(t,o)).or(n).getOrThunk(lE(o));return{dom:{tag:e.tag,attributes:null!==(r=e.attributes)&&void 0!==r?r:{},classes:e.classes.concat(s),innerHtml:i},behaviours:Td([...null!==(a=e.behaviours)&&void 0!==a?a:[],uE()])}},pE=(e,t,o,n=A.none())=>gE(t,e,o(),n),hE={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},fE=Fh({name:"Notification",factory:e=>{const t=Le("notification-text"),o=ov({dom:tv(`<p id=${t}>${rE(e.backstageProvider.translate(e.text))}</p>`),behaviours:Td([kg.config({})])}),n=e=>({dom:{tag:"div",classes:["tox-bar"],styles:{width:`${e}%`}}}),r=e=>({dom:{tag:"div",classes:["tox-text"],innerHtml:`${e}%`}}),a=ov({dom:{tag:"div",classes:e.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(0)]},r(0)],behaviours:Td([kg.config({})])}),s={updateProgress:(e,t)=>{e.getSystem().isConnected()&&a.getOpt(e).each(e=>{kg.set(e,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(t)]},r(t)])})},updateText:(e,t)=>{if(e.getSystem().isConnected()){const n=o.get(e);kg.set(n,[op(t)])}}},i=$([e.icon.toArray(),[e.level],A.from(hE[e.level]).toArray()]),l=ov(yv.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"],attributes:{"aria-label":e.backstageProvider.translate("Close")}},components:[pE("close",{tag:"span",classes:["tox-icon"]},e.iconProvider)],buttonBehaviours:Td([Nx.config({}),Qx.config({...e.backstageProvider.tooltips.getConfig({tooltipText:e.backstageProvider.translate("Close")})})]),action:t=>{e.onAction(t)}})),c=((e,t,o)=>{const n=o(),r=j(e,e=>be(n,cE(e,n)));return gE(t,r.getOr(iE),n,A.none())})(i,{tag:"div",classes:["tox-notification__icon"]},e.iconProvider),d=[c,{dom:{tag:"div",classes:["tox-notification__body"]},components:[o.asSpec()],behaviours:Td([kg.config({})])}];return{uid:e.uid,dom:{tag:"div",attributes:{role:"alert","aria-labelledby":t},classes:["tox-notification","tox-notification--in",`tox-notification--${e.level}`]},behaviours:Td([Nx.config({}),Pd.config({}),Wu.config({mode:"special",onEscape:t=>(e.onAction(t),A.some(!0))})]),components:d.concat(e.progress?[a.asSpec()]:[]).concat([l.asSpec()]),apis:s}},configFields:[fs("level","info",["success","error","warning","warn","info"]),Ka("progress"),rs("icon"),Ka("onAction"),Ka("text"),Ka("iconProvider"),Ka("backstageProvider")],apis:{updateProgress:(e,t,o)=>{e.updateProgress(t,o)},updateText:(e,t,o)=>{e.updateText(t,o)}}});var bE=(e,t,o,n)=>{const r=t.backstage.shared,a=()=>it.fromDom(""===e.queryCommandValue("ToggleView")?e.getContentAreaContainer():e.getContainer()),s=()=>{const e=Pr(a());return A.some(e)},i=e=>{s().each(t=>{P(e,e=>{vn(e.element,"width"),Tn(e.element)>t.width&&mn(e.element,"width",t.width+"px")})})};return{open:(t,l,c)=>{const d=()=>{const t=(t,o)=>{Wy.hide(t),n.clear(),o&&e.focus()},o=(e,t)=>{t&&Wu.focusIn(e)};n.on(e=>{l();const n=c();(e=>{kg.remove(e,m),u()})(e),((e,n)=>{0===po(e.element).length?t(e,n):o(e,n)})(e,n)})},m=sp(fE.sketch({text:t.text,level:B(["success","error","warning","warn","info"],t.type)?t.type:void 0,progress:!0===t.progressBar,icon:t.icon,onAction:d,iconProvider:r.providers.icons,backstageProvider:r.providers}));if(n.isSet()){const e=ip(m);n.on(t=>{kg.append(t,e),Wy.reposition(t),m.hasConfigured(ch)&&ch.refresh(t),i(t.components())})}else{const t=sp(Wy.sketch({dom:{tag:"div",classes:["tox-notifications-container"],attributes:{"aria-label":"Notifications",role:"region"}},lazySink:r.getSink,fireDismissalEventInstead:{},...r.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}},inlineBehaviours:Td([Wu.config({mode:"cyclic",selector:".tox-notification, .tox-notification a, .tox-notification button"}),kg.config({}),...Uk(e)&&r.header.isPositionedAtTop()?[]:[ch.config({contextual:{lazyContext:()=>A.some(Pr(a())),fadeInClass:"tox-notification-container-dock-fadein",fadeOutClass:"tox-notification-container-dock-fadeout",transitionClass:"tox-notification-container-dock-transition"},modes:["top"],lazyViewport:t=>Xk(e,t.element).map(e=>({bounds:Jk(e),optScrollEnv:A.some({currentScrollTop:e.element.dom.scrollTop,scrollElmTop:Bn(e.element).top})})).getOrThunk(()=>({bounds:Zr(),optScrollEnv:A.none()}))})]])})),i=ip(m),l={maxHeightFunction:Wc()},c={...r.anchors.banner(),overrides:l};n.set(t),o.add(t),Wy.showWithinBounds(t,i,{anchor:c},s)}h(t.timeout)&&t.timeout>0&&IC.setEditorTimeout(e,()=>{d()},t.timeout);const u=()=>{n.on(e=>{Wy.reposition(e),e.hasConfigured(ch)&&ch.refresh(e),i(e.components())})};return{close:d,reposition:u,text:e=>{fE.updateText(m,e)},settings:t,getEl:()=>m.element.dom,progressBar:{value:e=>{fE.updateProgress(m,e)}}}},close:e=>{e.close()},getArgs:e=>e.settings}};const xE=(e,t)=>{const o=(e,t)=>{nd(e,Ls(),{raw:t})},n=()=>e.getMenu().bind(hm.getHighlighted);t.on("keydown",t=>{const r=t.which;e.isActive()&&(e.isMenuOpen()?13===r?(n().each(rd),t.preventDefault()):40===r?(n().fold(()=>{e.getMenu().each(hm.highlightFirst)},e=>{o(e,t)}),t.preventDefault(),t.stopImmediatePropagation()):37!==r&&38!==r&&39!==r||n().each(e=>{o(e,t),t.preventDefault(),t.stopImmediatePropagation()}):13!==r&&38!==r&&40!==r||e.cancelIfNecessary())}),t.on("NodeChange",()=>{!e.isActive()||e.isProcessingAction()||t.queryCommandState("mceAutoCompleterInRange")||e.cancelIfNecessary()})};var vE;!function(e){e[e.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",e[e.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"}(vE||(vE={}));var yE=vE;const wE="tox-menu-nav__js",_E="tox-collection__item",CE="tox-swatch",kE={normal:wE,color:CE},SE="tox-collection__item--enabled",EE="tox-collection__item-icon",OE="tox-collection__item-label",TE="tox-collection__item-caret",AE="tox-collection__item--active",DE="tox-collection__item-container",ME="tox-collection__item-container--row",RE=e=>fe(kE,e).getOr(wE),NE=e=>"color"===e?"tox-swatches":"tox-menu",BE=e=>({backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:NE(e),tieredMenu:"tox-tiered-menu"}),zE=e=>{const t=BE(e);return{backgroundMenu:t.backgroundMenu,selectedMenu:t.selectedMenu,menu:t.menu,selectedItem:t.selectedItem,item:RE(e)}},HE=(e,t,o)=>{const n=BE(o);return{tag:"div",classes:$([[n.menu,`tox-menu-${t}-column`],e?[n.hasIcons]:[]])}},LE=[Gv.parts.items({})],IE=(e,t,o)=>{const n=BE(o);return{dom:{tag:"div",classes:$([[n.tieredMenu]])},markers:zE(o)}},PE=Le("refetch-trigger-event"),FE=Le("redirect-menu-item-interaction"),VE="tox-menu__searcher",ZE=e=>Kn(e.element,`.${VE}`).bind(t=>e.getSystem().getByDom(t).toOptional()),UE=ZE,jE=e=>({fetchPattern:Bf.getValue(e),selectionStart:e.element.dom.selectionStart,selectionEnd:e.element.dom.selectionEnd}),WE=e=>{const t=(e,t)=>(t.cut(),A.none()),o=(e,t)=>{const o={interactionEvent:t.event,eventType:t.event.raw.type};return nd(e,FE,o),A.some(!0)},n="searcher-events";return{dom:{tag:"div",classes:[_E]},components:[Yy.sketch({inputClasses:[VE,"tox-textfield"],inputAttributes:{...e.placeholder.map(t=>({placeholder:e.i18n(t)})).getOr({}),type:"search","aria-autocomplete":"list"},inputBehaviours:Td([Bd(n,[md(Ps(),e=>{od(e,PE)}),md(Ls(),(e,t)=>{"Escape"===t.event.raw.key&&t.stop()})]),Wu.config({mode:"special",onLeft:t,onRight:t,onSpace:t,onEnter:o,onEscape:o,onUp:o,onDown:o})]),eventOrder:{keydown:[n,Wu.name()]}})]}},$E="tox-collection--results__js",qE=e=>{var t;return e.dom?{...e,dom:{...e.dom,attributes:{...null!==(t=e.dom.attributes)&&void 0!==t?t:{},id:Le("aria-item-search-result-id"),"aria-selected":"false"}}}:e},GE=(e,t)=>o=>{const n=L(o,t);return I(n,t=>({dom:e,components:t}))},KE=(e,t)=>{const o=[];let n=[];return P(e,(e,r)=>{t(e,r)?(n.length>0&&o.push(n),n=[],(be(e.dom,"innerHtml")||e.components&&e.components.length>0)&&n.push(e)):n.push(e)}),n.length>0&&o.push(n),I(o,e=>({dom:{tag:"div",classes:["tox-collection__group"]},components:e}))},YE=(e,t,o)=>Gv.parts.items({preprocess:n=>{const r=I(n,o);return"auto"!==e&&e>1?GE({tag:"div",classes:["tox-collection__group"]},e)(r):KE(r,(e,o)=>"separator"===t[o].type)}}),XE=(e,t,o=!0)=>({dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===e?["tox-collection--list"]:["tox-collection--grid"])},components:[YE(e,t,w)]}),JE=e=>z(e,e=>"icon"in e&&void 0!==e.icon),QE=e=>(console.error(Ua(e)),console.log(e),A.none()),eO=(e,t,o,n,r)=>{const a=(s=o,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[Gv.parts.items({preprocess:e=>KE(e,(e,t)=>"separator"===s[t].type)})]});var s;return{value:e,dom:a.dom,components:a.components,items:o}},tO=(e,t,o,n,r)=>{const a=()=>"searchable"!==r.menuType?XE(n,o):"search-with-field"===r.searchMode.searchMode?((e,t,o)=>{const n=Le("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===e?["tox-collection--list"]:["tox-collection--grid"])},components:[WE({i18n:aE.translate,placeholder:o.placeholder}),{dom:{tag:"div",classes:[...1===e?["tox-collection--list"]:["tox-collection--grid"],$E],attributes:{id:n}},components:[YE(e,t,qE)]}]}})(n,o,r.searchMode):((e,t)=>{const o=Le("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection",$E].concat(1===e?["tox-collection--list"]:["tox-collection--grid"]),attributes:{id:o}},components:[YE(e,t,qE)]}})(n,o);if("color"===r.menuType){const t=(e=>({dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[Gv.parts.items({preprocess:"auto"!==e?GE({tag:"div",classes:["tox-swatches__row"]},e):w})]}]}))(n);return{value:e,dom:t.dom,components:t.components,items:o}}if("imageselector"===r.menuType&&"auto"!==n){const t=(e=>({dom:{tag:"div",classes:["tox-menu","tox-image-selector-menu"]},components:[{dom:{tag:"div",classes:["tox-image-selector"]},components:[Gv.parts.items({preprocess:"auto"!==e?GE({tag:"div",classes:["tox-image-selector__row"]},e):w})]}]}))(n);return{value:e,dom:t.dom,components:t.components,items:o}}if("normal"===r.menuType&&"auto"===n){const t=XE(n,o);return{value:e,dom:t.dom,components:t.components,items:o}}if("normal"===r.menuType||"searchable"===r.menuType){const t=a();return{value:e,dom:t.dom,components:t.components,items:o}}if("listpreview"===r.menuType&&"auto"!==n){const t=(e=>({dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Gv.parts.items({preprocess:GE({tag:"div",classes:["tox-collection__group"]},e)})]}))(n);return{value:e,dom:t.dom,components:t.components,items:o}}return{value:e,dom:HE(t,n,r.menuType),components:LE,items:o}},oO=Ja("type"),nO=Ja("name"),rO=Ja("label"),aO=Ja("text"),sO=Ja("title"),iO=Ja("icon"),lO=Ja("url"),cO=Ja("value"),dO=es("fetch"),mO=es("getSubmenuItems"),uO=es("onAction"),gO=es("onItemAction"),pO=xs("onSetup",()=>b),hO=is("name"),fO=is("text"),bO=is("role"),xO=is("icon"),vO=is("tooltip"),yO=is("label"),wO=is("shortcut"),_O=cs("select"),CO=bs("active",!1),kO=bs("borderless",!1),SO=bs("enabled",!0),EO=bs("primary",!1),OO=e=>us("columns",e),TO=us("meta",{}),AO=xs("onAction",b),DO=e=>hs("type",e),MO=e=>$a("name","name",xa(()=>Le(`${e}-name`)),ga),RO=[oO,aO,Qa("level",["info","warn","error","success"]),iO,us("url","")],NO=Ma(RO),BO=[oO,aO,SO,MO("button"),xO,kO,ls("buttonType",["primary","secondary","toolbar"]),EO,hs("context","mode:design")],zO=Ma(BO),HO=[oO,nO],LO=HO.concat([yO]),IO=HO.concat([rO,SO,hs("context","mode:design")]),PO=Ma(IO),FO=pa,VO=LO.concat([OO("auto"),hs("context","mode:design")]),ZO=Ma(VO),UO=za([cO,aO,iO]),jO=LO.concat([hs("storageKey","default"),hs("context","mode:design")]),WO=Ma(jO),$O=ga,qO=Ma(LO),GO=ga,KO=HO.concat([hs("tag","textarea"),Ja("scriptId"),Ja("scriptUrl"),cs("onFocus"),((e,t)=>gs(e,t,ba))("settings",void 0)]),YO=HO.concat([hs("tag","textarea"),es("init")]),XO=Ia(e=>Fa("customeditor.old",Da(YO),e).orThunk(()=>Fa("customeditor.new",Da(KO),e))),JO=ga,QO=[SO,fO,bO,wO,(eT="menuitem",$a("value","value",xa(()=>Le(`${eT}-value`)),da())),TO,hs("context","mode:design")];var eT;const tT=Ma([oO,nO].concat(QO)),oT=pa,nT=[MO("button"),xO,fs("align","end",["start","end"]),EO,SO,ls("buttonType",["primary","secondary"]),hs("context","mode:design")],rT=[...nT,aO],aT=[Qa("type",["submit","cancel","custom"]),...rT],sT=[Qa("type",["menu"]),fO,vO,xO,ns("items",tT),...nT],iT=[...nT,Qa("type",["togglebutton"]),vO,xO,fO,bs("active",!1)],lT=ja("type",{submit:aT,cancel:aT,custom:aT,menu:sT,togglebutton:iT}),cT=LO.concat([hs("context","mode:design")]),dT=Ma(cT),mT=Ra(ca),uT=e=>[oO,Xa("columns"),e],gT=[oO,Ja("html"),fs("presets","presentation",["presentation","document"]),xs("onInit",b),bs("stretched",!1)],pT=Ma(gT),hT=LO.concat([bs("border",!1),bs("sandboxed",!0),bs("streamContent",!1),bs("transparent",!0)]),fT=Ma(hT),bT=ga,xT=Ma(HO.concat([is("height")])),vT=Ma([Ja("url"),ss("zoom"),ss("cachedWidth"),ss("cachedHeight")]),yT=LO.concat([is("inputMode"),is("placeholder"),bs("maximized",!1),SO,hs("context","mode:design")]),wT=Ma(yT),_T=ga,CT=e=>[oO,rO,e,fs("align","start",["start","center","end"]),is("for")],kT=[aO,cO],ST=[aO,ns("items",Wa(0,()=>ET))],ET=Na([Ma(kT),Ma(ST)]),OT=LO.concat([ns("items",ET),SO,hs("context","mode:design")]),TT=Ma(OT),AT=ga,DT=LO.concat([os("items",[aO,cO]),ps("size",1),SO,hs("context","mode:design")]),MT=Ma(DT),RT=ga,NT=LO.concat([bs("constrain",!0),SO,hs("context","mode:design")]),BT=Ma(NT),zT=Ma([Ja("width"),Ja("height")]),HT=HO.concat([rO,ps("min",0),ps("max",0)]),LT=Ma(HT),IT=ua,PT=[oO,ns("header",ga),ns("cells",Ra(ga))],FT=Ma(PT),VT=LO.concat([is("placeholder"),bs("maximized",!1),SO,hs("context","mode:design")]),ZT=Ma(VT),UT=ga,jT=[hs("buttonType","default"),is("text"),is("tooltip"),is("icon"),gs("search",!1,Na([pa,Ma([is("placeholder")])],e=>d(e)?e?A.some({placeholder:A.none()}):A.none():A.some(e))),es("fetch"),xs("onSetup",()=>b),hs("context","mode:design")],WT=Ma([oO,...jT]),$T=e=>Fa("menubutton",WT,e),qT=[Qa("type",["directory","leaf"]),sO,Ja("id"),as("menu",WT),is("customStateIcon"),is("customStateIconTooltip")],GT=Ma(qT),KT=qT.concat([ns("children",Wa(0,()=>La("type",{directory:YT,leaf:GT})))]),YT=Ma(KT),XT=La("type",{directory:YT,leaf:GT}),JT=[oO,ns("items",XT),cs("onLeafAction"),cs("onToggleExpand"),vs("defaultExpandedIds",[],ga),is("defaultSelectedId")],QT=Ma(JT),eA=LO.concat([fs("filetype","file",["image","media","file"]),SO,is("picker_text"),hs("context","mode:design")]),tA=Ma(eA),oA=Ma([cO,TO]),nA=e=>$a("items","items",{tag:"required",process:{}},Ra(Ia(t=>Fa(`Checking item of ${e}`,rA,t).fold(e=>Ae.error(Ua(e)),e=>Ae.value(e))))),rA=Ta(()=>{return La("type",{alertbanner:NO,bar:Ma((e=nA("bar"),[oO,e])),button:zO,checkbox:PO,colorinput:WO,colorpicker:qO,dropzone:dT,grid:Ma(uT(nA("grid"))),iframe:fT,input:wT,listbox:TT,selectbox:MT,sizeinput:BT,slider:LT,textarea:ZT,urlinput:tA,customeditor:XO,htmlpanel:pT,imagepreview:xT,collection:ZO,label:Ma(CT(nA("label"))),table:FT,tree:QT,panel:sA});var e}),aA=[oO,us("classes",[]),ns("items",rA)],sA=Ma(aA),iA=[MO("tab"),sO,ns("items",rA)],lA=[oO,os("tabs",iA)],cA=Ma(lA),dA=rT,mA=lT,uA=Ma([Ja("title"),Ya("body",La("type",{panel:sA,tabpanel:cA})),hs("size","normal"),vs("buttons",[],mA),us("initialData",{}),xs("onAction",b),xs("onChange",b),xs("onSubmit",b),xs("onClose",b),xs("onCancel",b),xs("onTabChange",b)]),gA=Ma([Qa("type",["cancel","custom"]),...dA]),pA=Ma([Ja("title"),Ja("url"),ss("height"),ss("width"),ds("buttons",gA),xs("onAction",b),xs("onCancel",b),xs("onClose",b),xs("onMessage",b)]),hA=e=>s(e)?[e].concat(q(he(e),hA)):l(e)?q(e,hA):[],fA=e=>a(e.type)&&a(e.name),bA={checkbox:FO,colorinput:$O,colorpicker:GO,dropzone:mT,input:_T,iframe:bT,imagepreview:vT,selectbox:RT,sizeinput:zT,slider:IT,listbox:AT,size:zT,textarea:UT,urlinput:oA,customeditor:JO,collection:UO,togglemenuitem:oT},xA=e=>{const t=(e=>V(hA(e),fA))(e),o=q(t,e=>(e=>A.from(bA[e.type]))(e).fold(()=>[],t=>[Ya(e.name,t)]));return Ma(o)},vA=e=>{var t;return{internalDialog:Va(Fa("dialog",uA,e)),dataValidator:xA(e),initialData:null!==(t=e.initialData)&&void 0!==t?t:{}}},yA={open:(e,t)=>{const o=vA(t);return e(o.internalDialog,o.initialData,o.dataValidator)},openUrl:(e,t)=>e(Va(Fa("dialog",pA,t))),redial:e=>vA(e)},wA=Ma([oO,fO]),_A=Ma([DO("autocompleteitem"),CO,SO,TO,cO,fO,xO]);Ma([oO,Ja("trigger"),ps("minChars",1),OO(1),ps("maxResults",10),cs("matches"),dO,uO,vs("highlightOn",[],ga)]);const CA=[SO,vO,xO,fO,pO,hs("context","mode:design")],kA=Ma([oO,uO,wO].concat(CA)),SA=e=>Fa("toolbarbutton",kA,e),EA=[CO].concat(CA),OA=Ma(EA.concat([oO,uO,wO])),TA=e=>Fa("ToggleButton",OA,e),AA=[xs("predicate",O),fs("scope","node",["node","editor"]),fs("position","selection",["node","selection","line"])],DA=CA.concat([DO("contextformbutton"),hs("align","end"),EO,uO,qa("original",w)]),MA=EA.concat([DO("contextformbutton"),hs("align","end"),EO,uO,qa("original",w)]),RA=CA.concat([DO("contextformbutton")]),NA=EA.concat([DO("contextformtogglebutton")]),BA=[yO,ns("commands",ja("type",{contextformbutton:DA,contextformtogglebutton:MA})),as("launch",ja("type",{contextformbutton:RA,contextformtogglebutton:NA})),xs("onInput",b),xs("onSetup",b)],zA=[...AA,...BA,Qa("type",["contextform"]),xs("initValue",y("")),is("placeholder")],HA=[...AA,...BA,Qa("type",["contextsliderform"]),xs("initValue",y(0)),xs("min",y(0)),xs("max",y(100))],LA=[...AA,...BA,Qa("type",["contextsizeinputform"]),xs("initValue",y({width:"",height:""}))],IA=ja("type",{contextform:zA,contextsliderform:HA,contextsizeinputform:LA}),PA=CA.concat([DO("contexttoolbarbutton")]),FA=Ma([DO("contexttoolbar"),ms("launch",PA),Ya("items",Na([ga,za([is("name"),is("label"),ns("items",ga)])]))].concat(AA)),VA=e=>({name:e.name.getOrUndefined(),label:e.label.getOrUndefined(),items:e.items}),ZA=[oO,Ja("src"),is("alt"),vs("classes",[],ga)],UA=Ma(ZA),jA=[oO,aO,hO,vs("classes",["tox-collection__item-label"],ga)],WA=Ma(jA),$A=Ta(()=>La("type",{cardimage:UA,cardtext:WA,cardcontainer:qA})),qA=Ma([oO,hs("direction","horizontal"),hs("align","left"),hs("valign","middle"),ns("items",$A)]),GA=Ma([oO,yO,ns("items",$A),pO,AO].concat(QO)),KA=Ma([oO,CO,xO,yO].concat(QO)),YA=[oO,Ja("fancytype"),AO],XA=[us("initData",{})].concat(YA),JA=[cs("select"),ys("initData",{},[bs("allowCustomColors",!0),hs("storageKey","default"),ds("colors",da())])].concat(YA),QA=[cs("select"),ts("initData",[Xa("columns"),vs("items",[],da())])].concat(YA),eD=ja("fancytype",{inserttable:XA,colorswatch:JA,imageselect:QA}),tD=Ma([oO,CO,lO,yO,vO].concat(QO)),oD=Ma([oO,CO,iO,rO,vO,cO].concat(QO)),nD=Ma([oO,pO,AO,xO].concat(QO)),rD=Ma([oO,mO,pO,xO].concat(QO)),aD=Ma([oO,xO,CO,pO,uO].concat(QO)),sD=Ma([xO,vO,xs("onShow",b),xs("onHide",b),pO]),iD=Ma([oO,Ya("items",Na([za([nO,ns("items",ga)]),ga]))].concat(CA)),lD=Ma([oO,vO,xO,fO,_O,dO,pO,fs("presets","normal",["normal","color","listpreview"]),OO(1),uO,gO,hs("context","mode:design")]),cD=[fO,xO,is("tooltip"),fs("buttonType","secondary",["primary","secondary"]),bs("borderless",!1),es("onAction"),hs("context","mode:design")],dD={button:[...cD,aO,Qa("type",["button"])],togglebutton:[...cD,bs("active",!1),Qa("type",["togglebutton"])]},mD=[Qa("type",["group"]),vs("buttons",[],ja("type",dD))],uD=ja("type",{...dD,group:mD}),gD=Ma([vs("buttons",[],uD),es("onShow"),es("onHide")]),pD=(e,t,o)=>{const n=pr(e.element,"."+o);if(n.length>0){const e=W(n,e=>{const o=e.dom.getBoundingClientRect().top,r=n[0].dom.getBoundingClientRect().top;return Math.abs(o-r)>t}).getOr(n.length);return A.some({numColumns:e,numRows:Math.ceil(n.length/e)})}return A.none()},hD=(e,t)=>Td([Bd(e,t)]),fD=e=>hD(Le("unnamed-events"),e),bD=e=>Mp.config({disabled:e,disableClass:"tox-collection__item--state-disabled"}),xD=e=>Mp.config({disabled:e}),vD=e=>Mp.config({disabled:e,disableClass:"tox-tbtn--disabled"}),yD=e=>Mp.config({disabled:e,disableClass:"tox-tbtn--disabled",useNative:!1}),wD=(e,t)=>{const o=e.getApi(t);return e=>{e(o)}},_D=(e,t)=>vd(o=>{p(e.onBeforeSetup)&&e.onBeforeSetup(o);wD(e,o)(o=>{const n=e.onSetup(o);p(n)&&t.set(n)})}),CD=(e,t)=>yd(o=>wD(e,o)(t.get())),kD=(e,t,o)=>yd(n=>(o.set(Bf.getValue(n)),wD(e,n)(t.get()))),SD="silver.uistate",ED="setDisabled",OD="init",TD=["switchmode",OD],AD=(e,t)=>{const o=e.mainUi.outerContainer,n=[e.mainUi.mothership,...e.uiMotherships];t===ED&&P(n,e=>{e.broadcastOn([av()],{target:o.element})}),P(n,e=>{e.broadcastOn([SD],t)})},DD=(e,t)=>{e.on("init SwitchMode",e=>{AD(t,e.type)}),e.on("DisabledStateChange",o=>{if(!o.isDefaultPrevented()){const n=o.state?ED:OD;AD(t,n),o.state||e.nodeChanged()}}),e.on("NodeChange",o=>{const n=e.ui.isEnabled()?o.type:ED;AD(t,n)}),WC(e)&&e.mode.set("readonly")},MD=e=>Gb.config({channels:{[SD]:{onReceive:(t,o)=>{if(o===ED||"setEnabled"===o)return void Mp.set(t,o===ED);const{contextType:n,shouldDisable:r}=e();("mode"!==n||B(TD,o))&&Mp.set(t,r)}}}}),RD=(e,t)=>_d((o,n)=>{wD(e,o)(e.onAction),e.triggersSubmenu||t!==yE.CLOSE_ON_EXECUTE||(o.getSystem().isConnected()&&od(o,oi()),n.stop())}),ND={[Js()]:["disabling","alloy.base.behaviour","toggling","item-events"]},BD=Ze,zD=(e,t,o,n)=>{const r=ye(b);return{type:"item",dom:t.dom,components:BD(t.optComponents),data:e.data,eventOrder:ND,hasSubmenu:e.triggersSubmenu,itemBehaviours:Td([Bd("item-events",[RD(e,o),_D(e,r),CD(e,r)]),bD(()=>!e.enabled||n.checkUiComponentContext(e.context).shouldDisable),MD(()=>n.checkUiComponentContext(e.context)),kg.config({})].concat(e.itemBehaviours))}},HD=e=>({value:e.value,meta:{text:e.text.getOr(""),...e.meta}}),LD=(e,t)=>{var o,n;const r=it.fromTag("div");nr(r,"tox-image-selector-loading-spinner");return{dom:{tag:e.tag,attributes:null!==(o=e.attributes)&&void 0!==o?o:{},classes:e.classes},components:[{dom:{tag:"div",classes:["tox-image-selector-image-wrapper"]},components:[{dom:{tag:"img",attributes:{src:t},classes:["tox-image-selector-image-img"]}}]},...e.checkMark.toArray()],behaviours:Td([...null!==(n=e.behaviours)&&void 0!==n?n:[],Bd("render-image-events",[vd(e=>{var t;t=e.element,nr(t,"tox-image-selector-loading-spinner-wrapper"),Zo(t,r),Kn(e.element,"img").each(t=>{nn(t).catch(e=>{console.error(e)}).finally(()=>{(e=>{ar(e,"tox-image-selector-loading-spinner-wrapper"),Jo(r)})(e.element)})})})])])}},ID=e=>{const t=VC.os.isMacOS()||VC.os.isiOS(),o=t?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},n=e.split("+"),r=I(n,e=>{const t=e.toLowerCase().trim();return be(o,t)?o[t]:e});return t?r.join(""):r.join("+")},PD=(e,t,o=[EE])=>pE(e,{tag:"div",classes:o},t),FD=e=>({dom:{tag:"div",classes:[OE]},components:[op(aE.translate(e))]}),VD=(e,t)=>({dom:{tag:"div",classes:t,innerHtml:e}}),ZD=(e,t)=>({dom:{tag:"div",classes:[OE]},components:[{dom:{tag:e.tag,styles:e.styles},components:[op(aE.translate(t))]}]}),UD=e=>({dom:{tag:"div",classes:["tox-collection__item-accessory"]},components:[op(ID(e))]}),jD=e=>PD("checkmark",e,["tox-collection__item-checkmark"]),WD=(e,t,o)=>{const n=e.value,r=e.iconContent.map(e=>((e,t,o)=>{const n=t();return dE(e,n).or(o).getOrThunk(lE(n))})(e,t.icons,o)),a=e.ariaLabel.map(e=>({"aria-label":t.translate(e),"data-mce-name":e})).getOr({});return{dom:(()=>{const e=CE,t=r.getOr(""),o={tag:"div",attributes:a,classes:[e]};return"custom"===n?{...o,tag:"button",classes:[...o.classes,"tox-swatches__picker-btn"],innerHtml:t}:"remove"===n?{...o,classes:[...o.classes,"tox-swatch--remove"],innerHtml:t}:g(n)?{...o,attributes:{...o.attributes,"data-mce-color":n},styles:{"background-color":n},innerHtml:t}:o})(),optComponents:[]}},$D=(e,t)=>{const o=e.map(e=>({attributes:{id:Le("menu-item"),"aria-label":aE.translate(e)}})).getOr({});return{tag:"div",classes:[wE,_E].concat(t),...o}},qD=e=>({dom:{tag:"label"},components:[op(e)]}),GD=(e,t,o,n=A.none())=>"color"===e.presets?WD(e,t,n):"img"===e.presets?(e=>{var t,o;return{dom:$D(e.ariaLabel,["tox-collection__item-image-selector"]),optComponents:[A.some((t=e.iconContent.getOrDie(),o={tag:"div",classes:["tox-collection__item-image"],checkMark:e.checkMark},LD(o,t))),e.labelContent.map(qD)]}})(e):((e,t,o,n)=>{const r={tag:"div",classes:[EE]},a=o?e.iconContent.map(e=>pE(e,r,t.icons,n)).orThunk(()=>A.some({dom:r})):A.none(),s=e.checkMark,i=A.from(e.meta).fold(()=>FD,e=>be(e,"style")?C(ZD,e.style):FD),l=e.htmlContent.fold(()=>e.textContent.map(i),e=>A.some(VD(e,[OE])));return{dom:$D(e.ariaLabel,[]),optComponents:[a,l,e.shortcutContent.map(UD),s,e.caret,e.labelContent.map(qD)]}})(e,t,o,n),KD=(e,t,o)=>fe(e,"tooltipWorker").map(e=>[Qx.config({lazySink:t.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:e=>({type:"submenu",item:e,overrides:{maxHeightFunction:Wc}}),mode:"follow-highlight",onShow:(t,o)=>{e(e=>{Qx.setComponents(t,[np({element:it.fromDom(e)})])})}})]).getOrThunk(()=>o.map(e=>[Qx.config({...t.providers.tooltips.getConfig({tooltipText:e}),mode:"follow-highlight"})]).getOr([])),YD=(e,t)=>{const o=(e=>PC.DOM.encode(e))(aE.translate(e));if(t.length>0){const e=new RegExp((e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t),"gi");return o.replace(e,e=>`<span class="tox-autocompleter-highlight">${e}</span>`)}return o},XD=(e,t)=>I(e,e=>{switch(e.type){case"cardcontainer":return((e,t)=>{const o="vertical"===e.direction?"tox-collection__item-container--column":ME,n="left"===e.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right";return{dom:{tag:"div",classes:[DE,o,n,(()=>{switch(e.valign){case"top":return"tox-collection__item-container--valign-top";case"middle":return"tox-collection__item-container--valign-middle";case"bottom":return"tox-collection__item-container--valign-bottom"}})()]},components:t}})(e,XD(e.items,t));case"cardimage":return((e,t,o)=>({dom:{tag:"img",classes:t,attributes:{src:e,alt:o.getOr("")}}}))(e.src,e.classes,e.alt);case"cardtext":const o=e.name.exists(e=>B(t.cardText.highlightOn,e)),n=o?A.from(t.cardText.matchText).getOr(""):"";return VD(YD(e.text,n),e.classes)}}),JD=(e,t,o,n,r,a,s,i=!0)=>{const l=GD({presets:o,textContent:t?e.text:A.none(),htmlContent:A.none(),labelContent:e.label,ariaLabel:e.text,iconContent:e.icon,shortcutContent:t?e.shortcut:A.none(),checkMark:t?A.some(jD(s.icons)):A.none(),caret:A.none(),value:e.value},s,i),c=e.text.filter(y(!t)).map(e=>Qx.config(s.tooltips.getConfig({tooltipText:s.translate(e)})));return Pe(zD({context:e.context,data:HD(e),enabled:e.enabled,getApi:e=>({setActive:t=>{Vx.set(e,t)},isActive:()=>Vx.isOn(e),isEnabled:()=>!Mp.isDisabled(e),setEnabled:t=>Mp.set(e,!t)}),onAction:t=>n(e.value),onSetup:e=>(e.setActive(r),b),triggersSubmenu:!1,itemBehaviours:[...c.toArray()]},l,a,s),{toggling:{toggleClass:SE,toggleOnExecute:!1,selected:e.active,exclusive:!0}})},QD=e=>({value:nM(e)}),eM=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,tM=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,oM=e=>eM.test(e)||tM.test(e),nM=e=>Xe(e,"#").toUpperCase(),rM=e=>{const t=(e=>{const t=e.value.replace(eM,(e,t,o,n)=>t+t+o+o+n+n);return{value:t}})(e),o=tM.exec(t.value);return null===o?["FFFFFF","FF","FF","FF"]:o},aM=e=>{const t=e.toString(16);return(1===t.length?"0"+t:t).toUpperCase()},sM=e=>{const t=aM(e.red)+aM(e.green)+aM(e.blue);return QD(t)},iM=(e,t,o)=>({hue:e,saturation:t,value:o}),lM=e=>{let t=0,o=0,n=0;const r=e.red/255,a=e.green/255,s=e.blue/255,i=Math.min(r,Math.min(a,s)),l=Math.max(r,Math.max(a,s));if(i===l)return n=i,iM(0,0,100*n);return t=r===i?3:s===i?1:5,t=60*(t-(r===i?a-s:s===i?r-a:s-r)/(l-i)),o=(l-i)/l,n=l,iM(Math.round(t),Math.round(100*o),Math.round(100*n))},cM=Math.min,dM=Math.max,mM=Math.round,uM=/^\s*rgb\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*\)\s*$/i,gM=/^\s*rgba\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*((?:\d?\.\d+|\d+)%?)\s*\)\s*$/i,pM=(e,t,o,n)=>({red:e,green:t,blue:o,alpha:n}),hM=e=>{const t=parseInt(e,10);return t.toString()===e&&t>=0&&t<=255},fM=e=>{let t,o,n;const r=(e.hue||0)%360;let a=e.saturation/100,s=e.value/100;if(a=dM(0,cM(a,1)),s=dM(0,cM(s,1)),0===a)return t=o=n=mM(255*s),pM(t,o,n,1);const i=r/60,l=s*a,c=l*(1-Math.abs(i%2-1)),d=s-l;switch(Math.floor(i)){case 0:t=l,o=c,n=0;break;case 1:t=c,o=l,n=0;break;case 2:t=0,o=l,n=c;break;case 3:t=0,o=c,n=l;break;case 4:t=c,o=0,n=l;break;case 5:t=l,o=0,n=c;break;default:t=o=n=0}return t=mM(255*(t+d)),o=mM(255*(o+d)),n=mM(255*(n+d)),pM(t,o,n,1)},bM=e=>{const t=rM(e),o=parseInt(t[1],16),n=parseInt(t[2],16),r=parseInt(t[3],16);return pM(o,n,r,1)},xM=(e,t,o,n)=>{const r=parseInt(e,10),a=parseInt(t,10),s=parseInt(o,10),i=parseFloat(n);return pM(r,a,s,i)},vM=e=>{const t=uM.exec(e);if(null!==t)return A.some(xM(t[1],t[2],t[3],"1"));const o=gM.exec(e);return null!==o?A.some(xM(o[1],o[2],o[3],o[4])):A.none()},yM=e=>`rgba(${e.red},${e.green},${e.blue},${e.alpha})`,wM=pM(255,0,0,1),_M=e=>sM(fM(e)),CM=e=>{return(t=e,oM(t)?A.some({value:nM(t)}):A.none()).orThunk(()=>vM(e).map(sM)).getOrThunk(()=>{const t=document.createElement("canvas");t.height=1,t.width=1;const o=t.getContext("2d");o.clearRect(0,0,t.width,t.height),o.fillStyle="#FFFFFF",o.fillStyle=e,o.fillRect(0,0,1,1);const n=o.getImageData(0,0,1,1).data,r=n[0],a=n[1],s=n[2],i=n[3];return sM(pM(r,a,s,i))});var t},kM=(e,t)=>{e.dispatch("ResizeContent",t)},SM=(e,t)=>{e.dispatch("TextColorChange",t)},EM=(e,t)=>e.dispatch("ResolveName",{name:t.nodeName.toLowerCase(),target:t}),OM=e=>{e.dispatch("ContextToolbarClose")},TM=(e,t)=>()=>{e(),t()},AM=(e,t=T)=>MM(e,"NodeChange",o=>{o.setEnabled(e.selection.isEditable()&&t())}),DM=(e,t)=>o=>{const n=AM(e)(o),r=((e,t)=>o=>{const n=Ge(),r=()=>{o.setActive(e.formatter.match(t));const r=e.formatter.formatChanged(t,o.setActive);n.set(r)};return e.initialized?r():e.once("init",r),()=>{e.off("init",r),n.clear()}})(e,t)(o);return()=>{n(),r()}},MM=(e,t,o)=>n=>{const r=()=>o(n),a=()=>{o(n),e.on(t,r)};return e.initialized?a():e.once("init",a),()=>{e.off("init",a),e.off(t,r)}},RM=e=>t=>()=>{e.undoManager.transact(()=>{e.focus(),e.execCommand("mceToggleFormat",!1,t.format)})},NM=(e,t)=>()=>e.execCommand(t);var BM=tinymce.util.Tools.resolve("tinymce.util.LocalStorage");const zM={},HM=(e,t=10)=>{const o=BM.getItem(e),n=a(o)?JSON.parse(o):[],r=t-(s=n).length<0?s.slice(0,t):s;var s;const i=e=>{r.splice(e,1)};return{add:o=>{((e,t)=>{const o=N(e,t);return-1===o?A.none():A.some(o)})(r,o).each(i),r.unshift(o),r.length>t&&r.pop(),BM.setItem(e,JSON.stringify(r))},state:()=>r.slice(0)}},LM=e=>fe(zM,e).getOrThunk(()=>{const t=`tinymce-custom-colors-${e}`,o=BM.getItem(t);if(u(o)){const e=BM.getItem("tinymce-custom-colors");BM.setItem(t,g(e)?e:"[]")}const n=HM(t,10);return zM[e]=n,n}),IM=(e,t)=>{LM(e).add(t)},PM="forecolor",FM="hilitecolor",VM=e=>{const t=[];for(let o=0;o<e.length;o+=2)t.push({text:e[o+1],value:e[o],icon:"checkmark",type:"choiceitem"});return t},ZM=e=>t=>t.options.get(e),UM="#000000",jM=(e,t)=>t===PM&&e.options.isSet("color_map_foreground")?ZM("color_map_foreground")(e):t===FM&&e.options.isSet("color_map_background")?ZM("color_map_background")(e):e.options.isSet("color_map_raw")?ZM("color_map_raw")(e):ZM("color_map")(e),WM=(e,t="default")=>Math.max(5,Math.ceil(Math.sqrt(jM(e,t).length))),$M=(e,t)=>{const o=ZM("color_cols")(e),n=WM(e,t);return o===WM(e)?n:o},qM=(e,t="default")=>Math.round(t===PM?ZM("color_cols_foreground")(e):t===FM?ZM("color_cols_background")(e):ZM("color_cols")(e)),GM=ZM("custom_colors"),KM=ZM("color_default_foreground"),YM=ZM("color_default_background"),XM=e=>vr(e,e=>{if(to(e)){const t=pn(e,"background-color");return We((e=>vM(e).exists(e=>0!==e.alpha))(t),t)}return A.none()}).getOr("rgba(0, 0, 0, 0)"),JM=(e,t)=>{const o=it.fromDom(e.selection.getStart()),n="hilitecolor"===t?XM(o):pn(o,"color");return vM(n).map(e=>"#"+sM(e).value)},QM=e=>{const t="choiceitem",o={type:t,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return e?[o,{type:t,text:"Custom color",icon:"color-picker",value:"custom"}]:[o]},eR=(e,t,o,n)=>{if("custom"===o){cR(e)(o=>{o.each(o=>{IM(t,o),e.execCommand("mceApplyTextcolor",t,o),n(o)})},JM(e,t).getOr(UM))}else"remove"===o?(n(""),e.execCommand("mceRemoveTextcolor",t)):(n(o),e.execCommand("mceApplyTextcolor",t,o))},tR=(e,t,o)=>e.concat((e=>I(LM(e).state(),e=>({type:"choiceitem",text:e,icon:"checkmark",value:e})))(t).concat(QM(o))),oR=(e,t,o)=>n=>{n(tR(e,t,o))},nR=(e,t,o)=>{const n="forecolor"===t?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";e.setIconFill(n,o)},rR=(e,t)=>{e.setTooltip(t)},aR=(e,t)=>o=>{const n=JM(e,t);return Ve(n,o.toUpperCase())},sR=(e,t,o)=>{if(nt(o))return"forecolor"===t?"Text color":"Background color";const n="forecolor"===t?"Text color {0}":"Background color {0}",r=tR(jM(e,t),t,!1),a=j(r,e=>e.value===o).getOr({text:""}).text;return e.translate([n,e.translate(a)])},iR=(e,t,o,n)=>{e.ui.registry.addSplitButton(t,{tooltip:sR(e,o,n.get()),presets:"color",icon:"forecolor"===t?"text-color":"highlight-bg-color",select:aR(e,o),columns:qM(e,o),fetch:oR(jM(e,o),o,GM(e)),onAction:t=>{eR(e,o,n.get(),b)},onItemAction:(r,a)=>{eR(e,o,a,o=>{n.set(o),SM(e,{name:t,color:o})})},onSetup:r=>{nR(r,t,n.get());const a=n=>{n.name===t&&(nR(r,n.name,n.color),rR(r,sR(e,o,n.color)))};return e.on("TextColorChange",a),TM(AM(e)(r),()=>{e.off("TextColorChange",a)})}})},lR=(e,t,o,n,r)=>{e.ui.registry.addNestedMenuItem(t,{text:n,icon:"forecolor"===t?"text-color":"highlight-bg-color",onSetup:n=>(rR(n,sR(e,o,r.get())),nR(n,t,r.get()),AM(e)(n)),getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"colorswatch",select:aR(e,o),initData:{storageKey:o},onAction:n=>{eR(e,o,n.value,o=>{r.set(o),SM(e,{name:t,color:o})})}}]})},cR=e=>(t,o)=>{let n=!1;const r={colorpicker:o};e.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onAction:(e,t)=>{"hex-valid"===t.name&&(n=t.value)},onSubmit:o=>{const r=o.getData().colorpicker;n?(t(A.from(r)),o.close()):e.windowManager.alert(e.translate(["Invalid hex color code: {0}",r]))},onClose:b,onCancel:()=>{t(A.none())}})},dR=(e,t,o,n,r,a,s,i)=>{const l=JE(t),c=mR(t,o,n,"color"!==r?"normal":"color",a,s,i);return tO(e,l,c,n,{menuType:r})},mR=(e,t,o,n,r,a,s)=>Ze(I(e,i=>{return"choiceitem"===i.type?(l=i,Fa("choicemenuitem",KA,l)).fold(QE,i=>A.some(JD(i,1===o,n,t,a(i.value),r,s,JE(e)))):"imageitem"===i.type?(e=>Fa("imagemenuitem",tD,e))(i).fold(QE,e=>A.some(((e,t,o,n,r)=>{const a=GD({presets:"img",textContent:A.none(),htmlContent:A.none(),ariaLabel:e.tooltip,iconContent:A.some(e.url),labelContent:e.label,shortcutContent:A.none(),checkMark:A.some(jD(r.icons)),caret:A.none(),value:e.value},r,!0),s=e.tooltip.map(e=>Qx.config(r.tooltips.getConfig({tooltipText:r.translate(e)})));return Pe(zD({context:e.context,data:HD(e),enabled:e.enabled,getApi:e=>({setActive:t=>{Vx.set(e,t)},isActive:()=>Vx.isOn(e),isEnabled:()=>!Mp.isDisabled(e),setEnabled:t=>Mp.set(e,!t)}),onAction:o=>{t(e.value),o.setActive(!0)},onSetup:e=>(e.setActive(o),b),triggersSubmenu:!1,itemBehaviours:[...s.toArray()]},a,n,r),{toggling:{toggleClass:SE,toggleOnExecute:!1,selected:e.active,exclusive:!0}})})(e,t,a(e.value),r,s))):"resetimage"===i.type?(e=>Fa("resetimageitem",oD,e))(i).fold(QE,i=>A.some(JD({...i,type:"choiceitem",text:i.tooltip,icon:A.some(i.icon),label:A.some(i.label)},1===o,n,t,a(i.value),r,s,JE(e)))):A.none();var l})),uR=(e,t)=>{const o=zE(t);if(1===e)return{mode:"menu",moveOnTab:!0};if("auto"===e)return{mode:"grid",selector:"."+o.item,initSize:{numColumns:1,numRows:1}};return{mode:"matrix",rowSelector:"."+{color:"tox-swatches__row",imageselector:"tox-image-selector__row",listpreview:"tox-collection__group",normal:"tox-collection__group"}[t],previousSelector:e=>"color"===t?Kn(e.element,"[aria-checked=true]"):A.none()}},gR=(e,t)=>{const o=e.initData.allowCustomColors&&t.colorinput.hasCustomColors();return e.initData.colors.fold(()=>tR(t.colorinput.getColors(e.initData.storageKey),e.initData.storageKey,o),e=>e.concat(QM(o)))},pR=Le("cell-over"),hR=Le("cell-execute"),fR=(e,t,o)=>{const n=o=>nd(o,hR,{row:e,col:t}),r=(e,t)=>{t.stop(),n(e)};return sp({dom:{tag:"div",attributes:{role:"button","aria-label":o}},behaviours:Td([Bd("insert-table-picker-cell",[md(Bs(),Pd.focus),md(Js(),n),md(Vs(),r),md(ei(),r)]),Vx.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Pd.config({onFocus:o=>nd(o,pR,{row:e,col:t})})])})},bR=e=>q(e,e=>I(e,ip)),xR=(e,t)=>op(`${t}x${e}`),vR={inserttable:(e,t)=>{const o=(e=>(t,o)=>e.shared.providers.translate(["{0} columns, {1} rows",o,t]))(t),n=((e,t,o)=>{const n=[];for(let r=0;r<t;r++){const t=[];for(let n=0;n<o;n++){const o=e(r+1,n+1);t.push(fR(r,n,o))}n.push(t)}return n})(o,10,10),r=xR(0,0),a=ov({dom:{tag:"span",classes:["tox-insert-table-picker__label"]},components:[r],behaviours:Td([kg.config({})])});return{type:"widget",data:{value:Le("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[Xy.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:bR(n).concat(a.asSpec()),behaviours:Td([Bd("insert-table-picker",[vd(e=>{kg.set(a.get(e),[r])}),hd(pR,(e,t,o)=>{const{row:r,col:s}=o.event;((e,t,o,n,r)=>{for(let a=0;a<n;a++)for(let n=0;n<r;n++)Vx.set(e[a][n],a<=t&&n<=o)})(n,r,s,10,10),kg.set(a.get(e),[xR(r+1,s+1)])}),hd(hR,(t,o,n)=>{const{row:r,col:a}=n.event;od(t,oi()),e.onAction({numRows:r+1,numColumns:a+1})})]),Wu.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:(e,t)=>{const o=gR(e,t),n=t.colorinput.getColorCols(e.initData.storageKey),r="color",a=dR(Le("menu-value"),o,t=>{e.onAction({value:t})},n,r,yE.CLOSE_ON_EXECUTE,e.select.getOr(O),t.shared.providers),s={...a,markers:zE(r),movement:uR(n,r),showMenuRole:!1};return{type:"widget",data:{value:Le("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[Xy.widget(Gv.sketch(s))]}},imageselect:(e,t)=>{const o="imageselector",n=e.initData.columns,r=dR(Le("menu-value"),e.initData.items,t=>{e.onAction({value:t})},n,o,yE.CLOSE_ON_EXECUTE,e.select.getOr(O),t.shared.providers),a={...r,markers:zE(o),movement:uR(n,o),showMenuRole:!1};return{type:"widget",data:{value:Le("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem","tox-collection--toolbar"]},autofocus:!0,components:[Xy.widget(Gv.sketch(a))]}}},yR=(e,t,o,n,r,a,s,i=!0)=>{const l=GD({presets:n,textContent:A.none(),htmlContent:o?e.text.map(e=>YD(e,t)):A.none(),ariaLabel:e.text,labelContent:A.none(),iconContent:e.icon,shortcutContent:A.none(),checkMark:A.none(),caret:A.none(),value:e.value},s.providers,i,e.icon),c=e.text.filter(e=>!o&&""!==e);return zD({context:"mode:design",data:HD(e),enabled:e.enabled,getApi:y({}),onAction:t=>r(e.value,e.meta),onSetup:y(b),triggersSubmenu:!1,itemBehaviours:KD(e,s,c)},l,a,s.providers)},wR=e=>({type:"separator",dom:{tag:"div",classes:[_E,"tox-collection__group-heading"]},components:e.text.map(op).toArray()}),_R=(e,t,o,n=!0)=>{const r=GD({presets:"normal",iconContent:e.icon,textContent:e.text,htmlContent:A.none(),labelContent:A.none(),ariaLabel:e.text,caret:A.none(),checkMark:A.none(),shortcutContent:e.shortcut},o,n);return zD({context:e.context,data:HD(e),getApi:e=>({isEnabled:()=>!Mp.isDisabled(e),setEnabled:t=>Mp.set(e,!t)}),enabled:e.enabled,onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,t,o)},CR=(e,t,o,n=!0,r=!1)=>{const a=r?(s=o.icons,PD("chevron-down",s,[TE])):(e=>PD("chevron-right",e,[TE]))(o.icons);var s;const i=GD({presets:"normal",iconContent:e.icon,textContent:e.text,htmlContent:A.none(),ariaLabel:e.text,labelContent:A.none(),caret:A.some(a),checkMark:A.none(),shortcutContent:e.shortcut},o,n);return zD({context:e.context,data:HD(e),getApi:e=>({isEnabled:()=>!Mp.isDisabled(e),setEnabled:t=>Mp.set(e,!t),setIconFill:(t,o)=>{Kn(e.element,`svg path[class="${t}"], rect[class="${t}"]`).each(e=>{Wo(e,"fill",o)})},setTooltip:t=>{const n=o.translate(t);Wo(e.element,"aria-label",n)}}),enabled:e.enabled,onAction:b,onSetup:e.onSetup,triggersSubmenu:!0,itemBehaviours:[]},i,t,o)},kR=(e,t,o,n=!0)=>{const r=GD({iconContent:e.icon,textContent:e.text,htmlContent:A.none(),labelContent:A.none(),ariaLabel:e.text,checkMark:A.some(jD(o.icons)),caret:A.none(),shortcutContent:e.shortcut,presets:"normal",meta:e.meta},o,n);return Pe(zD({context:e.context,data:HD(e),enabled:e.enabled,getApi:e=>({setActive:t=>{Vx.set(e,t)},isActive:()=>Vx.isOn(e),isEnabled:()=>!Mp.isDisabled(e),setEnabled:t=>Mp.set(e,!t)}),onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,t,o),{toggling:{toggleClass:SE,toggleOnExecute:!1,selected:e.active},role:e.role.getOrUndefined()})},SR=(e,t)=>fe(vR,e.fancytype).map(o=>o(e,t)),ER=(e,t,o,n)=>{const r={dom:$D(e.label,[]),optComponents:[A.some({dom:{tag:"div",classes:[DE,ME]},components:XD(e.items,n)})]};return zD({context:"mode:design",data:HD({text:A.none(),...e}),enabled:e.enabled,getApi:e=>({isEnabled:()=>!Mp.isDisabled(e),setEnabled:t=>{Mp.set(e,!t),P(pr(e.element,"*"),o=>{e.getSystem().getByDom(o).each(e=>{e.hasConfigured(Mp)&&Mp.set(e,!t)})})}}),onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:!1,itemBehaviours:A.from(n.itemBehaviours).getOr([])},r,t,o.providers)},OR=e=>{const t=Bf.getValue(e),o=ZE(e).map(jE);wy.refetch(t).get(()=>{const e=bp.getCoupled(t,"sandbox");o.each(t=>ZE(e).each(e=>((e,t)=>{Bf.setValue(e,t.fetchPattern),e.element.dom.selectionStart=t.selectionStart,e.element.dom.selectionEnd=t.selectionEnd})(e,t)))})},TR=e=>cx.getState(e).bind(hm.getHighlighted).bind(hm.getHighlighted),AR=(e,t,o)=>{UE(e).each(e=>{((e,t)=>{Go(t.element,"id").each(t=>Wo(e.element,"aria-activedescendant",t))})(e,o);var n;(ir((n=t).element,$E)?A.some(n.element):Kn(n.element,"."+$E)).each(t=>{Go(t,"id").each(t=>Wo(e.element,"aria-controls",t))})}),Wo(o.element,"aria-selected","true")},DR=(e,t,o)=>{Wo(o.element,"aria-selected","false")},MR=e=>bp.getExistingCoupled(e,"sandbox").bind(ZE).map(jE).map(e=>e.fetchPattern).getOr("");var RR;!function(e){e[e.ContentFocus=0]="ContentFocus",e[e.UiFocus=1]="UiFocus"}(RR||(RR={}));const NR=(e,t,o,n,r)=>{const a=o.shared.providers,s=e=>r?{...e,shortcut:A.none(),icon:e.text.isSome()?A.none():e.icon}:e;switch(e.type){case"menuitem":return(i=e,Fa("menuitem",nD,i)).fold(QE,e=>A.some(_R(s(e),t,a,n)));case"nestedmenuitem":return(e=>Fa("nestedmenuitem",rD,e))(e).fold(QE,e=>A.some(CR(s(e),t,a,n,r)));case"togglemenuitem":return(e=>Fa("togglemenuitem",aD,e))(e).fold(QE,e=>A.some(kR(s(e),t,a,n)));case"separator":return(e=>Fa("separatormenuitem",wA,e))(e).fold(QE,e=>A.some(wR(e)));case"fancymenuitem":return(e=>Fa("fancymenuitem",eD,e))(e).fold(QE,e=>SR(e,o));default:return console.error("Unknown item in general menu",e),A.none()}var i},BR=(e,t,o,n,r,a,s)=>{const i=1===n,l=!i||JE(e);return Ze(I(e,e=>{switch(e.type){case"separator":return(n=e,Fa("Autocompleter.Separator",wA,n)).fold(QE,e=>A.some(wR(e)));case"cardmenuitem":return(e=>Fa("cardmenuitem",GA,e))(e).fold(QE,e=>A.some(ER({...e,onAction:t=>{e.onAction(t),o(e.value,e.meta)}},r,a,{itemBehaviours:KD(e.meta,a,A.none()),cardText:{matchText:t,highlightOn:s}})));default:return(e=>Fa("Autocompleter.Item",_A,e))(e).fold(QE,e=>A.some(yR(e,t,i,"normal",o,r,a,l)))}var n}))},zR=(e,t,o,n,r,a)=>{const s=JE(t),i=Ze(I(t,e=>{const t=e=>NR(e,o,n,(e=>r?!be(e,"text"):s)(e),r);return"nestedmenuitem"===e.type&&e.getSubmenuItems().length<=0?t({...e,enabled:!1}):t(e)})),l=(e=>"no-search"===e.searchMode?{menuType:"normal"}:{menuType:"searchable",searchMode:e})(a);return(r?eO:tO)(e,s,i,1,l)},HR=e=>oy.singleData(e.value,e),LR=e=>yr(it.fromDom(e.startContainer),e.startOffset,it.fromDom(e.endContainer),e.endOffset),IR=(e,t)=>{const o=Le("autocompleter"),n=ye(!1),r=ye(!1),a=Ke(),s=sp(Wy.sketch({dom:{tag:"div",classes:["tox-autocompleter"],attributes:{id:o}},components:[],fireDismissalEventInstead:{},inlineBehaviours:Td([Bd("dismissAutocompleter",[md(mi(),()=>m()),md(xi(),(t,o)=>{Go(o.event.target,"id").each(t=>Wo(it.fromDom(e.getBody()),"aria-activedescendant",t))})])]),lazySink:t.getSink})),i=()=>Wy.isOpen(s),l=r.get,c=()=>{if(i()){Wy.hide(s),e.dom.remove(o,!1);const t=it.fromDom(e.getBody());Go(t,"aria-owns").filter(e=>e===o).each(()=>{Yo(t,"aria-owns"),Yo(t,"aria-activedescendant")})}},d=()=>Wy.getContent(s).bind(e=>ee(e.components(),0)),m=()=>e.execCommand("mceAutocompleterClose"),u=(t,o)=>{const n=re(t,e=>A.from(e.columns)).getOr(1);Wy.showMenuAt(s,{anchor:{type:"selection",getSelection:()=>a.get().map(LR),root:it.fromDom(e.getBody())}},((e,t,o,n)=>{const r=uR(t,n),a=zE(n);return{data:HR({...e,movement:r,menuBehaviours:fD("auto"!==t?[]:[vd((e,t)=>{pD(e,4,a.item).each(({numColumns:t,numRows:o})=>{Wu.setGridSize(e,o,t)})})])}),menu:{markers:zE(n),fakeFocus:o===RR.ContentFocus}}})(tO("autocompleter-value",!0,o,n,{menuType:"normal"}),n,RR.ContentFocus,"normal")),d().each(hm.highlightFirst)},g=r=>{const s=(o=>{const r=re(o,e=>A.from(e.columns)).getOr(1);return q(o,o=>{const s=o.items;return BR(s,o.matchText,(t,r)=>{const s={hide:()=>m(),reload:t=>{c(),e.execCommand("mceAutocompleterReload",!1,{fetchOptions:t})}};e.execCommand("mceAutocompleterRefreshActiveRange"),a.get().each(e=>{n.set(!0),o.onAction(s,e,t,r),n.set(!1)})},r,yE.BUBBLE_TO_SANDBOX,t,o.highlightOn)})})(r);s.length>0?(u(r,s),Wo(it.fromDom(e.getBody()),"aria-owns",o),e.inline||p()):c()},p=()=>{e.dom.get(o)&&e.dom.remove(o,!1);const t=e.getDoc().documentElement,n=e.selection.getNode(),r=(e=>Qo(e,!0))(s.element);un(r,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",top:`${n.offsetTop}px`,left:`${n.offsetLeft}px`}),e.dom.add(t,r.dom),Kn(r,'[role="menu"]').each(e=>{vn(e,"position"),vn(e,"max-height")})};e.on("AutocompleterStart",({lookupData:e})=>{r.set(!0),n.set(!1),g(e)}),e.on("AutocompleterUpdate",({lookupData:e})=>g(e)),e.on("AutocompleterUpdateActiveRange",({range:e})=>a.set(e)),e.on("AutocompleterEnd",()=>{c(),r.set(!1),n.set(!1),a.clear()});const h={cancelIfNecessary:m,isMenuOpen:i,isActive:l,isProcessingAction:n.get,getMenu:d};xE(h,e)};var PR=tinymce.util.Tools.resolve("tinymce.html.Entities");const FR=(e,t,o,n)=>{const r=VR(e,t,o,n);return Py.sketch(r)},VR=(e,t,o,n)=>({dom:ZR(o),components:e.toArray().concat([t]),fieldBehaviours:Td(n)}),ZR=e=>({tag:"div",classes:["tox-form__group"].concat(e)}),UR=(e,t)=>Py.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[op(t.translate(e))]}),jR=Le("form-component-change"),WR=Le("form-component-input"),$R=Le("form-close"),qR=Le("form-cancel"),GR=Le("form-action"),KR=Le("form-submit"),YR=Le("form-block"),XR=Le("form-unblock"),JR=Le("form-tabchange"),QR=Le("form-resize"),eN=(e,t,o)=>{const n=e.label.map(e=>UR(e,t)),r=t.icons(),a=e=>(t,o)=>{Yn(o.event.target,"[data-collection-item-value]").each(n=>{e(t,o,n,qo(n,"data-collection-item-value"))})},s=(o,n)=>{const a=t.checkUiComponentContext("mode:design").shouldDisable||t.isDisabled()?" tox-collection__item--state-disabled":"",s=I(n,t=>{const o=aE.translate(t.text),n=1===e.columns?`<div class="tox-collection__item-label">${o}</div>`:"",s=`<div class="tox-collection__item-icon">${(e=>{var t;return null!==(t=r[e])&&void 0!==t?t:e})(t.icon)}</div>`,i={_:" "," - ":" ","-":" "},l=o.replace(/\_| \- |\-/g,e=>i[e]);return`<div data-mce-tooltip="${l}" class="tox-collection__item${a}" tabindex="-1" data-collection-item-value="${PR.encodeAllRaw(t.value)}" aria-label="${l}">${s}${n}</div>`}),i="auto"!==e.columns&&e.columns>1?L(s,e.columns):[s],l=I(i,e=>`<div class="tox-collection__group">${e.join("")}</div>`);tn(o.element,l.join(""))},i=a((o,n,r,a)=>{n.stop(),t.checkUiComponentContext("mode:design").shouldDisable||t.isDisabled()||nd(o,GR,{name:e.name,value:a})}),l=[md(Bs(),a((e,t,o)=>{Bo(o,!0)})),md(Vs(),i),md(ei(),i),md(zs(),a((e,t,o)=>{Kn(e.element,"."+AE).each(e=>{ar(e,AE)}),nr(o,AE)})),md(Hs(),a(e=>{Kn(e.element,"."+AE).each(e=>{ar(e,AE),zo(e)})})),_d(a((t,o,n,r)=>{nd(t,GR,{name:e.name,value:r})}))],c=(e,t)=>I(pr(e.element,".tox-collection__item"),t),d=Py.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==e.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:w},behaviours:Td([Mp.config({disabled:()=>t.checkUiComponentContext(e.context).shouldDisable,onDisabled:e=>{c(e,e=>{nr(e,"tox-collection__item--state-disabled"),Wo(e,"aria-disabled",!0)})},onEnabled:e=>{c(e,e=>{ar(e,"tox-collection__item--state-disabled"),Yo(e,"aria-disabled")})}}),MD(()=>t.checkUiComponentContext(e.context)),kg.config({}),Qx.config({...t.tooltips.getConfig({tooltipText:"",onShow:e=>{Kn(e.element,"."+AE+"[data-mce-tooltip]").each(o=>{Go(o,"data-mce-tooltip").each(o=>{Qx.setComponents(e,t.tooltips.getComponents({tooltipText:o}))})})}}),mode:"children-keyboard-focus",anchor:e=>({type:"node",node:Kn(e.element,"."+AE).orThunk(()=>bt(".tox-collection__item")),root:e.element,layouts:{onLtr:y([gc,uc,lc,dc,cc,mc]),onRtl:y([gc,uc,lc,dc,cc,mc])},bubble:Zl(0,-2,{})})}),Bf.config({store:{mode:"memory",initialValue:o.getOr([])},onSetValue:(t,o)=>{s(t,o),"auto"===e.columns&&pD(t,5,"tox-collection__item").each(({numRows:e,numColumns:o})=>{Wu.setGridSize(t,e,o)}),od(t,QR)}}),Nx.config({}),Wu.config((m=e.columns,u="normal",1===m?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===m?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===u?".tox-swatches__row":".tox-collection__group",cell:"color"===u?`.${CE}`:`.${_E}`}})),Bd("collection-events",l)]),eventOrder:{[Js()]:["disabling","alloy.base.behaviour","collection-events"],[zs()]:["collection-events","tooltipping"]}});var m,u;return FR(n,d,["tox-form__group--collection"],[])},tN=Le("color-input-change"),oN=Le("color-swatch-change"),nN=Le("color-picker-cancel"),rN=(e,t,o,n)=>{const r=Py.parts.field({factory:Yy,inputClasses:["tox-textfield"],data:n,onSetValue:e=>zf.run(e).get(b),inputBehaviours:Td([Mp.config({disabled:()=>t.providers.isDisabled()||t.providers.checkUiComponentContext(e.context).shouldDisable}),MD(()=>t.providers.checkUiComponentContext(e.context)),Nx.config({}),zf.config({invalidClass:"tox-textbox-field-invalid",getRoot:e=>uo(e.element),notify:{onValid:e=>{const t=Bf.getValue(e);nd(e,tN,{color:t})}},validator:{validateOnLoad:!1,validate:e=>{const t=Bf.getValue(e);if(0===t.length)return Ee(Ae.value(!0));{const e=it.fromTag("span");mn(e,"background-color",t);const o=fn(e,"background-color").fold(()=>Ae.error("blah"),e=>Ae.value(t));return Ee(o)}}}})]),selectOnFocus:!1}),a=e.label.map(e=>UR(e,t.providers)),s=(e,t)=>{nd(e,oN,{value:t})},i=ov(((e,t)=>wy.sketch({dom:e.dom,components:e.components,toggleClass:"mce-active",dropdownBehaviours:Td([xD(()=>t.providers.isDisabled()||t.providers.checkUiComponentContext(e.context).shouldDisable),MD(()=>t.providers.checkUiComponentContext(e.context)),ev.config({}),Nx.config({})]),layouts:e.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:t.getSink,fetch:o=>Se(t=>e.fetch(t)).map(n=>A.from(HR(Pe(dR(Le("menu-value"),n,t=>{e.onItemAction(o,t)},e.columns,e.presets,yE.CLOSE_ON_EXECUTE,O,t.providers),{movement:uR(e.columns,e.presets)})))),parts:{menu:IE(0,0,e.presets)}}))({dom:{tag:"span",attributes:{"aria-label":t.providers.translate("Color swatch")}},layouts:{onRtl:()=>[cc,lc,gc],onLtr:()=>[lc,cc,gc]},components:[],fetch:oR(o.getColors(e.storageKey),e.storageKey,o.hasCustomColors()),columns:o.getColorCols(e.storageKey),presets:"color",onItemAction:(t,n)=>{i.getOpt(t).each(t=>{"custom"===n?o.colorPicker(o=>{o.fold(()=>od(t,nN),o=>{s(t,o),IM(e.storageKey,o)})},"#ffffff"):s(t,"remove"===n?"":n)})},context:e.context},t));return Py.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:a.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,i.asSpec()]}]),fieldBehaviours:Td([Bd("form-field-events",[md(tN,(t,o)=>{i.getOpt(t).each(e=>{mn(e.element,"background-color",o.event.color)}),nd(t,jR,{name:e.name})}),md(oN,(e,t)=>{Py.getField(e).each(o=>{Bf.setValue(o,t.event.value),gp.getCurrent(e).each(Pd.focus)})}),md(nN,(e,t)=>{Py.getField(e).each(t=>{gp.getCurrent(e).each(Pd.focus)})})])])})},aN=()=>gp.config({find:A.some}),sN=e=>gp.config({find:e.getOpt}),iN=e=>gp.config({find:t=>ho(t.element,e).bind(e=>t.getSystem().getByDom(e).toOptional())}),lN=Ma([us("preprocess",w),us("postprocess",w)]),cN=(e,t)=>{const o=Za("RepresentingConfigs.memento processors",lN,t);return Bf.config({store:{mode:"manual",getValue:t=>{const n=e.get(t),r=Bf.getValue(n);return o.postprocess(r)},setValue:(t,n)=>{const r=o.preprocess(n),a=e.get(t);Bf.setValue(a,r)}}})},dN=(e,t,o)=>Bf.config({store:{mode:"manual",...e.map(e=>({initialValue:e})).getOr({}),getValue:t,setValue:o}}),mN=(e,t,o)=>dN(e,e=>t(e.element),(e,t)=>o(e.element,t)),uN=e=>Bf.config({store:{mode:"memory",initialValue:e}}),gN=Le("rgb-hex-update"),pN=Le("slider-update"),hN=Le("palette-update"),fN=Le("valid-input"),bN=Le("invalid-input"),xN=Le("validating-input"),vN="colorcustom.rgb.",yN={isEnabled:T,setEnabled:b,immediatelyShow:b,immediatelyHide:b},wN=(e,t,o,n,r,a)=>{const s=(e,t)=>{const o=t.get();e!==o.isEnabled()&&(o.setEnabled(e),e?o.immediatelyShow():o.immediatelyHide())},i=(o,n,r)=>zf.config({invalidClass:t("invalid"),notify:{onValidate:e=>{nd(e,xN,{type:o})},onValid:e=>{s(!1,r),nd(e,fN,{type:o,value:Bf.getValue(e)})},onInvalid:e=>{s(!0,r),nd(e,bN,{type:o,value:Bf.getValue(e)})}},validator:{validate:t=>{const o=Bf.getValue(t),r=n(o)?Ae.value(!0):Ae.error(e("aria.input.invalid"));return Ee(r)},validateOnLoad:!1}}),l=(o,n,s,l,c)=>{const d=ye(yN),m=e(vN+"range"),u=Py.parts.label({dom:{tag:"label"},components:[op(s)]}),g=Py.parts.field({data:c,factory:Yy,inputAttributes:{type:"text","aria-label":l,..."hex"===n?{"aria-live":"polite"}:{}},inputClasses:[t("textfield")],inputBehaviours:Td([i(n,o,d),Nx.config({}),Qx.config({...r({tooltipText:"",onSetup:e=>{d.set({isEnabled:()=>Qx.isEnabled(e),setEnabled:t=>Qx.setEnabled(e,t),immediatelyShow:()=>Qx.immediateOpenClose(e,!0),immediatelyHide:()=>Qx.immediateOpenClose(e,!1)}),Qx.setEnabled(e,!1)},onShow:(o,r)=>{Qx.setComponents(o,[{dom:{tag:"p",classes:[t("rgb-warning-note")]},components:[op(e("hex"===n?"colorcustom.rgb.invalidHex":"colorcustom.rgb.invalid"))]}])}})})]),onSetValue:e=>{if(zf.isInvalid(e)){zf.run(e).get(b)}}}),p=Le("aria-invalid"),h=ov(a("invalid",A.some(p),"warning")),f=[u,g,ov({dom:{tag:"div",classes:[t("invalid-icon")]},components:[h.asSpec()]}).asSpec()],x="hex"!==n?[Py.parts["aria-descriptor"]({text:m})]:[],v=f.concat(x);return{dom:{tag:"div",attributes:{role:"presentation"},classes:[t("rgb-container")]},components:v}},c=(e,t)=>{const o=t.red,n=t.green,r=t.blue;Bf.setValue(e,{red:o,green:n,blue:r})},d=ov({dom:{tag:"div",classes:[t("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),m=(e,t)=>{d.getOpt(e).each(e=>{mn(e.element,"background-color","#"+t.value)})},u=Fh({factory:()=>{const r={red:ye(A.some(255)),green:ye(A.some(255)),blue:ye(A.some(255)),hex:ye(A.some("ffffff"))},a=e=>r[e].get(),s=(e,t)=>{r[e].set(t)},i=e=>{const t=e.red,o=e.green,n=e.blue;s("red",A.some(t)),s("green",A.some(o)),s("blue",A.some(n))},u=(e,t)=>{const o=t.event;"hex"!==o.type?s(o.type,A.none()):n(e)},g=(e,t,o)=>{const n=parseInt(o,10);s(t,A.some(n)),a("red").bind(e=>a("green").bind(t=>a("blue").map(o=>pM(e,t,o,1)))).each(t=>{const o=((e,t)=>{const o=sM(t);return Ey.getField(e,"hex").each(t=>{Pd.isFocused(t)||Bf.setValue(e,{hex:o.value})}),o})(e,t);nd(e,gN,{hex:o}),m(e,o)})},p=(e,t)=>{const n=t.event;(e=>"hex"===e.type)(n)?((e,t)=>{o(e);const n=QD(t);s("hex",A.some(n.value));const r=bM(n);c(e,r),i(r),nd(e,gN,{hex:n}),m(e,n)})(e,n.value):g(e,n.type,n.value)},h=t=>({label:e(vN+t+".label"),description:e(vN+t+".description")}),f=h("red"),b=h("green"),x=h("blue"),v=h("hex");return Pe(Ey.sketch(o=>({dom:{tag:"form",classes:[t("rgb-form")],attributes:{"aria-label":e("aria.color.picker")}},components:[o.field("red",Py.sketch(l(hM,"red",f.label,f.description,255))),o.field("green",Py.sketch(l(hM,"green",b.label,b.description,255))),o.field("blue",Py.sketch(l(hM,"blue",x.label,x.description,255))),o.field("hex",Py.sketch(l(oM,"hex",v.label,v.description,"ffffff"))),d.asSpec()],formBehaviours:Td([zf.config({invalidClass:t("form-invalid")}),Bd("rgb-form-events",[md(fN,p),md(bN,u),md(xN,u)])])})),{apis:{updateHex:(e,t)=>{Bf.setValue(e,{hex:t.value}),((e,t)=>{const o=bM(t);c(e,o),i(o)})(e,t),m(e,t)}}})},name:"RgbForm",configFields:[],apis:{updateHex:(e,t,o)=>{e.updateHex(t,o)}},extraApis:{}});return u},_N=(e,t)=>{const o=I_.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[t("sv-palette-spectrum")]}}),n=I_.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[t("sv-palette-thumb")],innerHtml:`<div class=${t("sv-palette-inner-thumb")} role="presentation"></div>`}}),r=(e,t)=>{const{width:o,height:n}=e,r=e.getContext("2d");if(null===r)return;r.fillStyle=t,r.fillRect(0,0,o,n);const a=r.createLinearGradient(0,0,o,0);a.addColorStop(0,"rgba(255,255,255,1)"),a.addColorStop(1,"rgba(255,255,255,0)"),r.fillStyle=a,r.fillRect(0,0,o,n);const s=r.createLinearGradient(0,0,0,n);s.addColorStop(0,"rgba(0,0,0,0)"),s.addColorStop(1,"rgba(0,0,0,1)"),r.fillStyle=s,r.fillRect(0,0,o,n)},a=Fh({factory:a=>{const s=y({x:0,y:0}),i=Td([gp.config({find:A.some}),Pd.config({})]);return I_.sketch({dom:{tag:"div",attributes:{role:"slider","aria-valuetext":e(["Saturation {0}%, Brightness {1}%",0,0])},classes:[t("sv-palette")]},model:{mode:"xy",getInitialValue:s},rounded:!1,components:[o,n],onChange:(t,o,n)=>{h(n)||Wo(t.element,"aria-valuetext",e(["Saturation {0}%, Brightness {1}%",Math.floor(n.x),Math.floor(100-n.y)])),nd(t,hN,{value:n})},onInit:(e,t,o,n)=>{r(o.element.dom,yM(wM))},sliderBehaviours:i})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:(e,t,o)=>{((e,t)=>{const o=e.components()[0].element.dom,n=iM(t,100,100),a=fM(n);r(o,yM(a))})(t,o)},setThumb:(t,o,n)=>{((t,o)=>{const n=lM(bM(o));I_.setValue(t,{x:n.saturation,y:100-n.value}),Wo(t.element,"aria-valuetext",e(["Saturation {0}%, Brightness {1}%",n.saturation,n.value]))})(o,n)}},extraApis:{}});return a},CN=(e,t,o,n)=>{const r=Fh({name:"ColourPicker",configFields:[Ka("dom"),us("onValidHex",b),us("onInvalidHex",b)],factory:r=>{const a=wN(e,t,r.onValidHex,r.onInvalidHex,o,n),s=_N(e,t),i={paletteRgba:ye(wM),paletteHue:ye(0)},l=ov(((e,t)=>{const o=I_.parts.spectrum({dom:{tag:"div",classes:[t("hue-slider-spectrum")],attributes:{role:"presentation"}}}),n=I_.parts.thumb({dom:{tag:"div",classes:[t("hue-slider-thumb")],attributes:{role:"presentation"}}});return I_.sketch({dom:{tag:"div",classes:[t("hue-slider")],attributes:{role:"slider","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":120}},rounded:!1,model:{mode:"y",getInitialValue:y(0)},components:[o,n],sliderBehaviours:Td([Pd.config({})]),onChange:(e,t,o)=>{Wo(e.element,"aria-valuenow",Math.floor(360-3.6*o)),nd(e,pN,{value:o})}})})(0,t)),c=ov(s.sketch({})),d=ov(a.sketch({})),m=(e,t,o)=>{c.getOpt(e).each(e=>{s.setHue(e,o)})},u=(e,t)=>{d.getOpt(e).each(e=>{a.updateHex(e,t)})},g=(e,t,o)=>{l.getOpt(e).each(e=>{I_.setValue(e,(e=>100-e/360*100)(o))})},p=(e,t)=>{c.getOpt(e).each(e=>{s.setThumb(e,t)})},h=(e,t,o,n)=>{((e,t)=>{const o=bM(e);i.paletteRgba.set(o),i.paletteHue.set(t)})(t,o),P(n,n=>{n(e,t,o)})};return{uid:r.uid,dom:r.dom,components:[c.asSpec(),l.asSpec(),d.asSpec()],behaviours:Td([Bd("colour-picker-events",[md(gN,(()=>{const e=[m,g,p];return(t,o)=>{const n=o.event.hex,r=(e=>lM(bM(e)))(n);h(t,n,r.hue,e)}})()),md(hN,(()=>{const e=[u];return(t,o)=>{const n=o.event.value,r=i.paletteHue.get(),a=iM(r,n.x,100-n.y),s=_M(a);h(t,s,r,e)}})()),md(pN,(()=>{const e=[m,u];return(t,o)=>{const n=(e=>(100-e)/100*360)(o.event.value),r=i.paletteRgba.get(),a=lM(r),s=iM(n,a.saturation,a.value),l=_M(s);h(t,l,n,e)}})())]),gp.config({find:e=>d.getOpt(e)}),Wu.config({mode:"acyclic"})])}}});return r},kN={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red channel","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green channel","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue channel","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","colorcustom.rgb.invalid":"Numbers only, 0 to 255","colorcustom.rgb.invalidHex":"Hexadecimal only, 000000 to FFFFFF","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},SN=(e,t,o)=>{const n=e=>"tox-"+e,r=CN((e=>t=>a(t)?e.translate(kN[t]):e.translate(t))(t),n,t.tooltips.getConfig,(e,o,n=e,r=e)=>pE(n,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+e],attributes:{title:t.translate(r),"aria-live":"polite",...o.fold(()=>({}),e=>({id:e}))}},t.icons)),s=ov(r.sketch({dom:{tag:"div",classes:[n("color-picker-container")],attributes:{role:"presentation"}},onValidHex:e=>{nd(e,GR,{name:"hex-valid",value:!0})},onInvalidHex:e=>{nd(e,GR,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[s.asSpec()],behaviours:Td([dN(o,e=>{const t=s.get(e);return gp.getCurrent(t).bind(e=>Bf.getValue(e).hex).map(e=>"#"+Xe(e,"#")).getOr("")},(e,t)=>{const o=A.from(/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(t)).bind(e=>ee(e,1)),n=s.get(e);gp.getCurrent(n).fold(()=>{console.log("Can not find form")},e=>{Bf.setValue(e,{hex:o.getOr("")}),Ey.getField(e,"hex").each(e=>{od(e,Ps())})})}),aN()])}};var EN=tinymce.util.Tools.resolve("tinymce.Resource");const ON=e=>be(e,"init");var TN=tinymce.util.Tools.resolve("tinymce.util.Tools");const AN=Le("browse.files.event"),DN=(e,t,o)=>{const n=(e,t)=>{t.stop()},r=e=>(t,o)=>{P(e,e=>{e(t,o)})},a=(o,n)=>{n&&(Bf.setValue(o,((e,t)=>{const o=TN.explode(t.getOption("images_file_types"));return V(ne(e),e=>z(o,t=>et(e.name.toLowerCase(),`.${t.toLowerCase()}`)))})(n,t)),nd(o,jR,{name:e.name}))},s=ov({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:Td([Bd("input-file-events",[fd(Vs()),fd(ei())])])}),i=e.label.map(e=>UR(e,t)),l=Py.parts.field({factory:yv,dom:{tag:"button",styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[op(t.translate("Browse for an image")),s.asSpec()],action:e=>{s.get(e).element.dom.click()},buttonBehaviours:Td([aN(),uN(o.getOr([])),Nx.config({}),xD(()=>t.checkUiComponentContext(e.context).shouldDisable),MD(()=>t.checkUiComponentContext(e.context))])}),c={dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:Td([Mp.config({disabled:()=>t.checkUiComponentContext(e.context).shouldDisable}),MD(()=>t.checkUiComponentContext(e.context)),Vx.config({toggleClass:"dragenter",toggleOnExecute:!1}),Bd("dropzone-events",[md("dragenter",r([n,Vx.toggle])),md("dragleave",r([n,Vx.toggle])),md("dragover",n),md("drop",r([n,(e,t)=>{var o;if(!Mp.isDisabled(e)){const n=t.event.raw;nd(e,AN,{files:null===(o=n.dataTransfer)||void 0===o?void 0:o.files})}}])),md(Fs(),(e,t)=>{const o=t.event.raw.target;nd(e,AN,{files:o.files})})])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p"},components:[op(t.translate("Drop an image here"))]},l]}]};return FR(i,c,["tox-form__group--stretched"],[Bd("handle-files",[md(AN,(e,t)=>{Py.getField(e).each(e=>{a(e,t.event.files)})})])])},MN=Le("alloy-fake-before-tabstop"),RN=Le("alloy-fake-after-tabstop"),NN=e=>({dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:e},behaviours:Td([Pd.config({ignore:!0}),Nx.config({})])}),BN=(e,t)=>({dom:{tag:"div",classes:["tox-navobj",...e.getOr([])]},components:[NN([MN]),t,NN([RN])],behaviours:Td([iN(1)])}),zN=(e,t)=>{nd(e,Ls(),{raw:{which:9,shiftKey:t}})},HN=(e,t)=>{const o=t.element;ir(o,MN)?zN(e,!0):ir(o,RN)&&zN(e,!1)},LN=e=>fr(e,["."+MN,"."+RN].join(","),O),IN=Le("update-dialog"),PN=Le("update-title"),FN=Le("update-body"),VN=Le("update-footer"),ZN=Le("body-send-message"),UN=Le("dialog-focus-shifted"),jN=Gt().browser,WN=jN.isSafari(),$N=jN.isFirefox(),qN=WN||$N,GN=jN.isChromium(),KN=({scrollTop:e,scrollHeight:t,clientHeight:o})=>Math.ceil(e)+o>=t,YN=(e,t)=>e.scrollTo(0,"bottom"===t?99999999:t),XN=(e,t,o)=>{const n=e.dom;A.from(n.contentDocument).fold(o,e=>{let o=0;const r=((e,t)=>{const o=e.body;return A.from(!/^<!DOCTYPE (html|HTML)/.test(t)&&(!GN&&!WN||g(o)&&(0!==o.scrollTop||Math.abs(o.scrollHeight-o.clientHeight)>1))?o:e.documentElement)})(e,t).map(e=>(o=e.scrollTop,e)).forall(KN),a=()=>{const e=n.contentWindow;g(e)&&(r?YN(e,"bottom"):!r&&qN&&0!==o&&YN(e,o))};WN&&n.addEventListener("load",a,{once:!0}),e.open(),e.write(t),e.close(),WN||a()})},JN=We(qN,WN?500:200).map(e=>((e,t)=>{let o=null,n=null;return{cancel:()=>{c(o)||(clearTimeout(o),o=null,n=null)},throttle:(...r)=>{n=r,c(o)&&(o=setTimeout(()=>{const t=n;o=null,n=null,e.apply(null,t)},t))}}})(XN,e)),QN=(e,t,o)=>{const n="tox-dialog__iframe",r=e.transparent?[]:[`${n}--opaque`],a=e.border?["tox-navobj-bordered"]:[],s={...e.label.map(e=>({title:e})).getOr({}),...o.map(e=>({srcdoc:e})).getOr({}),...e.sandboxed?{sandbox:"allow-scripts allow-same-origin"}:{}},i=((e,t)=>{const o=ye(e.getOr(""));return{getValue:e=>o.get(),setValue:(e,n)=>{if(o.get()!==n){const o=e.element,r=()=>Wo(o,"srcdoc",n);t?JN.fold(y(XN),e=>e.throttle)(o,n,r):r()}o.set(n)}}})(o,e.streamContent),l=e.label.map(e=>UR(e,t)),c=Py.parts.field({factory:{sketch:e=>BN(A.from(a),{uid:e.uid,dom:{tag:"iframe",attributes:s,classes:[n,...r]},behaviours:Td([Nx.config({}),Pd.config({}),dN(o,i.getValue,i.setValue),Gb.config({channels:{[UN]:{onReceive:(e,t)=>{t.newFocus.each(t=>{uo(e.element).each(o=>{(xt(e.element,t)?nr:ar)(o,"tox-navobj-bordered-focus")})})}}}})])})}});return FR(l,c,["tox-form__group--stretched"],[])},eB=(e,t)=>{const o=ye(t.getOr({url:""})),n=ov({dom:{tag:"img",classes:["tox-imagepreview__image"],attributes:t.map(e=>({src:e.url})).getOr({})}}),r=ov({dom:{tag:"div",classes:["tox-imagepreview__container"],attributes:{role:"presentation"}},components:[n.asSpec()]}),a={};e.height.each(e=>a.height=e);const s=t.map(e=>({url:e.url,zoom:A.from(e.zoom),cachedWidth:A.from(e.cachedWidth),cachedHeight:A.from(e.cachedHeight)}));return{dom:{tag:"div",classes:["tox-imagepreview"],styles:a,attributes:{role:"presentation"}},components:[r.asSpec()],behaviours:Td([aN(),dN(s,()=>o.get(),(e,t)=>{const a={url:t.url};t.zoom.each(e=>a.zoom=e),t.cachedWidth.each(e=>a.cachedWidth=e),t.cachedHeight.each(e=>a.cachedHeight=e),o.set(a);const s=()=>{const{cachedWidth:t,cachedHeight:o,zoom:n}=a;if(!m(t)&&!m(o)){if(m(n)){const n=((e,t,o)=>{const n=Tn(e),r=Cn(e);return Math.min(n/t,r/o,1)})(e.element,t,o);a.zoom=n}const s=((e,t,o,n,r)=>{const a=o*r,s=n*r,i=Math.max(0,e/2-a/2),l=Math.max(0,t/2-s/2);return{left:i.toString()+"px",top:l.toString()+"px",width:a.toString()+"px",height:s.toString()+"px"}})(Tn(e.element),Cn(e.element),t,o,a.zoom);r.getOpt(e).each(e=>{un(e.element,s)})}};n.getOpt(e).each(o=>{const n=o.element;t.url!==qo(n,"src")&&(Wo(n,"src",t.url),ar(e.element,"tox-imagepreview__loaded")),s(),nn(n).then(t=>{e.getSystem().isConnected()&&(nr(e.element,"tox-imagepreview__loaded"),a.cachedWidth=t.dom.naturalWidth,a.cachedHeight=t.dom.naturalHeight,s())})})})])}},tB=Le("toolbar.button.execute"),oB=Le("common-button-display-events"),nB={[Js()]:["disabling","alloy.base.behaviour","toggling","toolbar-button-events","tooltipping"],[ci()]:["toolbar-button-events",oB],[di()]:["toolbar-button-events","dropdown-events","tooltipping"],[Ds()]:["focusing","alloy.base.behaviour",oB]},rB=e=>mn(e.element,"width",pn(e.element,"width")),aB=(e,t,o)=>pE(e,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:o},t),sB=(e,t)=>aB(e,t,[]),iB=(e,t)=>aB(e,t,[kg.config({})]),lB=(e,t,o)=>({dom:{tag:"span",classes:[`${t}__select-label`]},components:[op(o.translate(e))],behaviours:Td([kg.config({})])}),cB=Le("update-menu-text"),dB=Le("update-menu-icon"),mB=Le("update-tooltip-text"),uB=(e,t,o,n)=>{const r=ye(b),a=ye(e.tooltip),s=e.text.map(e=>ov(lB(e,t,o.providers))),i=e.icon.map(e=>ov(iB(e,o.providers.icons))),l=(e,t)=>{const o=Bf.getValue(e);return Pd.focus(o),nd(o,"keydown",{raw:t.event.raw}),wy.close(o),A.some(!0)},c=e.role.fold(()=>({}),e=>({role:e})),d=A.from(e.listRole).map(e=>({listRole:e})).getOr({}),m=e.ariaLabel.fold(()=>({}),e=>({"aria-label":o.providers.translate(e)})),u=pE("chevron-down",{tag:"div",classes:[`${t}__select-chevron`]},o.providers.icons),p=Le("common-button-display-events"),h="dropdown-events",f=ov(wy.sketch({...e.uid?{uid:e.uid}:{},...c,...d,dom:{tag:"button",classes:[t,`${t}--select`].concat(I(e.classes,e=>`${t}--${e}`)),attributes:{...m,...g(n)?{"data-mce-name":n}:{}}},components:BD([i.map(e=>e.asSpec()),s.map(e=>e.asSpec()),A.some(u)]),matchWidth:!0,useMinWidth:!0,onOpen:(t,o,n)=>{e.searchable&&(e=>{UE(e).each(e=>Pd.focus(e))})(n)},dropdownBehaviours:Td([...e.dropdownBehaviours,xD(()=>e.disabled||o.providers.checkUiComponentContext(e.context).shouldDisable),MD(()=>o.providers.checkUiComponentContext(e.context)),ev.config({}),kg.config({}),...e.tooltip.map(t=>Qx.config(o.providers.tooltips.getConfig({tooltipText:o.providers.translate(t),onShow:t=>{if(Ue(a.get(),e.tooltip,(e,t)=>t!==e).getOr(!1)){const e=o.providers.translate(a.get().getOr(""));Qx.setComponents(t,o.providers.tooltips.getComponents({tooltipText:e}))}}}))).toArray(),Bd(h,[_D(e,r),CD(e,r)]),Bd(p,[vd((t,o)=>{"listbox"!==e.listRole&&rB(t)})]),Bd("update-dropdown-width-variable",[md(li(),(e,t)=>wy.close(e))]),Bd("menubutton-update-display-text",[md(cB,(e,t)=>{s.bind(t=>t.getOpt(e)).each(e=>{kg.set(e,[op(o.providers.translate(t.event.text))])})}),md(dB,(e,t)=>{i.bind(t=>t.getOpt(e)).each(e=>{kg.set(e,[iB(t.event.icon,o.providers.icons)])})}),md(mB,(e,t)=>{const n=o.providers.translate(t.event.text);Wo(e.element,"aria-label",n),a.set(A.some(t.event.text))})])]),eventOrder:Pe(nB,{[Ds()]:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"],[ci()]:["toolbar-button-events",Qx.name(),h,p]}),sandboxBehaviours:Td([Wu.config({mode:"special",onLeft:l,onRight:l}),Bd("dropdown-sandbox-events",[md(PE,(e,t)=>{OR(e),t.stop()}),md(FE,(e,t)=>{((e,t)=>{TR(e).each(o=>{((e,t,o,n)=>{const r={...n,target:t};e.getSystem().triggerEvent(o,t,r)})(e,o.element,t.event.eventType,t.event.interactionEvent)})})(e,t),t.stop()})])]),lazySink:o.getSink,toggleClass:`${t}--active`,parts:{menu:{...IE(0,e.columns,e.presets),fakeFocus:e.searchable,..."listbox"===e.listRole?{}:{onHighlightItem:AR,onCollapseMenu:(e,t,o)=>{hm.getHighlighted(o).each(t=>{AR(e,o,t)})},onDehighlightItem:DR}}},getAnchorOverrides:()=>({maxHeightFunction:(e,t)=>{jc()(e,t-10)}}),fetch:t=>Se(C(e.fetch,t))}));return f.asSpec()},gB=e=>"separator"===e.type,pB={type:"separator"},hB=(e,t)=>{const o=U(e,(e,o)=>(e=>a(e))(o)?""===o?e:"|"===o?e.length>0&&!gB(e[e.length-1])?e.concat([pB]):e:be(t,o.toLowerCase())?e.concat([t[o.toLowerCase()]]):e:e.concat([o]),[]);return o.length>0&&gB(o[o.length-1])&&o.pop(),o},fB=(e,t)=>{const o=hB(a(e)?e.split(" "):e,t);return Z(o,(e,o)=>{if((e=>be(e,"getSubmenuItems"))(o)){const n=(e=>{const t=fe(e,"value").getOrThunk(()=>Le("generated-menu-item"));return Pe({value:t},e)})(o),r=((e,t)=>{const o=e.getSubmenuItems(),n=fB(o,t);return{item:e,menus:Pe(n.menus,{[e.value]:n.items}),expansions:Pe(n.expansions,{[e.value]:e.value})}})(n,t);return{menus:Pe(e.menus,r.menus),items:[r.item,...e.items],expansions:Pe(e.expansions,r.expansions)}}return{...e,items:[o,...e.items]}},{menus:{},expansions:{},items:[]})},bB=(e,t,o,n)=>{const r=Le("primary-menu"),a=fB(e,o.shared.providers.menuItems());if(0===a.items.length)return A.none();const s=(e=>e.search.fold(()=>({searchMode:"no-search"}),e=>({searchMode:"search-with-field",placeholder:e.placeholder})))(n),i=zR(r,a.items,t,o,n.isHorizontalMenu,s),l=(e=>e.search.fold(()=>({searchMode:"no-search"}),e=>({searchMode:"search-with-results"})))(n),c=le(a.menus,(e,n)=>zR(n,e,t,o,!1,l)),d=Pe(c,_s(r,i));return A.from(oy.tieredData(r,d,a.expansions))},xB=e=>!be(e,"items"),vB="data-value",yB=(e,t,o,n,r)=>I(o,o=>xB(o)?{type:"togglemenuitem",...r?{}:{role:"option"},text:o.text,value:o.value,active:o.value===n,onAction:()=>{Bf.setValue(e,o.value),nd(e,jR,{name:t}),Pd.focus(e)}}:{type:"nestedmenuitem",text:o.text,getSubmenuItems:()=>yB(e,t,o.items,n,r)}),wB=(e,t)=>re(e,e=>xB(e)?We(e.value===t,e):wB(e.items,t)),_B=e=>{const t={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4};let o=e.value.toFixed((n=e.unit)in t?t[n]:1);var n;return-1!==o.indexOf(".")&&(o=o.replace(/\.?0*$/,"")),o+e.unit},CB=e=>{const t=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(e);if(null!==t){const e=parseFloat(t[1]),o=t[2];return Ae.value({value:e,unit:o})}return Ae.error(e)},kB=(e,t)=>{const o={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},n=e=>be(o,e);return e.unit===t?A.some(e.value):n(e.unit)&&n(t)?o[e.unit]===o[t]?A.some(e.value):A.some(e.value/o[e.unit]*o[t]):A.none()},SB=e=>A.none(),EB=(e,t)=>{const o=CB(e).toOptional(),n=CB(t).toOptional();return Ue(o,n,(e,t)=>kB(e,t.unit).map(e=>t.value/e).map(e=>{return o=e,n=t.unit,e=>kB(e,n).map(e=>({value:e*o,unit:n}));var o,n}).getOr(SB)).getOr(SB)},OB=(e,t)=>{const o=e.label.map(e=>UR(e,t)),n=[Mp.config({disabled:()=>e.disabled||t.checkUiComponentContext(e.context).shouldDisable}),MD(()=>t.checkUiComponentContext(e.context)),Wu.config({mode:"execution",useEnter:!0!==e.multiline,useControlEnter:!0===e.multiline,execute:e=>(od(e,KR),A.some(!0))}),Bd("textfield-change",[md(Ps(),(t,o)=>{nd(t,jR,{name:e.name})}),md(Ys(),(t,o)=>{nd(t,jR,{name:e.name})})]),Nx.config({})],r=e.validation.map(e=>zf.config({getRoot:e=>uo(e.element),invalidClass:"tox-invalid",validator:{validate:t=>{const o=Bf.getValue(t),n=e.validator(o);return Ee(!0===n?Ae.value(o):Ae.error(n))},validateOnLoad:e.validateOnLoad}})).toArray(),a={...e.placeholder.fold(y({}),e=>({placeholder:t.translate(e)})),...e.inputMode.fold(y({}),e=>({inputmode:e})),"data-mce-name":e.name},s=Py.parts.field({tag:!0===e.multiline?"textarea":"input",...e.data.map(e=>({data:e})).getOr({}),inputAttributes:a,inputClasses:[e.classname],inputBehaviours:Td($([n,r])),selectOnFocus:!1,factory:Yy}),i=e.multiline?{dom:{tag:"div",classes:["tox-textarea-wrap"]},components:[s]}:s,l=(e.flex?["tox-form__group--stretched"]:[]).concat(e.maximized?["tox-form-group--maximize"]:[]),c=[Mp.config({disabled:()=>e.disabled||t.checkUiComponentContext(e.context).shouldDisable,onDisabled:e=>{Py.getField(e).each(Mp.disable)},onEnabled:e=>{Py.getField(e).each(Mp.enable)}}),MD(()=>t.checkUiComponentContext(e.context))];return FR(o,i,l,c)},TB=e=>({isEnabled:()=>!Mp.isDisabled(e),setEnabled:t=>Mp.set(e,!t),setActive:t=>{const o=e.element;t?(nr(o,"tox-tbtn--enabled"),Wo(o,"aria-pressed",!0)):(ar(o,"tox-tbtn--enabled"),Yo(o,"aria-pressed"))},isActive:()=>ir(e.element,"tox-tbtn--enabled"),setTooltip:t=>{nd(e,mB,{text:t})},setText:t=>{nd(e,cB,{text:t})},setIcon:t=>nd(e,dB,{icon:t})}),AB=(e,t,o,n,r=!0,a)=>{const s="bordered"===e.buttonType?["bordered"]:[];return uB({text:e.text,icon:e.icon,tooltip:e.tooltip,ariaLabel:e.tooltip,searchable:e.search.isSome(),role:n,fetch:(t,n)=>{const r={pattern:e.search.isSome()?MR(t):""};e.fetch(t=>{n(bB(t,yE.CLOSE_ON_EXECUTE,o,{isHorizontalMenu:!1,search:e.search}))},r,TB(t))},onSetup:e.onSetup,getApi:e=>TB(e),columns:1,presets:"normal",classes:s,dropdownBehaviours:[...r?[Nx.config({})]:[]],context:e.context},t,o.shared,a)},DB=(e,t,o)=>{const n=e=>n=>{const r=!n.isActive();n.setActive(r),e.storage.set(r),o.shared.getSink().each(o=>{t().getOpt(o).each(t=>{Bo(t.element),nd(t,GR,{name:e.name,value:e.storage.get()})})})},r=e=>t=>{t.setActive(e.storage.get())};return t=>{t(I(e,e=>{const t=e.text.fold(()=>({}),e=>({text:e}));return{type:e.type,active:!1,...t,context:e.context,onAction:n(e),onSetup:r(e)}}))}},MB=e=>({dom:{tag:"span",classes:["tox-tree__label"],attributes:{"aria-label":e}},components:[op(e)]}),RB=(e,t,o)=>{e.customStateIcon.each(n=>t.push(zB(n,o.shared.providers.icons,e.customStateIconTooltip.fold(()=>[],e=>[Qx.config(o.shared.providers.tooltips.getConfig({tooltipText:e}))]),["tox-icon-custom-state"])))},NB=Le("leaf-label-event-id"),BB=({leaf:e,onLeafAction:t,visible:o,treeId:n,selectedId:r,backstage:a})=>{const s=e.menu.map(e=>AB(e,"tox-mbtn",a,A.none(),o)),i=[MB(e.title)];return RB(e,i,a),s.each(e=>i.push(e)),yv.sketch({dom:{tag:"div",classes:["tox-tree--leaf__label","tox-trbtn"].concat(o?["tox-tree--leaf__label--visible"]:[])},components:i,role:"treeitem",action:o=>{t(e.id),o.getSystem().broadcastOn([`update-active-item-${n}`],{value:e.id})},eventOrder:{[Ls()]:[NB,"keying"]},buttonBehaviours:Td([...o?[Nx.config({})]:[],Vx.config({toggleClass:"tox-trbtn--enabled",toggleOnExecute:!1,aria:{mode:"selected"}}),Gb.config({channels:{[`update-active-item-${n}`]:{onReceive:(t,o)=>{(o.value===e.id?Vx.on:Vx.off)(t)}}}}),Bd(NB,[vd((t,o)=>{r.each(o=>{(o===e.id?Vx.on:Vx.off)(t)})}),md(Ls(),(e,t)=>{const o="ArrowLeft"===t.event.raw.code,n="ArrowRight"===t.event.raw.code;o?($n(e.element,".tox-tree--directory").each(t=>{e.getSystem().getByDom(t).each(e=>{Gn(t,".tox-tree--directory__label").each(t=>{e.getSystem().getByDom(t).each(Pd.focus)})})}),t.stop()):n&&t.stop()})])])})},zB=(e,t,o,n,r)=>pE(e,{tag:"span",classes:["tox-tree__icon-wrap","tox-icon"].concat(n||[]),behaviours:o,attributes:r},t),HB=Le("directory-label-event-id"),LB=({directory:e,visible:t,noChildren:o,backstage:n})=>{const r=e.menu.map(e=>AB(e,"tox-mbtn",n,A.none())),a=[{dom:{tag:"div",classes:["tox-chevron"]},components:[(s="chevron-right",i=n.shared.providers.icons,zB(s,i,[]))]},MB(e.title)];var s,i;RB(e,a,n),r.each(e=>{a.push(e)});const l=t=>{$n(t.element,".tox-tree--directory").each(o=>{t.getSystem().getByDom(o).each(o=>{const n=!Vx.isOn(o);Vx.toggle(o),nd(t,"expand-tree-node",{expanded:n,node:e.id})})})};return yv.sketch({dom:{tag:"div",classes:["tox-tree--directory__label","tox-trbtn"].concat(t?["tox-tree--directory__label--visible"]:[])},components:a,action:l,eventOrder:{[Ls()]:[HB,"keying"]},buttonBehaviours:Td([...t?[Nx.config({})]:[],Bd(HB,[md(Ls(),(e,t)=>{const n="ArrowRight"===t.event.raw.code,r="ArrowLeft"===t.event.raw.code;n&&o&&t.stop(),(n||r)&&$n(e.element,".tox-tree--directory").each(o=>{e.getSystem().getByDom(o).each(o=>{!Vx.isOn(o)&&n||Vx.isOn(o)&&r?(l(e),t.stop()):r&&!Vx.isOn(o)&&($n(o.element,".tox-tree--directory").each(e=>{Gn(e,".tox-tree--directory__label").each(e=>{o.getSystem().getByDom(e).each(Pd.focus)})}),t.stop())})})})])])})},IB=({children:e,onLeafAction:t,visible:o,treeId:n,expandedIds:r,selectedId:a,backstage:s})=>({dom:{tag:"div",classes:["tox-tree--directory__children"]},components:e.map(e=>"leaf"===e.type?BB({leaf:e,selectedId:a,onLeafAction:t,visible:o,treeId:n,backstage:s}):FB({directory:e,expandedIds:r,selectedId:a,onLeafAction:t,labelTabstopping:o,treeId:n,backstage:s})),behaviours:Td([Sx.config({dimension:{property:"height"},closedClass:"tox-tree--directory__children--closed",openClass:"tox-tree--directory__children--open",growingClass:"tox-tree--directory__children--growing",shrinkingClass:"tox-tree--directory__children--shrinking",expanded:o}),kg.config({})])}),PB=Le("directory-event-id"),FB=({directory:e,onLeafAction:t,labelTabstopping:o,treeId:n,backstage:r,expandedIds:a,selectedId:s})=>{const{children:i}=e,l=ye(a),c=a.includes(e.id);return{dom:{tag:"div",classes:["tox-tree--directory"],attributes:{role:"treeitem"}},components:[LB({directory:e,visible:o,noChildren:0===e.children.length,backstage:r}),IB({children:i,expandedIds:a,selectedId:s,onLeafAction:t,visible:c,treeId:n,backstage:r})],behaviours:Td([Bd(PB,[vd((e,t)=>{Vx.set(e,c)}),md("expand-tree-node",(e,t)=>{const{expanded:o,node:n}=t.event;l.set(o?[...l.get(),n]:l.get().filter(e=>e!==n))})]),Vx.config({...e.children.length>0?{aria:{mode:"expanded"}}:{},toggleClass:"tox-tree--directory--expanded",onToggled:(e,o)=>{const a=e.components()[1],c=(d=o,i.map(e=>"leaf"===e.type?BB({leaf:e,selectedId:s,onLeafAction:t,visible:d,treeId:n,backstage:r}):FB({directory:e,expandedIds:l.get(),selectedId:s,onLeafAction:t,labelTabstopping:d,treeId:n,backstage:r})));var d;o?Sx.grow(a):Sx.shrink(a),kg.set(a,c)}})])}},VB=Le("tree-event-id"),ZB=(e,t,o=[],n,r,a,s)=>{const i=t.fold(()=>({}),e=>({action:e})),l={buttonBehaviours:Td([bD(()=>!e.enabled||s.checkUiComponentContext(e.context).shouldDisable),MD(()=>s.checkUiComponentContext(e.context)),Nx.config({}),...a.map(e=>Qx.config(s.tooltips.getConfig({tooltipText:s.translate(e)}))).toArray(),Bd("button press",[dd("click")])].concat(o)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]},...i},c=Pe(l,{dom:n});return Pe(c,{components:r})},UB=(e,t,o,n=[],r)=>{const a={tag:"button",classes:["tox-tbtn"],attributes:{...e.tooltip.map(e=>({"aria-label":o.translate(e)})).getOr({}),"data-mce-name":r}},s=e.icon.map(e=>sB(e,o.icons)),i=BD([s]);return ZB(e,t,n,a,i,e.tooltip,o)},jB=e=>{switch(e){case"primary":return["tox-button"];case"toolbar":return["tox-tbtn"];default:return["tox-button","tox-button--secondary"]}},WB=(e,t,o,n=[],r=[])=>{const a=o.translate(e.text),s=e.icon.map(e=>sB(e,o.icons)),i=[s.getOrThunk(()=>op(a))],l=e.buttonType.getOr(e.primary||e.borderless?"primary":"secondary"),c={tag:"button",classes:[...jB(l),...s.isSome()?["tox-button--icon"]:[],...e.borderless?["tox-button--naked"]:[],...r],attributes:{"aria-label":a,"data-mce-name":e.text}},d=e.icon.map(y(a));return ZB(e,t,n,c,i,d,o)},$B=(e,t,o,n=[],r=[])=>{const a=WB(e,A.some(t),o,n,r);return yv.sketch(a)},qB=(e,t)=>o=>{"custom"===t?nd(o,GR,{name:e,value:{}}):"submit"===t?od(o,KR):"cancel"===t?od(o,qR):console.error("Unknown button type: ",t)},GB=(e,t,o)=>{if(((e,t)=>"menu"===t)(0,t)){const t=()=>a,n=e,r={...e,buttonType:"default",type:"menubutton",search:A.none(),onSetup:t=>(t.setEnabled(e.enabled),b),fetch:DB(n.items,t,o)},a=ov(AB(r,"tox-tbtn",o,A.none(),!0,e.text.or(e.tooltip).getOrUndefined()));return a.asSpec()}if(((e,t)=>"custom"===t||"cancel"===t||"submit"===t)(0,t)){const n=qB(e.name,t),r={...e,context:"cancel"===t?"any":e.context,borderless:!1};return $B(r,n,o.shared.providers,[])}if(((e,t)=>"togglebutton"===t)(0,t))return((e,t,o)=>{var n,r;const a=e.icon.map(e=>iB(e,t.icons)).map(ov),s=e.buttonType.getOr(e.primary?"primary":"secondary"),i={...e,name:null!==(n=e.name)&&void 0!==n?n:"",primary:"primary"===s,tooltip:e.tooltip,enabled:null!==(r=e.enabled)&&void 0!==r&&r,borderless:!1},l=i.tooltip.or(e.text).map(e=>({"aria-label":t.translate(e)})).getOr({}),c=jB(null!=s?s:"secondary"),d=e.icon.isSome()&&e.text.isSome(),m={tag:"button",classes:[...c.concat(e.icon.isSome()?["tox-button--icon"]:[]),...e.active?["tox-button--enabled"]:[],...d?["tox-button--icon-and-text"]:[]],attributes:{...l,...g(o)?{"data-mce-name":o}:{}}},u=t.translate(e.text.getOr("")),p=op(u),h=[...BD([a.map(e=>e.asSpec())]),...e.text.isSome()?[p]:[]],f=ZB(i,A.some(o=>{nd(o,GR,{name:e.name,value:{setIcon:e=>{a.map(n=>n.getOpt(o).each(o=>{kg.set(o,[iB(e,t.icons)])}))}}})}),[],m,h,e.tooltip,t);return yv.sketch(f)})(e,o.shared.providers,e.text.or(e.tooltip).getOrUndefined());throw console.error("Unknown footer button type: ",t),new Error("Unknown footer button type")},KB=(e,t)=>{const o=qB(e.name,"custom");return n=A.none(),r=Py.parts.field({factory:yv,...WB(e,A.some(o),t,[uN(""),aN()])}),FR(n,r,[],[]);var n,r},YB={type:"separator"},XB=e=>({type:"menuitem",value:e.url,text:e.title,meta:{attach:e.attach},onAction:b}),JB=(e,t)=>({type:"menuitem",value:t,text:e,meta:{attach:void 0},onAction:b}),QB=(e,t)=>(e=>I(e,XB))(((e,t)=>V(t,t=>t.type===e))(e,t)),ez=e=>QB("header",e.targets),tz=e=>QB("anchor",e.targets),oz=e=>A.from(e.anchorTop).map(e=>JB("<top>",e)).toArray(),nz=e=>A.from(e.anchorBottom).map(e=>JB("<bottom>",e)).toArray(),rz=(e,t)=>{const o=e.toLowerCase();return V(t,e=>{var t;const n=void 0!==e.meta&&void 0!==e.meta.text?e.meta.text:e.text,r=null!==(t=e.value)&&void 0!==t?t:"";return Je(n.toLowerCase(),o)||Je(r.toLowerCase(),o)})},az=(e,t,o)=>{var n,r;const a=Bf.getValue(t),s=null!==(r=null===(n=null==a?void 0:a.meta)||void 0===n?void 0:n.text)&&void 0!==r?r:a.value;return o.getLinkInformation().fold(()=>[],t=>{const n=rz(s,(e=>I(e,e=>JB(e,e)))(o.getHistory(e)));return"file"===e?(r=[n,rz(s,ez(t)),rz(s,$([oz(t),tz(t),nz(t)]))],U(r,(e,t)=>0===e.length||0===t.length?e.concat(t):e.concat(YB,t),[])):n;var r})},sz=Le("aria-invalid"),iz=e=>(t,o,n,r,a)=>fe(o,"name").fold(()=>e(o,r,A.none(),a),s=>t.field(s,e(o,r,fe(n,s),a))),lz={bar:iz((e,t)=>((e,t)=>({dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:I(e.items,t.interpreter)}))(e,t.shared)),collection:iz((e,t,o)=>eN(e,t.shared.providers,o)),alertbanner:iz((e,t)=>((e,t)=>{const o=mE(e.icon,t.icons);return Zh.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in",`tox-notification--${e.level}`]},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:e.url?void 0:o},components:e.url?[yv.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:o,attributes:{title:t.translate(e.iconTooltip)}},action:t=>nd(t,GR,{name:"alert-banner",value:e.url}),buttonBehaviours:Td([uE()])})]:void 0},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:t.translate(e.text)}}]})})(e,t.shared.providers)),input:iz((e,t,o)=>((e,t,o)=>OB({name:e.name,multiline:!1,label:e.label,inputMode:e.inputMode,placeholder:e.placeholder,flex:!1,disabled:!e.enabled,classname:"tox-textfield",validation:A.none(),maximized:e.maximized,data:o,context:e.context},t))(e,t.shared.providers,o)),textarea:iz((e,t,o)=>((e,t,o)=>OB({name:e.name,multiline:!0,label:e.label,inputMode:A.none(),placeholder:e.placeholder,flex:!0,disabled:!e.enabled,classname:"tox-textarea",validation:A.none(),maximized:e.maximized,data:o,context:e.context},t))(e,t.shared.providers,o)),label:iz((e,t,o,n)=>((e,t,o)=>{const n="tox-label",r="center"===e.align?[`${n}--center`]:[],a="end"===e.align?[`${n}--end`]:[],s=ov({dom:{tag:"label",classes:[n,...r,...a]},components:[op(t.providers.translate(e.label))]}),i=I(e.items,t.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[s.asSpec(),...i],behaviours:Td([aN(),kg.config({}),(l=A.none(),mN(l,en,tn)),Wu.config({mode:"acyclic"}),Bd("label",[vd(t=>{e.for.each(e=>{o(e).each(e=>{s.getOpt(t).each(t=>{var o;const n=null!==(o=qo(e.element,"id"))&&void 0!==o?o:Le("form-field");Wo(e.element,"id",n),Wo(t.element,"for",n)})})})})])])};var l})(e,t.shared,n)),iframe:(e=>(t,o,n,r,a)=>{const s=Pe(o,{source:"dynamic"});return iz(e)(t,s,n,r,a)})((e,t,o)=>QN(e,t.shared.providers,o)),button:iz((e,t)=>KB(e,t.shared.providers)),checkbox:iz((e,t,o)=>((e,t,o)=>{const n=e=>(e.element.dom.click(),A.some(!0)),r=Py.parts.field({factory:{sketch:w},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:Td([aN(),Mp.config({disabled:()=>!e.enabled||t.checkUiComponentContext(e.context).shouldDisable,onDisabled:e=>{uo(e.element).each(e=>nr(e,"tox-checkbox--disabled"))},onEnabled:e=>{uo(e.element).each(e=>ar(e,"tox-checkbox--disabled"))}}),Nx.config({}),Pd.config({}),mN(o,Jn,Xn),Wu.config({mode:"special",onEnter:n,onSpace:n,stopSpaceKeyup:!0}),Bd("checkbox-events",[md(Fs(),(t,o)=>{nd(t,jR,{name:e.name})})])])}),a=Py.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"]},components:[op(t.translate(e.label))],behaviours:Td([ev.config({})])}),s=e=>pE("checked"===e?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+e]},t.icons),i=ov({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[s("checked"),s("unchecked")]});return Py.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[r,i.asSpec(),a],fieldBehaviours:Td([Mp.config({disabled:()=>!e.enabled||t.checkUiComponentContext(e.context).shouldDisable}),MD(()=>t.checkUiComponentContext(e.context))])})})(e,t.shared.providers,o)),colorinput:iz((e,t,o)=>rN(e,t.shared,t.colorinput,o)),colorpicker:iz((e,t,o)=>SN(0,t.shared.providers,o)),dropzone:iz((e,t,o)=>DN(e,t.shared.providers,o)),grid:iz((e,t)=>((e,t)=>({dom:{tag:"div",classes:["tox-form__grid",`tox-form__grid--${e.columns}col`]},components:I(e.items,t.interpreter)}))(e,t.shared)),listbox:iz((e,t,o)=>((e,t,o)=>{const n=z(e.items,e=>!xB(e)),r=t.shared.providers,a=o.bind(t=>wB(e.items,t)).orThunk(()=>te(e.items).filter(xB)),s=e.label.map(e=>UR(e,r)),i=Py.parts.field({dom:{},factory:{sketch:o=>uB({context:e.context,uid:o.uid,text:a.map(e=>e.text),icon:A.none(),tooltip:A.none(),role:We(!n,"combobox"),...n?{}:{listRole:"listbox"},ariaLabel:e.label,fetch:(o,r)=>{const a=yB(o,e.name,e.items,Bf.getValue(o),n);r(bB(a,yE.CLOSE_ON_EXECUTE,t,{isHorizontalMenu:!1,search:A.none()}))},onSetup:y(b),getApi:y({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[Nx.config({}),dN(a.map(e=>e.value),e=>qo(e.element,vB),(t,o)=>{wB(e.items,o).each(e=>{Wo(t.element,vB,e.value),nd(t,cB,{text:e.text})})})]},"tox-listbox",t.shared)}}),l={dom:{tag:"div",classes:["tox-listboxfield"]},components:[i]};return Py.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:$([s.toArray(),[l]]),fieldBehaviours:Td([Mp.config({disabled:()=>!e.enabled||r.checkUiComponentContext(e.context).shouldDisable,onDisabled:e=>{Py.getField(e).each(Mp.disable)},onEnabled:e=>{Py.getField(e).each(Mp.enable)}})])})})(e,t,o)),selectbox:iz((e,t,o)=>((e,t,o)=>{const n=I(e.items,e=>({text:t.translate(e.text),value:e.value})),r=e.label.map(e=>UR(e,t)),a=Py.parts.field({dom:{},...o.map(e=>({data:e})).getOr({}),selectAttributes:{size:e.size},options:n,factory:jy,selectBehaviours:Td([Mp.config({disabled:()=>!e.enabled||t.checkUiComponentContext(e.context).shouldDisable}),Nx.config({}),Bd("selectbox-change",[md(Fs(),(t,o)=>{nd(t,jR,{name:e.name})})])])}),s=e.size>1?A.none():A.some(pE("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},t.icons)),i={dom:{tag:"div",classes:["tox-selectfield"]},components:$([[a],s.toArray()])};return Py.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:$([r.toArray(),[i]]),fieldBehaviours:Td([Mp.config({disabled:()=>!e.enabled||t.checkUiComponentContext(e.context).shouldDisable,onDisabled:e=>{Py.getField(e).each(Mp.disable)},onEnabled:e=>{Py.getField(e).each(Mp.enable)}}),MD(()=>t.checkUiComponentContext(e.context))])})})(e,t.shared.providers,o)),sizeinput:iz((e,t)=>((e,t)=>{let o=SB;const n=Le("ratio-event"),r=e=>pE(e,{tag:"span",classes:["tox-icon","tox-lock-icon__"+e]},t.icons),a=()=>!e.enabled||t.checkUiComponentContext(e.context).shouldDisable,s=MD(()=>t.checkUiComponentContext(e.context)),i=e.label.getOr("Constrain proportions"),l=t.translate(i),c=Uy.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{"aria-label":l,"data-mce-name":i}},components:[r("lock"),r("unlock")],buttonBehaviours:Td([Mp.config({disabled:a}),s,Nx.config({}),Qx.config(t.tooltips.getConfig({tooltipText:l}))])}),d=e=>({dom:{tag:"div",classes:["tox-form__group"]},components:e}),m=t=>Py.parts.field({factory:Yy,inputClasses:["tox-textfield"],inputBehaviours:Td([Mp.config({disabled:a}),s,Nx.config({}),Bd("size-input-events",[md(zs(),(e,o)=>{nd(e,n,{isField1:t})}),md(Fs(),(t,o)=>{nd(t,jR,{name:e.name})})])]),selectOnFocus:!1}),u=e=>({dom:{tag:"label",classes:["tox-label"]},components:[op(t.translate(e))]}),g=Uy.parts.field1(d([Py.parts.label(u("Width")),m(!0)])),p=Uy.parts.field2(d([Py.parts.label(u("Height")),m(!1)]));return Uy.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[g,p,d([u(" "),c])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:(e,t,n)=>{CB(Bf.getValue(e)).each(e=>{o(e).each(e=>{Bf.setValue(t,_B(e))})})},coupledFieldBehaviours:Td([Mp.config({disabled:a,onDisabled:e=>{Uy.getField1(e).bind(Py.getField).each(Mp.disable),Uy.getField2(e).bind(Py.getField).each(Mp.disable),Uy.getLock(e).each(Mp.disable)},onEnabled:e=>{Uy.getField1(e).bind(Py.getField).each(Mp.enable),Uy.getField2(e).bind(Py.getField).each(Mp.enable),Uy.getLock(e).each(Mp.enable)}}),MD(()=>t.checkUiComponentContext("mode:design")),Bd("size-input-events2",[md(n,(e,t)=>{const n=t.event.isField1,r=n?Uy.getField1(e):Uy.getField2(e),a=n?Uy.getField2(e):Uy.getField1(e),s=r.map(Bf.getValue).getOr(""),i=a.map(Bf.getValue).getOr("");o=EB(s,i)})])])})})(e,t.shared.providers)),slider:iz((e,t,o)=>((e,t,o)=>{const n=I_.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[op(t.translate(e.label))]}),r=I_.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),a=I_.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return I_.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:e.min,maxX:e.max,getInitialValue:y(o.getOrThunk(()=>(Math.abs(e.max)-Math.abs(e.min))/2))},components:[n,r,a],sliderBehaviours:Td([aN(),Pd.config({})]),onChoose:(t,o,n)=>{nd(t,jR,{name:e.name,value:n})},onChange:(t,o,n)=>{nd(t,jR,{name:e.name,value:n})}})})(e,t.shared.providers,o)),urlinput:iz((e,t,o)=>((e,t,o,n)=>{const r=t.shared.providers,a=t=>{const n=Bf.getValue(t);o.addToHistory(n.value,e.filetype)},s={...n.map(e=>({initialData:e})).getOr({}),dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":sz,type:"url"},minChars:0,responseTime:0,fetch:n=>{const r=az(e.filetype,n,o),a=bB(r,yE.BUBBLE_TO_SANDBOX,t,{isHorizontalMenu:!1,search:A.none()});return Ee(a)},getHotspot:e=>g.getOpt(e),onSetValue:(e,t)=>{e.hasConfigured(zf)&&zf.run(e).get(b)},typeaheadBehaviours:Td([...o.getValidationHandler().map(t=>zf.config({getRoot:e=>uo(e.element),invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:(e,t)=>{c.getOpt(e).each(e=>{Wo(e.element,"title",r.translate(t))})}},validator:{validate:o=>{const n=Bf.getValue(o);return Re(o=>{t({type:e.filetype,url:n.value},e=>{if("invalid"===e.status){const t=Ae.error(e.message);o(t)}else{const t=Ae.value(e.message);o(t)}})})},validateOnLoad:!1}})).toArray(),Mp.config({disabled:()=>!e.enabled||r.checkUiComponentContext(e.context).shouldDisable}),Nx.config({}),Bd("urlinput-events",[md(Ps(),t=>{const o=mr(t.element),n=o.trim();n!==o&&ur(t.element,n),"file"===e.filetype&&nd(t,jR,{name:e.name})}),md(Fs(),t=>{nd(t,jR,{name:e.name}),a(t)}),md(Ys(),t=>{nd(t,jR,{name:e.name}),a(t)})])]),eventOrder:{[Ps()]:["streaming","urlinput-events","invalidating"]},model:{getDisplayText:e=>e.value,selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:t.shared.getSink,parts:{menu:IE(0,0,"normal")},onExecute:(e,t,o)=>{nd(t,KR,{})},onItemExecute:(t,o,n,r)=>{a(t),nd(t,jR,{name:e.name})}},i=Py.parts.field({...s,factory:BC}),l=e.label.map(e=>UR(e,r)),c=ov(((e,t,o=e,n=e)=>pE(o,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+e],attributes:{title:r.translate(n),"aria-live":"polite",...t.fold(()=>({}),e=>({id:e}))}},r.icons))("invalid",A.some(sz),"warning")),d=ov({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[c.asSpec()]}),m=o.getUrlPicker(e.filetype),u=Le("browser.url.event"),g=ov({dom:{tag:"div",classes:["tox-control-wrap"]},components:[i,d.asSpec()],behaviours:Td([Mp.config({disabled:()=>!e.enabled||r.checkUiComponentContext(e.context).shouldDisable})])}),p=ov($B({context:e.context,name:e.name,icon:A.some("browse"),text:e.picker_text.or(e.label).getOr(""),enabled:e.enabled,primary:!1,buttonType:A.none(),borderless:!0},e=>od(e,u),r,[],["tox-browse-url"]));return Py.sketch({dom:ZR([]),components:l.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:$([[g.asSpec()],m.map(()=>p.asSpec()).toArray()])}]),fieldBehaviours:Td([Mp.config({disabled:()=>!e.enabled||r.checkUiComponentContext(e.context).shouldDisable,onDisabled:e=>{Py.getField(e).each(Mp.disable),p.getOpt(e).each(Mp.disable)},onEnabled:e=>{Py.getField(e).each(Mp.enable),p.getOpt(e).each(Mp.enable)}}),MD(()=>r.checkUiComponentContext(e.context)),Bd("url-input-events",[md(u,t=>{gp.getCurrent(t).each(o=>{const n=Bf.getValue(o),r={fieldname:e.name,...n};m.each(n=>{n(r).get(n=>{Bf.setValue(o,n),nd(t,jR,{name:e.name})})})})})])])})})(e,t,t.urlinput,o)),customeditor:iz(e=>{const t=Ke(),o=ov({dom:{tag:e.tag}}),n=Ke(),r=!ON(e)&&e.onFocus.isSome()?[Pd.config({onFocus:t=>{e.onFocus.each(e=>{e(t.element.dom)})}}),Nx.config({})]:[];return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:Td([Bd("custom-editor-events",[vd(r=>{o.getOpt(r).each(o=>{(ON(e)?e.init(o.element.dom):EN.load(e.scriptId,e.scriptUrl).then(t=>t(o.element.dom,e.settings))).then(e=>{n.on(t=>{e.setValue(t)}),n.clear(),t.set(e)})})})]),dN(A.none(),()=>t.get().fold(()=>n.get().getOr(""),e=>e.getValue()),(e,o)=>{t.get().fold(()=>n.set(o),e=>e.setValue(o))}),aN()].concat(r)),components:[o.asSpec()]}}),htmlpanel:iz((e,t)=>((e,t)=>{const o=["tox-form__group",...e.stretched?["tox-form__group--stretched"]:[]],n=Bd("htmlpanel",[vd(t=>{e.onInit(t.element.dom)})]);return"presentation"===e.presets?Zh.sketch({dom:{tag:"div",classes:o,innerHtml:e.html},containerBehaviours:Td([Qx.config({...t.tooltips.getConfig({tooltipText:"",onShow:e=>{Kn(e.element,"[data-mce-tooltip]:hover").orThunk(()=>Io(e.element)).each(o=>{Go(o,"data-mce-tooltip").each(o=>{Qx.setComponents(e,t.tooltips.getComponents({tooltipText:o}))})})}}),mode:"children-normal",anchor:e=>({type:"node",node:Kn(e.element,"[data-mce-tooltip]:hover").orThunk(()=>Io(e.element).filter(e=>Go(e,"data-mce-tooltip").isSome())),root:e.element,layouts:{onLtr:y([gc,uc,lc,dc,cc,mc]),onRtl:y([gc,uc,lc,dc,cc,mc])},bubble:Zl(0,-2,{})})}),n])}):Zh.sketch({dom:{tag:"div",classes:o,innerHtml:e.html,attributes:{role:"document"}},containerBehaviours:Td([Nx.config({}),Pd.config({}),n])})})(e,t.shared.providers)),imagepreview:iz((e,t,o)=>eB(e,o)),table:iz((e,t)=>((e,t)=>{const o=e=>({dom:{tag:"th",innerHtml:t.translate(e)}}),n=e=>({dom:{tag:"td",innerHtml:t.translate(e)}}),r=e=>({dom:{tag:"tr"},components:I(e,n)});return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(s=e.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:I(s,o)}]}),(a=e.cells,{dom:{tag:"tbody"},components:I(a,r)})],behaviours:Td([Nx.config({}),Pd.config({})])};var a,s})(e,t.shared.providers)),tree:iz((e,t)=>((e,t)=>{const o=e.onLeafAction.getOr(b),n=e.onToggleExpand.getOr(b),r=e.defaultExpandedIds,a=ye(r),s=ye(e.defaultSelectedId),i=Le("tree-id"),l=(n,r)=>e.items.map(e=>"leaf"===e.type?BB({leaf:e,selectedId:n,onLeafAction:o,visible:!0,treeId:i,backstage:t}):FB({directory:e,selectedId:n,onLeafAction:o,expandedIds:r,labelTabstopping:!0,treeId:i,backstage:t}));return{dom:{tag:"div",classes:["tox-tree"],attributes:{role:"tree"}},components:l(s.get(),a.get()),behaviours:Td([Wu.config({mode:"flow",selector:".tox-tree--leaf__label--visible, .tox-tree--directory__label--visible",cycles:!1}),Bd(VB,[md("expand-tree-node",(e,t)=>{const{expanded:o,node:r}=t.event;a.set(o?[...a.get(),r]:a.get().filter(e=>e!==r)),n(a.get(),{expanded:o,node:r})})]),Gb.config({channels:{[`update-active-item-${i}`]:{onReceive:(e,t)=>{s.set(A.some(t.value)),kg.set(e,l(A.some(t.value),a.get()))}}}}),kg.config({})])}})(e,t)),panel:iz((e,t)=>((e,t)=>({dom:{tag:"div",classes:e.classes},components:I(e.items,t.shared.interpreter)}))(e,t))},cz={field:(e,t)=>t,record:y([])},dz=(e,t,o,n,r)=>{const a=Pe(n,{shared:{interpreter:t=>mz(e,t,o,a,r)}});return mz(e,t,o,a,r)},mz=(e,t,o,n,r)=>fe(lz,t.type).fold(()=>(console.error(`Unknown factory type "${t.type}", defaulting to container: `,t),t),a=>a(e,t,o,n,r)),uz=(e,t,o,n)=>mz(cz,e,t,o,n),gz={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},pz=(e,t,o)=>{const n={maxHeightFunction:Wc()};return()=>o()?{type:"node",root:_o(wo(e())),node:A.from(e()),bubble:Zl(12,12,gz),layouts:{onRtl:()=>[Bc],onLtr:()=>[Nc]},overrides:n}:{type:"hotspot",hotspot:t(),bubble:Zl(-12,12,gz),layouts:{onRtl:()=>[lc,cc,gc],onLtr:()=>[cc,lc,gc]},overrides:n}},hz=(e,t,o,n)=>{const r={maxHeightFunction:Wc()};return()=>n()?{type:"node",root:_o(wo(t())),node:A.from(t()),bubble:Zl(12,12,gz),layouts:{onRtl:()=>[zc],onLtr:()=>[zc]},overrides:r}:e?{type:"node",root:_o(wo(t())),node:A.from(t()),bubble:Zl(0,-kn(t()),gz),layouts:{onRtl:()=>[uc],onLtr:()=>[uc]},overrides:r}:{type:"hotspot",hotspot:o(),bubble:Zl(0,0,gz),layouts:{onRtl:()=>[uc],onLtr:()=>[uc]},overrides:r}},fz=(e,t,o)=>()=>o()?{type:"node",root:_o(wo(e())),node:A.from(e()),layouts:{onRtl:()=>[zc],onLtr:()=>[zc]}}:{type:"hotspot",hotspot:t(),layouts:{onRtl:()=>[gc],onLtr:()=>[gc]}},bz=(e,t)=>()=>({type:"selection",root:t(),getSelection:()=>{const t=e.selection.getRng(),o=e.model.table.getSelectedCells();if(o.length>1){const e=o[0],t=o[o.length-1],n={firstCell:it.fromDom(e),lastCell:it.fromDom(t)};return A.some(n)}return A.some(kr.range(it.fromDom(t.startContainer),t.startOffset,it.fromDom(t.endContainer),t.endOffset))}}),xz=e=>t=>({type:"node",root:e(),node:t}),vz=(e,t,o,n)=>{const r=Fk(e),a=()=>it.fromDom(e.getBody()),s=()=>it.fromDom(e.getContentAreaContainer()),i=()=>r||!n();return{inlineDialog:pz(s,t,i),inlineBottomDialog:hz(e.inline,s,o,i),banner:fz(s,t,i),cursor:bz(e,a),node:xz(a)}},yz=e=>(t,o)=>{cR(e)(t,o)},wz=e=>()=>GM(e),_z=e=>t=>jM(e,t),Cz=e=>t=>qM(e,t),kz=e=>()=>yk(e),Sz=e=>xe(e,"items"),Ez=e=>xe(e,"format"),Oz=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],Tz=e=>U(e,(e,t)=>{if(be(t,"items")){const o=Tz(t.items);return{customFormats:e.customFormats.concat(o.customFormats),formats:e.formats.concat([{title:t.title,items:o.formats}])}}if((e=>be(e,"inline"))(t)||(e=>be(e,"block"))(t)||(e=>be(e,"selector"))(t)){const o=`custom-${a(t.name)?t.name:t.title.toLowerCase()}`;return{customFormats:e.customFormats.concat([{name:o,format:t}]),formats:e.formats.concat([{title:t.title,format:o,icon:t.icon}])}}return{...e,formats:e.formats.concat(t)}},{customFormats:[],formats:[]}),Az=e=>QC(e).map(t=>{const o=((e,t)=>{const o=Tz(t),n=t=>{P(t,t=>{e.formatter.has(t.name)||e.formatter.register(t.name,t.format)})};return e.formatter?n(o.customFormats):e.on("init",()=>{n(o.customFormats)}),o.formats})(e,t);return ek(e)?Oz.concat(o):o}).getOr(Oz),Dz=(e,t,o)=>({...e,type:"formatter",isSelected:t(e.format),getStylePreview:o(e.format)}),Mz=(e,t,o,n)=>{const r=t=>I(t,t=>Sz(t)?(e=>{const t=r(e.items);return{...e,type:"submenu",getStyleItems:y(t)}})(t):Ez(t)?(e=>Dz(e,o,n))(t):(e=>{const t=ae(e);return 1===t.length&&B(t,"title")})(t)?{...t,type:"separator"}:(t=>{const r=a(t.name)?t.name:Le(t.title),s=`custom-${r}`,i={...t,type:"formatter",format:s,isSelected:o(s),getStylePreview:n(s)};return e.formatter.register(r,i),i})(t));return r(t)},Rz=e=>{let t=0;const o=e=>[{dom:{tag:"div",classes:["tox-tooltip__body"]},components:[op(e.tooltipText)]}];return{getConfig:n=>({delayForShow:()=>t>0?60:300,delayForHide:y(300),exclusive:!0,lazySink:e,tooltipDom:{tag:"div",classes:["tox-tooltip","tox-tooltip--up"]},tooltipComponents:o(n),onShow:(e,o)=>{t++,n.onShow&&n.onShow(e,o)},onHide:(e,o)=>{t--,n.onHide&&n.onHide(e,o)},onSetup:n.onSetup}),getComponents:o}},Nz=TN.trim,Bz=e=>t=>{if((e=>g(e)&&1===e.nodeType)(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1},zz=Bz("true"),Hz=Bz("false"),Lz=(e,t,o,n,r)=>({type:e,title:t,url:o,level:n,attach:r}),Iz=e=>e.innerText||e.textContent,Pz=e=>(e=>e&&"A"===e.nodeName&&void 0!==(e.id||e.name))(e)&&Vz(e),Fz=e=>e&&/^(H[1-6])$/.test(e.nodeName),Vz=e=>(e=>{let t=e;for(;t=t.parentNode;){const e=t.contentEditable;if(e&&"inherit"!==e)return zz(t)}return!1})(e)&&!Hz(e),Zz=e=>Fz(e)&&Vz(e),Uz=e=>{var t;const o=(e=>e.id?e.id:Le("h"))(e);return Lz("header",null!==(t=Iz(e))&&void 0!==t?t:"","#"+o,(e=>Fz(e)?parseInt(e.nodeName.substr(1),10):0)(e),()=>{e.id=o})},jz=e=>{const t=e.id||e.name,o=Iz(e);return Lz("anchor",o||"#"+t,"#"+t,0,b)},Wz=e=>{const t=(o="h1,h2,h3,h4,h5,h6,a:not([href])",n=e,I(pr(it.fromDom(n),o),e=>e.dom));var o,n;return t},$z=e=>Nz(e.title).length>0,qz=e=>{const t=Wz(e);return V((e=>I(V(e,Zz),Uz))(t).concat((e=>I(V(e,Pz),jz))(t)),$z)},Gz="tinymce-url-history",Kz=e=>a(e)&&/^https?/.test(e),Yz=e=>s(e)&&pe(e,e=>{return!(l(t=e)&&t.length<=5&&G(t,Kz));var t}).isNone(),Xz=()=>{const e=BM.getItem(Gz);if(null===e)return{};let t;try{t=JSON.parse(e)}catch(e){if(e instanceof SyntaxError)return console.log("Local storage "+Gz+" was not valid JSON",e),{};throw e}return Yz(t)?t:(console.log("Local storage "+Gz+" was not valid format",t),{})},Jz=e=>{const t=Xz();return fe(t,e).getOr([])},Qz=(e,t)=>{if(!Kz(e))return;const o=Xz(),n=fe(o,t).getOr([]),r=V(n,t=>t!==e);o[t]=[e].concat(r).slice(0,5),(e=>{if(!Yz(e))throw new Error("Bad format for history:\n"+JSON.stringify(e));BM.setItem(Gz,JSON.stringify(e))})(o)},eH=e=>!!e,tH=e=>le(TN.makeMap(e,/[, ]/),eH),oH=e=>A.from(gk(e)),nH=(e,t)=>{const o=(e=>{const t=A.from(fk(e)).filter(eH).map(tH);return oH(e).fold(O,e=>t.fold(T,e=>ae(e).length>0&&e))})(e);return d(o)?o?oH(e):A.none():o[t]?oH(e):A.none()},rH=e=>A.from(e).filter(a).getOrUndefined(),aH=e=>({getHistory:Jz,addToHistory:Qz,getLinkInformation:()=>(e=>bk(e)?A.some({targets:qz(e.getBody()),anchorTop:rH(xk(e)),anchorBottom:rH(vk(e))}):A.none())(e),getValidationHandler:()=>(e=>A.from(pk(e)))(e),getUrlPicker:t=>((e,t)=>nH(e,t).map(o=>n=>Se(r=>{const i={filetype:t,fieldname:n.fieldname,...A.from(n.meta).getOr({})};o.call(e,(e,t)=>{if(!a(e))throw new Error("Expected value to be string");if(void 0!==t&&!s(t))throw new Error("Expected meta to be a object");r({value:e,meta:t})},n.value,i)})))(e,t)}),sH=(e,t,o,n)=>{const r=ye(!1),a=(e=>{const t=ye(Ik(e)?"bottom":"top");return{isPositionedAtTop:()=>"top"===t.get(),getDockingMode:t.get,setDockingMode:t.set}})(t),s={icons:()=>t.ui.registry.getAll().icons,menuItems:()=>t.ui.registry.getAll().menuItems,translate:aE.translate,isDisabled:()=>!t.ui.isEnabled(),getOption:t.options.get,tooltips:Rz(e.dialog),checkUiComponentContext:e=>{if($C(t))return{contextType:"disabled",shouldDisable:!0};const[o,n=""]=e.split(":"),r=t.ui.registry.getAll().contexts;return{contextType:o,shouldDisable:!fe(r,o).fold(()=>fe(r,"mode").map(e=>e("design")).getOr(!1),e=>"!"===n.charAt(0)?!e(n.slice(1)):e(n))}}},i=aH(t),l=(e=>{const t=t=>()=>e.formatter.match(t),o=t=>()=>{const o=e.formatter.get(t);return void 0!==o?A.some({tag:o.length>0&&(o[0].inline||o[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))}):A.none()},n=ye([]),r=ye([]),a=ye(!1);return e.on("PreInit",r=>{const a=Az(e),s=Mz(e,a,t,o);n.set(s)}),e.on("addStyleModifications",n=>{const s=Mz(e,n.items,t,o);r.set(s),a.set(n.replace)}),{getData:()=>{const e=a.get()?[]:n.get(),t=r.get();return e.concat(t)}}})(t),c=(e=>({colorPicker:yz(e),hasCustomColors:wz(e),getColors:_z(e),getColorCols:Cz(e)}))(t),d=(e=>({isDraggableModal:kz(e)}))(t),m={shared:{providers:s,anchors:vz(t,o,n,a.isPositionedAtTop),header:a},urlinput:i,styles:l,colorinput:c,dialog:d,isContextMenuOpen:()=>r.get(),setContextMenuState:e=>r.set(e)},u=e=>A.none(),g={...m,shared:{...m.shared,interpreter:e=>uz(e,{},g,u),getSink:e.popup}},p={...m,shared:{...m.shared,interpreter:e=>uz(e,{},p,u),getSink:e.dialog}};return{popup:g,dialog:p}},iH=b,lH=O,cH=y([]);var dH=Object.freeze({__proto__:null,setup:iH,isDocked:lH,getBehaviours:cH});const mH=y(Le("toolbar-height-change")),uH={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},gH="tox-tinymce--toolbar-sticky-on",pH="tox-tinymce--toolbar-sticky-off",hH=(e,t)=>B(ch.getModes(e),t),fH=e=>{const t=e.element;uo(t).each(o=>{const n="padding-"+ch.getModes(e)[0];if(ch.isDocked(e)){const e=Tn(o);mn(t,"width",e+"px"),mn(o,n,(e=>kn(e)+(parseInt(pn(e,"margin-top"),10)||0)+(parseInt(pn(e,"margin-bottom"),10)||0))(t)+"px")}else vn(t,"width"),vn(o,n)})},bH=(e,t)=>{t?(ar(e,uH.fadeOutClass),lr(e,[uH.transitionClass,uH.fadeInClass])):(ar(e,uH.fadeInClass),lr(e,[uH.fadeOutClass,uH.transitionClass]))},xH=(e,t)=>{const o=it.fromDom(e.getContainer());t?(nr(o,gH),ar(o,pH)):(nr(o,pH),ar(o,gH))},vH=(e,t)=>{const o=Ke(),n=t.getSink,r=e=>{n().each(t=>e(t.element))},a=t=>{e.inline||fH(t),xH(e,ch.isDocked(t)),t.getSystem().broadcastOn([sv()],{}),n().each(e=>e.getSystem().broadcastOn([sv()],{}))},s=e.inline?[]:[Gb.config({channels:{[mH()]:{onReceive:fH}}})];return[Pd.config({}),ch.config({contextual:{lazyContext:t=>{const o=kn(t.element),n=e.inline?e.getContentAreaContainer():e.getContainer();return A.from(n).map(n=>{const r=Pr(it.fromDom(n));return Xk(e,t.element).fold(()=>{const e=r.height-o,n=r.y+(hH(t,"top")?0:o);return Ir(r.x,n,r.width,e)},e=>{const n=Vr(r,Jk(e)),a=hH(t,"top")?n.y:n.y+o;return Ir(n.x,a,n.width,n.height-o)})})},onShow:()=>{r(e=>bH(e,!0))},onShown:e=>{r(e=>cr(e,[uH.transitionClass,uH.fadeInClass])),o.get().each(t=>{((e,t)=>{const o=so(t);Lo(o).filter(e=>!xt(t,e)).filter(t=>xt(t,it.fromDom(o.dom.body))||vt(e,t)).each(()=>Bo(t))})(e.element,t),o.clear()})},onHide:e=>{((e,t)=>Io(e).orThunk(()=>t().toOptional().bind(e=>Io(e.element))))(e.element,n).fold(o.clear,o.set),r(e=>bH(e,!1))},onHidden:()=>{r(e=>cr(e,[uH.transitionClass]))},...uH},lazyViewport:t=>Xk(e,t.element).fold(()=>{const o=Zr(),n=dk(e),r=o.y+(hH(t,"top")&&!Yk(e)?n:0),a=o.height-(hH(t,"bottom")?n:0);return{bounds:Ir(o.x,r,o.width,a),optScrollEnv:A.none()}},e=>({bounds:Jk(e),optScrollEnv:A.some({currentScrollTop:e.element.dom.scrollTop,scrollElmTop:Bn(e.element).top})})),modes:[t.header.getDockingMode()],onDocked:a,onUndocked:a}),...s]};var yH=Object.freeze({__proto__:null,setup:(e,t,o)=>{e.inline||(t.header.isPositionedAtTop()||e.on("ResizeEditor",()=>{o().each(ch.reset)}),e.on("ResizeWindow ResizeEditor",()=>{o().each(fH)}),e.on("SkinLoaded",()=>{o().each(e=>{ch.isDocked(e)?ch.reset(e):ch.refresh(e)})}),e.on("FullscreenStateChanged",()=>{o().each(ch.reset)})),e.on("AfterScrollIntoView",e=>{o().each(t=>{ch.refresh(t);const o=t.element;Sn(o)&&((e,t)=>{const o=so(t),n=co(t).dom.innerHeight,r=Hn(o),a=it.fromDom(e.elm),s=Fr(a),i=Cn(a),l=s.y,c=l+i,d=Bn(t),m=Cn(t),u=d.top,g=u+m,p=Math.abs(u-r.top)<2,h=Math.abs(g-(r.top+n))<2;if(p&&l<g)Ln(r.left,l-m,o);else if(h&&c>u){const e=l-n+i+m;Ln(r.left,e,o)}})(e,o)})}),e.on("PostRender",()=>{xH(e,!1)})},isDocked:e=>e().map(ch.isDocked).getOr(!1),getBehaviours:vH});var wH=Fh({factory:(e,t)=>{const o={focus:Wu.focusIn,setMenus:(e,o)=>{const n=I(o,e=>{const o={type:"menubutton",text:e.text,fetch:t=>{t(e.getItems())},context:"any"},n=$T(o).mapError(e=>Ua(e)).getOrDie();return AB(n,"tox-mbtn",t.backstage,A.some("menuitem"))});kg.set(e,n)}};return{uid:e.uid,dom:e.dom,components:[],behaviours:Td([kg.config({}),Bd("menubar-events",[vd(t=>{e.onSetup(t)}),md(Bs(),(e,t)=>{Kn(e.element,".tox-mbtn--active").each(o=>{Yn(t.event.target,".tox-mbtn").each(t=>{xt(o,t)||e.getSystem().getByDom(o).each(o=>{e.getSystem().getByDom(t).each(e=>{wy.expand(e),wy.close(o),Pd.focus(e)})})})})}),md(gi(),(e,t)=>{t.event.prevFocus.bind(t=>e.getSystem().getByDom(t).toOptional()).each(o=>{t.event.newFocus.bind(t=>e.getSystem().getByDom(t).toOptional()).each(e=>{wy.isOpen(o)&&(wy.expand(e),wy.close(o))})})})]),Wu.config({mode:"flow",selector:".tox-mbtn",onEscape:t=>(e.onEscape(t),A.some(!0))}),Nx.config({})]),apis:o,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[Ka("dom"),Ka("uid"),Ka("onEscape"),Ka("backstage"),us("onSetup",b)],apis:{focus:(e,t)=>{e.focus(t)},setMenus:(e,t,o)=>{e.setMenus(t,o)}}});const _H=e=>({element:()=>e.element.dom}),CH=(e,t)=>{const o=I(ae(t),e=>{const o=t[e],n=Va((e=>Fa("sidebar",sD,e))(o));return{name:e,getApi:_H,onSetup:n.onSetup,onShow:n.onShow,onHide:n.onHide}});return I(o,t=>{const n=ye(b);return e.slot(t.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:fD([_D(t,n),CD(t,n),md(pi(),(e,t)=>{const n=t.event,r=j(o,e=>e.name===n.name);r.each(t=>{(n.visible?t.onShow:t.onHide)(t.getApi(e))})})])})})},kH=e=>j_.sketch(t=>({dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:CH(t,e),slotBehaviours:fD([vd(e=>j_.hideAllSlots(e))])})),SH=(e,t)=>{Wo(e,"role",t)},EH=e=>gp.getCurrent(e).bind(e=>{if(Sx.isGrowing(e)||Sx.hasGrown(e)){return gp.getCurrent(e).bind(e=>j(j_.getSlotNames(e),t=>j_.isShowing(e,t)))}return A.none()}),OH=Le("FixSizeEvent"),TH=Le("AutoSizeEvent"),AH=e=>gp.getCurrent(e).each(e=>Bo(e.element,!0)),DH=(e,t,o,n)=>{const r=t.element;if(((e,t)=>{const o="tabindex",n=`data-mce-${o}`;A.from(e.iframeElement).map(it.fromDom).each(e=>{t?(Go(e,o).each(t=>Wo(e,n,t)),Wo(e,o,-1)):(Yo(e,o),Go(e,n).each(t=>{Wo(e,o,t),Yo(e,n)}))})})(e,o),o)dp.block(t,(e=>(t,o)=>({dom:{tag:"div",attributes:{"aria-label":e.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:tv('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}))(n)),vn(r,"display"),Yo(r,"aria-hidden"),e.hasFocus()&&AH(t);else{const o=gp.getCurrent(t).exists(e=>Ho(e.element));dp.unblock(t),mn(r,"display","none"),Wo(r,"aria-hidden","true"),o&&e.focus()}},MH=(e,t,o)=>{const n=ye(!1),r=Ke(),a=o=>{n.get()&&!(e=>{if((e=>"focusin"===e.type)(e))return(e.composed?te(e.composedPath()):A.from(e.target)).map(it.fromDom).filter(to).exists(e=>ir(e,"mce-pastebin"));return!1})(o)&&(o.preventDefault(),AH(t()),e.editorManager.setActive(e))};e.inline||e.on("PreInit",()=>{e.dom.bind(e.getWin(),"focusin",a),e.on("BeforeExecCommand",e=>{"mcefocus"===e.command.toLowerCase()&&!0!==e.value&&a(e)})});const s=r=>{r!==n.get()&&(n.set(r),DH(e,t(),r,o.providers),((e,t)=>{e.dispatch("AfterProgressState",{state:t})})(e,r))};e.on("ProgressState",t=>{if(r.on(clearTimeout),h(t.time)){const o=IC.setEditorTimeout(e,()=>s(t.state),t.time);r.set(o)}else s(t.state),r.clear()})},RH=e=>{const t=e.label.isNone()?e.title.fold(()=>({}),e=>({attributes:{"aria-label":e}})):e.label.fold(()=>({}),e=>({attributes:{"aria-label":e}}));return{dom:{tag:"div",classes:["tox-toolbar__group"].concat(e.label.isSome()?["tox-toolbar__group_with_label"]:[]),...t},components:[...e.label.map(e=>({dom:{tag:"span",classes:["tox-label","tox-label--context-toolbar"]},components:[op(e)]})).toArray(),iC.parts.items({})],items:e.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-item:not([disabled]), .tox-number-input:not([disabled])"},tgroupBehaviours:Td([Nx.config({}),Pd.config({ignore:!0})])}},NH=e=>iC.sketch(RH(e)),BH=(e,t)=>{const o=vd(t=>{const o=I(e.initGroups,NH);Ay.setGroups(t,o)});return Td([yD(()=>e.providers.checkUiComponentContext("any").shouldDisable),MD(()=>e.providers.checkUiComponentContext("any")),Wu.config({mode:t,onEscape:e.onEscape,visibilitySelector:".tox-toolbar__overflow",selector:".tox-toolbar__group"}),Bd("toolbar-events",[o])])},zH=e=>{const t=e.cyclicKeying?"cyclic":"acyclic";return{uid:e.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":RH({title:A.none(),label:A.none(),items:[]}),"overflow-button":UB({context:"any",name:"more",icon:A.some("more-drawer"),enabled:!0,tooltip:A.some("Reveal or hide additional toolbar items"),primary:!1,buttonType:A.none(),borderless:!1},A.none(),e.providers,[],"overflow-button")},splitToolbarBehaviours:BH(e,t)}},HH=e=>{const t=zH(e),o=dC.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return dC.sketch({...t,lazySink:e.getSink,getOverflowBounds:()=>{const t=e.moreDrawerData.lazyHeader().element,o=Fr(t),n=lo(t),r=Fr(n),a=Math.max(n.dom.scrollHeight,r.height);return Ir(o.x+4,r.y,o.width-8,a)},parts:{...t.parts,overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:e.attributes}}},components:[o],markers:{overflowToggledClass:"tox-tbtn--enabled"},onOpened:t=>e.onToggled(t,!0),onClosed:t=>e.onToggled(t,!1)})},LH=e=>{const t=hC.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),o=hC.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),n=zH(e);return hC.sketch({...n,components:[t,o],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:t=>{t.getSystem().broadcastOn([mH()],{type:"opened"}),e.onToggled(t,!0)},onClosed:t=>{t.getSystem().broadcastOn([mH()],{type:"closed"}),e.onToggled(t,!1)}})},IH=e=>{const t=e.cyclicKeying?"cyclic":"acyclic";return Ay.sketch({uid:e.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(e.type===zC.scrolling?["tox-toolbar--scrolling"]:[])},components:[Ay.parts.groups({})],toolbarBehaviours:BH(e,t)})},PH=(e,t)=>((e,t)=>{var o,n;const r="togglebutton"===e.type,a=e.icon.map(e=>iB(e,t.icons)).map(ov),s=o=>{const n=e=>{a.map(n=>n.getOpt(o).each(o=>{kg.set(o,[iB(e,t.icons)])}))},s=e=>{const t=o.element;e?(nr(t,"tox-button--enabled"),Wo(t,"aria-pressed",!0)):(ar(t,"tox-button--enabled"),Yo(t,"aria-pressed"))},i=()=>ir(o.element,"tox-button--enabled"),l=()=>Bo(o.element);return r?e.onAction({setIcon:n,setActive:s,isActive:i,focus:l}):"button"===e.type?e.onAction({setIcon:n}):void 0},i={...e,name:r?e.text.getOr(e.icon.getOr("")):null!==(o=e.text)&&void 0!==o?o:e.icon.getOr(""),primary:"primary"===e.buttonType,buttonType:A.from(e.buttonType),tooltip:e.tooltip,icon:e.icon,enabled:!0,borderless:e.borderless},l=jB(null!==(n=e.buttonType)&&void 0!==n?n:"secondary"),c=r?e.text.map(t.translate):A.some(t.translate(e.text)),d=c.map(op),m=i.tooltip.or(c).map(e=>({"aria-label":t.translate(e)})).getOr({}),u=a.map(e=>e.asSpec()),g=BD([u,d]),p=e.icon.isSome()&&d.isSome(),h={tag:"button",classes:l.concat(...e.icon.isSome()&&!p?["tox-button--icon"]:[]).concat(...p?["tox-button--icon-and-text"]:[]).concat(...e.borderless?["tox-button--naked"]:[]).concat(..."togglebutton"===e.type&&e.active?["tox-button--enabled"]:[]),attributes:m},f=ZB(i,A.some(s),[],h,g,e.tooltip,t);return yv.sketch(f)})(e,t),FH=Gt().deviceType,VH=FH.isPhone(),ZH=FH.isTablet();var UH=Vh({name:"silver.View",configFields:[Ka("viewConfig")],partFields:[yl({factory:{sketch:e=>{let t=!1;const o=I(e.buttons,o=>"group"===o.type?(t=!0,((e,t)=>({dom:{tag:"div",classes:["tox-view__toolbar__group"]},components:I(e.buttons,e=>PH(e,t))}))(o,e.providers)):PH(o,e.providers));return{uid:e.uid,dom:{tag:"div",classes:[t?"tox-view__toolbar":"tox-view__header",...VH||ZH?["tox-view--mobile","tox-view--scrolling"]:[]]},behaviours:Td([Pd.config({}),Wu.config({mode:"flow",selector:"button, .tox-button",focusInside:qi.OnEnterOrSpaceMode})]),components:t?o:[Zh.sketch({dom:{tag:"div",classes:["tox-view__header-start"]},components:[]}),Zh.sketch({dom:{tag:"div",classes:["tox-view__header-end"]},components:o})]}}},schema:[Ka("buttons"),Ka("providers")],name:"header"}),yl({factory:{sketch:e=>({uid:e.uid,behaviours:Td([Pd.config({}),Nx.config({})]),dom:{tag:"div",classes:["tox-view__pane"]}})},schema:[],name:"pane"})],factory:(e,t,o,n)=>{const r={getPane:t=>nv.getPart(t,e,"pane"),getOnShow:t=>e.viewConfig.onShow,getOnHide:t=>e.viewConfig.onHide};return{uid:e.uid,dom:e.dom,components:t,behaviours:Td([Pd.config({}),Wu.config({mode:"cyclic",focusInside:qi.OnEnterOrSpaceMode})]),apis:r}},apis:{getPane:(e,t)=>e.getPane(t),getOnShow:(e,t)=>e.getOnShow(t),getOnHide:(e,t)=>e.getOnHide(t)}});const jH=(e,t,o)=>ge(t,(t,n)=>{const r=Va(Fa("view",gD,t));return e.slot(n,UH.sketch({dom:{tag:"div",classes:["tox-view"]},viewConfig:r,components:[...r.buttons.length>0?[UH.parts.header({buttons:r.buttons,providers:o})]:[],UH.parts.pane({})]}))}),WH=(e,t)=>j_.sketch(o=>({dom:{tag:"div",classes:["tox-view-wrap__slot-container"]},components:jH(o,e,t),slotBehaviours:fD([vd(e=>j_.hideAllSlots(e))])})),$H=e=>j(j_.getSlotNames(e),t=>j_.isShowing(e,t)),qH=(e,t,o)=>{j_.getSlot(e,t).each(e=>{UH.getPane(e).each(t=>{var n;o(e)((n=t.element.dom,{getContainer:y(n)}))})})};var GH=Fh({factory:(e,t)=>{const o={setViews:(e,o)=>{kg.set(e,[WH(o,t.backstage.shared.providers)])},whichView:e=>gp.getCurrent(e).bind($H),toggleView:(e,t,o,n)=>gp.getCurrent(e).exists(r=>{const a=$H(r),s=a.exists(e=>n===e),i=j_.getSlot(r,n).isSome();return i&&(j_.hideAllSlots(r),s?((e=>{const t=e.element;mn(t,"display","none"),Wo(t,"aria-hidden","true")})(e),t()):(o(),(e=>{const t=e.element;vn(t,"display"),Yo(t,"aria-hidden")})(e),j_.showSlot(r,n),((e,t)=>{qH(e,t,UH.getOnShow)})(r,n)),a.each(e=>((e,t)=>qH(e,t,UH.getOnHide))(r,e))),i})};return{uid:e.uid,dom:{tag:"div",classes:["tox-view-wrap"],attributes:{"aria-hidden":"true"},styles:{display:"none"}},components:[],behaviours:Td([kg.config({}),gp.config({find:e=>{const t=kg.contents(e);return te(t)}})]),apis:o}},name:"silver.ViewWrapper",configFields:[Ka("backstage")],apis:{setViews:(e,t,o)=>e.setViews(t,o),toggleView:(e,t,o,n,r)=>e.toggleView(t,o,n,r),whichView:(e,t)=>e.whichView(t)}});const KH=rv.optional({factory:wH,name:"menubar",schema:[Ka("backstage")]}),YH=rv.optional({factory:{sketch:e=>kv.sketch({uid:e.uid,dom:e.dom,listBehaviours:Td([Wu.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:()=>IH({type:e.type,uid:Le("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:e.providers,onEscape:()=>(e.onEscape(),A.some(!0))}),setupItem:(e,t,o,n)=>{Ay.setGroups(t,o)},shell:!0})},name:"multiple-toolbar",schema:[Ka("dom"),Ka("onEscape")]}),XH=rv.optional({factory:{sketch:e=>{const t=(e=>e.type===zC.sliding?LH:e.type===zC.floating?HH:IH)(e);return t({type:e.type,uid:e.uid,onEscape:()=>(e.onEscape(),A.some(!0)),onToggled:(t,o)=>e.onToolbarToggled(o),cyclicKeying:!1,initGroups:[],getSink:e.getSink,providers:e.providers,moreDrawerData:{lazyToolbar:e.lazyToolbar,lazyMoreButton:e.lazyMoreButton,lazyHeader:e.lazyHeader},attributes:e.attributes})}},name:"toolbar",schema:[Ka("dom"),Ka("onEscape"),Ka("getSink")]}),JH=rv.optional({factory:{sketch:e=>{const t=e.editor,o=e.sticky?vH:cH;return{uid:e.uid,dom:e.dom,components:e.components,behaviours:Td(o(t,e.sharedBackstage))}}},name:"header",schema:[Ka("dom")]}),QH=rv.optional({factory:{sketch:e=>{const t=e.promotionLink?[{dom:{tag:"a",attributes:{href:"https://www.tiny.cloud/tinymce-upgrade-to-cloud/?utm_campaign=self_hosted_upgrade_promo&utm_source=tiny&utm_medium=referral",rel:"noopener",target:"_blank","aria-hidden":"true"},classes:["tox-promotion-link"],innerHtml:"💝Get all features"}}]:[];return{uid:e.uid,dom:e.dom,components:t}}},name:"promotion",schema:[Ka("dom"),Ka("promotionLink")]}),eL=rv.optional({name:"socket",schema:[Ka("dom")]}),tL=rv.optional({factory:{sketch:e=>({uid:e.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"presentation"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:Td([Nx.config({}),Pd.config({}),Sx.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:e=>{gp.getCurrent(e).each(j_.hideAllSlots),od(e,TH)},onGrown:e=>{od(e,TH)},onStartGrow:e=>{nd(e,OH,{width:fn(e.element,"width").getOr("")})},onStartShrink:e=>{nd(e,OH,{width:Tn(e.element)+"px"})}}),kg.config({}),gp.config({find:e=>{const t=kg.contents(e);return te(t)}})])}],behaviours:Td([iN(0),Bd("sidebar-sliding-events",[md(OH,(e,t)=>{mn(e.element,"width",t.event.width)}),md(TH,(e,t)=>{vn(e.element,"width")})])])})},name:"sidebar",schema:[Ka("dom")]}),oL=rv.optional({factory:{sketch:e=>({uid:e.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:Td([kg.config({}),dp.config({focus:!1}),gp.config({find:e=>te(e.components())})]),components:[]})},name:"throbber",schema:[Ka("dom")]}),nL=rv.optional({factory:GH,name:"viewWrapper",schema:[Ka("backstage")]}),rL=rv.optional({factory:{sketch:e=>({uid:e.uid,dom:{tag:"div",classes:["tox-editor-container"]},components:e.components})},name:"editorContainer",schema:[]});var aL=Vh({name:"OuterContainer",factory:(e,t,o)=>{let n=!1;const r=e=>{qn(e,".tox-statusbar").each(e=>{"none"===pn(e,"display")&&"true"===qo(e,"aria-hidden")?(vn(e,"display"),Yo(e,"aria-hidden")):(mn(e,"display","none"),Wo(e,"aria-hidden","true"))})},s={getSocket:t=>nv.getPart(t,e,"socket"),setSidebar:(t,o,n)=>{nv.getPart(t,e,"sidebar").each(e=>((e,t,o)=>{gp.getCurrent(e).each(n=>{kg.set(n,[kH(t)]);const r=null==o?void 0:o.toLowerCase();a(r)&&be(t,r)&&gp.getCurrent(n).each(t=>{j_.showSlot(t,r),Sx.immediateGrow(n),vn(n.element,"width"),SH(e.element,"region")})})})(e,o,n))},toggleSidebar:(t,o)=>{nv.getPart(t,e,"sidebar").each(e=>((e,t)=>{gp.getCurrent(e).each(o=>{gp.getCurrent(o).each(n=>{Sx.hasGrown(o)?j_.isShowing(n,t)?(Sx.shrink(o),SH(e.element,"presentation")):(j_.hideAllSlots(n),j_.showSlot(n,t),SH(e.element,"region")):(j_.hideAllSlots(n),j_.showSlot(n,t),Sx.grow(o),SH(e.element,"region"))})})})(e,o))},whichSidebar:t=>nv.getPart(t,e,"sidebar").bind(EH).getOrNull(),getHeader:t=>nv.getPart(t,e,"header"),getToolbar:t=>nv.getPart(t,e,"toolbar"),setToolbar:(t,o)=>{nv.getPart(t,e,"toolbar").each(e=>{const t=I(o,NH);e.getApis().setGroups(e,t)})},setToolbars:(t,o)=>{nv.getPart(t,e,"multiple-toolbar").each(e=>{const t=I(o,e=>I(e,NH));kv.setItems(e,t)})},refreshToolbar:t=>{nv.getPart(t,e,"toolbar").each(e=>e.getApis().refresh(e))},toggleToolbarDrawer:t=>{nv.getPart(t,e,"toolbar").each(e=>{je(e.getApis().toggle,t=>t(e))})},toggleToolbarDrawerWithoutFocusing:t=>{nv.getPart(t,e,"toolbar").each(e=>{je(e.getApis().toggleWithoutFocusing,t=>t(e))})},isToolbarDrawerToggled:t=>nv.getPart(t,e,"toolbar").bind(e=>A.from(e.getApis().isOpen).map(t=>t(e))).getOr(!1),getThrobber:t=>nv.getPart(t,e,"throbber"),focusToolbar:t=>{nv.getPart(t,e,"toolbar").orThunk(()=>nv.getPart(t,e,"multiple-toolbar")).each(e=>{Wu.focusIn(e)})},setMenubar:(t,o)=>{nv.getPart(t,e,"menubar").each(e=>{wH.setMenus(e,o)})},focusMenubar:t=>{nv.getPart(t,e,"menubar").each(e=>{wH.focus(e)})},setViews:(t,o)=>{nv.getPart(t,e,"viewWrapper").each(e=>{GH.setViews(e,o)})},toggleView:(t,o)=>nv.getPart(t,e,"viewWrapper").exists(e=>GH.toggleView(e,()=>s.showMainView(t),()=>s.hideMainView(t),o)),whichView:t=>nv.getPart(t,e,"viewWrapper").bind(GH.whichView).getOrNull(),hideMainView:t=>{n=s.isToolbarDrawerToggled(t),n&&s.toggleToolbarDrawer(t),nv.getPart(t,e,"editorContainer").each(e=>{const t=e.element;r(t),mn(t,"display","none"),Wo(t,"aria-hidden","true")})},showMainView:t=>{n&&s.toggleToolbarDrawer(t),nv.getPart(t,e,"editorContainer").each(e=>{const t=e.element;r(t),vn(t,"display"),Yo(t,"aria-hidden")})}};return{uid:e.uid,dom:e.dom,components:t,apis:s,behaviours:e.behaviours}},configFields:[Ka("dom"),Ka("behaviours")],partFields:[JH,KH,XH,YH,eL,tL,QH,oL,nL,rL],apis:{getSocket:(e,t)=>e.getSocket(t),setSidebar:(e,t,o,n)=>{e.setSidebar(t,o,n)},toggleSidebar:(e,t,o)=>{e.toggleSidebar(t,o)},whichSidebar:(e,t)=>e.whichSidebar(t),getHeader:(e,t)=>e.getHeader(t),getToolbar:(e,t)=>e.getToolbar(t),setToolbar:(e,t,o)=>{e.setToolbar(t,o)},setToolbars:(e,t,o)=>{e.setToolbars(t,o)},refreshToolbar:(e,t)=>e.refreshToolbar(t),toggleToolbarDrawer:(e,t)=>{e.toggleToolbarDrawer(t)},toggleToolbarDrawerWithoutFocusing:(e,t)=>{e.toggleToolbarDrawerWithoutFocusing(t)},isToolbarDrawerToggled:(e,t)=>e.isToolbarDrawerToggled(t),getThrobber:(e,t)=>e.getThrobber(t),setMenubar:(e,t,o)=>{e.setMenubar(t,o)},focusMenubar:(e,t)=>{e.focusMenubar(t)},focusToolbar:(e,t)=>{e.focusToolbar(t)},setViews:(e,t,o)=>{e.setViews(t,o)},toggleView:(e,t,o)=>e.toggleView(t,o),whichView:(e,t)=>e.whichView(t)}});const sL={file:{title:"File",items:"newdocument restoredraft | preview | importword exportpdf exportword | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code revisionhistory | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed inserttemplate codesample inserttable accordion math | charmap emoticons hr | pagebreak nonbreaking anchor tableofcontents footnotes | mergetags | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | styles blocks fontfamily fontsize align lineheight | forecolor backcolor | language | removeformat"},tools:{title:"Tools",items:"aidialog aishortcuts | spellchecker spellcheckerlanguage | autocorrect capitalization | a11ycheck code typography wordcount addtemplate"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},iL=e=>e.split(" "),lL=(e,t)=>{const o={...sL,...t.menus},n=ae(t.menus).length>0,r=void 0===t.menubar||!0===t.menubar?iL("file edit view insert format tools table help"):iL(!1===t.menubar?"":t.menubar),s=V(r,e=>{const o=be(sL,e);return n?o||fe(t.menus,e).exists(e=>be(e,"items")):o}),i=I(s,n=>{const r=o[n];return((e,t,o)=>{const n=nk(o).split(/[ ,]/);return{text:e.title,getItems:()=>q(e.items,e=>{const o=e.toLowerCase();return 0===o.trim().length||z(n,e=>e===o)?[]:"separator"===o||"|"===o?[{type:"separator"}]:t.menuItems[o]?[t.menuItems[o]]:[]})}})({title:r.title,items:iL(r.items)},t,e)});return V(i,e=>e.getItems().length>0&&z(e.getItems(),e=>a(e)||"separator"!==e.type))},cL=(e,t,o)=>(e.on("remove",()=>o.unload(t)),o.load(t)),dL=(e,t,o,n)=>(e.on("remove",()=>n.unloadRawCss(t)),n.loadRawCss(t,o)),mL=e=>A.from(tinymce.Resource.get(e)).filter(a),uL=(e,t,o="")=>{const n=(e=>{const t=Dk(e);return t?A.from(t):A.none()})(e).map(e=>((e,t)=>"ui/"+e+"/"+t)(e,`${t}.css`)),r=n.bind(mL);return Ue(n,r,(e,t)=>({_kind:"load-raw",key:e,css:t})).getOrThunk(()=>{const n=e.editorManager.suffix;return{_kind:"load-stylesheet",url:o+`/${t}${n}.css`}})},gL=(e,t)=>{const o=e.ui.styleSheetLoader,n=uL(e,"skin",t);switch(n._kind){case"load-raw":const{key:t,css:r}=n;return dL(e,t,r,o),Promise.resolve();case"load-stylesheet":const{url:a}=n;return cL(e,a,o);default:return Promise.resolve()}},pL=(e,t)=>{var o;if(!(o=it.fromDom(e.getElement()),Co(o).isSome()))return Promise.resolve();{const o=PC.DOM.styleSheetLoader,n=uL(e,"skin.shadowdom",t);switch(n._kind){case"load-raw":const{key:t,css:r}=n;return dL(e,t,r,o),Promise.resolve();case"load-stylesheet":const{url:a}=n;return cL(e,a,o);default:return Promise.resolve()}}},hL=async(e,t)=>{const o=Nk(t);if(await((e,t,o)=>{const n=uL(e,t?"content.inline":"content",o);switch(n._kind){case"load-raw":const{key:r,css:a}=n;return t?dL(e,r,a,e.ui.styleSheetLoader):e.on("PostRender",()=>{dL(e,r,a,e.dom.styleSheetLoader)}),Promise.resolve();case"load-stylesheet":const{url:s}=n;return o&&e.contentCSS.push(s),Promise.resolve();default:return Promise.resolve()}})(t,e,o),!Mk(t)&&a(o))return Promise.all([gL(t,o),pL(t,o)]).then()},fL=(e,t)=>hL(e,t).then((e=>{const t=()=>{e._skinLoaded=!0,(e=>{e.dispatch("SkinLoaded")})(e)};return()=>{e.initialized?t():e.on("init",t)}})(t),((e,t)=>()=>((e,t)=>{e.dispatch("SkinLoadError",t)})(e,{message:t}))(t,"Skin could not be loaded")),bL=C(fL,!1),xL=C(fL,!0),vL=e=>({isEnabled:()=>!Mp.isDisabled(e),setEnabled:t=>Mp.set(e,!t),setText:t=>nd(e,cB,{text:t}),setIcon:t=>nd(e,dB,{icon:t})}),yL=e=>({setActive:t=>{Vx.set(e,t)},isActive:()=>Vx.isOn(e),isEnabled:()=>!Mp.isDisabled(e),setEnabled:t=>Mp.set(e,!t),setText:t=>nd(e,cB,{text:t}),setIcon:t=>nd(e,dB,{icon:t})}),wL=(e,t)=>e.map(e=>({"aria-label":t.translate(e)})).getOr({}),_L=Le("focus-button"),CL=(e,t,o,n,r,a,s)=>{const i=t.map(e=>ov(lB(e,"tox-tbtn",r))),l=e.map(e=>ov(iB(e,r.icons)));return{dom:{tag:"button",classes:["tox-tbtn"].concat(t.isSome()?["tox-tbtn--select"]:[]),attributes:{...wL(o,r),...g(s)?{"data-mce-name":s}:{}}},components:BD([l.map(e=>e.asSpec()),i.map(e=>e.asSpec())]),eventOrder:{[Ds()]:["focusing","alloy.base.behaviour",oB],[ci()]:[oB,"toolbar-group-button-events"],[di()]:[oB,"toolbar-group-button-events","tooltipping"]},buttonBehaviours:Td([yD(()=>r.checkUiComponentContext(a).shouldDisable),MD(()=>r.checkUiComponentContext(a)),Bd(oB,[vd((e,t)=>rB(e)),md(cB,(e,t)=>{i.bind(t=>t.getOpt(e)).each(e=>{kg.set(e,[op(r.translate(t.event.text))])})}),md(dB,(e,t)=>{l.bind(t=>t.getOpt(e)).each(e=>{kg.set(e,[iB(t.event.icon,r.icons)])})}),md(Ds(),(e,t)=>{t.event.prevent(),od(e,_L)})])].concat(n.getOr([])))}},kL=(e,t,o,n)=>{var r;const a=ye(b),s=CL(e.icon,e.text,e.tooltip,A.none(),o,e.context,n);return yv.sketch({dom:s.dom,components:s.components,eventOrder:nB,buttonBehaviours:{...Td([Bd("toolbar-button-events",[(i={onAction:e.onAction,getApi:t.getApi},_d((e,t)=>{wD(i,e)(t=>{nd(e,tB,{buttonApi:t}),i.onAction(t)})})),_D(t,a),CD(t,a)]),...e.tooltip.map(t=>Qx.config(o.tooltips.getConfig({tooltipText:o.translate(t)+e.shortcut.map(e=>` (${ID(e)})`).getOr("")}))).toArray(),yD(()=>!e.enabled||o.checkUiComponentContext(e.context).shouldDisable),MD(()=>o.checkUiComponentContext(e.context))].concat(t.toolbarButtonBehaviours)),[oB]:null===(r=s.buttonBehaviours)||void 0===r?void 0:r[oB]}});var i},SL=(e,t,o,n)=>kL(e,{toolbarButtonBehaviours:o.length>0?[Bd("toolbarButtonWith",o)]:[],getApi:vL,onSetup:e.onSetup},t,n),EL=(e,t,o,n)=>kL(e,{toolbarButtonBehaviours:[kg.config({}),Vx.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(o.length>0?[Bd("toolbarToggleButtonWith",o)]:[]),getApi:yL,onSetup:e.onSetup},t,n),OL=(e,t,o)=>n=>Se(e=>t.fetch(e)).map(r=>A.from(HR(Pe(dR(Le("menu-value"),r,o=>{t.onItemAction(e(n),o)},t.columns,t.presets,yE.CLOSE_ON_EXECUTE,t.select.getOr(O),o),{movement:uR(t.columns,t.presets),menuBehaviours:fD("auto"!==t.columns?[]:[vd((e,o)=>{pD(e,4,RE(t.presets)).each(({numRows:t,numColumns:o})=>{Wu.setGridSize(e,t,o)})})])})))),TL=e=>{Wy.getContent(e).each(e=>{Kn(e.element,".tox-toolbar-slider__input,.tox-toolbar-textfield").fold(()=>Wu.focusIn(e),Bo)})},AL=Le("forward-slide"),DL=Le("backward-slide"),ML=Le("change-slide-event"),RL="tox-pop--resizing",NL=(e,t,o)=>nt(o)?e.translate(t):e.translate([t,e.translate(o)]),BL=(e,t)=>{const o=(o,r,a,s)=>{const i=e.shared.providers.translate(o.title);if("separator"===o.type)return A.some({type:"separator",text:i});if("submenu"===o.type){const e=q(o.getStyleItems(),e=>n(e,r,s));return 0===r&&e.length<=0?A.none():A.some({type:"nestedmenuitem",text:i,enabled:e.length>0,getSubmenuItems:()=>q(o.getStyleItems(),e=>n(e,r,s))})}return A.some({type:"togglemenuitem",text:i,icon:o.icon,active:o.isSelected(s),enabled:!a,onAction:t.onAction(o),...o.getStylePreview().fold(()=>({}),e=>({meta:{style:e}}))})},n=(e,n,r)=>{const a="formatter"===e.type&&t.isInvalid(e);return 0===n?a?[]:o(e,n,!1,r).toArray():o(e,n,a,r).toArray()},r=e=>{const o=t.getCurrentValue(),r=t.shouldHide?0:1;return q(e,e=>n(e,r,o))};return{validateItems:r,getFetch:(e,t)=>(o,n)=>{const a=t(),s=r(a);n(bB(s,yE.CLOSE_ON_EXECUTE,e,{isHorizontalMenu:!1,search:A.none()}))}}},zL=(e,t)=>{const o=t.dataset,n="basic"===o.type?()=>I(o.data,e=>Dz(e,t.isSelectedFor,t.getPreviewFor)):o.getData;return{items:BL(e,t),getStyleItems:n}},HL=(e,t,o,n,r,a)=>{const{items:s,getStyleItems:i}=zL(t,o),l=ye(o.tooltip);return uB({context:"mode:design",text:o.icon.isSome()?A.none():o.text,icon:o.icon,ariaLabel:A.some(o.tooltip),tooltip:A.none(),role:A.none(),fetch:s.getFetch(t,i),onSetup:t=>{const a=o=>t.setTooltip(NL(e,n(o.value),o.value));return e.on(r,a),TM(MM(e,"NodeChange",t=>{const n=t.getComponent();o.updateText(n),Mp.set(t.getComponent(),!e.selection.isEditable()||0===i().length)})(t),()=>e.off(r,a))},getApi:e=>({getComponent:y(e),setTooltip:o=>{const n=t.shared.providers.translate(o);Wo(e.element,"aria-label",n),l.set(o)}}),columns:1,presets:"normal",classes:o.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[Qx.config({...t.shared.providers.tooltips.getConfig({tooltipText:t.shared.providers.translate(o.tooltip),onShow:e=>{if(o.tooltip!==l.get()){const o=t.shared.providers.translate(l.get());Qx.setComponents(e,t.shared.providers.tooltips.getComponents({tooltipText:o}))}}})})]},"tox-tbtn",t.shared,a)};var LL;!function(e){e[e.SemiColon=0]="SemiColon",e[e.Space=1]="Space"}(LL||(LL={}));const IL=(e,t,o)=>{const n=(e=>I(e,e=>{let t=e,o=e;const n=e.split("=");return n.length>1&&(t=n[0],o=n[1]),{title:t,format:o}}))(((e,t)=>t===LL.SemiColon?e.replace(/;$/,"").split(";"):e.split(" "))(e.options.get(t),o));return{type:"basic",data:n}},PL=y("Alignment {0}"),FL="left",VL=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],ZL=e=>{const t={type:"basic",data:VL};return{tooltip:NL(e,PL(),FL),text:A.none(),icon:A.some("align-left"),isSelectedFor:t=>()=>e.formatter.match(t),getCurrentValue:A.none,getPreviewFor:e=>A.none,onAction:t=>()=>j(VL,e=>e.format===t.format).each(t=>e.execCommand(t.command)),updateText:t=>{const o=j(VL,t=>e.formatter.match(t.format)),n=o.fold(y(FL),e=>e.title.toLowerCase());nd(t,dB,{icon:`align-${n}`}),((e,t)=>{e.dispatch("AlignTextUpdate",t)})(e,{value:n})},dataset:t,shouldHide:!1,isInvalid:t=>!e.formatter.canApply(t.format)}},UL=(e,t)=>{const o=t(),n=I(o,e=>e.format);return A.from(e.formatter.closest(n)).bind(e=>j(o,t=>t.format===e))},jL=y("Block {0}"),WL="Paragraph",$L=e=>{const t=IL(e,"block_formats",LL.SemiColon);return{tooltip:NL(e,jL(),WL),text:A.some(WL),icon:A.none(),isSelectedFor:t=>()=>e.formatter.match(t),getCurrentValue:A.none,getPreviewFor:t=>()=>{const o=e.formatter.get(t);return o?A.some({tag:o.length>0&&(o[0].inline||o[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))}):A.none()},onAction:RM(e),updateText:o=>{const n=UL(e,()=>t.data).fold(y(WL),e=>e.title);nd(o,cB,{text:n}),((e,t)=>{e.dispatch("BlocksTextUpdate",t)})(e,{value:n})},dataset:t,shouldHide:!1,isInvalid:t=>!e.formatter.canApply(t.format)}},qL=y("Font {0}"),GL="System Font",KL=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],YL=e=>{const t=e.split(/\s*,\s*/);return I(t,e=>e.replace(/^['"]+|['"]+$/g,""))},XL=(e,t)=>t.length>0&&G(t,t=>e.indexOf(t.toLowerCase())>-1),JL=e=>{const t=()=>{const t=e=>e?YL(e)[0]:"",n=e.queryCommandValue("FontName"),r=o.data,a=n?n.toLowerCase():"",s=Ak(e),i=j(r,e=>{const o=e.format;return o.toLowerCase()===a||t(o).toLowerCase()===t(a).toLowerCase()}).orThunk(()=>We(((e,t)=>{if(0===e.indexOf("-apple-system")||t.length>0){const o=YL(e.toLowerCase());return XL(o,KL)||XL(o,t)}return!1})(a,s),{title:GL,format:a}));return{matchOpt:i,font:n}},o=IL(e,"font_family_formats",LL.SemiColon);return{tooltip:NL(e,qL(),GL),text:A.some(GL),icon:A.none(),isSelectedFor:e=>t=>t.exists(t=>t.format===e),getCurrentValue:()=>{const{matchOpt:e}=t();return e},getPreviewFor:e=>()=>A.some({tag:"div",styles:-1===e.indexOf("dings")?{"font-family":e}:{}}),onAction:t=>()=>{e.undoManager.transact(()=>{e.focus(),e.execCommand("FontName",!1,t.format)})},updateText:o=>{const{matchOpt:n,font:r}=t(),a=n.fold(y(r),e=>e.title);nd(o,cB,{text:a}),((e,t)=>{e.dispatch("FontFamilyTextUpdate",t)})(e,{value:a})},dataset:o,shouldHide:!1,isInvalid:O}};var QL=tinymce.util.Tools.resolve("tinymce.util.VK");const eI=(e,t,o,n)=>{let r=A.none();const a=MM(e,"NodeChange SwitchMode DisabledStateChange",t=>{const n=t.getComponent();r=A.some(n),o.updateInputValue(n),Mp.set(n,!e.selection.isEditable()||$C(e))}),s=e=>({getComponent:y(e)}),i=ye(b),l=Le("custom-number-input-events"),c=(e,t,n)=>{const a=r.map(e=>Bf.getValue(e)).getOr("");const s=o.getNewValue(a,e),i=a.length-`${s}`.length,l=r.map(e=>e.element.dom.selectionStart-i),c=r.map(e=>e.element.dom.selectionEnd-i);o.onAction(s,n),r.each(e=>{Bf.setValue(e,s),t&&(l.each(t=>e.element.dom.selectionStart=t),c.each(t=>e.element.dom.selectionEnd=t))})},d=(e,t)=>c((e,t)=>e-t,e,t),m=(e,t)=>c((e,t)=>e+t,e,t),u=e=>uo(e.element).fold(A.none,e=>(Bo(e),A.some(!0))),p=e=>Ho(e.element)?(fo(e.element).each(e=>Bo(e)),A.some(!0)):A.none(),h=(o,n,r,a)=>{const i=ye(b),l=t.shared.providers.translate(r),c=Le("altExecuting"),d=MM(e,"NodeChange SwitchMode DisabledStateChange",t=>{Mp.set(t.getComponent(),!e.selection.isEditable()||$C(e))}),m=e=>{Mp.isDisabled(e)||o(!0)};return yv.sketch({dom:{tag:"button",attributes:{"aria-label":l,"data-mce-name":n},classes:a.concat(n)},components:[sB(n,t.shared.providers.icons)],buttonBehaviours:Td([Mp.config({}),Qx.config(t.shared.providers.tooltips.getConfig({tooltipText:l})),Bd(c,[_D({onSetup:d,getApi:s},i),CD({getApi:s},i),md(Ls(),(e,t)=>{t.event.raw.keyCode!==QL.SPACEBAR&&t.event.raw.keyCode!==QL.ENTER||Mp.isDisabled(e)||o(!1)}),md(Vs(),m),md(Ts(),m)])]),eventOrder:{[Ls()]:[c,"keying"],[Vs()]:[c,"alloy.base.behaviour"],[Ts()]:[c,"alloy.base.behaviour"],[ci()]:["alloy.base.behaviour",c,"tooltipping"],[di()]:[c,"tooltipping"]}})},f=ov(h(e=>d(!1,e),"minus","Decrease font size",[])),x=ov(h(e=>m(!1,e),"plus","Increase font size",[])),v=ov({dom:{tag:"div",classes:["tox-input-wrapper"]},components:[Yy.sketch({inputBehaviours:Td([Mp.config({}),Bd(l,[_D({onSetup:a,getApi:s},i),CD({getApi:s},i)]),Bd("input-update-display-text",[md(cB,(e,t)=>{Bf.setValue(e,t.event.text)}),md(Hs(),e=>{o.onAction(Bf.getValue(e))}),md(Fs(),e=>{o.onAction(Bf.getValue(e))})]),Wu.config({mode:"special",onEnter:e=>(c(w,!0,!0),A.some(!0)),onEscape:u,onUp:e=>(m(!0,!1),A.some(!0)),onDown:e=>(d(!0,!1),A.some(!0)),onLeft:(e,t)=>(t.cut(),A.none()),onRight:(e,t)=>(t.cut(),A.none())})])})],behaviours:Td([Pd.config({}),Wu.config({mode:"special",onEnter:p,onSpace:p,onEscape:u}),Bd("input-wrapper-events",[md(Bs(),e=>{P([f,x],t=>{const o=it.fromDom(t.get(e).element.dom);Ho(o)&&zo(o)})})])])});return{dom:{tag:"div",classes:["tox-number-input"],attributes:{...g(n)?{"data-mce-name":n}:{}}},components:[f.asSpec(),v.asSpec(),x.asSpec()],behaviours:Td([Pd.config({}),Wu.config({mode:"flow",focusInside:qi.OnEnterOrSpaceMode,cycles:!1,selector:"button, .tox-input-wrapper",onEscape:e=>Ho(e.element)?A.none():(Bo(e.element),A.some(!0))})])}},tI=y("Font size {0}"),oI="12pt",nI={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},rI={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},aI=(e,t)=>/[0-9.]+px$/.test(e)?((e,t)=>{const o=Math.pow(10,t);return Math.round(e*o)/o})(72*parseInt(e,10)/96,t||0)+"pt":fe(rI,e).getOr(e),sI=e=>fe(nI,e).getOr(""),iI=e=>{const t=()=>{let t=A.none();const o=n.data,r=e.queryCommandValue("FontSize");if(r)for(let e=3;t.isNone()&&e>=0;e--){const n=aI(r,e),a=sI(n);t=j(o,e=>e.format===r||e.format===n||e.format===a)}return{matchOpt:t,size:r}},o=y(A.none),n=IL(e,"font_size_formats",LL.Space);return{tooltip:NL(e,tI(),oI),text:A.some(oI),icon:A.none(),isSelectedFor:e=>t=>t.exists(t=>t.format===e),getPreviewFor:o,getCurrentValue:()=>{const{matchOpt:e}=t();return e},onAction:t=>()=>{e.undoManager.transact(()=>{e.focus(),e.execCommand("FontSize",!1,t.format)})},updateText:o=>{const{matchOpt:n,size:r}=t(),a=n.fold(y(r),e=>e.title);nd(o,cB,{text:a}),((e,t)=>{e.dispatch("FontSizeTextUpdate",t)})(e,{value:a})},dataset:n,shouldHide:!1,isInvalid:O}},lI=e=>nt(e)?"Formats":"Format {0}",cI=(e,t)=>{const o="Formats";return{tooltip:NL(e,lI(""),""),text:A.some(o),icon:A.none(),isSelectedFor:t=>()=>e.formatter.match(t),getCurrentValue:A.none,getPreviewFor:t=>()=>{const o=e.formatter.get(t);return void 0!==o?A.some({tag:o.length>0&&(o[0].inline||o[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))}):A.none()},onAction:RM(e),updateText:t=>{const n=e=>Sz(e)?q(e.items,n):Ez(e)?[{title:e.title,format:e.format}]:[],r=q(Az(e),n),a=UL(e,y(r)).fold(y({title:o,tooltipLabel:""}),e=>({title:e.title,tooltipLabel:e.title}));nd(t,cB,{text:a.title}),((e,t)=>{e.dispatch("StylesTextUpdate",t)})(e,{value:a.tooltipLabel})},shouldHide:tk(e),isInvalid:t=>!e.formatter.canApply(t.format),dataset:t}},dI=[{name:"history",items:["undo","redo"]},{name:"ai",items:["aidialog","aishortcuts"]},{name:"styles",items:["styles"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],mI=(e,t)=>(o,n,r,a)=>{const s=e(o).mapError(e=>Ua(e)).getOrDie();return t(s,n,r,a)},uI={button:mI(SA,(e,t,o,n)=>((e,t,o)=>SL(e,t,[],o))(e,t.shared.providers,n)),togglebutton:mI(TA,(e,t,o,n)=>((e,t,o)=>EL(e,t,[],o))(e,t.shared.providers,n)),menubutton:mI($T,(e,t,o,n)=>AB(e,"tox-tbtn",t,A.none(),!1,n)),splitbutton:mI(e=>Fa("SplitButton",lD,e),(e,t,o,n)=>((e,t,o)=>{const n=ye(e.tooltip.getOr("")),r=e=>({isEnabled:()=>!Mp.isDisabled(e),setEnabled:t=>Mp.set(e,!t),setIconFill:(t,o)=>{Kn(e.element,`svg path[class="${t}"], rect[class="${t}"]`).each(e=>{Wo(e,"fill",o)})},setActive:t=>{Wo(e.element,"aria-pressed",t),Kn(e.element,"span").each(o=>{e.getSystem().getByDom(o).each(e=>Vx.set(e,t))})},isActive:()=>Kn(e.element,"span").exists(t=>e.getSystem().getByDom(t).exists(Vx.isOn)),setText:t=>Kn(e.element,"span").each(o=>e.getSystem().getByDom(o).each(e=>nd(e,cB,{text:t}))),setIcon:t=>Kn(e.element,"span").each(o=>e.getSystem().getByDom(o).each(e=>nd(e,dB,{icon:t}))),setTooltip:o=>{const r=t.providers.translate(o);Wo(e.element,"aria-label",r),n.set(o)}}),a=ye(b),s={getApi:r,onSetup:e.onSetup};return K_.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:{"aria-pressed":!1,...wL(e.tooltip,t.providers),...g(o)?{"data-mce-name":o}:{}}},onExecute:t=>{const o=r(t);o.isEnabled()&&e.onAction(o)},onItemExecute:(e,t,o)=>{},splitDropdownBehaviours:Td([Bd("split-dropdown-events",[vd((e,t)=>rB(e)),md(_L,Pd.focus),_D(s,a),CD(s,a)]),vD(()=>t.providers.isDisabled()||t.providers.checkUiComponentContext(e.context).shouldDisable),MD(()=>t.providers.checkUiComponentContext(e.context)),ev.config({}),...e.tooltip.map(e=>Qx.config({...t.providers.tooltips.getConfig({tooltipText:t.providers.translate(e),onShow:o=>{if(n.get()!==e){const e=t.providers.translate(n.get());Qx.setComponents(o,t.providers.tooltips.getComponents({tooltipText:e}))}}})})).toArray()]),eventOrder:{[ci()]:["alloy.base.behaviour","split-dropdown-events","tooltipping"],[di()]:["split-dropdown-events","tooltipping"]},toggleClass:"tox-tbtn--enabled",lazySink:t.getSink,fetch:OL(r,e,t.providers),parts:{menu:IE(0,e.columns,e.presets)},components:[K_.parts.button(CL(e.icon,e.text,A.none(),A.some([Vx.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1}),yD(O),MD(y({contextType:"any",shouldDisable:!1}))]),t.providers,e.context)),K_.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:mE("chevron-down",t.providers.icons)},buttonBehaviours:Td([vD(O),MD(y({contextType:"any",shouldDisable:!1}))])}),K_.parts["aria-descriptor"]({text:t.providers.translate("To open the popup, press Shift+Enter")})]})})(e,t.shared,n)),grouptoolbarbutton:mI(e=>Fa("GroupToolbarButton",iD,e),(e,t,o,n)=>{const r=o.ui.registry.getAll().buttons,a=e=>fI(o,{buttons:r,toolbar:e,allowToolbarGroups:!1},t,A.none()),s={[Gc]:t.shared.header.isPositionedAtTop()?qc.TopToBottom:qc.BottomToTop};if(rk(o)===zC.floating)return((e,t,o,n,r)=>{const a=t.shared,s=ye(b),i={toolbarButtonBehaviours:[],getApi:vL,onSetup:e.onSetup},l=[Bd("toolbar-group-button-events",[_D(i,s),CD(i,s)]),...e.tooltip.map(e=>Qx.config(t.shared.providers.tooltips.getConfig({tooltipText:t.shared.providers.translate(e)}))).toArray()];return Hy.sketch({lazySink:a.getSink,fetch:()=>Se(t=>{t(I(o(e.items),NH))}),markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:CL(e.icon,e.text,e.tooltip,A.some(l),a.providers,e.context,r),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:n}}}})})(e,t,a,s,n);throw new Error("Toolbar groups are only supported when using floating toolbar mode")})},gI={styles:(e,t)=>{const o={type:"advanced",...t.styles};return HL(e,t,cI(e,o),lI,"StylesTextUpdate","styles")},fontsize:(e,t)=>HL(e,t,iI(e),tI,"FontSizeTextUpdate","fontsize"),fontsizeinput:(e,t)=>eI(e,t,(e=>{const t=()=>e.queryCommandValue("FontSize");return{updateInputValue:e=>nd(e,cB,{text:t()}),onAction:(t,o)=>e.execCommand("FontSize",!1,t,{skip_focus:!o}),getNewValue:(o,n)=>{Rr(o,["unsupportedLength","empty"]);const r=t(),a=Rr(o,["unsupportedLength","empty"]).or(Rr(r,["unsupportedLength","empty"])),s=a.map(e=>e.value).getOr(16),i=hk(e),l=a.map(e=>e.unit).filter(e=>""!==e).getOr(i),c=n(s,(e=>{var t;return null!==(t={em:{step:.1},cm:{step:.1},in:{step:.1},pc:{step:.1},ch:{step:.1},rem:{step:.1}}[e])&&void 0!==t?t:{step:1}})(l).step),d=`${(e=>e>=0)(c)?c:s}${l}`;return d!==r&&((e,t)=>{e.dispatch("FontSizeInputTextUpdate",t)})(e,{value:d}),d}}})(e),"fontsizeinput"),fontfamily:(e,t)=>HL(e,t,JL(e),qL,"FontFamilyTextUpdate","fontfamily"),blocks:(e,t)=>HL(e,t,$L(e),jL,"BlocksTextUpdate","blocks"),align:(e,t)=>HL(e,t,ZL(e),PL,"AlignTextUpdate","align"),navigateback:(e,t)=>{const o=Va(SA({type:"button",icon:"chevron-left",tooltip:"Back",onAction:b}));return SL(o,t.shared.providers,[md(tB,e=>{od(e,DL)})])}},pI=e=>{const t=e.toolbar,o=e.buttons;return!1===t?[]:void 0===t||!0===t?(e=>{const t=I(dI,t=>{const o=V(t.items,t=>be(e,t)||be(gI,t));return{name:t.name,items:o}});return V(t,e=>e.items.length>0)})(o):a(t)?(e=>{const t=e.split("|");return I(t,e=>({items:e.trim().split(" ")}))})(t):(e=>f(e,e=>(be(e,"name")||be(e,"label"))&&be(e,"items")))(t)?t:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},hI=(e,t,o,n,r,a)=>fe(t,o.toLowerCase()).orThunk(()=>a.bind(e=>re(e,e=>fe(t,e+o.toLowerCase())))).fold(()=>fe(gI,o.toLowerCase()).map(t=>t(e,r)),t=>"grouptoolbarbutton"!==t.type||n?((e,t,o,n)=>fe(uI,e.type).fold(()=>(console.error("skipping button defined by",e),A.none()),r=>A.some(r(e,t,o,n))))(t,r,e,o.toLowerCase()):(console.warn(`Ignoring the '${o}' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested.`),A.none())),fI=(e,t,o,n)=>{const r=pI(t),a=I(r,r=>{const a=q(r.items,r=>0===r.trim().length?[]:hI(e,t.buttons,r,t.allowToolbarGroups,o,n).toArray());return{title:A.from(e.translate(r.name)),label:We(void 0!==r.label,e.translate(r.label)),items:a}});return V(a,e=>e.items.length>0)},bI=(e,t,o,n)=>{const r=t.mainUi.outerContainer,s=o.toolbar,i=o.buttons;if(f(s,a)){const t=s.map(t=>{const r={toolbar:t,buttons:i,allowToolbarGroups:o.allowToolbarGroups};return fI(e,r,n,A.none())});aL.setToolbars(r,t)}else aL.setToolbar(r,fI(e,o,n,A.none()))},xI=Gt(),vI=xI.os.isiOS()&&xI.os.version.major<=12;var yI=Object.freeze({__proto__:null,render:(e,t,o,n,r)=>{const{mainUi:a,uiMotherships:s}=t,i=ye(0),l=a.outerContainer;bL(e);const d=it.fromDom(r.targetNode),m=_o(wo(d));cg(d,a.mothership),((e,t,o)=>{jk(e)&&cg(o.mainUi.mothership.element,o.popupUi.mothership),lg(t,o.dialogUi.mothership)})(e,m,t),e.on("PostRender",()=>{aL.setSidebar(l,o.sidebar,Ek(e))}),e.on("SkinLoaded",()=>{bI(e,t,o,n),i.set(e.getWin().innerWidth),aL.setMenubar(l,lL(e,o)),aL.setViews(l,o.views),((e,t)=>{const{uiMotherships:o}=t,n=e.dom;let r=e.getWin();const a=e.getDoc().documentElement,s=ye(Rn(r.innerWidth,r.innerHeight)),i=ye(Rn(a.offsetWidth,a.offsetHeight)),l=()=>{const t=s.get();t.left===r.innerWidth&&t.top===r.innerHeight||(s.set(Rn(r.innerWidth,r.innerHeight)),kM(e))},c=()=>{const t=e.getDoc().documentElement,o=i.get();o.left===t.offsetWidth&&o.top===t.offsetHeight||(i.set(Rn(t.offsetWidth,t.offsetHeight)),kM(e))},d=t=>{((e,t)=>{e.dispatch("ScrollContent",t)})(e,t)};n.bind(r,"resize",l),n.bind(r,"scroll",d);const m=Mo(it.fromDom(e.getBody()),"load",c);e.on("hide",()=>{P(o,e=>{mn(e.element,"display","none")})}),e.on("show",()=>{P(o,e=>{vn(e.element,"display")})}),e.on("NodeChange",c),e.on("remove",()=>{m.unbind(),n.unbind(r,"resize",l),n.unbind(r,"scroll",d),r=null})})(e,t)});const u=aL.getSocket(l).getOrDie("Could not find expected socket element");if(vI){un(u.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});const t=((e,t)=>{let o=null;return{cancel:()=>{c(o)||(clearTimeout(o),o=null)},throttle:(...n)=>{c(o)&&(o=setTimeout(()=>{o=null,e.apply(null,n)},t))}}})(()=>{e.dispatch("ScrollContent")},20),o=Do(u.element,"scroll",t.throttle);e.on("remove",o.unbind)}DD(e,t),e.addCommand("ToggleSidebar",(t,o)=>{aL.toggleSidebar(l,o),(e=>{e.dispatch("ToggleSidebar")})(e)}),e.addQueryValueHandler("ToggleSidebar",()=>{var e;return null!==(e=aL.whichSidebar(l))&&void 0!==e?e:""}),e.addCommand("ToggleView",(t,o)=>{if(aL.toggleView(l,o)){const t=l.element;a.mothership.broadcastOn([av()],{target:t}),P(s,e=>{e.broadcastOn([av()],{target:t})}),c(aL.whichView(l))&&(e.focus(),e.nodeChanged(),aL.refreshToolbar(l)),(e=>{e.dispatch("ToggleView")})(e)}}),e.addQueryValueHandler("ToggleView",()=>{var e;return null!==(e=aL.whichView(l))&&void 0!==e?e:""});const g=rk(e);g!==zC.sliding&&g!==zC.floating||e.on("ResizeWindow ResizeEditor ResizeContent",()=>{const o=e.getWin().innerWidth;o!==i.get()&&(aL.refreshToolbar(t.mainUi.outerContainer),i.set(o))});const p={setEnabled:e=>{AD(t,e?"setEnabled":"setDisabled")},isEnabled:()=>!Mp.isDisabled(l)};return{iframeContainer:u.element.dom,editorContainer:l.element.dom,api:p}}});const wI=e=>h(e)?e+"px":e,_I=(e,t,o)=>{const n=t.filter(t=>e<t),r=o.filter(t=>e>t);return n.or(r).getOr(e)},CI=e=>{const t=((e,t)=>{if("number"==typeof t)return A.from(t);const o=/^([0-9.]+)(pt|em|px)$/.exec(t.trim());if(o){const t=o[2],n=Number.parseFloat(o[1]);if(Number.isNaN(n)||n<0)return A.none();if("em"===t)return A.from(n*Number.parseFloat(window.getComputedStyle(e.dom).fontSize));if("pt"===t)return A.from(.75*n);if("px"===t)return A.from(n)}return A.none()})(it.fromDom(e.targetElm),qC(e)),o=YC(e),n=JC(e);return t.map(e=>_I(e,o,n))},kI=e=>{const t=GC(e),o=KC(e),n=XC(e);return(r=t,/^[0-9\.]+(|px)$/i.test(""+r)?A.some(parseInt(""+r,10)):A.none()).map(e=>_I(e,o,n));var r},{ToolbarLocation:SI,ToolbarMode:EI}=$k,OI=(e,t,o,n,r)=>{const{mainUi:a,uiMotherships:s}=o,i=PC.DOM,l=Fk(e),c=Uk(e),d=XC(e).or(kI(e)),m=n.shared.header,u=m.isPositionedAtTop,g=rk(e),p=g===EI.sliding||g===EI.floating,h=ye(!1),f=()=>h.get()&&!e.removed,b=e=>p?e.fold(y(0),e=>e.components().length>1?Cn(e.components()[1].element):0):0,x=(e,t)=>jk(e)?jr(t):A.none(),v=()=>{P(s,e=>{e.broadcastOn([sv()],{})})},w=o=>{if(!f())return;l||r.on(e=>{const o=d.getOrThunk(()=>Br().width-zn(t).left-10);mn(e.element,"max-width",o+"px")});const n=Hn(),s=!l&&(()=>{if(!l&&(Bn(a.outerContainer.element).left+An(a.outerContainer.element)>=window.innerWidth-40||fn(a.outerContainer.element,"width").isSome()))return mn(a.outerContainer.element,"position","absolute"),mn(a.outerContainer.element,"left","0px"),vn(a.outerContainer.element,"width"),!0;return!1})();if(p&&aL.refreshToolbar(a.outerContainer),!l){const o=Hn(),i=We(n.left!==o.left,n);((o,n)=>{r.on(r=>{const s=aL.getToolbar(a.outerContainer),i=b(s),l=Pr(t),c=x(e,a.outerContainer.element),d=c.fold(()=>l.x,e=>{const t=Pr(e);return xt(e,sn())?l.x:l.x-t.x}),m=We(o,Math.ceil(a.outerContainer.element.dom.getBoundingClientRect().width)).filter(e=>e>150).map(e=>{const t=n.getOr(Hn()),o=window.innerWidth-(d-t.left),r=Math.max(Math.min(e,o),150);return o<e&&mn(a.outerContainer.element,"width",r+"px"),{width:r+"px"}}).getOr({width:"max-content"}),g={position:"absolute",left:Math.round(d)+"px",top:c.fold(()=>u()?Math.max(l.y-Cn(r.element)+i,0):l.bottom,e=>{var t;const o=Pr(e),n=null!==(t=e.dom.scrollTop)&&void 0!==t?t:0,a=xt(e,sn())?Math.max(l.y-Cn(r.element)+i,0):l.y-o.y+n-Cn(r.element)+i;return u()?a:l.bottom})+"px"};un(a.outerContainer.element,{...g,...m})})})(s,i),i.each(e=>{Ln(e.left,o.top)})}c&&r.on(o),v()},_=()=>!(l||!c||!f())&&r.get().exists(o=>{const n=m.getDockingMode(),s=(o=>{switch(sk(e)){case SI.auto:const e=aL.getToolbar(a.outerContainer),n=b(e),r=Cn(o.element)-n,s=Pr(t);if(s.y>r)return"top";{const e=lo(t),o=Math.max(e.dom.scrollHeight,Cn(e));return s.bottom<o-r||Zr().bottom<s.bottom-r?"bottom":"top"}case SI.bottom:return"bottom";case SI.top:default:return"top"}})(o);return s!==n&&(i=s,r.on(e=>{ch.setModes(e,[i]),m.setDockingMode(i);const t=u()?qc.TopToBottom:qc.BottomToTop;Wo(e.element,Gc,t)}),!0);var i});return{isVisible:f,isPositionedAtTop:u,show:()=>{h.set(!0),mn(a.outerContainer.element,"display","flex"),i.addClass(e.getBody(),"mce-edit-focus"),P(s,e=>{vn(e.element,"display")}),_(),jk(e)?w(e=>ch.isDocked(e)?ch.reset(e):ch.refresh(e)):w(ch.refresh)},hide:()=>{h.set(!1),mn(a.outerContainer.element,"display","none"),i.removeClass(e.getBody(),"mce-edit-focus"),P(s,e=>{mn(e.element,"display","none")})},update:w,updateMode:()=>{_()&&w(ch.reset)},repositionPopups:v}},TI=(e,t)=>{const o=Pr(e);return{pos:t?o.y:o.bottom,bounds:o}};var AI=Object.freeze({__proto__:null,render:(e,t,o,n,r)=>{const{mainUi:a}=t,s=Ke(),i=it.fromDom(r.targetNode),l=OI(e,i,t,n,s),c=ck(e);xL(e);const d=()=>{if(s.isSet())return void l.show();s.set(aL.getHeader(a.outerContainer).getOrDie());const r=Vk(e);jk(e)?(cg(i,a.mothership),cg(i,t.popupUi.mothership)):lg(r,a.mothership),lg(r,t.dialogUi.mothership);const d=()=>{bI(e,t,o,n),aL.setMenubar(a.outerContainer,lL(e,o)),l.show(),((e,t,o,n)=>{const r=ye(TI(t,o.isPositionedAtTop())),a=n=>{const{pos:a,bounds:s}=TI(t,o.isPositionedAtTop()),{pos:i,bounds:l}=r.get(),c=s.height!==l.height||s.width!==l.width;r.set({pos:a,bounds:s}),c&&kM(e,n),o.isVisible()&&(i!==a?o.update(ch.reset):c&&(o.updateMode(),o.repositionPopups()))};n||(e.on("activate",o.show),e.on("deactivate",o.hide)),e.on("SkinLoaded ResizeWindow",()=>o.update(ch.reset)),e.on("NodeChange keydown",e=>{requestAnimationFrame(()=>a(e))});let s=0;const i=rt(()=>o.update(ch.refresh),33);e.on("ScrollWindow",()=>{const e=Hn().left;e!==s&&(s=e,i.throttle()),o.updateMode()}),jk(e)&&e.on("ElementScroll",e=>{o.update(ch.refresh)});const l=Ge();l.set(Mo(it.fromDom(e.getBody()),"load",e=>a(e.raw))),e.on("remove",()=>{l.clear()})})(e,i,l,c),e.nodeChanged()};c?e.once("SkinLoaded",d):d()};e.on("show",d),e.on("hide",l.hide),c||(e.on("focus",d),e.on("blur",l.hide)),e.on("init",()=>{(e.hasFocus()||c)&&d()}),DD(e,t);const m={show:d,hide:l.hide,setEnabled:e=>{AD(t,e?"setEnabled":"setDisabled")},isEnabled:()=>!Mp.isDisabled(a.outerContainer)};return{editorContainer:a.outerContainer.element.dom,api:m}}});const DI="contexttoolbar-hide",MI=(e,t,o)=>({setInputEnabled:t=>{!t&&o&&Bo(o),Mp.set(e,!t)},isInputEnabled:()=>!Mp.isDisabled(e),hide:()=>{od(e,oi())},back:()=>{od(e,DL)},getValue:()=>t.get().getOrThunk(()=>Bf.getValue(e)),setValue:o=>{e.getSystem().isConnected()?Bf.setValue(e,o):t.set(o)}}),RI=(e,t,o)=>md(tB,(n,r)=>{const a=e.get(n),s=MI(a,o,n.element);t.onAction(s,r.event.buttonApi)}),NI=(e,t,o,n)=>(e=>"contextformtogglebutton"===e.type)(t)?((e,t,o,n)=>{const{primary:r,...a}=t.original,s=Va(TA({...a,type:"togglebutton",onAction:b}));return EL(s,o,[RI(e,t,n)])})(e,t,o,n):((e,t,o,n)=>{const{primary:r,...a}=t.original,s=Va(SA({...a,type:"button",onAction:b}));return SL(s,o,[RI(e,t,n)])})(e,t,o,n),BI=(e,t,o,n)=>{const r=I(t,t=>ov(NI(e,t,o,n)));return{asSpecs:()=>I(r,e=>e.asSpec()),findPrimary:e=>re(t,(t,o)=>t.primary?A.from(r[o]).bind(t=>t.getOpt(e)).filter(k(Mp.isDisabled)):A.none())}},zI=(e,t,o,n)=>{const{width:r,height:a}=e.initValue();let s=SB;const i=Le("ratio-event"),l=e=>MI(e,n),c=e=>pE(e,{tag:"span",classes:["tox-icon","tox-lock-icon__"+e]},t.icons),d=()=>!1,m=e.label.getOr("Constrain proportions"),u=t.translate(m),g=Uy.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-lock-context-form-size-input","tox-button","tox-button--naked","tox-button--icon"],attributes:{"aria-label":u,"data-mce-name":m}},components:[c("lock"),c("unlock")],buttonBehaviours:Td([Mp.config({disabled:d}),Nx.config({}),Qx.config(t.tooltips.getConfig({tooltipText:u}))])}),p=e=>({dom:{tag:"div",classes:["tox-context-form__group"]},components:e}),h=e=>$n(e.element,"div.tox-focusable-wrapper").fold(A.none,e=>(Bo(e),A.some(!0))),f=e=>Py.parts.field({factory:Yy,inputClasses:["tox-textfield","tox-toolbar-textfield","tox-textfield-size"],data:e?r:a,inputBehaviours:Td([Mp.config({disabled:d}),Nx.config({}),Bd("size-input-toolbar-events",[md(zs(),(t,o)=>{nd(t,i,{isField1:e})})]),Wu.config({mode:"special",onEnter:o,onEscape:h})]),selectOnFocus:!1}),x=e=>({dom:{tag:"label",classes:["tox-label"]},components:[op(t.translate(e))]}),v=e=>({dom:{tag:"div",classes:["tox-focusable-wrapper","tox-toolbar-nav-item"]},components:[e],behaviours:Td([Nx.config({}),Pd.config({}),Wu.config({mode:"special",onEnter:e=>Kn(e.element,"input").fold(A.none,e=>(Bo(e),A.some(!0)))})])}),y=v(Uy.parts.field1(p([Py.parts.label(x("Width:")),f(!0)]))),w=v(Uy.parts.field2(p([Py.parts.label(x("Height:")),f(!1)]))),_=ye(b),C=[_D({onBeforeSetup:e=>Kn(e.element,"input").each(Bo),onSetup:e.onSetup,getApi:l},_),kD({getApi:l},_,n)];return Uy.sketch({dom:{tag:"div",classes:["tox-context-form__group"]},components:[y,p([g]),w],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:(e,t,o)=>{CB(Bf.getValue(e)).each(e=>{s(e).each(e=>{Bf.setValue(t,_B(e))})})},onInput:e=>od(e,WR),coupledFieldBehaviours:Td([Pd.config({}),Wu.config({mode:"flow",focusInside:qi.OnEnterOrSpaceMode,cycles:!1,selector:"button, .tox-focusable-wrapper"}),Mp.config({disabled:d,onDisabled:e=>{Uy.getField1(e).bind(Py.getField).each(Mp.disable),Uy.getField2(e).bind(Py.getField).each(Mp.disable),Uy.getLock(e).each(Mp.disable)},onEnabled:e=>{Uy.getField1(e).bind(Py.getField).each(Mp.enable),Uy.getField2(e).bind(Py.getField).each(Mp.enable),Uy.getLock(e).each(Mp.enable)}}),MD(()=>t.checkUiComponentContext("mode:design")),Bd("size-input-toolbar-events2",[md(i,(e,t)=>{const o=t.event.isField1,n=o?Uy.getField1(e):Uy.getField2(e),r=o?Uy.getField2(e):Uy.getField1(e),a=n.map(Bf.getValue).getOr(""),i=r.map(Bf.getValue).getOr("");s=EB(a,i)}),md(WR,t=>e.onInput(l(t))),...C])])})},HI=(e,t,o)=>Py.sketch({dom:{tag:"div",classes:["tox-context-form__group"]},components:[...e.toArray(),t],fieldBehaviours:Td([Mp.config({disabled:()=>o.checkUiComponentContext("mode:design").shouldDisable,onDisabled:e=>{(e=>{Io(e.element).each(e=>{$n(e,'[tabindex="-1"]').each(e=>{Bo(e)})})})(e),Py.getField(e).each(Mp.disable)},onEnabled:e=>{Py.getField(e).each(Mp.enable)}})])}),LI=(e,t,o,n)=>{const r=ye(b),a=e=>MI(e,n),s=e.label.map(e=>Py.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[op(t.translate(e))]})),i=Py.parts.field({factory:Yy,type:"range",inputClasses:["tox-toolbar-slider__input","tox-toolbar-nav-item"],inputAttributes:{min:String(e.min()),max:String(e.max())},data:e.initValue().toString(),fromInputValue:t=>(e=>{const t=parseFloat(e);return isNaN(t)?A.none():A.some(t)})(t).getOr(e.min()),toInputValue:e=>String(e),inputBehaviours:Td([Mp.config({disabled:()=>t.checkUiComponentContext("mode:design").shouldDisable}),MD(()=>t.checkUiComponentContext("mode:design")),Wu.config({mode:"special",onEnter:o,onLeft:(e,t)=>(t.cut(),A.none()),onRight:(e,t)=>(t.cut(),A.none())}),Bd("slider-events",[_D({onSetup:e.onSetup,getApi:a,onBeforeSetup:Wu.focusIn},r),kD({getApi:a},r,n),md(Ps(),t=>{e.onInput(a(t))})])])});return HI(s,i,t)},II=(e,t,o,n)=>{const r=ye(b),a=e=>MI(e,n),s=e.label.map(e=>Py.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[op(t.translate(e))]})),i={...e.placeholder.map(e=>({placeholder:t.translate(e)})).getOr({})},l=Py.parts.field({factory:Yy,inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-item"],inputAttributes:i,data:e.initValue(),selectOnFocus:!0,inputBehaviours:Td([Mp.config({disabled:()=>t.checkUiComponentContext("mode:design").shouldDisable}),MD(()=>t.checkUiComponentContext("mode:design")),Wu.config({mode:"special",onEnter:o,onLeft:(e,t)=>(t.cut(),A.none()),onRight:(e,t)=>(t.cut(),A.none())}),Bd("input-events",[_D({onSetup:e.onSetup,getApi:e=>$n(e.element,".tox-toolbar").bind(e=>Kn(e,"button:enabled")).fold(()=>MI(e,n),t=>MI(e,n,t)),onBeforeSetup:Wu.focusIn},r),kD({getApi:a},r,n),md(Ps(),t=>{e.onInput(a(t))})])])});return HI(s,l,t)},PI=(e,t,o)=>{const n=Ke(),r=ov(e(o,e=>s.findPrimary(e).orThunk(()=>i.findPrimary(e)).map(e=>(rd(e),!0)),n)),a=F(t.commands,e=>"start"===e.align),s=BI(r,a.pass,o,n),i=BI(r,a.fail,o,n);return V([{title:A.none(),label:A.none(),items:s.asSpecs()},{title:A.none(),label:A.none(),items:[r.asSpec()]},{title:A.none(),label:A.none(),items:i.asSpecs()}],e=>e.items.length>0)},FI=(e,t)=>{switch(e.type){case"contextform":return PI(C(II,e),e,t);case"contextsliderform":return PI(C(LI,e),e,t);case"contextsizeinputform":return PI(C(zI,e),e,t)}},VI=FI,ZI=(e,t,o)=>t.bottom-e.y>=o&&e.bottom-t.y>=o,UI=e=>{const t=(e=>{const t=e.getBoundingClientRect();if(t.height<=0&&t.width<=0){const o=xo(it.fromDom(e.startContainer),e.startOffset).element;return(oo(o)?mo(o):A.some(o)).filter(to).map(e=>e.dom.getBoundingClientRect()).getOr(t)}return t})(e.selection.getRng());if(e.inline){const e=Hn();return Ir(e.left+t.left,e.top+t.top,t.width,t.height)}{const o=Fr(it.fromDom(e.getBody()));return Ir(o.x+t.left,o.y+t.top,t.width,t.height)}},jI=(e,t,o,n=0)=>{const r=Br(window),a=Pr(it.fromDom(e.getContentAreaContainer())),s=Rk(e)||zk(e)||Lk(e),{x:i,width:l}=((e,t,o)=>{const n=Math.max(e.x+o,t.x);return{x:n,width:Math.min(e.right-o,t.right)-n}})(a,r,n);if(e.inline&&!s)return Ir(i,r.y,l,r.height);{const s=t.header.isPositionedAtTop(),{y:c,bottom:d}=((e,t,o,n,r,a)=>{const s=it.fromDom(e.getContainer()),i=Kn(s,".tox-editor-header").getOr(s),l=Pr(i),c=l.y>=t.bottom,d=n&&!c;if(e.inline&&d)return{y:Math.max(l.bottom+a,o.y),bottom:o.bottom};if(e.inline&&!d)return{y:o.y,bottom:Math.min(l.y-a,o.bottom)};const m="line"===r?Pr(s):t;return d?{y:Math.max(l.bottom+a,o.y),bottom:Math.min(m.bottom-a,o.bottom)}:{y:Math.max(m.y+a,o.y),bottom:Math.min(l.y-a,o.bottom)}})(e,a,r,s,o,n);return Ir(i,c,l,d-c)}},WI={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"],inset:["tox-pop--inset"]},$I={maxHeightFunction:Wc(),maxWidthFunction:$c()},qI=e=>"node"===e,GI=(e,t,o,n,r)=>{const a=UI(e),s=n.lastElement().exists(e=>xt(o,e));if(((e,t)=>{const o=e.selection.getRng(),n=xo(it.fromDom(o.startContainer),o.startOffset);return o.startContainer===o.endContainer&&o.startOffset===o.endOffset-1&&xt(n.element,t)})(e,o))return s?Fc:zc;if(s)return((e,t,o)=>{const n=fn(e,"position");mn(e,"position",t);const r=o(e);return n.each(t=>mn(e,"position",t)),r})(t,n.getMode(),()=>ZI(a,Pr(t),-20)&&!n.isReposition()?Zc:Fc);return("fixed"===n.getMode()?r.y+Hn().top:r.y)+(Cn(t)+12)<=a.y?zc:Hc},KI=(e,t,o,n)=>{const r=t=>(n,r,a,s,i)=>({...GI(e,s,t,o,i)({...n,y:i.y,height:i.height},r,a,s,i),alwaysFit:!0}),a=e=>qI(n)?[r(e)]:[];return t?{onLtr:e=>[gc,lc,cc,dc,mc,uc].concat(a(e)),onRtl:e=>[gc,cc,lc,mc,dc,uc].concat(a(e))}:{onLtr:e=>[uc,gc,dc,lc,mc,cc].concat(a(e)),onRtl:e=>[uc,gc,mc,cc,dc,lc].concat(a(e))}},YI=(e,t)=>{const o=V(t,t=>t.predicate(e.dom)),{pass:n,fail:r}=F(o,e=>"contexttoolbar"===e.type);return{contextToolbars:n,contextForms:r}},XI=(e,t,o)=>{const n=YI(e,t);if(n.contextForms.length>0)return A.some({elem:e,toolbars:[n.contextForms[0]]});{const t=YI(e,o);if(t.contextForms.length>0)return A.some({elem:e,toolbars:[t.contextForms[0]]});if(n.contextToolbars.length>0||t.contextToolbars.length>0){const o=(e=>{if(e.length<=1)return e;{const t=t=>z(e,e=>e.position===t),o=t=>V(e,e=>e.position===t),n=t("selection"),r=t("node");if(n||r){if(r&&n){const e=o("node"),t=I(o("selection"),e=>({...e,position:"node"}));return e.concat(t)}return o(n?"selection":"node")}return o("line")}})(n.contextToolbars.concat(t.contextToolbars));return A.some({elem:e,toolbars:o})}return A.none()}},JI=(e,t,o)=>e(t)?A.none():xr(t,e=>{if(to(e)){const{contextToolbars:t,contextForms:n}=YI(e,o.inNodeScope),r=n.length>0?n:(e=>{if(e.length<=1)return e;{const t=t=>j(e,e=>e.position===t),o=t("selection").orThunk(()=>t("node")).orThunk(()=>t("line")).map(e=>e.position);return o.fold(()=>[],t=>V(e,e=>e.position===t))}})(t);return r.length>0?A.some({elem:e,toolbars:r}):A.none()}return A.none()},e),QI=(e,t)=>{const o={},n=[],r=[],a={},s={},i=(e,i)=>{const l=Va(Fa("ContextForm",IA,i));o[e]=l,l.launch.map(o=>{a["form:"+e]={...i.launch,type:"contextformtogglebutton"===o.type?"togglebutton":"button",onAction:()=>{t(l)}}}),"editor"===l.scope?r.push(l):n.push(l),s[e]=l},l=(e,o)=>{var i;(i=o,Fa("ContextToolbar",FA,i)).each(i=>{i.launch.isSome()&&(a["toolbar:"+e]={...o.launch,type:"button",onAction:()=>{t(i)}}),"editor"===o.scope?r.push(i):n.push(i),s[e]=i})},c=ae(e);return P(c,t=>{const o=e[t];"contextform"===o.type||"contextsliderform"===o.type||"contextsizeinputform"===o.type?i(t,o):"contexttoolbar"===o.type&&l(t,o)}),{forms:o,inNodeScope:n,inEditorScope:r,lookupTable:s,formNavigators:a}},eP="tox-pop--transition",tP=(e,t,o,n)=>{const r=n.backstage,s=r.shared,i=Gt().deviceType.isTouch,l=Ke(),c=Ke(),d=Ke(),m=(e=>{const t=ye([]),o=Wy.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:e=>{t.set([]),Wy.getContent(e).each(e=>{vn(e.element,"visibility")}),ar(e.element,RL),vn(e.element,"width")},onHide:()=>{t.set([]),e.onHide()},inlineBehaviours:Td([Bd("context-toolbar-events",[xd(Us(),(e,t)=>{"width"===t.event.raw.propertyName&&(ar(e.element,RL),vn(e.element,"width"))}),md(ML,(e,t)=>{const o=e.element;vn(o,"width");const n=Tn(o),r=Io(e.element).isSome();vn(o,"left"),vn(o,"right"),vn(o,"max-width"),Wy.setContent(e,t.event.contents),nr(o,RL);const a=Tn(o);mn(o,"transition","none"),Wy.reposition(e),vn(o,"transition"),mn(o,"width",n+"px"),t.event.focus.fold(()=>{r&&TL(e)},t=>{Lo(wo(e.element)).fold(()=>Bo(t),e=>{xt(e,t)||Bo(t)})}),setTimeout(()=>{mn(e.element,"width",a+"px")},0)}),md(AL,(e,o)=>{Wy.getContent(e).each(o=>{t.set(t.get().concat([{bar:o,focus:Lo(wo(e.element))}]))}),nd(e,ML,{contents:o.event.forwardContents,focus:A.none()})}),md(DL,(o,n)=>{e.onBack(),oe(t.get()).each(e=>{t.set(t.get().slice(0,t.get().length-1)),nd(o,ML,{contents:ip(e.bar),focus:e.focus})})})]),Wu.config({mode:"special",onEscape:o=>oe(t.get()).fold(()=>e.onEscape(),e=>(od(o,DL),A.some(!0)))})]),lazySink:()=>Ae.value(e.sink)});return{sketch:o,inSubtoolbar:()=>t.get().length>0}})({sink:o,onEscape:()=>(e.focus(),OM(e),A.some(!0)),onHide:()=>{OM(e)},onBack:()=>{(e=>{e.dispatch("ContextFormSlideBack")})(e)}}),u=sp(m.sketch),g=()=>{const t=d.get().getOr("node"),o=qI(t)?1:0;return jI(e,s,t,o)},p=()=>!(e.removed||i()&&r.isContextMenuOpen()),h=()=>{if(p()){const t=g(),o=Ve(d.get(),"node")?((e,t)=>t.filter(e=>an(e)&&eo(e)).map(Fr).getOrThunk(()=>UI(e)))(e,l.get()):UI(e);return t.height<=0||!ZI(o,t,.01)}return!0},f=()=>{l.clear(),c.clear(),d.clear(),Wy.hide(u)},x=()=>{if(Wy.isOpen(u)){const e=u.element;vn(e,"display"),h()?mn(e,"display","none"):(c.set(0),Wy.reposition(u))}},v=t=>({dom:{tag:"div",classes:["tox-pop__dialog"]},components:[t],behaviours:Td([Wu.config({mode:"acyclic"}),Bd("pop-dialog-wrap-events",[vd(t=>{e.shortcuts.add("ctrl+F9","focus statusbar",()=>Wu.focusIn(t))}),yd(t=>{e.shortcuts.remove("ctrl+F9")})])])}),y=e=>{const t=_([e]);nd(u,AL,{forwardContents:v(t)})},w=at(()=>QI(t,y)),_=t=>{const{buttons:o}=e.ui.registry.getAll(),r={...o,...w().formNavigators},i=rk(e)===zC.scrolling?zC.scrolling:zC.default,l=$(I(t,t=>{return"contexttoolbar"===t.type?((t,o)=>fI(e,{buttons:t,toolbar:o.items,allowToolbarGroups:!1},n.backstage,A.some(["form:","toolbar:"])))(r,(o=t,{...o,launch:o.launch.getOrUndefined(),items:a(o.items)?o.items:I(o.items,VA)})):((e,t)=>VI(e,t))(t,s.providers);var o}));return IH({type:i,uid:Le("context-toolbar"),initGroups:l,onEscape:A.none,cyclicKeying:!0,providers:s.providers})},C=(t,n)=>{const r="node"===t?s.anchors.node(n):s.anchors.cursor(),a=((e,t,o,n)=>"line"===t?{bubble:Zl(12,0,WI),layouts:{onLtr:()=>[pc],onRtl:()=>[hc]},overrides:$I}:{bubble:Zl(0,12,WI,1/12),layouts:KI(e,o,n,t),overrides:$I})(e,t,i(),{lastElement:l.get,isReposition:()=>Ve(c.get(),0),getMode:()=>Wb.getMode(o)});return Pe(r,a)},k=(e,t)=>{if(E.cancel(),!p())return;const n=_(e),r=e[0].position,a=C(r,t);d.set(r),c.set(1);const s=u.element;vn(s,"display"),(e=>Ve(Ue(e,l.get(),xt),!0))(t)||(ar(s,eP),Wb.reset(o,u)),Wy.showWithinBounds(u,v(n),{anchor:a,transition:{classes:[eP],mode:"placement"}},()=>A.some(g())),t.fold(l.clear,l.set),h()&&mn(s,"display","none")};let S=!1;const E=rt(()=>{if(e.hasFocus()&&!e.removed&&!S)if(ir(u.element,eP))E.throttle();else{((e,t)=>{const o=it.fromDom(t.getBody()),n=e=>xt(e,o),r=it.fromDom(t.selection.getNode());return(e=>!n(e)&&!vt(o,e))(r)?A.none():XI(r,e.inNodeScope,e.inEditorScope).orThunk(()=>JI(n,r,e))})(w(),e).fold(f,e=>{k(e.toolbars,A.some(e.elem))})}},17);e.on("init",()=>{e.on("remove",f),e.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",x),e.on("click focus SetContent",E.throttle),e.on("keyup",e=>{var t;((t=e.keyCode)!==QL.ENTER&&t!==QL.SPACEBAR||!m.inSubtoolbar())&&E.throttle()}),e.on(DI,f),e.on("contexttoolbar-show",t=>{const o=w();fe(o.lookupTable,t.toolbarKey).each(o=>{k([o],We(t.target!==e,t.target)),TL(u)})}),e.on("focusout",t=>{IC.setEditorTimeout(e,()=>{Io(o.element).isNone()&&Io(u.element).isNone()&&!e.hasFocus()&&f()},0)}),e.on("SwitchMode",()=>{e.mode.isReadOnly()&&f()}),e.on("DisabledStateChange",e=>{e.state&&f()}),e.on("ExecCommand",({command:e})=>{"toggleview"===e.toLowerCase()&&f()}),e.on("AfterProgressState",t=>{t.state?f():e.hasFocus()&&E.throttle()}),e.on("dragstart",()=>{S=!0}),e.on("dragend drop",()=>{S=!1}),e.on("NodeChange",e=>{m.inSubtoolbar()?(mn(u.element,"transition","none"),x(),vn(u.element,"transition")):Io(u.element).fold(E.throttle,b)})})},oP=(e,t)=>{const o=()=>{const o=t.getOptions(e),n=t.getCurrent(e).map(t.hash),r=Ke();return I(o,o=>({type:"togglemenuitem",text:t.display(o),onSetup:a=>{const s=e=>{e&&(r.on(e=>e.setActive(!1)),r.set(a)),a.setActive(e)};s(Ve(n,t.hash(o)));const i=t.watcher(e,o,s);return()=>{r.clear(),i()}},onAction:()=>t.setCurrent(e,o)}))};e.ui.registry.addMenuButton(t.name,{tooltip:t.text,icon:t.icon,fetch:e=>e(o()),onSetup:t.onToolbarSetup}),e.ui.registry.addNestedMenuItem(t.name,{type:"nestedmenuitem",text:t.text,getSubmenuItems:o,onSetup:t.onMenuSetup})},nP=e=>({name:"lineheight",text:"Line height",icon:"line-height",getOptions:Bk,hash:e=>((e,t)=>Rr(e,t).map(({value:e,unit:t})=>e+t))(e,["fixed","relative","empty"]).getOr(e),display:w,watcher:(e,t,o)=>e.formatter.formatChanged("lineheight",o,!1,{value:t}).unbind,getCurrent:e=>A.from(e.queryCommandValue("LineHeight")),setCurrent:(e,t)=>e.execCommand("LineHeight",!1,t),onToolbarSetup:AM(e),onMenuSetup:AM(e)}),rP=e=>{oP(e,nP(e)),(e=>A.from(ok(e)).map(t=>({name:"language",text:"Language",icon:"language",getOptions:y(t),hash:e=>m(e.customCode)?e.code:`${e.code}/${e.customCode}`,display:e=>e.title,watcher:(e,t,o)=>{var n;return e.formatter.formatChanged("lang",o,!1,{value:t.code,customValue:null!==(n=t.customCode)&&void 0!==n?n:null}).unbind},getCurrent:e=>{const t=it.fromDom(e.selection.getNode());return vr(t,e=>A.some(e).filter(to).bind(e=>Go(e,"lang").map(t=>({code:t,customCode:Go(e,"data-mce-lang").getOrUndefined(),title:""}))))},setCurrent:(e,t)=>e.execCommand("Lang",!1,t),onToolbarSetup:t=>{const o=Ge();return t.setActive(e.formatter.match("lang",{},void 0,!0)),o.set(e.formatter.formatChanged("lang",t.setActive,!0)),TM(o.clear,AM(e)(t))},onMenuSetup:AM(e)})))(e).each(t=>oP(e,t))},aP=(e,t)=>{((e,t)=>{const o=zL(t,ZL(e));e.ui.registry.addNestedMenuItem("align",{text:t.shared.providers.translate("Align"),onSetup:AM(e),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})})(e,t),((e,t)=>{const o=zL(t,JL(e));e.ui.registry.addNestedMenuItem("fontfamily",{text:t.shared.providers.translate("Fonts"),onSetup:AM(e),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})})(e,t),((e,t)=>{const o={type:"advanced",...t.styles},n=zL(t,cI(e,o));e.ui.registry.addNestedMenuItem("styles",{text:"Formats",onSetup:AM(e,()=>n.getStyleItems().length>0),getSubmenuItems:()=>n.items.validateItems(n.getStyleItems())})})(e,t),((e,t)=>{const o=zL(t,$L(e));e.ui.registry.addNestedMenuItem("blocks",{text:"Blocks",onSetup:AM(e),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})})(e,t),((e,t)=>{const o=zL(t,iI(e));e.ui.registry.addNestedMenuItem("fontsize",{text:"Font sizes",onSetup:AM(e),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})})(e,t)},sP=e=>MM(e,"NodeChange",t=>{t.setEnabled(e.queryCommandState("outdent")&&e.selection.isEditable())}),iP=e=>{(e=>{e.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:sP(e),onAction:NM(e,"outdent")}),e.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onSetup:AM(e),onAction:NM(e,"indent")})})(e)},lP=(e,t)=>o=>{o.setActive(t.get());const n=e=>{t.set(e.state),o.setActive(e.state)};return e.on("PastePlainTextToggle",n),TM(()=>e.off("PastePlainTextToggle",n),AM(e)(o))},cP=(e,t)=>()=>{e.execCommand("mceToggleFormat",!1,t)},dP=e=>{(e=>{TN.each([{name:"bold",text:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],(t,o)=>{e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onSetup:DM(e,t.name),onAction:cP(e,t.name),shortcut:t.shortcut})});for(let t=1;t<=6;t++){const o="h"+t,n=`Access+${t}`;e.ui.registry.addToggleButton(o,{text:o.toUpperCase(),tooltip:"Heading "+t,onSetup:DM(e,o),onAction:cP(e,o),shortcut:n})}})(e),(e=>{TN.each([{name:"copy",text:"Copy",action:"Copy",icon:"copy",context:"any"},{name:"help",text:"Help",action:"mceHelp",icon:"help",shortcut:"Alt+0",context:"any"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A",context:"any"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"print",text:"Print",action:"mcePrint",icon:"print",shortcut:"Meta+P",context:"any"}],t=>{e.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onAction:NM(e,t.action),shortcut:t.shortcut,context:t.context})}),TN.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"},{name:"hr",text:"Horizontal line",action:"InsertHorizontalRule",icon:"horizontal-rule"}],t=>{e.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onSetup:AM(e),onAction:NM(e,t.action)})})})(e),(e=>{TN.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],t=>{e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:NM(e,t.action),onSetup:DM(e,t.name)})})})(e)},mP=e=>{dP(e),(e=>{TN.each([{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C",context:"any"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A",context:"any"},{name:"print",text:"Print...",action:"mcePrint",icon:"print",shortcut:"Meta+P",context:"any"}],t=>{e.ui.registry.addMenuItem(t.name,{text:t.text,icon:t.icon,shortcut:t.shortcut,onAction:NM(e,t.action),context:t.context})}),TN.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"hr",text:"Horizontal line",action:"InsertHorizontalRule",icon:"horizontal-rule"}],t=>{e.ui.registry.addMenuItem(t.name,{text:t.text,icon:t.icon,shortcut:t.shortcut,onSetup:AM(e),onAction:NM(e,t.action)})}),e.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onSetup:AM(e),onAction:cP(e,"code")})})(e)},uP=(e,t)=>MM(e,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",o=>{o.setEnabled(!e.mode.isReadOnly()&&e.undoManager[t]())}),gP=e=>{(e=>{e.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:uP(e,"hasUndo"),onAction:NM(e,"undo")}),e.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:uP(e,"hasRedo"),onAction:NM(e,"redo")})})(e),(e=>{e.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",enabled:!1,onSetup:uP(e,"hasUndo"),onAction:NM(e,"undo"),shortcut:"Meta+Z"}),e.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",enabled:!1,onSetup:uP(e,"hasRedo"),onAction:NM(e,"redo"),shortcut:"Meta+Y"})})(e)},pP=e=>MM(e,"VisualAid",t=>{t.setActive(e.hasVisual)}),hP=e=>{(e=>{e.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:NM(e,"mceToggleVisualAid"),context:"any"})})(e),(e=>{e.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:pP(e),onAction:NM(e,"mceToggleVisualAid"),context:"any"})})(e)},fP=(e,t)=>{(e=>{P([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],t=>{e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:NM(e,t.cmd),onSetup:DM(e,t.name)})}),e.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onSetup:AM(e),onAction:NM(e,"JustifyNone")})})(e),mP(e),aP(e,t),gP(e),(e=>{(e=>{e.addCommand("mceApplyTextcolor",(t,o)=>{((e,t,o)=>{e.undoManager.transact(()=>{e.focus(),e.formatter.apply(t,{value:o}),e.nodeChanged()})})(e,t,o)}),e.addCommand("mceRemoveTextcolor",t=>{((e,t)=>{e.undoManager.transact(()=>{e.focus(),e.formatter.remove(t,{value:null},void 0,!0),e.nodeChanged()})})(e,t)})})(e);const t=KM(e),o=YM(e),n=ye(t),r=ye(o);iR(e,"forecolor","forecolor",n),iR(e,"backcolor","hilitecolor",r),lR(e,"forecolor","forecolor","Text color",n),lR(e,"backcolor","hilitecolor","Background color",r)})(e),hP(e),iP(e),rP(e),(e=>{const t=ye(Sk(e)),o=()=>e.execCommand("mceTogglePlainTextPaste");e.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:o,onSetup:lP(e,t)}),e.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:o,onSetup:lP(e,t)})})(e),(e=>{e.ui.registry.addContext("editable",()=>e.selection.isEditable()),e.ui.registry.addContext("mode",t=>e.mode.get()===t),e.ui.registry.addContext("any",T),e.ui.registry.addContext("formatting",t=>e.formatter.canApply(t)),e.ui.registry.addContext("insert",t=>e.schema.isValidChild(e.selection.getNode().tagName,t))})(e)},bP=e=>a(e)?e.split(/[ ,]/):e,xP=e=>t=>t.options.get(e),vP=xP("contextmenu_never_use_native"),yP=xP("contextmenu_avoid_overlap"),wP=e=>{const t=e.ui.registry.getAll().contextMenus,o=e.options.get("contextmenu");return e.options.isSet("contextmenu")?o:V(o,e=>be(t,e))},_P=(e,t)=>({type:"makeshift",x:e,y:t}),CP=e=>"longpress"===e.type||0===e.type.indexOf("touch"),kP=(e,t)=>{const o=PC.DOM.getPos(e);return((e,t,o)=>_P(e.x+t,e.y+o))(t,o.x,o.y)},SP=(e,t)=>"contextmenu"===t.type||"longpress"===t.type?e.inline?(e=>{if(CP(e)){const t=e.touches[0];return _P(t.pageX,t.pageY)}return _P(e.pageX,e.pageY)})(t):kP(e.getContentAreaContainer(),(e=>{if(CP(e)){const t=e.touches[0];return _P(t.clientX,t.clientY)}return _P(e.clientX,e.clientY)})(t)):EP(e),EP=e=>({type:"selection",root:it.fromDom(e.selection.getNode())}),OP=(e,t,o)=>{switch(o){case"node":return(e=>({type:"node",node:A.some(it.fromDom(e.selection.getNode())),root:it.fromDom(e.getBody())}))(e);case"point":return SP(e,t);case"selection":return EP(e)}},TP=(e,t,o,n,r,a)=>{const s=o(),i=OP(e,t,a);bB(s,yE.CLOSE_ON_EXECUTE,n,{isHorizontalMenu:!1,search:A.none()}).map(e=>{t.preventDefault(),Wy.showMenuAt(r,{anchor:i},{menu:{markers:zE("normal")},data:e})})},AP={onLtr:()=>[gc,lc,cc,dc,mc,uc,zc,Hc,Bc,Rc,Nc,Mc],onRtl:()=>[gc,cc,lc,mc,dc,uc,zc,Hc,Nc,Mc,Bc,Rc]},DP={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},MP=(e,t,o,n,r,a,s)=>{const i=((e,t,o)=>{const n=OP(e,t,o);return{bubble:Zl(0,"point"===o?12:0,DP),layouts:AP,overrides:{maxWidthFunction:$c(),maxHeightFunction:Wc()},...n}})(e,t,a);bB(o,yE.CLOSE_ON_EXECUTE,n,{isHorizontalMenu:!0,search:A.none()}).map(o=>{t.preventDefault();const l=s?Yc.HighlightMenuAndItem:Yc.HighlightNone;Wy.showMenuWithinBounds(r,{anchor:i},{menu:{markers:zE("normal"),highlightOnOpen:l},data:o,type:"horizontal"},()=>A.some(jI(e,n.shared,"node"===a?"node":"selection"))),e.dispatch(DI)})},RP=(e,t,o,n,r,a)=>{const s=Gt(),i=s.os.isiOS(),l=s.os.isMacOS(),c=s.os.isAndroid(),d=s.deviceType.isTouch(),m=()=>{const s=o();MP(e,t,s,n,r,a,!(c||i||l&&d))};if((l||i)&&"node"!==a){const o=()=>{(e=>{const t=e.selection.getRng(),o=()=>{IC.setEditorTimeout(e,()=>{e.selection.setRng(t)},10),a()};e.once("touchend",o);const n=e=>{e.preventDefault(),e.stopImmediatePropagation()};e.on("mousedown",n,!0);const r=()=>a();e.once("longpresscancel",r);const a=()=>{e.off("touchend",o),e.off("longpresscancel",r),e.off("mousedown",n)}})(e),m()};((e,t)=>{const o=e.selection;if(o.isCollapsed()||t.touches.length<1)return!1;{const n=t.touches[0],r=o.getRng();return Tr(e.getWin(),kr.domRange(r)).exists(e=>e.left<=n.clientX&&e.right>=n.clientX&&e.top<=n.clientY&&e.bottom>=n.clientY)}})(e,t)?o():(e.once("selectionchange",o),e.once("touchend",()=>e.off("selectionchange",o)))}else m()},NP=e=>a(e)?"|"===e:"separator"===e.type,BP={type:"separator"},zP=e=>{const t=e=>({text:e.text,icon:e.icon,enabled:e.enabled,shortcut:e.shortcut});if(a(e))return e;switch(e.type){case"separator":return BP;case"submenu":return{type:"nestedmenuitem",...t(e),getSubmenuItems:()=>{const t=e.getSubmenuItems();return a(t)?t:I(t,zP)}};default:const o=e;return{type:"menuitem",...t(o),onAction:x(o.onAction)}}},HP=(e,t)=>{if(0===t.length)return e;const o=oe(e).filter(e=>!NP(e)),n=o.fold(()=>[],e=>[BP]);return e.concat(n).concat(t).concat([BP])},LP=(e,t)=>!(e=>"longpress"===e.type||be(e,"touches"))(t)&&(2!==t.button||t.target===e.getBody()&&""===t.pointerType),IP=(e,t)=>LP(e,t)?e.selection.getStart(!0):t.target,PP=(e,t,o)=>{const n=Gt().deviceType.isTouch,r=sp(Wy.sketch({dom:{tag:"div"},lazySink:t,onEscape:()=>e.focus(),onShow:()=>o.setContextMenuState(!0),onHide:()=>o.setContextMenuState(!1),fireDismissalEventInstead:{},inlineBehaviours:Td([Bd("dismissContextMenu",[md(mi(),(t,o)=>{cx.close(t),e.focus()})])])})),s=()=>Wy.hide(r),i=t=>{if(vP(e)&&t.preventDefault(),((e,t)=>t.ctrlKey&&!vP(e))(e,t)||(e=>0===wP(e).length)(e))return;const s=((e,t)=>{const o=yP(e),n=LP(e,t)?"selection":"point";if(ot(o)){const r=IP(e,t);return fr(it.fromDom(r),o)?"node":n}return n})(e,t);(n()?RP:TP)(e,t,()=>{const o=IP(e,t),n=e.ui.registry.getAll(),r=wP(e);return((e,t,o)=>{const n=U(t,(t,n)=>fe(e,n.toLowerCase()).map(e=>{const n=e.update(o);if(a(n)&&ot(tt(n)))return HP(t,n.split(" "));if(l(n)&&n.length>0){const e=I(n,zP);return HP(t,e)}return t}).getOrThunk(()=>t.concat([n])),[]);return n.length>0&&NP(n[n.length-1])&&n.pop(),n})(n.contextMenus,r,o)},o,r,s)};e.on("init",()=>{const t="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(n()?"":" ResizeWindow");e.on(t,s),e.on("longpress contextmenu",i)})},FP=(e,t,o,n,r,a)=>e.fold(()=>uf.snap({sensor:yh(o-20,n-20),range:Rn(r,a),output:yh(A.some(o),A.some(n)),extra:{td:t}}),e=>{const r=o-20,a=n-20,s=e.element.dom.getBoundingClientRect();return uf.snap({sensor:yh(r,a),range:Rn(40,40),output:yh(A.some(o-s.width/2),A.some(n-s.height/2)),extra:{td:t}})}),VP=(e,t,o)=>({getSnapPoints:e,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:(e,n)=>{const r=n.td;((e,t)=>e.exists(e=>xt(e,t)))(t.get(),r)||(t.set(r),o(r))},mustSnap:!0}),ZP=e=>ov(yv.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:Td([uf.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:e}),ev.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}})),UP=(e,t)=>{const o=ye([]),n=ye([]),r=ye(!1),a=Ke(),s=Ke(),i=e=>{const o=Fr(e);return FP(m.getOpt(t),e,o.x,o.y,o.width,o.height)},l=e=>{const o=Fr(e);return FP(u.getOpt(t),e,o.right,o.bottom,o.width,o.height)},c=VP(()=>I(o.get(),e=>i(e)),a,t=>{s.get().each(o=>{e.dispatch("TableSelectorChange",{start:t,finish:o})})}),d=VP(()=>I(n.get(),e=>l(e)),s,t=>{a.get().each(o=>{e.dispatch("TableSelectorChange",{start:o,finish:t})})}),m=ZP(c),u=ZP(d),g=sp(m.asSpec()),p=sp(u.asSpec()),h=(t,o,n,r)=>{const a=n(o);uf.snapTo(t,a);((t,o,n,r)=>{const a=o.dom.getBoundingClientRect();vn(t.element,"display");const s=co(it.fromDom(e.getBody())).dom.innerHeight,i=n(a),l=r(a,s);(i||l)&&mn(t.element,"display","none")})(t,o,e=>e[r]<0,(e,t)=>e[r]>t)},f=e=>h(g,e,i,"top"),b=e=>h(p,e,l,"bottom");if(Gt().deviceType.isTouch()){const i=e=>I(e,it.fromDom);e.on("TableSelectionChange",e=>{r.get()||(ng(t,g),ng(t,p),r.set(!0));const l=it.fromDom(e.start),c=it.fromDom(e.finish);a.set(l),s.set(c),A.from(e.otherCells).each(e=>{o.set(i(e.upOrLeftCells)),n.set(i(e.downOrRightCells)),f(l),b(c)})}),e.on("ResizeEditor ResizeWindow ScrollContent",()=>{a.get().each(f),s.get().each(b)}),e.on("TableSelectionClear",()=>{r.get()&&(sg(g),sg(p),r.set(!1)),a.clear(),s.clear()})}};const jP=e=>"BR"===e.nodeName||!!e.getAttribute("data-mce-bogus")||"bookmark"===e.getAttribute("data-mce-type"),WP=(e,t,o)=>{var n;const r=null!==(n=t.delimiter)&&void 0!==n?n:"›",a=(t,n,r)=>yv.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{"data-index":r}},components:[op(t)],action:t=>{e.focus(),e.selection.select(n),e.nodeChanged()},buttonBehaviours:Td([Qx.config({...o.tooltips.getConfig({tooltipText:o.translate(["Select the {0} element",n.nodeName.toLowerCase()]),onShow:(e,t)=>{((e,t)=>{const o=A.from(qo(e,"id")).getOrThunk(()=>{const e=Le("aria");return Wo(t,"id",e),e});Wo(e,"aria-describedby",o)})(e.element,t.element)},onHide:e=>{var t;t=e.element,Yo(t,"aria-describedby")}})}),xD(o.isDisabled),MD(()=>o.checkUiComponentContext("any"))])});return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:Td([Wu.config({mode:"flow",selector:"div[role=button]"}),Mp.config({disabled:o.isDisabled}),MD(()=>o.checkUiComponentContext("any")),Nx.config({}),kg.config({}),Bd("elementPathEvents",[vd((t,o)=>{e.shortcuts.add("alt+F11","focus statusbar elementpath",()=>Wu.focusIn(t)),e.on("NodeChange",o=>{const n=(t=>{const o=[];let n=t.length;for(;n-- >0;){const r=t[n];if(1===r.nodeType&&!jP(r)){const t=EM(e,r);if(t.isDefaultPrevented()||o.push({name:t.name,element:r}),t.isPropagationStopped())break}}return o})(o.parents),s=n.length>0?U(n,(e,t,o)=>{const n=a(t.name,t.element,o);return 0===o?e.concat([n]):e.concat([{dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0}},components:[op(` ${r} `)]},n])},[]):[];kg.set(t,s)})})])]),components:[]}};var $P;!function(e){e[e.None=0]="None",e[e.Both=1]="Both",e[e.Vertical=2]="Vertical"}($P||($P={}));const qP=(e,t,o)=>{const n=it.fromDom(e.getContainer()),r=((e,t,o,n,r)=>{const a={height:_I(n+t.top,YC(e),JC(e))};return o===$P.Both&&(a.width=_I(r+t.left,KC(e),XC(e))),a})(e,t,o,Cn(n),Tn(n));ie(r,(e,t)=>{h(e)&&mn(n,t,wI(e))}),(e=>{e.dispatch("ResizeEditor")})(e)},GP=(e,t,o,n)=>{const r=Rn(20*o,20*n);return qP(e,r,t),A.some(!0)},KP=(e,t)=>{const o=(e=>{const t=kk(e);return!1===t?$P.None:"both"===t?$P.Both:$P.Vertical})(e);if(o===$P.None)return A.none();const n=o===$P.Both?"Press the arrow keys to resize the editor.":"Press the Up and Down arrow keys to resize the editor.",r=o===$P.Both?"tox-statusbar__resize-cursor-both":"tox-statusbar__resize-cursor-default";return A.some(pE("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle",r],attributes:{"aria-label":t.translate(n),"data-mce-name":"resize-handle"},behaviours:[uf.config({mode:"mouse",repositionTarget:!1,onDrag:(t,n,r)=>qP(e,r,o),blockerClass:"tox-blocker"}),Wu.config({mode:"special",onLeft:()=>GP(e,o,-1,0),onRight:()=>GP(e,o,1,0),onUp:()=>GP(e,o,0,-1),onDown:()=>GP(e,o,0,1)}),Nx.config({}),Pd.config({}),Qx.config(t.tooltips.getConfig({tooltipText:t.translate("Resize")}))]},t.icons))},YP=(e,t)=>{const o=()=>{const o=[];return e.hasPlugin("wordcount")&&o.push(((e,t)=>{const o=(e,o,n)=>kg.set(e,[op(t.translate(["{0} "+n,o[n]]))]);return yv.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:Td([xD(t.isDisabled),MD(()=>t.checkUiComponentContext("any")),Nx.config({}),kg.config({}),Bf.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Bd("wordcount-events",[_d(e=>{const t=Bf.getValue(e),n="words"===t.mode?"characters":"words";Bf.setValue(e,{mode:n,count:t.count}),o(e,t.count,n)}),vd(t=>{e.on("wordCountUpdate",e=>{const{mode:n}=Bf.getValue(t);Bf.setValue(t,{mode:n,count:e.wordCount}),o(t,e.wordCount,n)})})])]),eventOrder:{[Js()]:["disabling","alloy.base.behaviour","wordcount-events"]}})})(e,t)),Ck(e)&&o.push({dom:{tag:"span",classes:["tox-statusbar__branding"]},components:[{dom:{tag:"a",attributes:{href:"https://www.tiny.cloud/powered-by-tiny?utm_campaign=poweredby&utm_source=tiny&utm_medium=referral&utm_content=v7",rel:"noopener",target:"_blank","aria-label":e.translate(["Build with {0}","TinyMCE"])},innerHtml:e.translate(["Build with {0}",'<svg height="16" viewBox="0 0 80 16" width="80" xmlns="http://www.w3.org/2000/svg"><g opacity=".8"><path d="m80 3.537v-2.202h-7.976v11.585h7.976v-2.25h-5.474v-2.621h4.812v-2.069h-4.812v-2.443zm-10.647 6.929c-.493.217-1.13.337-1.864.337s-1.276-.156-1.805-.47a3.732 3.732 0 0 1 -1.3-1.298c-.324-.554-.48-1.191-.48-1.877s.156-1.335.48-1.877a3.635 3.635 0 0 1 1.3-1.299 3.466 3.466 0 0 1 1.805-.481c.65 0 .914.06 1.263.18.36.12.698.277.986.47.289.192.578.384.842.6l.12.085v-2.586l-.023-.024c-.385-.35-.855-.614-1.384-.818-.53-.205-1.155-.313-1.877-.313-.721 0-1.6.144-2.333.445a5.773 5.773 0 0 0 -1.937 1.251 5.929 5.929 0 0 0 -1.324 1.9c-.324.735-.48 1.565-.48 2.455s.156 1.72.48 2.454c.325.734.758 1.383 1.324 1.913.553.53 1.215.938 1.937 1.25a6.286 6.286 0 0 0 2.333.434c.819 0 1.384-.108 1.961-.313.59-.216 1.083-.505 1.468-.866l.024-.024v-2.49l-.12.096c-.41.337-.878.626-1.396.866zm-14.869-4.15-4.8-5.04-.024-.025h-.902v11.67h2.502v-6.847l2.827 3.08.385.409.397-.41 2.791-3.067v6.845h2.502v-11.679h-.902l-4.788 5.052z"/><path clip-rule="evenodd" d="m15.543 5.137c0-3.032-2.466-5.113-4.957-5.137-.36 0-.745.024-1.094.096-.157.024-3.85.758-3.85.758-3.032.602-4.62 2.466-4.704 4.788-.024.89-.024 4.27-.024 4.27.036 3.165 2.406 5.138 5.017 5.126.337 0 1.119-.109 1.287-.145.144-.024.385-.084.746-.144.661-.12 1.684-.325 3.067-.602 2.37-.409 4.103-2.009 4.44-4.33.156-1.023.084-4.692.084-4.692zm-3.213 3.308-2.346.457v2.31l-5.859 1.143v-5.75l2.346-.458v3.441l3.513-.686v-3.44l-3.513.685v-2.297l5.859-1.143v5.75zm20.09-3.296-.083-1.023h-2.13v8.794h2.346v-4.884c0-1.107.95-1.985 2.057-1.997 1.095 0 1.901.89 1.901 1.997v4.884h2.346v-5.245c-.012-2.105-1.588-3.777-3.67-3.765a3.764 3.764 0 0 0 -2.778 1.25l.012-.011zm-6.014-4.102 2.346-.458v2.298l-2.346.457z" fill-rule="evenodd"/><path d="m28.752 4.126h-2.346v8.794h2.346z"/><path clip-rule="evenodd" d="m43.777 15.483 4.043-11.357h-2.418l-1.54 4.355-.445 1.324-.36-1.324-1.54-4.355h-2.418l3.151 8.794-1.083 3.08zm-21.028-5.51c0 .722.541 1.034.878 1.034s.638-.048.95-.144l.518 1.708c-.217.145-.879.518-2.13.518a2.565 2.565 0 0 1 -2.562-2.587c-.024-1.082-.024-2.49 0-4.21h-1.54v-2.142h1.54v-1.912l2.346-.458v2.37h2.201v2.142h-2.2v3.693-.012z" fill-rule="evenodd"/></g></svg>\n'.trim()])},behaviours:Td([Pd.config({})])}]}),{dom:{tag:"div",classes:["tox-statusbar__right-container"]},components:o}},n=()=>{const n=[],r=Tk(e),a=_k(e),s=Ck(e)||e.hasPlugin("wordcount"),i=()=>{const e="tox-statusbar__text-container--flex-start",t="tox-statusbar__text-container--flex-end";if(r){const o="tox-statusbar__text-container-3-cols";return s||a?s&&!a?[o,t]:[o,e]:[o,"tox-statusbar__text-container--space-around"]}return[s&&!a?t:e]};return a&&n.push(WP(e,{},t)),r&&n.push((()=>{const e=ID("Alt+0");return{dom:{tag:"div",classes:["tox-statusbar__help-text"]},components:[op(aE.translate(["Press {0} for help",e]))]}})()),s&&n.push(o()),n.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container",...i()]},components:n}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:(()=>{const o=n(),r=KP(e,t);return o.concat(r.toArray())})()}},XP=(e,t)=>t.get().getOrDie(`UI for ${e} has not been rendered`),JP=(e,t)=>{const o=e.inline,n=o?AI:yI,r=Uk(e)?yH:dH,a=(()=>{const e=Ke(),t=Ke(),o=Ke();return{dialogUi:e,popupUi:t,mainUi:o,getUiMotherships:()=>{const o=e.get().map(e=>e.mothership),n=t.get().map(e=>e.mothership);return o.fold(()=>n.toArray(),e=>n.fold(()=>[e],t=>xt(e.element,t.element)?[e]:[e,t]))},lazyGetInOuterOrDie:(e,t)=>()=>o.get().bind(e=>t(e.outerContainer)).getOrDie(`Could not find ${e} element in OuterContainer`)}})(),s=Ke(),i=Ke(),l=Ke(),c=Gt().deviceType.isTouch()?["tox-platform-touch"]:[],d=Ik(e),m=rk(e),u=ov({dom:{tag:"div",classes:["tox-anchorbar"]}}),g=ov({dom:{tag:"div",classes:["tox-bottom-anchorbar"]}}),p=()=>a.mainUi.get().map(e=>e.outerContainer).bind(aL.getHeader),h=a.lazyGetInOuterOrDie("anchor bar",u.getOpt),f=a.lazyGetInOuterOrDie("bottom anchor bar",g.getOpt),b=a.lazyGetInOuterOrDie("toolbar",aL.getToolbar),x=a.lazyGetInOuterOrDie("throbber",aL.getThrobber),v=sH({popup:()=>Ae.fromOption(a.popupUi.get().map(e=>e.sink),"(popup) UI has not been rendered"),dialog:()=>Ae.fromOption(a.dialogUi.get().map(e=>e.sink),"UI has not been rendered")},e,h,f),y=e=>aL.parts.promotion({dom:{tag:"div",classes:["tox-promotion"]},promotionLink:e}),w=()=>{const t=(()=>{const t={attributes:{[Gc]:d?qc.BottomToTop:qc.TopToBottom}},o=aL.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:v.popup,onEscape:()=>{e.focus()}}),n=aL.parts.toolbar({dom:{tag:"div",classes:["tox-toolbar"]},getSink:v.popup.shared.getSink,providers:v.popup.shared.providers,onEscape:()=>{e.focus()},onToolbarToggled:t=>{((e,t)=>{e.dispatch("ToggleToolbarDrawer",{state:t})})(e,t)},type:m,lazyToolbar:b,lazyHeader:()=>p().getOrDie("Could not find header element"),...t}),r=aL.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:v.popup.shared.providers,onEscape:()=>{e.focus()},type:m}),a=Lk(e),s=zk(e),i=Rk(e),l=Ok(e),c=y(l),g=a||s||i,h=[c,o];return aL.parts.header({dom:{tag:"div",classes:["tox-editor-header"].concat(g?[]:["tox-editor-header--empty"]),...t},components:$([i?h:[],a?[r]:s?[n]:[],Fk(e)?[]:[u.asSpec()]]),sticky:Uk(e),editor:e,sharedBackstage:v.popup.shared})})(),n={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[aL.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),aL.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}})]},r=aL.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:v.popup}),a=aL.parts.viewWrapper({backstage:v.popup}),i=wk(e)&&!o?A.some(YP(e,v.popup.shared.providers)):A.none(),l=$([d?[]:[t],o?[]:[n],d?[t]:[]]),h=aL.parts.editorContainer({components:$([l,o?[]:[g.asSpec()]])}),f=Zk(e),x={role:"application",...aE.isRtl()?{dir:"rtl"}:{},...f?{"aria-hidden":"true"}:{}},w=sp(aL.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(o?["tox-tinymce-inline"]:[]).concat(d?["tox-tinymce--toolbar-bottom"]:[]).concat(c),styles:{visibility:"hidden",...f?{opacity:"0",border:"0"}:{}},attributes:x},components:[h,...o?[]:[a,...i.toArray()],r],behaviours:Td([MD(()=>v.popup.shared.providers.checkUiComponentContext("any")),Mp.config({disableClass:"tox-tinymce--disabled"}),Wu.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a, .tox-statusbar__resize-handle"})])})),_=bv(w);return s.set(_),{mothership:_,outerContainer:w}},_=t=>{const o=wI((e=>CI(e).getOr(qC(e)))(e)),n=wI((e=>kI(e).getOr(GC(e)))(e));return e.inline||(xn("div","width",n)&&mn(t.element,"width",n),xn("div","height",o)?mn(t.element,"height",o):mn(t.element,"height","400px")),o},C=t=>{const{mainUi:o,popupUi:a,uiMotherships:s}=t;le(ak(e),(t,o)=>{e.ui.registry.addGroupToolbarButton(o,t)});const{buttons:i,menuItems:l,contextToolbars:c,sidebars:d,views:u}=e.ui.registry.getAll(),g=Hk(e),h={menuItems:l,menus:Wk(e),menubar:mk(e),toolbar:g.getOrThunk(()=>uk(e)),allowToolbarGroups:m===zC.floating,buttons:i,sidebar:d,views:u};var f;f=o.outerContainer,e.addShortcut("alt+F9","focus menubar",()=>{aL.focusMenubar(f)}),e.addShortcut("alt+F10","focus toolbar",()=>{aL.focusToolbar(f)}),e.addCommand("ToggleToolbarDrawer",(e,t)=>{(null==t?void 0:t.skipFocus)?aL.toggleToolbarDrawerWithoutFocusing(f):aL.toggleToolbarDrawer(f)}),e.addQueryStateHandler("ToggleToolbarDrawer",()=>aL.isToolbarDrawerToggled(f)),((e,t,o)=>{const n=(e,n)=>{P([t,...o],t=>{t.broadcastEvent(e,n)})},r=(e,n)=>{P([t,...o],t=>{t.broadcastOn([e],n)})},a=e=>r(av(),{target:e.target}),s=No(),i=Do(s,"touchstart",a),l=Do(s,"touchmove",e=>n(ai(),e)),c=Do(s,"touchend",e=>n(si(),e)),d=Do(s,"mousedown",a),m=Do(s,"mouseup",e=>{0===e.raw.button&&r(iv(),{target:e.target})}),u=e=>r(av(),{target:it.fromDom(e.target)}),g=e=>{0===e.button&&r(iv(),{target:it.fromDom(e.target)})},p=()=>{P(e.editorManager.get(),t=>{e!==t&&t.dispatch("DismissPopups",{relatedTarget:e})})},h=e=>n(ii(),Ro(e)),f=e=>{r(sv(),{}),n(li(),Ro(e))},b=wo(it.fromDom(e.getElement())),x=Mo(b,"scroll",o=>{requestAnimationFrame(()=>{if(null!=e.getContainer()){const r=Xk(e,t.element).map(e=>[e.element,...e.others]).getOr([]);z(r,e=>xt(e,o.target))&&(e.dispatch("ElementScroll",{target:o.target.dom}),n(hi(),o))}})}),v=()=>r(sv(),{}),y=t=>{t.state&&r(av(),{target:it.fromDom(e.getContainer())})},w=e=>{r(av(),{target:it.fromDom(e.relatedTarget.getContainer())})},_=t=>e.dispatch("focusin",t),C=t=>e.dispatch("focusout",t);e.on("PostRender",()=>{e.on("click",u),e.on("tap",u),e.on("mouseup",g),e.on("mousedown",p),e.on("ScrollWindow",h),e.on("ResizeWindow",f),e.on("ResizeEditor",v),e.on("AfterProgressState",y),e.on("DismissPopups",w),P([t,...o],e=>{e.element.dom.addEventListener("focusin",_),e.element.dom.addEventListener("focusout",C)})}),e.on("remove",()=>{e.off("click",u),e.off("tap",u),e.off("mouseup",g),e.off("mousedown",p),e.off("ScrollWindow",h),e.off("ResizeWindow",f),e.off("ResizeEditor",v),e.off("AfterProgressState",y),e.off("DismissPopups",w),P([t,...o],e=>{e.element.dom.removeEventListener("focusin",_),e.element.dom.removeEventListener("focusout",C)}),d.unbind(),i.unbind(),l.unbind(),c.unbind(),m.unbind(),x.unbind()}),e.on("detach",()=>{P([t,...o],mg),P([t,...o],e=>e.destroy())})})(e,o.mothership,s),r.setup(e,v.popup.shared,p),fP(e,v.popup),PP(e,v.popup.shared.getSink,v.popup),(e=>{const{sidebars:t}=e.ui.registry.getAll();P(ae(t),o=>{const n=t[o],r=()=>Ve(A.from(e.queryCommandValue("ToggleSidebar")),o);e.ui.registry.addToggleButton(o,{icon:n.icon,tooltip:n.tooltip,onAction:t=>{e.execCommand("ToggleSidebar",!1,o),t.setActive(r())},onSetup:t=>{t.setActive(r());const o=()=>t.setActive(r());return e.on("ToggleSidebar",o),()=>{e.off("ToggleSidebar",o)}},context:"any"})})})(e),MH(e,x,v.popup.shared),tP(e,c,a.sink,{backstage:v.popup}),UP(e,a.sink);const b={targetNode:e.getElement(),height:_(o.outerContainer)};return n.render(e,t,h,v.popup,b)};return{popups:{backstage:v.popup,getMothership:()=>XP("popups",l)},dialogs:{backstage:v.dialog,getMothership:()=>XP("dialogs",i)},renderUI:()=>{const o=w(),n=(()=>{const t=Vk(e),o=xt(sn(),t)&&"grid"===pn(t,"display"),n={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(c),attributes:{...aE.isRtl()?{dir:"rtl"}:{}}},behaviours:Td([Wb.config({useFixed:()=>r.isDocked(p)})])},a={dom:{styles:{width:document.body.clientWidth+"px"}},events:ld([md(li(),e=>{mn(e.element,"width",document.body.clientWidth+"px")})])},s=sp(Pe(n,o?a:{})),l=bv(s);return i.set(l),{sink:s,mothership:l}})(),s=jk(e)?(()=>{const e={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-silver-popup-sink","tox-tinymce-aux"].concat(c),attributes:{...aE.isRtl()?{dir:"rtl"}:{}}},behaviours:Td([Wb.config({useFixed:()=>r.isDocked(p),getBounds:()=>t.getPopupSinkBounds()})])},o=sp(e),n=bv(o);return l.set(n),{sink:o,mothership:n}})():(e=>(l.set(e.mothership),e))(n);a.dialogUi.set(n),a.popupUi.set(s),a.mainUi.set(o);const d={popupUi:s,dialogUi:n,mainUi:o,uiMotherships:a.getUiMotherships()};return C(d)}}},QP=e=>{const t=[],o={};return ie(e,(e,n)=>{e.fold(()=>{t.push(n)},e=>{o[n]=e})}),t.length>0?Ae.error(t):Ae.value(o)},eF=(e,t,o,n)=>{const r=ov(Ey.sketch(r=>({dom:{tag:"div",classes:["tox-form"].concat(e.classes)},components:I(e.items,e=>dz(r,e,t,o,n))})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[r.asSpec()]}],behaviours:Td([Wu.config({mode:"acyclic",useTabstopAt:k(LN)}),sN(r),cN(r,{postprocess:e=>QP(e).fold(e=>(console.error(e),{}),w)}),Bd("dialog-body-panel",[md(zs(),(e,t)=>{e.getSystem().broadcastOn([UN],{newFocus:A.some(t.event.target)})})])])}},tF=(e,t)=>{mn(e,"height",t+"px"),mn(e,"flex-basis",t+"px")},oF=(e,t,o)=>{$n(e,'[role="dialog"]').each(e=>{Kn(e,'[role="tablist"]').each(n=>{o.get().map(o=>(mn(t,"height","0"),mn(t,"flex-basis","0"),Math.min(o,((e,t,o)=>{const n=lo(e).dom,r=$n(e,".tox-dialog-wrap").getOr(e);let a;a="fixed"===pn(r,"position")?Math.max(n.clientHeight,window.innerHeight):Math.max(n.offsetHeight,n.scrollHeight);const s=Cn(t),i=t.dom.offsetLeft>=o.dom.offsetLeft+Tn(o)?Math.max(Cn(o),s):s,l=parseInt(pn(e,"margin-top"),10)||0,c=parseInt(pn(e,"margin-bottom"),10)||0;return a-(Cn(e)+l+c-i)})(e,t,n)))).each(e=>{tF(t,e)})})})},nF=e=>Kn(e,'[role="tabpanel"]'),rF=e=>{const t=Ke(),o=[vd(o=>{const n=o.element;nF(n).each(r=>{mn(r,"visibility","hidden"),o.getSystem().getByDom(r).toOptional().each(o=>{const n=((e,t,o)=>I(e,(n,r)=>{kg.set(o,e[r].view());const a=t.dom.getBoundingClientRect();return kg.set(o,[]),a.height}))(e,r,o),a=(e=>te(Q(e,(e,t)=>e>t?-1:e<t?1:0)))(n);a.fold(t.clear,t.set)}),oF(n,r,t),vn(r,"visibility"),((e,t)=>{te(e).each(e=>EC.showTab(t,e.value))})(e,o),requestAnimationFrame(()=>{oF(n,r,t)})})}),md(li(),e=>{const o=e.element;nF(o).each(e=>{oF(o,e,t)})}),md(QR,(e,o)=>{const n=e.element;nF(n).each(e=>{const o=Lo(wo(e));mn(e,"visibility","hidden");const r=fn(e,"height").map(e=>parseInt(e,10));vn(e,"height"),vn(e,"flex-basis");const a=e.dom.getBoundingClientRect().height;r.forall(e=>a>e)?(t.set(a),oF(n,e,t)):r.each(t=>{tF(e,t)}),vn(e,"visibility"),o.each(Bo)})})];return{extraEvents:o,selectFirst:!1}},aF="send-data-to-section",sF="send-data-to-view",iF=(e,t,o,n)=>{const r=ye({}),a=e=>{const t=Bf.getValue(e),o=QP(t).getOr({}),n=r.get(),a=Pe(n,o);r.set(a)},s=e=>{const t=r.get();Bf.setValue(e,t)},i=ye(null),l=I(e.tabs,e=>({value:e.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"]},components:[op(o.shared.providers.translate(e.title))],view:()=>[Ey.sketch(r=>({dom:{tag:"div",classes:["tox-form"]},components:I(e.items,e=>dz(r,e,t,o,n)),formBehaviours:Td([Wu.config({mode:"acyclic",useTabstopAt:k(LN)}),Bd("TabView.form.events",[vd(s),yd(a)]),Gb.config({channels:Cs([{key:aF,value:{onReceive:a}},{key:sF,value:{onReceive:s}}])})])}))]})),c=rF(l);return EC.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:(e,t,o)=>{const n=Bf.getValue(t);nd(e,JR,{name:n,oldName:i.get()}),i.set(n)},tabs:l,components:[EC.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[yC.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:Td([Nx.config({})])}),EC.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:c.selectFirst,tabSectionBehaviours:Td([Bd("tabpanel",c.extraEvents),Wu.config({mode:"acyclic"}),gp.config({find:e=>te(EC.getViewItems(e))}),dN(A.none(),e=>(e.getSystem().broadcastOn([aF],{}),r.get()),(e,t)=>{r.set(t),e.getSystem().broadcastOn([sF],{})})])})},lF=(e,t,o,n,r,a)=>({dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:{...o.map(e=>({id:e})).getOr({}),...r?{"aria-live":"polite"}:{}}},components:[],behaviours:Td([iN(0),Jb.config({channel:`${FN}-${t}`,updateState:(e,t)=>A.some({isTabPanel:()=>"tabpanel"===t.body.type}),renderComponents:e=>{const t=e.body;return"tabpanel"===t.type?[iF(t,e.initialData,n,a)]:[eF(t,e.initialData,n,a)]},initialData:e})])}),cF=VC.deviceType.isTouch(),dF=(e,t)=>({dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[e,t]}),mF=(e,t)=>tw.parts.close(yv.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close")}},action:e,buttonBehaviours:Td([Nx.config({})])})),uF=()=>tw.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}}),gF=(e,t)=>tw.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:tv(`<p>${rE(t.translate(e))}</p>`)}]}]}),pF=e=>tw.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:e}),hF=(e,t)=>[Zh.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:e}),Zh.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:t})],fF=e=>{const t="tox-dialog",o=t+"-wrap",n=o+"__backdrop",r=t+"__disable-scroll";return tw.sketch({lazySink:e.lazySink,onEscape:t=>(e.onEscape(t),A.some(!0)),useTabstopAt:e=>!LN(e),firstTabstop:e.firstTabstop,dom:{tag:"div",classes:[t].concat(e.extraClasses),styles:{position:"relative",...e.extraStyles}},components:[e.header,e.body,...e.footer.toArray()],parts:{blocker:{dom:tv(`<div class="${o}"></div>`),components:[{dom:{tag:"div",classes:cF?[n,n+"--opaque"]:[n]}}]}},dragBlockClass:o,modalBehaviours:Td([Pd.config({}),Bd("dialog-events",e.dialogEvents.concat([xd(zs(),(e,t)=>{dp.isBlocked(e)||Wu.focusIn(e)}),md(gi(),(e,t)=>{e.getSystem().broadcastOn([UN],{newFocus:t.event.newFocus})})])),Bd("scroll-lock",[vd(()=>{nr(sn(),r)}),yd(()=>{ar(sn(),r)})]),...e.extraBehaviours]),eventOrder:{[Js()]:["dialog-events"],[ci()]:["scroll-lock","dialog-events","alloy.base.behaviour"],[di()]:["alloy.base.behaviour","dialog-events","scroll-lock"],...e.eventOrder}})},bF=e=>yv.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close"),"data-mce-name":"close"}},buttonBehaviours:Td([Nx.config({}),Qx.config(e.tooltips.getConfig({tooltipText:e.translate("Close")}))]),components:[pE("close",{tag:"span",classes:["tox-icon"]},e.icons)],action:e=>{od(e,qR)}}),xF=(e,t,o,n)=>({dom:{tag:"h1",classes:["tox-dialog__title"],attributes:{...o.map(e=>({id:e})).getOr({})}},components:[],behaviours:Td([Jb.config({channel:`${PN}-${t}`,initialData:e,renderComponents:e=>[op(n.translate(e.title))]})])}),vF=()=>({dom:tv('<div class="tox-dialog__draghandle"></div>')}),yF=(e,t,o)=>((e,t,o)=>{const n=tw.parts.title(xF(e,t,A.none(),o)),r=tw.parts.draghandle(vF()),a=tw.parts.close(bF(o)),s=[n].concat(e.draggable?[r]:[]).concat([a]);return Zh.sketch({dom:tv('<div class="tox-dialog__header"></div>'),components:s})})({title:o.shared.providers.translate(e),draggable:o.dialog.isDraggableModal()},t,o.shared.providers),wF=(e,t,o,n)=>({dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":o.translate(e)},styles:{left:"0px",right:"0px",bottom:"0px",top:`${n.getOr(0)}px`,position:"absolute"}},behaviours:t,components:[{dom:tv('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}),_F=(e,t,o)=>({onClose:()=>o.closeWindow(),onBlock:o=>{const n=Kn(e().element,".tox-dialog__header").map(e=>Cn(e));tw.setBusy(e(),(e,r)=>wF(o.message,r,t,n))},onUnblock:()=>{tw.setIdle(e())}}),CF="tox-dialog--fullscreen",kF="tox-dialog--width-lg",SF="tox-dialog--width-md",EF=e=>{switch(e){case"large":return A.some(kF);case"medium":return A.some(SF);default:return A.none()}},OF=(e,t)=>{const o=it.fromDom(t.element.dom);ir(o,CF)||(cr(o,[kF,SF]),EF(e).each(e=>nr(o,e)))},TF=(e,t)=>{const o=it.fromDom(e.element.dom),n=dr(o),r=j(n,e=>e===kF||e===SF).or(EF(t));((e,t)=>{P(t,t=>{sr(e,t)})})(o,[CF,...r.toArray()])},AF=(e,t,o)=>sp(fF({...e,firstTabstop:1,lazySink:o.shared.getSink,extraBehaviours:[uN({}),...e.extraBehaviours],onEscape:e=>{od(e,qR)},dialogEvents:t,eventOrder:{[Xs()]:[Jb.name(),Gb.name()],[ci()]:["scroll-lock",Jb.name(),"messages","dialog-events","alloy.base.behaviour"],[di()]:["alloy.base.behaviour","dialog-events","messages",Jb.name(),"scroll-lock"]}})),DF=(e,t={})=>I(e,e=>"menu"===e.type?(e=>{const o=I(e.items,e=>{const o=fe(t,e.name).getOr(ye(!1));return{...e,storage:o}});return{...e,items:o}})(e):e),MF=e=>U(e,(e,t)=>{if("menu"===t.type){return U(t.items,(e,t)=>(e[t.name]=t.storage,e),e)}return e},{}),RF=(e,t)=>[hd(zs(),HN),e($R,(e,o,n,r)=>{Ho(r.element)&&Lo(wo(r.element)).each(zo),t.onClose(),o.onClose()}),e(qR,(e,t,o,n)=>{t.onCancel(e),od(n,$R)}),md(XR,(e,o)=>t.onUnblock()),md(YR,(e,o)=>t.onBlock(o.event))],NF=(e,t,o)=>{const n=(t,o)=>md(t,(t,n)=>{r(t,(r,a)=>{o(e(),r,n.event,t)})}),r=(e,t)=>{Jb.getState(e).get().each(o=>{t(o.internalDialog,e)})};return[...RF(n,t),n(KR,(e,t)=>t.onSubmit(e)),n(jR,(e,t,o)=>{t.onChange(e,{name:o.name})}),n(GR,(e,t,n,r)=>{const a=()=>r.getSystem().isConnected()?Wu.focusIn(r):void 0,s=e=>Ko(e,"disabled")||Go(e,"aria-disabled").exists(e=>"true"===e),i=wo(r.element),l=Lo(i);t.onAction(e,{name:n.name,value:n.value}),Lo(i).fold(a,e=>{s(e)||l.exists(t=>vt(e,t)&&s(t))?a():o().toOptional().filter(t=>!vt(t.element,e)).each(a)})}),n(JR,(e,t,o)=>{t.onTabChange(e,{newTabName:o.name,oldTabName:o.oldName})}),yd(t=>{const o=e();Bf.setValue(t,o.getData())})]},BF=(e,t)=>{const o=t.map(e=>e.footerButtons).getOr([]),n=F(o,e=>"start"===e.align),r=(e,t)=>Zh.sketch({dom:{tag:"div",classes:[`tox-dialog__footer-${e}`]},components:I(t,e=>e.memento.asSpec())});return[r("start",n.pass),r("end",n.fail)]},zF=(e,t,o)=>({dom:tv('<div class="tox-dialog__footer"></div>'),components:[],behaviours:Td([Jb.config({channel:`${VN}-${t}`,initialData:e,updateState:(e,t)=>{const n=I(t.buttons,e=>{const t=ov(((e,t)=>GB(e,e.type,t))(e,o));return{name:e.name,align:e.align,memento:t}});return A.some({lookupByName:t=>((e,t,o)=>j(t,e=>e.name===o).bind(t=>t.memento.getOpt(e)))(e,n,t),footerButtons:n})},renderComponents:BF})])}),HF=(e,t,o)=>tw.parts.footer(zF(e,t,o)),LF=(e,t)=>{if(e.getRoot().getSystem().isConnected()){const o=gp.getCurrent(e.getFormWrapper()).getOr(e.getFormWrapper());return Ey.getField(o,t).orThunk(()=>{const o=e.getFooter().bind(e=>Jb.getState(e).get());return o.bind(e=>e.lookupByName(t))})}return A.none()},IF=(e,t,o)=>{const n=t=>{const o=e.getRoot();o.getSystem().isConnected()&&t(o)},r={getData:()=>{const t=e.getRoot(),n=t.getSystem().isConnected()?e.getFormWrapper():t;return{...Bf.getValue(n),...le(o,e=>e.get())}},setData:t=>{n(n=>{const a=r.getData(),s=Pe(a,t),i=((e,t)=>{const o=e.getRoot();return Jb.getState(o).get().map(e=>Va(Fa("data",e.dataValidator,t))).getOr(t)})(e,s),l=e.getFormWrapper();Bf.setValue(l,i),ie(o,(e,t)=>{be(s,t)&&e.set(s[t])})})},setEnabled:(t,o)=>{LF(e,t).each(o?Mp.enable:Mp.disable)},focus:t=>{LF(e,t).each(Pd.focus)},block:e=>{if(!a(e))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");n(t=>{nd(t,YR,{message:e})})},unblock:()=>{n(e=>{od(e,XR)})},showTab:t=>{n(o=>{const n=e.getBody();Jb.getState(n).get().exists(e=>e.isTabPanel())&&gp.getCurrent(n).each(e=>{EC.showTab(e,t)})})},redial:a=>{n(n=>{const s=e.getId(),i=t(a),l=DF(i.internalDialog.buttons,o);n.getSystem().broadcastOn([`${IN}-${s}`],i),n.getSystem().broadcastOn([`${PN}-${s}`],i.internalDialog),n.getSystem().broadcastOn([`${FN}-${s}`],i.internalDialog),n.getSystem().broadcastOn([`${VN}-${s}`],{...i.internalDialog,buttons:l}),r.setData(i.initialData)})},close:()=>{n(e=>{od(e,$R)})},toggleFullscreen:e.toggleFullscreen};return r},PF=(e,t,o)=>{const n=Le("dialog"),r=e.internalDialog,a=yF(r.title,n,o),s=ye(r.size),i=EF(s.get()).toArray(),l=((e,t,o,n)=>{const r=lF(e,t,A.none(),o,!1,n);return tw.parts.body(r)})({body:r.body,initialData:r.initialData},n,o,e=>LF(h,e)),c=DF(r.buttons),d=MF(c),m=We(0!==c.length,HF({buttons:c},n,o)),u=NF(()=>f,_F(()=>p,o.shared.providers,t),o.shared.getSink),g={id:n,header:a,body:l,footer:m,extraClasses:i,extraBehaviours:[Jb.config({channel:`${IN}-${n}`,updateState:(e,t)=>(s.set(t.internalDialog.size),OF(t.internalDialog.size,e),A.some(t)),initialData:e})],extraStyles:{}},p=AF(g,u,o),h={getId:y(n),getRoot:y(p),getBody:()=>tw.getBody(p),getFooter:()=>tw.getFooter(p),getFormWrapper:()=>{const e=tw.getBody(p);return gp.getCurrent(e).getOr(e)},toggleFullscreen:()=>{TF(p,s.get())}},f=IF(h,t.redial,d);return{dialog:p,instanceApi:f}},FF=(e,t,o,n=!1,r)=>{const a=Le("dialog"),s=Le("dialog-label"),i=Le("dialog-content"),l=e.internalDialog,c=ye(l.size),d=EF(c.get()).toArray(),m=ov(((e,t,o,n)=>Zh.sketch({dom:tv('<div class="tox-dialog__header"></div>'),components:[xF(e,t,A.some(o),n),vF(),bF(n)],containerBehaviours:Td([uf.config({mode:"mouse",blockerClass:"blocker",getTarget:e=>Yn(e,'[role="dialog"]').getOrDie(),snaps:{getSnapPoints:()=>[],leftAttr:"data-drag-left",topAttr:"data-drag-top"},onDrag:(e,t)=>{e.getSystem().broadcastOn([sv()],{target:t})}})])}))({title:l.title,draggable:!0},a,s,o.shared.providers)),u=ov(((e,t,o,n,r,a)=>lF(e,t,A.some(o),n,r,a))({body:l.body,initialData:l.initialData},a,i,o,n,e=>LF(v,e))),g=DF(l.buttons),p=MF(g),h=We(0!==g.length,ov(((e,t,o)=>zF(e,t,o))({buttons:g},a,o))),f=NF(()=>w,{onBlock:e=>{dp.block(x,(t,n)=>{const r=m.getOpt(x).map(e=>Cn(e.element));return wF(e.message,n,o.shared.providers,r)})},onUnblock:()=>{dp.unblock(x)},onClose:()=>t.closeWindow()},o.shared.getSink),b=Gt().os,x=sp({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline",...d],attributes:{role:"dialog",...b.isMacOS()?{"aria-label":l.title}:{"aria-labelledby":s}}},eventOrder:{[Xs()]:[Jb.name(),Gb.name()],[Js()]:["execute-on-form"],[ci()]:["reflecting","execute-on-form"]},behaviours:Td([Wu.config({mode:"cyclic",onEscape:e=>(od(e,$R),A.some(!0)),useTabstopAt:e=>!LN(e)&&("button"!==Jt(e)||"disabled"!==qo(e,"disabled")),firstTabstop:1}),Jb.config({channel:`${IN}-${a}`,updateState:(e,t)=>(c.set(t.internalDialog.size),OF(t.internalDialog.size,e),r(),A.some(t)),initialData:e}),Pd.config({}),Bd("execute-on-form",f.concat([xd(zs(),(e,t)=>{Wu.focusIn(e)}),md(gi(),(e,t)=>{e.getSystem().broadcastOn([UN],{newFocus:t.event.newFocus})})])),dp.config({getRoot:()=>A.some(x)}),kg.config({}),uN({})]),components:[m.asSpec(),u.asSpec(),...h.map(e=>e.asSpec()).toArray()]}),v={getId:y(a),getRoot:y(x),getFooter:()=>h.map(e=>e.get(x)),getBody:()=>u.get(x),getFormWrapper:()=>{const e=u.get(x);return gp.getCurrent(e).getOr(e)},toggleFullscreen:()=>{TF(x,c.get())}},w=IF(v,t.redial,p);return{dialog:x,instanceApi:w}};var VF=tinymce.util.Tools.resolve("tinymce.util.URI");const ZF=["insertContent","setContent","execCommand","close","block","unblock"],UF=e=>s(e)&&-1!==ZF.indexOf(e.mceAction),jF=(e,t,o,n)=>{const r=Le("dialog"),i=yF(e.title,r,n),l=(e=>{const t={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[BN(A.none(),{dom:{tag:"iframe",attributes:{src:e.url}},behaviours:Td([Nx.config({}),Pd.config({})])})]}],behaviours:Td([Wu.config({mode:"acyclic",useTabstopAt:k(LN)})])};return tw.parts.body(t)})(e),c=e.buttons.bind(e=>0===e.length?A.none():A.some(HF({buttons:e},r,n))),m=((e,t)=>{const o=(t,o)=>md(t,(t,r)=>{n(t,(n,a)=>{o(e(),n,r.event,t)})}),n=(e,t)=>{Jb.getState(e).get().each(o=>{t(o,e)})};return[...RF(o,t),o(GR,(e,t,o)=>{t.onAction(e,{name:o.name})})]})(()=>y,_F(()=>v,n.shared.providers,t)),u={...e.height.fold(()=>({}),e=>({height:e+"px","max-height":e+"px"})),...e.width.fold(()=>({}),e=>({width:e+"px","max-width":e+"px"}))},p=e.width.isNone()&&e.height.isNone()?["tox-dialog--width-lg"]:[],h=new VF(e.url,{base_uri:new VF(window.location.href)}),f=`${h.protocol}://${h.host}${h.port?":"+h.port:""}`,b=Ge(),x=[Jb.config({channel:`${IN}-${r}`,updateState:(e,t)=>A.some(t),initialData:e}),Bd("messages",[vd(()=>{const t=Do(it.fromDom(window),"message",t=>{if(h.isSameOrigin(new VF(t.raw.origin))){const n=t.raw.data;UF(n)?((e,t,o)=>{switch(o.mceAction){case"insertContent":e.insertContent(o.content);break;case"setContent":e.setContent(o.content);break;case"execCommand":const n=!!d(o.ui)&&o.ui;e.execCommand(o.cmd,n,o.value);break;case"close":t.close();break;case"block":t.block(o.message);break;case"unblock":t.unblock()}})(o,y,n):(e=>!UF(e)&&s(e)&&be(e,"mceAction"))(n)&&e.onMessage(y,n)}});b.set(t)}),yd(b.clear)]),Gb.config({channels:{[ZN]:{onReceive:(e,t)=>{Kn(e.element,"iframe").each(e=>{const o=e.dom.contentWindow;g(o)&&o.postMessage(t,f)})}}}})],v=AF({id:r,header:i,body:l,footer:c,extraClasses:p,extraBehaviours:x,extraStyles:u},m,n),y=(e=>{const t=t=>{e.getSystem().isConnected()&&t(e)};return{block:e=>{if(!a(e))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");t(t=>{nd(t,YR,{message:e})})},unblock:()=>{t(e=>{od(e,XR)})},close:()=>{t(e=>{od(e,$R)})},sendMessage:e=>{t(t=>{t.getSystem().broadcastOn([ZN],e)})}}})(v);return{dialog:v,instanceApi:y}},WF=(e,t)=>Va(Fa("data",t,e)),$F=e=>fr(e,".tox-alert-dialog")||fr(e,".tox-confirm-dialog"),qF=(e,t,o,n)=>t&&o?[]:[ch.config({contextual:{lazyContext:()=>A.some(Pr(it.fromDom(e.getContentAreaContainer()))),fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition",onHide:n},modes:["top"],lazyViewport:t=>Xk(e,t.element).map(e=>({bounds:Jk(e),optScrollEnv:A.some({currentScrollTop:e.element.dom.scrollTop,scrollElmTop:Bn(e.element).top})})).getOrThunk(()=>({bounds:Zr(),optScrollEnv:A.none()}))})],GF=e=>{const t=e.editor,o=Uk(t),n=(e=>{const t=e.shared;return{open:(o,n)=>{const r=()=>{tw.hide(l),n()},a=ov(GB({context:"any",name:"close-alert",text:"OK",primary:!0,buttonType:A.some("primary"),align:"end",enabled:!0,icon:A.none()},"cancel",e)),s=uF(),i=mF(r,t.providers),l=sp(fF({lazySink:()=>t.getSink(),header:dF(s,i),body:gF(o,t.providers),footer:A.some(pF(hF([],[a.asSpec()]))),onEscape:r,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[md(qR,r)],eventOrder:{}}));tw.show(l);const c=a.get(l);Pd.focus(c)}}})(e.backstages.dialog),r=(e=>{const t=e.shared;return{open:(o,n)=>{const r=e=>{tw.hide(c),n(e)},a=ov(GB({context:"any",name:"yes",text:"Yes",primary:!0,buttonType:A.some("primary"),align:"end",enabled:!0,icon:A.none()},"submit",e)),s=GB({context:"any",name:"no",text:"No",primary:!1,buttonType:A.some("secondary"),align:"end",enabled:!0,icon:A.none()},"cancel",e),i=uF(),l=mF(()=>r(!1),t.providers),c=sp(fF({lazySink:()=>t.getSink(),header:dF(i,l),body:gF(o,t.providers),footer:A.some(pF(hF([],[s,a.asSpec()]))),onEscape:()=>r(!1),extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[md(qR,()=>r(!1)),md(KR,()=>r(!0))],eventOrder:{}}));tw.show(c);const d=a.get(c);Pd.focus(d)}}})(e.backstages.dialog),a=(o,n)=>yA.openUrl(o=>{const r=jF(o,{closeWindow:()=>{tw.hide(r.dialog),n(r.instanceApi)}},t,e.backstages.dialog);return tw.show(r.dialog),r.instanceApi},o),s=(t,o)=>yA.open((t,n,r)=>{const a=n,s=PF({dataValidator:r,initialData:a,internalDialog:t},{redial:yA.redial,closeWindow:()=>{tw.hide(s.dialog),o(s.instanceApi)}},e.backstages.dialog);return tw.show(s.dialog),s.instanceApi.setData(a),s.instanceApi},t),i=(n,r,a,s)=>yA.open((n,i,l)=>{const c=WF(i,l),d=Ke(),m=e.backstages.popup.shared.header.isPositionedAtTop(),u=()=>d.on(e=>{Wy.reposition(e),o&&m||ch.refresh(e)}),g=FF({dataValidator:l,initialData:c,internalDialog:n},{redial:yA.redial,closeWindow:()=>{d.on(Wy.hide),t.off("ResizeEditor",u),t.off("ScrollWindow",p),d.clear(),a(g.instanceApi)}},e.backstages.popup,s.ariaAttrs,u),p=()=>g.dialog.getSystem().broadcastOn([sv()],{target:g.dialog.element}),h=sp(Wy.sketch({lazySink:e.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:s.persistent?{event:"doNotDismissYet"}:{},...m?{}:{fireRepositionEventInstead:{}},inlineBehaviours:Td([Bd("window-manager-inline-events",[md(mi(),(e,t)=>{od(g.dialog,qR)})]),...qF(t,o,m,()=>g.dialog.getSystem().broadcastOn([av()],{target:g.dialog.element}))]),isExtraPart:(e,t)=>$F(t)}));d.set(h);return Wy.showWithinBounds(h,ip(g.dialog),{anchor:r},()=>{const e=t.inline?sn():it.fromDom(t.getContainer()),o=Pr(e);return A.some(o)}),o&&m||(ch.refresh(h),t.on("ResizeEditor",u)),t.on("ScrollWindow",p),g.instanceApi.setData(c),Wu.focusIn(g.dialog),g.instanceApi},n),l=(o,n,r,a)=>yA.open((o,s,i)=>{const l=WF(s,i),c=Ke(),d=e.backstages.popup.shared.header.isPositionedAtTop(),m=()=>c.on(e=>{Wy.reposition(e),ch.refresh(e)}),u=FF({dataValidator:i,initialData:l,internalDialog:o},{redial:yA.redial,closeWindow:()=>{c.on(Wy.hide),t.off("ResizeEditor ScrollWindow ElementScroll",m),c.clear(),r(u.instanceApi)}},e.backstages.popup,a.ariaAttrs,m),g=sp(Wy.sketch({lazySink:e.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:a.persistent?{event:"doNotDismissYet"}:{},...d?{}:{fireRepositionEventInstead:{}},inlineBehaviours:Td([Bd("window-manager-inline-events",[md(mi(),(e,t)=>{od(u.dialog,qR)})]),ch.config({contextual:{lazyContext:()=>A.some(Pr(it.fromDom(t.getContentAreaContainer()))),fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top","bottom"],lazyViewport:e=>Xk(t,e.element).map(e=>({bounds:Jk(e),optScrollEnv:A.some({currentScrollTop:e.element.dom.scrollTop,scrollElmTop:Bn(e.element).top})})).getOrThunk(()=>({bounds:Zr(),optScrollEnv:A.none()}))})]),isExtraPart:(e,t)=>$F(t)}));c.set(g);return Wy.showWithinBounds(g,ip(u.dialog),{anchor:n},()=>e.backstages.popup.shared.getSink().toOptional().bind(e=>{const o=Xk(t,e.element).map(e=>Jk(e)).getOr(Zr()),n=Pr(it.fromDom(t.getContentAreaContainer())),r=Vr(n,o);return A.some(Ir(r.x,r.y,r.width,r.height-15))})),ch.refresh(g),t.on("ResizeEditor ScrollWindow ElementScroll ResizeWindow",m),u.instanceApi.setData(l),Wu.focusIn(u.dialog),u.instanceApi},o);return{open:(t,o,n)=>{if(!m(o)){if("toolbar"===o.inline)return i(t,e.backstages.popup.shared.anchors.inlineDialog(),n,o);if("bottom"===o.inline)return l(t,e.backstages.popup.shared.anchors.inlineBottomDialog(),n,o);if("cursor"===o.inline)return i(t,e.backstages.popup.shared.anchors.cursor(),n,o)}return s(t,n)},openUrl:(e,t)=>a(e,t),alert:(e,t)=>{n.open(e,t)},close:e=>{e.close()},confirm:(e,t)=>{r.open(e,t)}}},KF=e=>{jC(e),(e=>{const t=e.options.register,o=e=>{return f(e,a)?{value:(t=e,VM(t.map((e,t)=>t%2==0?"#"+CM(e).value:e))),valid:!0}:{valid:!1,message:"Must be an array of strings."};var t},n=e=>h(e)&&e>0?{value:e,valid:!0}:{valid:!1,message:"Must be a positive number."};t("color_map",{processor:o,default:["#BFEDD2","Light Green","#FBEEB8","Light Yellow","#F8CAC6","Light Red","#ECCAFA","Light Purple","#C2E0F4","Light Blue","#2DC26B","Green","#F1C40F","Yellow","#E03E2D","Red","#B96AD9","Purple","#3598DB","Blue","#169179","Dark Turquoise","#E67E23","Orange","#BA372A","Dark Red","#843FA1","Dark Purple","#236FA1","Dark Blue","#ECF0F1","Light Gray","#CED4D9","Medium Gray","#95A5A6","Gray","#7E8C8D","Dark Gray","#34495E","Navy Blue","#000000","Black","#ffffff","White"]}),t("color_map_raw",{processor:e=>f(e,a)?{value:VM(e),valid:!0}:{valid:!1,message:"Must be an array of strings."}}),t("color_map_background",{processor:o}),t("color_map_foreground",{processor:o}),t("color_cols",{processor:n,default:WM(e)}),t("color_cols_foreground",{processor:n,default:$M(e,PM)}),t("color_cols_background",{processor:n,default:$M(e,FM)}),t("custom_colors",{processor:"boolean",default:!0}),t("color_default_foreground",{processor:"string",default:UM}),t("color_default_background",{processor:"string",default:UM})})(e),(e=>{const t=e.options.register;t("contextmenu_avoid_overlap",{processor:"string",default:""}),t("contextmenu_never_use_native",{processor:"boolean",default:!1}),t("contextmenu",{processor:e=>!1===e?{value:[],valid:!0}:a(e)||f(e,a)?{value:bP(e),valid:!0}:{valid:!1,message:"Must be false or a string."},default:"link linkchecker image editimage table spellchecker configurepermanentpen"})})(e)};LC.add("silver",e=>{KF(e);let t=()=>Zr();const{dialogs:o,popups:n,renderUI:r}=JP(e,{getPopupSinkBounds:()=>t()});IR(e,n.backstage.shared);const a=GF({editor:e,backstages:{popup:n.backstage,dialog:o.backstage}}),s=Ke();return{renderUI:()=>{const o=r();return Xk(e,n.getMothership().element).each(e=>{t=()=>Jk(e)}),o},getWindowManagerImpl:y(a),getNotificationManagerImpl:()=>bE(e,{backstage:n.backstage},n.getMothership(),s),getPromotionElement:()=>Kn(it.fromDom(e.getContainer()),".tox-promotion").map(e=>e.dom).getOrNull()}})}()},37326:(e,t,o)=>{o(29375)},40854:e=>{!function(){"use strict";var t=function(e){if(null===e)return"null";if(void 0===e)return"undefined";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t},o=function(e){return{eq:e}},n=o(function(e,t){return e===t}),r=function(e){return o(function(t,o){if(t.length!==o.length)return!1;for(var n=t.length,r=0;r<n;r++)if(!e.eq(t[r],o[r]))return!1;return!0})},a=function(e,t){return function(e,t){return o(function(o,n){return e.eq(t(o),t(n))})}(r(e),function(e){return function(e,t){return Array.prototype.slice.call(e).sort(t)}(e,t)})},s=function(e){return o(function(t,o){var r=Object.keys(t),s=Object.keys(o);if(!a(n).eq(r,s))return!1;for(var i=r.length,l=0;l<i;l++){var c=r[l];if(!e.eq(t[c],o[c]))return!1}return!0})},i=o(function(e,o){if(e===o)return!0;var n=t(e);return n===t(o)&&(function(e){return-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(e)}(n)?e===o:"array"===n?r(i).eq(e,o):"object"===n&&s(i).eq(e,o))});const l=Object.getPrototypeOf,c=(e,t,o)=>{var n;return!!o(e,t.prototype)||(null===(n=e.constructor)||void 0===n?void 0:n.name)===t.name},d=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&c(e,String,(e,t)=>t.isPrototypeOf(e))?"string":t})(t)===e,m=e=>t=>typeof t===e,u=e=>t=>e===t,g=(e,t)=>h(e)&&c(e,t,(e,t)=>l(e)===t),p=d("string"),h=d("object"),f=e=>g(e,Object),b=d("array"),x=u(null),v=m("boolean"),y=u(void 0),w=e=>null==e,_=e=>!w(e),C=m("function"),k=m("number"),S=(e,t)=>{if(b(e)){for(let o=0,n=e.length;o<n;++o)if(!t(e[o]))return!1;return!0}return!1},E=()=>{},O=(e,t)=>(...o)=>e(t.apply(null,o)),T=(e,t)=>o=>e(t(o)),A=e=>()=>e,D=e=>e,M=(e,t)=>e===t;function R(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const N=e=>t=>!e(t),B=e=>()=>{throw new Error(e)},z=e=>e(),H=e=>{e()},L=A(!1),I=A(!0);class P{constructor(e,t){this.tag=e,this.value=t}static some(e){return new P(!0,e)}static none(){return P.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?P.some(e(this.value)):P.none()}bind(e){return this.tag?e(this.value):P.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:P.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return _(e)?P.some(e):P.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}P.singletonNone=new P(!1);const F=Array.prototype.slice,V=Array.prototype.indexOf,Z=Array.prototype.push,U=(e,t)=>V.call(e,t),j=(e,t)=>U(e,t)>-1,W=(e,t)=>{for(let o=0,n=e.length;o<n;o++){if(t(e[o],o))return!0}return!1},$=(e,t)=>{const o=e.length,n=new Array(o);for(let r=0;r<o;r++){const o=e[r];n[r]=t(o,r)}return n},q=(e,t)=>{for(let o=0,n=e.length;o<n;o++){t(e[o],o)}},G=(e,t)=>{for(let o=e.length-1;o>=0;o--){t(e[o],o)}},K=(e,t)=>{const o=[],n=[];for(let r=0,a=e.length;r<a;r++){const a=e[r];(t(a,r)?o:n).push(a)}return{pass:o,fail:n}},Y=(e,t)=>{const o=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];t(r,n)&&o.push(r)}return o},X=(e,t,o)=>(G(e,(e,n)=>{o=t(o,e,n)}),o),J=(e,t,o)=>(q(e,(e,n)=>{o=t(o,e,n)}),o),Q=(e,t,o)=>{for(let n=0,r=e.length;n<r;n++){const r=e[n];if(t(r,n))return P.some(r);if(o(r,n))break}return P.none()},ee=(e,t)=>Q(e,t,L),te=(e,t)=>{for(let o=0,n=e.length;o<n;o++){if(t(e[o],o))return P.some(o)}return P.none()},oe=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!b(e[o]))throw new Error("Arr.flatten item "+o+" was not an array, input: "+e);Z.apply(t,e[o])}return t},ne=(e,t)=>oe($(e,t)),re=(e,t)=>{for(let o=0,n=e.length;o<n;++o){if(!0!==t(e[o],o))return!1}return!0},ae=e=>{const t=F.call(e,0);return t.reverse(),t},se=(e,t)=>Y(e,e=>!j(t,e)),ie=(e,t)=>{const o={};for(let n=0,r=e.length;n<r;n++){const r=e[n];o[String(r)]=t(r,n)}return o},le=(e,t)=>{const o=F.call(e,0);return o.sort(t),o},ce=(e,t)=>t>=0&&t<e.length?P.some(e[t]):P.none(),de=e=>ce(e,0),me=e=>ce(e,e.length-1),ue=C(Array.from)?Array.from:e=>F.call(e),ge=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome())return n}return P.none()},pe=(e,t)=>{const o=[],n=C(t)?e=>W(o,o=>t(o,e)):e=>j(o,e);for(let t=0,r=e.length;t<r;t++){const r=e[t];n(r)||o.push(r)}return o},he=Object.keys,fe=Object.hasOwnProperty,be=(e,t)=>{const o=he(e);for(let n=0,r=o.length;n<r;n++){const r=o[n];t(e[r],r)}},xe=(e,t)=>ve(e,(e,o)=>({k:o,v:t(e,o)})),ve=(e,t)=>{const o={};return be(e,(e,n)=>{const r=t(e,n);o[r.k]=r.v}),o},ye=e=>(t,o)=>{e[o]=t},we=(e,t,o,n)=>{be(e,(e,r)=>{(t(e,r)?o:n)(e,r)})},_e=(e,t)=>{const o={};return we(e,t,ye(o),E),o},Ce=(e,t)=>{const o=[];return be(e,(e,n)=>{o.push(t(e,n))}),o},ke=e=>Ce(e,D),Se=(e,t)=>Ee(e,t)?P.from(e[t]):P.none(),Ee=(e,t)=>fe.call(e,t),Oe=(e,t)=>Ee(e,t)&&void 0!==e[t]&&null!==e[t],Te=e=>{if(!b(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");const t=[],o={};return q(e,(n,r)=>{const a=he(n);if(1!==a.length)throw new Error("one and only one name per case");const s=a[0],i=n[s];if(void 0!==o[s])throw new Error("duplicate key detected:"+s);if("cata"===s)throw new Error("cannot have a case named cata (sorry)");if(!b(i))throw new Error("case arguments must be an array");t.push(s),o[s]=(...o)=>{const n=o.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+s+". Expected "+i.length+" ("+i+"), got "+n);return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[r].apply(null,o)},match:e=>{const n=he(e);if(t.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","));if(!re(t,e=>j(n,e)))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "));return e[s].apply(null,o)},log:e=>{console.log(e,{constructors:t,constructor:s,params:o})}}}}),o},Ae=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},De=e=>{const t=t=>t(e),o=A(e),n=()=>r,r={tag:!0,inner:e,fold:(t,o)=>o(e),isValue:I,isError:L,map:t=>Re.value(t(e)),mapError:n,bind:t,exists:t,forall:t,getOr:o,or:n,getOrThunk:o,orThunk:n,getOrDie:o,each:t=>{t(e)},toOptional:()=>P.some(e)};return r},Me=e=>{const t=()=>o,o={tag:!1,inner:e,fold:(t,o)=>t(e),isValue:L,isError:I,map:t,mapError:t=>Re.error(t(e)),bind:t,exists:L,forall:I,getOr:D,or:D,getOrThunk:z,orThunk:z,getOrDie:B(String(e)),each:E,toOptional:P.none};return o},Re={value:De,error:Me,fromOption:(e,t)=>e.fold(()=>Me(t),De)},Ne="undefined"!=typeof window?window:Function("return this;")(),Be=()=>window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967295;let ze=0;const He=e=>{const t=(new Date).getTime(),o=Math.floor(1e9*Be());return ze++,e+"_"+o+ze+String(t)},Le=e=>(...t)=>{if(0===t.length)throw new Error("Can't merge zero objects");const o={};for(let n=0;n<t.length;n++){const r=t[n];for(const t in r)Ee(r,t)&&(o[t]=e(o[t],r[t]))}return o},Ie=Le((e,t)=>f(e)&&f(t)?Ie(e,t):t),Pe=Le((e,t)=>t),Fe=(e,t,o=M)=>e.exists(e=>o(e,t)),Ve=(e,t,o=M)=>Ze(e,t,o).getOr(e.isNone()&&t.isNone()),Ze=(e,t,o)=>e.isSome()&&t.isSome()?P.some(o(e.getOrDie(),t.getOrDie())):P.none(),Ue=(e,t)=>e?P.some(t):P.none(),je=(e,t)=>((e,t)=>{let o=null!=t?t:Ne;for(let t=0;t<e.length&&null!=o;++t)o=o[e[t]];return o})(e.split("."),t);Te([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const We=e=>{const t=Ae(P.none()),o=()=>t.get().each(e=>clearInterval(e));return{clear:()=>{o(),t.set(P.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:n=>{o(),t.set(P.some(setInterval(n,e)))}}},$e=()=>{const e=(e=>{const t=Ae(P.none()),o=()=>t.get().each(e);return{clear:()=>{o(),t.set(P.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{o(),t.set(P.some(e))}}})(E);return{...e,on:t=>e.get().each(t)}},qe=(e,t,o)=>""===t||e.length>=t.length&&e.substr(o,o+t.length)===t,Ge=(e,t)=>Ye(e,t)?((e,t)=>e.substring(t))(e,t.length):e,Ke=(e,t,o=0,n)=>{const r=e.indexOf(t,o);return-1!==r&&(!!y(n)||r+t.length<=n)},Ye=(e,t)=>qe(e,t,0),Xe=(e,t)=>qe(e,t,e.length-t.length),Je=e=>t=>t.replace(e,""),Qe=Je(/^\s+|\s+$/g),et=Je(/^\s+/g),tt=Je(/\s+$/g),ot=e=>e.length>0,nt=e=>!ot(e),rt=(e,t=10)=>{const o=parseInt(e,t);return isNaN(o)?P.none():P.some(o)},at=(e,t)=>{let o=null;return{cancel:()=>{x(o)||(clearTimeout(o),o=null)},throttle:(...n)=>{x(o)&&(o=setTimeout(()=>{o=null,e.apply(null,n)},t))}}},st=(e,t)=>{let o=null;const n=()=>{x(o)||(clearTimeout(o),o=null)};return{cancel:n,throttle:(...r)=>{n(),o=setTimeout(()=>{o=null,e.apply(null,r)},t)}}},it=e=>{let t,o=!1;return(...n)=>(o||(o=!0,t=e.apply(null,n)),t)},lt="\ufeff",ct=" ",dt=e=>e===lt,mt=e=>{const t={};return q(e,e=>{t[e]={}}),he(t)},ut=e=>void 0!==e.length,gt=Array.isArray,pt=(e,t,o)=>{if(!e)return!1;if(o=o||e,ut(e)){for(let n=0,r=e.length;n<r;n++)if(!1===t.call(o,e[n],n,e))return!1}else for(const n in e)if(Ee(e,n)&&!1===t.call(o,e[n],n,e))return!1;return!0},ht=(e,t)=>{const o=[];return pt(e,(n,r)=>{o.push(t(n,r,e))}),o},ft=(e,t)=>{const o=[];return pt(e,(n,r)=>{t&&!t(n,r,e)||o.push(n)}),o},bt=(e,t,o,n)=>{let r=y(o)?e[0]:o;for(let o=0;o<e.length;o++)r=t.call(n,r,e[o],o);return r},xt=(e,t,o)=>{for(let n=0,r=e.length;n<r;n++)if(t.call(o,e[n],n,e))return n;return-1},vt=e=>e[e.length-1],yt=()=>wt(0,0),wt=(e,t)=>({major:e,minor:t}),_t={nu:wt,detect:(e,t)=>{const o=String(t).toLowerCase();return 0===e.length?yt():((e,t)=>{const o=((e,t)=>{for(let o=0;o<e.length;o++){const n=e[o];if(n.test(t))return n}})(e,t);if(!o)return{major:0,minor:0};const n=e=>Number(t.replace(o,"$"+e));return wt(n(1),n(2))})(e,o)},unknown:yt},Ct=(e,t)=>{const o=String(t).toLowerCase();return ee(e,e=>e.search(o))},kt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,St=e=>t=>Ke(t,e),Et=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>Ke(e,"edge/")&&Ke(e,"chrome")&&Ke(e,"safari")&&Ke(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,kt],search:e=>Ke(e,"chrome")&&!Ke(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>Ke(e,"msie")||Ke(e,"trident")},{name:"Opera",versionRegexes:[kt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:St("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:St("firefox")},{name:"Safari",versionRegexes:[kt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(Ke(e,"safari")||Ke(e,"mobile/"))&&Ke(e,"applewebkit")}],Ot=[{name:"Windows",search:St("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>Ke(e,"iphone")||Ke(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:St("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:St("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:St("linux"),versionRegexes:[]},{name:"Solaris",search:St("sunos"),versionRegexes:[]},{name:"FreeBSD",search:St("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:St("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Tt={browsers:A(Et),oses:A(Ot)},At="Edge",Dt="Chromium",Mt="Opera",Rt="Firefox",Nt="Safari",Bt=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isEdge:n(At),isChromium:n(Dt),isIE:n("IE"),isOpera:n(Mt),isFirefox:n(Rt),isSafari:n(Nt)}},zt={unknown:()=>Bt({current:void 0,version:_t.unknown()}),nu:Bt,edge:A(At),chromium:A(Dt),ie:A("IE"),opera:A(Mt),firefox:A(Rt),safari:A(Nt)},Ht="Windows",Lt="Android",It="Linux",Pt="macOS",Ft="Solaris",Vt="FreeBSD",Zt="ChromeOS",Ut=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isWindows:n(Ht),isiOS:n("iOS"),isAndroid:n(Lt),isMacOS:n(Pt),isLinux:n(It),isSolaris:n(Ft),isFreeBSD:n(Vt),isChromeOS:n(Zt)}},jt={unknown:()=>Ut({current:void 0,version:_t.unknown()}),nu:Ut,windows:A(Ht),ios:A("iOS"),android:A(Lt),linux:A(It),macos:A(Pt),solaris:A(Ft),freebsd:A(Vt),chromeos:A(Zt)},Wt=(e,t,o)=>{const n=Tt.browsers(),r=Tt.oses(),a=t.bind(e=>((e,t)=>ge(t.brands,t=>{const o=t.brand.toLowerCase();return ee(e,e=>{var t;return o===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())}).map(e=>({current:e.name,version:_t.nu(parseInt(t.version,10),0)}))}))(n,e)).orThunk(()=>((e,t)=>Ct(e,t).map(e=>{const o=_t.detect(e.versionRegexes,t);return{current:e.name,version:o}}))(n,e)).fold(zt.unknown,zt.nu),s=((e,t)=>Ct(e,t).map(e=>{const o=_t.detect(e.versionRegexes,t);return{current:e.name,version:o}}))(r,e).fold(jt.unknown,jt.nu),i=((e,t,o,n)=>{const r=e.isiOS()&&!0===/ipad/i.test(o),a=e.isiOS()&&!r,s=e.isiOS()||e.isAndroid(),i=s||n("(pointer:coarse)"),l=r||!a&&s&&n("(min-device-width:768px)"),c=a||s&&!l,d=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),m=!c&&!l&&!d;return{isiPad:A(r),isiPhone:A(a),isTablet:A(l),isPhone:A(c),isTouch:A(i),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:A(d),isDesktop:A(m)}})(s,a,e,o);return{browser:a,os:s,deviceType:i}},$t=e=>window.matchMedia(e).matches;let qt=it(()=>Wt(window.navigator.userAgent,P.from(window.navigator.userAgentData),$t));const Gt=()=>qt(),Kt=(e,t)=>{const o=((e,t)=>je(e,t))(e,t);if(null==o)throw new Error(e+" not available on this browser");return o},Yt=Object.getPrototypeOf,Xt=e=>{const t=je("ownerDocument.defaultView",e);return h(e)&&((e=>Kt("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(Yt(e).constructor.name))},Jt=window.navigator.userAgent,Qt=Gt(),eo=Qt.browser,to=Qt.os,oo=Qt.deviceType,no=-1!==Jt.indexOf("Windows Phone"),ro={transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",documentMode:eo.isIE()?document.documentMode||7:10,cacheSuffix:null,container:null,canHaveCSP:!eo.isIE(),windowsPhone:no,browser:{current:eo.current,version:eo.version,isChromium:eo.isChromium,isEdge:eo.isEdge,isFirefox:eo.isFirefox,isIE:eo.isIE,isOpera:eo.isOpera,isSafari:eo.isSafari},os:{current:to.current,version:to.version,isAndroid:to.isAndroid,isChromeOS:to.isChromeOS,isFreeBSD:to.isFreeBSD,isiOS:to.isiOS,isLinux:to.isLinux,isMacOS:to.isMacOS,isSolaris:to.isSolaris,isWindows:to.isWindows},deviceType:{isDesktop:oo.isDesktop,isiPad:oo.isiPad,isiPhone:oo.isiPhone,isPhone:oo.isPhone,isTablet:oo.isTablet,isTouch:oo.isTouch,isWebView:oo.isWebView}},ao=/^\s*|\s*$/g,so=e=>w(e)?"":(""+e).replace(ao,""),io=function(e,t,o,n){n=n||this,e&&(o&&(e=e[o]),pt(e,(e,r)=>!1!==t.call(n,e,r,o)&&(io(e,t,o,n),!0)))},lo={trim:so,isArray:gt,is:(e,t)=>t?!("array"!==t||!gt(e))||typeof e===t:void 0!==e,toArray:e=>{if(gt(e))return e;{const t=[];for(let o=0,n=e.length;o<n;o++)t[o]=e[o];return t}},makeMap:(e,t,o={})=>{const n=p(e)?e.split(t||","):e||[];let r=n.length;for(;r--;)o[n[r]]={};return o},each:pt,map:ht,grep:ft,inArray:(e,t)=>{if(e)for(let o=0,n=e.length;o<n;o++)if(e[o]===t)return o;return-1},hasOwn:Ee,extend:(e,...t)=>{for(let o=0;o<t.length;o++){const n=t[o];for(const t in n)if(Ee(n,t)){const o=n[t];void 0!==o&&(e[t]=o)}}return e},walk:io,resolve:(e,t=window)=>{const o=e.split(".");for(let e=0,n=o.length;e<n&&(t=t[o[e]]);e++);return t},explode:(e,t)=>b(e)?e:""===e?[]:ht(e.split(t||","),so),_addCacheSuffix:e=>{const t=ro.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},co=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},mo={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return co(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return co(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return co(o)},fromDom:co,fromPoint:(e,t,o)=>P.from(e.dom.elementFromPoint(t,o)).map(co)},uo=(e,t,o)=>{const n=e.document.createRange();var r;return r=n,t.fold(e=>{r.setStartBefore(e.dom)},(e,t)=>{r.setStart(e.dom,t)},e=>{r.setStartAfter(e.dom)}),((e,t)=>{t.fold(t=>{e.setEndBefore(t.dom)},(t,o)=>{e.setEnd(t.dom,o)},t=>{e.setEndAfter(t.dom)})})(n,o),n},go=(e,t,o,n,r)=>{const a=e.document.createRange();return a.setStart(t.dom,o),a.setEnd(n.dom,r),a},po=Te([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),ho=(e,t,o)=>t(mo.fromDom(o.startContainer),o.startOffset,mo.fromDom(o.endContainer),o.endOffset),fo=(e,t)=>{const o=((e,t)=>t.match({domRange:e=>({ltr:A(e),rtl:P.none}),relative:(t,o)=>({ltr:it(()=>uo(e,t,o)),rtl:it(()=>P.some(uo(e,o,t)))}),exact:(t,o,n,r)=>({ltr:it(()=>go(e,t,o,n,r)),rtl:it(()=>P.some(go(e,n,r,t,o)))})}))(e,t);return((e,t)=>{const o=t.ltr();if(o.collapsed)return t.rtl().filter(e=>!1===e.collapsed).map(e=>po.rtl(mo.fromDom(e.endContainer),e.endOffset,mo.fromDom(e.startContainer),e.startOffset)).getOrThunk(()=>ho(0,po.ltr,o));return ho(0,po.ltr,o)})(0,o)};po.ltr,po.rtl;const bo=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},xo=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,vo=(e,t)=>e.dom===t.dom,yo=(e,t)=>{const o=e.dom,n=t.dom;return o!==n&&o.contains(n)},wo=(e,t)=>{const o=[],n=e=>(o.push(e),t(e));let r=t(e);do{r=r.bind(n)}while(r.isSome());return o},_o=e=>e.dom.nodeName.toLowerCase(),Co=e=>e.dom.nodeType,ko=e=>t=>Co(t)===e,So=e=>Eo(e)&&Xt(e.dom),Eo=ko(1),Oo=ko(3),To=ko(9),Ao=ko(11),Do=e=>t=>Eo(t)&&_o(t)===e,Mo=e=>mo.fromDom(e.dom.ownerDocument),Ro=e=>To(e)?e:Mo(e),No=e=>mo.fromDom(Ro(e).dom.defaultView),Bo=e=>P.from(e.dom.parentNode).map(mo.fromDom),zo=e=>P.from(e.dom.parentElement).map(mo.fromDom),Ho=(e,t)=>{const o=C(t)?t:L;let n=e.dom;const r=[];for(;null!==n.parentNode&&void 0!==n.parentNode;){const e=n.parentNode,t=mo.fromDom(e);if(r.push(t),!0===o(t))break;n=e}return r},Lo=e=>P.from(e.dom.previousSibling).map(mo.fromDom),Io=e=>P.from(e.dom.nextSibling).map(mo.fromDom),Po=e=>ae(wo(e,Lo)),Fo=e=>wo(e,Io),Vo=e=>$(e.dom.childNodes,mo.fromDom),Zo=(e,t)=>{const o=e.dom.childNodes;return P.from(o[t]).map(mo.fromDom)},Uo=e=>Zo(e,0),jo=e=>Zo(e,e.dom.childNodes.length-1),Wo=e=>e.dom.childNodes.length,$o=e=>Ao(e)&&_(e.dom.host),qo=e=>mo.fromDom(e.dom.getRootNode()),Go=e=>$o(e)?e:(e=>{const t=e.dom.head;if(null==t)throw new Error("Head is not available yet");return mo.fromDom(t)})(Ro(e)),Ko=e=>mo.fromDom(e.dom.host),Yo=e=>{if(_(e.target)){const t=mo.fromDom(e.target);if(Eo(t)&&Xo(t)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return de(t)}}return P.from(e.target)},Xo=e=>_(e.dom.shadowRoot),Jo=(e,t)=>o=>{e(o)&&t((e=>{const t=mo.fromDom(Yo(e).getOr(e.target)),o=()=>e.stopPropagation(),n=()=>e.preventDefault(),r=O(n,o);return((e,t,o,n,r,a,s)=>({target:e,x:t,y:o,stop:n,prevent:r,kill:a,raw:s}))(t,e.clientX,e.clientY,o,n,r,e)})(o))},Qo=(e,t,o,n)=>((e,t,o,n,r)=>{const a=Jo(o,n);return e.dom.addEventListener(t,a,r),{unbind:R(en,e,t,a,r)}})(e,t,o,n,!1),en=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)},tn=I,on=()=>mo.fromDom(document),nn=(e,t=!1)=>e.dom.focus({preventScroll:t}),rn=e=>{const t=qo(e).dom;return e.dom===t.activeElement},an=(e=on())=>P.from(e.dom.activeElement).map(mo.fromDom),sn=(e,t)=>{Bo(e).each(o=>{o.dom.insertBefore(t.dom,e.dom)})},ln=(e,t)=>{Io(e).fold(()=>{Bo(e).each(e=>{dn(e,t)})},e=>{sn(e,t)})},cn=(e,t)=>{Uo(e).fold(()=>{dn(e,t)},o=>{e.dom.insertBefore(t.dom,o.dom)})},dn=(e,t)=>{e.dom.appendChild(t.dom)},mn=(e,t)=>{sn(e,t),dn(t,e)},un=(e,t)=>{q(t,t=>{dn(e,t)})},gn=(e,t,o)=>{if(!(p(o)||v(o)||k(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")},pn=(e,t,o)=>{gn(e.dom,t,o)},hn=(e,t)=>{const o=e.dom;be(t,(e,t)=>{gn(o,t,e)})},fn=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},bn=(e,t)=>P.from(fn(e,t)),xn=(e,t)=>{const o=e.dom;return!(!o||!o.hasAttribute)&&o.hasAttribute(t)},vn=(e,t)=>{e.dom.removeAttribute(t)},yn=e=>J(e.dom.attributes,(e,t)=>(e[t.name]=t.value,e),{}),wn=e=>{e.dom.textContent="",q(Vo(e),e=>{_n(e)})},_n=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},Cn=e=>{const t=Vo(e);var o,n;t.length>0&&(o=e,q(n=t,(e,t)=>{const r=0===t?o:n[t-1];ln(r,e)})),_n(e)},kn=(e,t)=>mo.fromDom(e.dom.cloneNode(t)),Sn=e=>kn(e,!1),En=e=>kn(e,!0),On=(e,t)=>{const o=((e,t)=>{const o=mo.fromTag(t),n=yn(e);return hn(o,n),o})(e,t);ln(e,o);const n=Vo(e);return un(o,n),_n(e),o},Tn=e=>$(e,mo.fromDom),An=e=>e.dom.innerHTML,Dn=(e,t)=>{const o=Mo(e).dom,n=mo.fromDom(o.createDocumentFragment()),r=((e,t)=>{const o=(t||document).createElement("div");return o.innerHTML=e,Vo(mo.fromDom(o))})(t,o);un(n,r),wn(e),dn(e,n)},Mn=e=>void 0!==e.style&&C(e.style.getPropertyValue),Rn=e=>{const t=Oo(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return(e=>{const t=qo(e);return $o(t)?P.some(t):P.none()})(mo.fromDom(t)).fold(()=>o.body.contains(t),T(Rn,Ko))},Nn=(e,t,o)=>{if(!p(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);Mn(e)&&e.style.setProperty(t,o)},Bn=(e,t,o)=>{const n=e.dom;Nn(n,t,o)},zn=(e,t)=>{const o=e.dom;be(t,(e,t)=>{Nn(o,t,e)})},Hn=(e,t)=>{const o=e.dom,n=window.getComputedStyle(o).getPropertyValue(t);return""!==n||Rn(e)?n:Ln(o,t)},Ln=(e,t)=>Mn(e)?e.style.getPropertyValue(t):"",In=(e,t)=>{const o=e.dom,n=Ln(o,t);return P.from(n).filter(e=>e.length>0)},Pn=e=>{const t={},o=e.dom;if(Mn(o))for(let e=0;e<o.style.length;e++){const n=o.style.item(e);t[n]=o.style[n]}return t},Fn=(e,t)=>{((e,t)=>{Mn(e)&&e.style.removeProperty(t)})(e.dom,t),Fe(bn(e,"style").map(Qe),"")&&vn(e,"style")},Vn=((e,t)=>{const o=o=>{const n=t(o);if(n<=0||null===n){const t=Hn(o,e);return parseFloat(t)||0}return n},n=(e,t)=>J(t,(t,o)=>{const n=Hn(e,o),r=void 0===n?0:parseInt(n,10);return isNaN(r)?t:t+r},0);return{set:(t,o)=>{if(!k(o)&&!o.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+o);const n=t.dom;Mn(n)&&(n.style[e]=o+"px")},get:o,getOuter:o,aggregate:n,max:(e,t,o)=>{const r=n(e,o);return t>r?t-r:0}}})("height",e=>{const t=e.dom;return Rn(e)?t.getBoundingClientRect().height:t.offsetHeight}),Zn=(e,t)=>({left:e,top:t,translate:(o,n)=>Zn(e+o,t+n)}),Un=Zn,jn=(e,t)=>void 0!==e?e:void 0!==t?t:0,Wn=e=>{const t=e.dom,o=t.ownerDocument.body;return o===t?Un(o.offsetLeft,o.offsetTop):Rn(e)?(e=>{const t=e.getBoundingClientRect();return Un(t.left,t.top)})(t):Un(0,0)},$n=e=>{const t=void 0!==e?e.dom:document,o=t.body.scrollLeft||t.documentElement.scrollLeft,n=t.body.scrollTop||t.documentElement.scrollTop;return Un(o,n)},qn=(e,t,o)=>{const n=(void 0!==o?o.dom:document).defaultView;n&&n.scrollTo(e,t)},Gn=(e,t)=>{Gt().browser.isSafari()&&C(e.dom.scrollIntoViewIfNeeded)?e.dom.scrollIntoViewIfNeeded(!1):e.dom.scrollIntoView(t)},Kn=(e,t)=>{const o=(t||document).createDocumentFragment();return q(e,e=>{o.appendChild(e.dom)}),mo.fromDom(o)},Yn=((e,t)=>{const o=t=>e(t)?P.from(t.dom.nodeValue):P.none();return{get:n=>{if(!e(n))throw new Error("Can only get "+t+" value of a "+t+" node");return o(n).getOr("")},getOption:o,set:(o,n)=>{if(!e(o))throw new Error("Can only set raw "+t+" value of a "+t+" node");o.dom.nodeValue=n}}})(Oo,"text"),Xn=e=>Yn.get(e),Jn=(e,t)=>Yn.set(e,t),Qn=(e,t)=>{const o=fn(e,t);return void 0===o||""===o?[]:o.split(" ")};var er=(e,t,o,n,r)=>e(o,n)?P.some(o):C(r)&&r(o)?P.none():t(o,n,r);const tr=(e,t,o)=>{let n=e.dom;const r=C(o)?o:L;for(;n.parentNode;){n=n.parentNode;const e=mo.fromDom(n);if(t(e))return P.some(e);if(r(e))break}return P.none()},or=(e,t,o)=>er((e,t)=>t(e),tr,e,t,o),nr=(e,t)=>ee(e.dom.childNodes,e=>t(mo.fromDom(e))).map(mo.fromDom),rr=(e,t)=>{const o=e=>{for(let n=0;n<e.childNodes.length;n++){const r=mo.fromDom(e.childNodes[n]);if(t(r))return P.some(r);const a=o(e.childNodes[n]);if(a.isSome())return a}return P.none()};return o(e.dom)},ar=(e,t,o)=>tr(e,e=>bo(e,t),o),sr=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return xo(o)?P.none():P.from(o.querySelector(e)).map(mo.fromDom)})(t,e),ir=(e,t,o)=>er((e,t)=>bo(e,t),ar,e,t,o),lr=e=>void 0!==e.dom.classList,cr=e=>Qn(e,"class"),dr=(e,t)=>((e,t,o)=>{const n=Qn(e,t).concat([o]);return pn(e,t,n.join(" ")),!0})(e,"class",t),mr=(e,t)=>((e,t,o)=>{const n=Y(Qn(e,t),e=>e!==o);return n.length>0?pn(e,t,n.join(" ")):vn(e,t),!1})(e,"class",t),ur=(e,t)=>{lr(e)?e.dom.classList.add(t):dr(e,t)},gr=e=>{0===(lr(e)?e.dom.classList:cr(e)).length&&vn(e,"class")},pr=(e,t)=>{if(lr(e)){e.dom.classList.remove(t)}else mr(e,t);gr(e)},hr=(e,t)=>{const o=lr(e)?e.dom.classList.toggle(t):((e,t)=>j(cr(e),t)?mr(e,t):dr(e,t))(e,t);return gr(e),o},fr=(e,t)=>lr(e)&&e.dom.classList.contains(t),br=(e,t=!1)=>{return Rn(e)?e.dom.isContentEditable:(o=e,ir(o,"[contenteditable]")).fold(A(t),e=>"true"===xr(e));var o},xr=e=>e.dom.contentEditable,vr=(e,t)=>{e.dom.contentEditable=t?"true":"false"},yr=(e,t)=>{let o=[];return q(Vo(e),e=>{t(e)&&(o=o.concat([e])),o=o.concat(yr(e,t))}),o},wr=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return xo(o)?[]:$(o.querySelectorAll(e),mo.fromDom)})(t,e),_r=(e,t,o)=>tr(e,t,o).isSome(),Cr=(e,t)=>((e,t)=>{const o=e.dom;return o.parentNode?nr(mo.fromDom(o.parentNode),o=>!vo(e,o)&&t(o)):P.none()})(e,t).isSome(),kr=(e,t)=>rr(e,t).isSome(),Sr=e=>C(e)?e:L,Er=(e,t,o)=>{const n=t(e),r=Sr(o);return n.orThunk(()=>r(e)?P.none():((e,t,o)=>{let n=e.dom;const r=Sr(o);for(;n.parentNode;){n=n.parentNode;const e=mo.fromDom(n),o=t(e);if(o.isSome())return o;if(r(e))break}return P.none()})(e,t,r))},Or=e=>{return(t=e,Yn.getOption(t)).filter(e=>0!==e.trim().length||e.indexOf(ct)>-1).isSome();var t},Tr=["img","br"],Ar=e=>Or(e)||j(Tr,_o(e))||(e=>So(e)&&"false"===fn(e,"contenteditable"))(e),Dr=(e,t,o,n)=>({start:e,soffset:t,finish:o,foffset:n}),Mr=Te([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Rr={before:Mr.before,on:Mr.on,after:Mr.after,cata:(e,t,o,n)=>e.fold(t,o,n),getStart:e=>e.fold(D,D,D)},Nr=Te([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Br={domRange:Nr.domRange,relative:Nr.relative,exact:Nr.exact,exactFromRange:e=>Nr.exact(e.start,e.soffset,e.finish,e.foffset),getWin:e=>{const t=(e=>e.match({domRange:e=>mo.fromDom(e.startContainer),relative:(e,t)=>Rr.getStart(e),exact:(e,t,o,n)=>e}))(e);return No(t)},range:Dr},zr=(e,t,o)=>e.caretPositionFromPoint?((e,t,o)=>{var n;return P.from(null===(n=e.caretPositionFromPoint)||void 0===n?void 0:n.call(e,t,o)).bind(t=>{if(null===t.offsetNode)return P.none();const o=e.createRange();return o.setStart(t.offsetNode,t.offset),o.collapse(),P.some(o)})})(e,t,o):e.caretRangeFromPoint?((e,t,o)=>{var n;return P.from(null===(n=e.caretRangeFromPoint)||void 0===n?void 0:n.call(e,t,o))})(e,t,o):P.none(),Hr=(e,t)=>{const o=_o(e);return"input"===o?Rr.after(e):j(["br","img"],o)?0===t?Rr.before(e):Rr.after(e):Rr.on(e,t)},Lr=(e,t)=>{const o=e.fold(Rr.before,Hr,Rr.after),n=t.fold(Rr.before,Hr,Rr.after);return Br.relative(o,n)},Ir=(e,t,o,n)=>{const r=Hr(e,t),a=Hr(o,n);return Br.relative(r,a)},Pr=e=>{const t=Br.getWin(e).dom,o=(e,o,n,r)=>go(t,e,o,n,r),n=(e=>e.match({domRange:e=>{const t=mo.fromDom(e.startContainer),o=mo.fromDom(e.endContainer);return Ir(t,e.startOffset,o,e.endOffset)},relative:Lr,exact:Ir}))(e);return fo(t,n).match({ltr:o,rtl:o})},Fr=(e,t,o)=>((e,t,o)=>{const n=e.document;return zr(n,t,o).map(e=>Dr(mo.fromDom(e.startContainer),e.startOffset,mo.fromDom(e.endContainer),e.endOffset))})(e,t,o),Vr=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n}),Zr=e=>{const t=void 0===e?window:e,o=t.document,n=$n(mo.fromDom(o));return(e=>{const t=void 0===e?window:e;return Gt().browser.isFirefox()?P.none():P.from(t.visualViewport)})(t).fold(()=>{const e=t.document.documentElement,o=e.clientWidth,r=e.clientHeight;return Vr(n.left,n.top,o,r)},e=>Vr(Math.max(e.pageLeft,n.left),Math.max(e.pageTop,n.top),e.width,e.height))};class Ur{constructor(e,t){this.node=e,this.rootNode=t,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}current(){return this.node}next(e){return this.node=this.findSibling(this.node,"firstChild","nextSibling",e),this.node}prev(e){return this.node=this.findSibling(this.node,"lastChild","previousSibling",e),this.node}prev2(e){return this.node=this.findPreviousNode(this.node,e),this.node}findSibling(e,t,o,n){if(e){if(!n&&e[t])return e[t];if(e!==this.rootNode){let t=e[o];if(t)return t;for(let n=e.parentNode;n&&n!==this.rootNode;n=n.parentNode)if(t=n[o],t)return t}}}findPreviousNode(e,t){if(e){const o=e.previousSibling;if(this.rootNode&&o===this.rootNode)return;if(o){if(!t)for(let e=o.lastChild;e;e=e.lastChild)if(!e.lastChild)return e;return o}const n=e.parentNode;if(n&&n!==this.rootNode)return n}}}const jr=/^[ \t\r\n]*$/,Wr=e=>jr.test(e),$r=e=>"\n"===e||"\r"===e,qr=(e,t=4,o=!0,n=!0)=>{const r=((e,t)=>t<=0?"":new Array(t+1).join(e))(" ",t),a=e.replace(/\t/g,r),s=J(a,(e,t)=>(e=>-1!==" \f\t\v".indexOf(e))(t)||t===ct?e.pcIsSpace||""===e.str&&o||e.str.length===a.length-1&&n||((e,t)=>t<e.length&&t>=0&&$r(e[t]))(a,e.str.length+1)?{pcIsSpace:!1,str:e.str+ct}:{pcIsSpace:!0,str:e.str+" "}:{pcIsSpace:$r(t),str:e.str+t},{pcIsSpace:!1,str:""});return s.str},Gr=e=>t=>!!t&&t.nodeType===e,Kr=e=>!!e&&!Object.getPrototypeOf(e),Yr=Gr(1),Xr=e=>Yr(e)&&So(mo.fromDom(e)),Jr=e=>{const t=e.toLowerCase();return e=>_(e)&&e.nodeName.toLowerCase()===t},Qr=e=>{const t=e.map(e=>e.toLowerCase());return e=>{if(e&&e.nodeName){const o=e.nodeName.toLowerCase();return j(t,o)}return!1}},ea=(e,t)=>{const o=t.toLowerCase().split(" ");return t=>{if(Yr(t)){const n=t.ownerDocument.defaultView;if(n)for(let r=0;r<o.length;r++){const a=n.getComputedStyle(t,null);if((a?a.getPropertyValue(e):null)===o[r])return!0}}return!1}},ta=e=>Yr(e)&&e.hasAttribute("data-mce-bogus"),oa=e=>Yr(e)&&"TABLE"===e.tagName,na=e=>t=>{if(Xr(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1},ra=Qr(["textarea","input"]),aa=Gr(3),sa=Gr(4),ia=Gr(7),la=Gr(8),ca=Gr(9),da=Gr(11),ma=Jr("br"),ua=Jr("img"),ga=Jr("a"),pa=na("true"),ha=na("false"),fa=e=>Xr(e)&&e.isContentEditable&&_(e.parentElement)&&!e.parentElement.isContentEditable,ba=Qr(["td","th"]),xa=Qr(["td","th","caption"]),va=Qr(["video","audio","object","embed"]),ya=Jr("li"),wa=Jr("details"),_a=Jr("summary"),Ca={skipBogus:!0,includeZwsp:!1,checkRootAsContent:!1},ka=(Sa="data-mce-bookmark",e=>Yr(e)&&e.hasAttribute(Sa));var Sa;const Ea=(e,t,o)=>Wr(e.data)&&!((e,t,o)=>{const n=mo.fromDom(t),r=mo.fromDom(e),a=o.getWhitespaceElements();return _r(r,e=>Ee(a,_o(e)),R(vo,n))})(e,t,o),Oa=(e,t,o,n)=>aa(e)&&!Ea(e,t,o)&&(!n.includeZwsp||!(e=>{for(const t of e)if(!dt(t))return!1;return!0})(e.data)),Ta=(e,t,o,n)=>C(n.isContent)&&n.isContent(t)||((e,t)=>Yr(e)&&Ee(t.getNonEmptyElements(),e.nodeName))(t,e)||ka(t)||(e=>Yr(e)&&"A"===e.nodeName&&!e.hasAttribute("href")&&(e.hasAttribute("name")||e.hasAttribute("id")))(t)||Oa(t,o,e,n)||ha(t)||pa(t)&&(e=>zo(mo.fromDom(e)).exists(e=>!br(e)))(t),Aa=(e,t,o)=>{const n={...Ca,...o};if(n.checkRootAsContent&&Ta(e,t,t,n))return!1;let r=t.firstChild,a=0;if(!r)return!0;const s=new Ur(r,t);do{if(n.skipBogus&&Yr(r)){const e=r.getAttribute("data-mce-bogus");if(e){r=s.next("all"===e);continue}}if(la(r))r=s.next(!0);else if(ma(r))a++,r=s.next();else{if(Ta(e,r,t,n))return!1;r=s.next()}}while(r);return a<=1},Da=(e,t,o)=>Aa(e,t.dom,{checkRootAsContent:!0,...o}),Ma=(e,t,o)=>Ta(e,t,t,{includeZwsp:Ca.includeZwsp,...o}),Ra=e=>{const t=e.toLowerCase();return"svg"===t?"svg":"math"===t?"math":"html"},Na=e=>"html"!==Ra(e),Ba=e=>Na(e.nodeName),za=e=>Ra(e.nodeName),Ha=["svg","math"],La="data-mce-block",Ia=e=>$((e=>Y(he(e),e=>!/[A-Z]/.test(e)))(e),e=>{const t=CSS.escape(e);return`${t}:`+$(Ha,e=>`not(${e} ${t})`).join(":")}).join(","),Pa=(e,t)=>_(t.querySelector(e))?(t.setAttribute(La,"true"),"inline-boundary"===t.getAttribute("data-mce-selected")&&t.removeAttribute("data-mce-selected"),!0):(t.removeAttribute(La),!1),Fa=(e,t)=>{const o=Ia(e.getTransparentElements()),n=Ia(e.getBlockElements());return Y(t.querySelectorAll(o),e=>Pa(n,e))},Va=(e,t,o)=>{var n;const r=o?"lastChild":"firstChild";for(let o=t[r];o;o=o[r])if(Aa(e,o,{checkRootAsContent:!0}))return void(null===(n=o.parentNode)||void 0===n||n.removeChild(o))},Za=(e,t,o)=>{const n=e.getBlockElements(),r=mo.fromDom(t),a=e=>_o(e)in n,s=e=>vo(e,r);q(Tn(o),t=>{tr(t,a,s).each(o=>{const n=((e,t)=>Y(Vo(e),t))(t,t=>a(t)&&!e.isValidChild(_o(o),_o(t)));if(n.length>0){const t=zo(o);q(n,t=>{tr(t,a,s).each(o=>{((e,t,o)=>{const n=document.createRange(),r=t.parentNode;if(r){n.setStartBefore(t),n.setEndBefore(o);const a=n.extractContents();Va(e,a,!0),n.setStartAfter(o),n.setEndAfter(t);const s=n.extractContents();Va(e,s,!1),Aa(e,a,{checkRootAsContent:!0})||r.insertBefore(a,t),Aa(e,o,{checkRootAsContent:!0})||r.insertBefore(o,t),Aa(e,s,{checkRootAsContent:!0})||r.insertBefore(s,t),r.removeChild(t)}})(e,o.dom,t.dom)})}),t.each(t=>Fa(e,t.dom))}})})},Ua=(e,t)=>{const o=Fa(e,t);Za(e,t,o),((e,t,o)=>{q([...o,...Ga(e,t)?[t]:[]],t=>q(wr(mo.fromDom(t),t.nodeName.toLowerCase()),t=>{Ka(e,t.dom)&&Cn(t)}))})(e,t,o)},ja=(e,t)=>{if(qa(e,t)){const o=Ia(e.getBlockElements());Pa(o,t)}},Wa=e=>e.hasAttribute(La),$a=(e,t)=>Ee(e.getTransparentElements(),t),qa=(e,t)=>Yr(t)&&$a(e,t.nodeName),Ga=(e,t)=>qa(e,t)&&Wa(t),Ka=(e,t)=>qa(e,t)&&!Wa(t),Ya=(e,t)=>1===t.type&&$a(e,t.name)&&p(t.attr(La)),Xa=Gt().browser,Ja=e=>ee(e,Eo),Qa=(e,t)=>e.children&&j(e.children,t),es=(e,t,o)=>{let n=0,r=0;const a=e.ownerDocument;if(o=o||e,t){if(o===e&&t.getBoundingClientRect&&"static"===Hn(mo.fromDom(e),"position")){const o=t.getBoundingClientRect();return n=o.left+(a.documentElement.scrollLeft||e.scrollLeft)-a.documentElement.clientLeft,r=o.top+(a.documentElement.scrollTop||e.scrollTop)-a.documentElement.clientTop,{x:n,y:r}}let s=t;for(;s&&s!==o&&s.nodeType&&!Qa(s,o);){const e=s;n+=e.offsetLeft||0,r+=e.offsetTop||0,s=e.offsetParent}for(s=t.parentNode;s&&s!==o&&s.nodeType&&!Qa(s,o);)n-=s.scrollLeft||0,r-=s.scrollTop||0,s=s.parentNode;r+=(e=>Xa.isFirefox()&&"table"===_o(e)?Ja(Vo(e)).filter(e=>"caption"===_o(e)).bind(e=>Ja(Fo(e)).map(t=>{const o=t.dom.offsetTop,n=e.dom.offsetTop,r=e.dom.offsetHeight;return o<=n?-r:0})).getOr(0):0)(mo.fromDom(t))}return{x:n,y:r}},ts=(e,t={})=>{let o=0;const n={},r=mo.fromDom(e),a=Ro(r),s=e=>{dn(Go(r),e)},i=e=>{const t=Go(r);sr(t,"#"+e).each(_n)},l=e=>Se(n,e).getOrThunk(()=>({id:"mce-u"+o++,passed:[],failed:[],count:0})),c=e=>new Promise((o,r)=>{let i;const c=lo._addCacheSuffix(e),d=l(c);n[c]=d,d.count++;const m=(e,t)=>{q(e,H),d.status=t,d.passed=[],d.failed=[],i&&(i.onload=null,i.onerror=null,i=null)},u=()=>m(d.passed,2),g=()=>m(d.failed,3);if(o&&d.passed.push(o),r&&d.failed.push(r),1===d.status)return;if(2===d.status)return void u();if(3===d.status)return void g();d.status=1;const p=mo.fromTag("link",a.dom);hn(p,{rel:"stylesheet",type:"text/css",id:d.id}),t.contentCssCors&&pn(p,"crossOrigin","anonymous"),t.referrerPolicy&&pn(p,"referrerpolicy",t.referrerPolicy),i=p.dom,i.onload=u,i.onerror=g,s(p),pn(p,"href",c)}),d=e=>{const t=lo._addCacheSuffix(e);Se(n,t).each(e=>{0===--e.count&&(delete n[t],i(e.id))})};return{load:c,loadRawCss:(e,t)=>{const o=l(e);n[e]=o,o.count++;const r=mo.fromTag("style",a.dom);hn(r,{rel:"stylesheet",type:"text/css",id:o.id,"data-mce-key":e}),r.dom.innerHTML=t,s(r)},loadAll:e=>Promise.allSettled($(e,e=>c(e).then(A(e)))).then(e=>{const t=K(e,e=>"fulfilled"===e.status);return t.fail.length>0?Promise.reject($(t.fail,e=>e.reason)):$(t.pass,e=>e.value)}),unload:d,unloadRawCss:e=>{Se(n,e).each(t=>{0===--t.count&&(delete n[e],i(t.id))})},unloadAll:e=>{q(e,e=>{d(e)})},_setReferrerPolicy:e=>{t.referrerPolicy=e},_setContentCssCors:e=>{t.contentCssCors=e}}},os=(()=>{const e=new WeakMap;return{forElement:(t,o)=>{const n=qo(t).dom;return P.from(e.get(n)).getOrThunk(()=>{const t=ts(n,o);return e.set(n,t),t})}}})(),ns=(e,t)=>_(e)&&(Ma(t,e)||t.isInline(e.nodeName.toLowerCase())),rs=e=>(e=>"span"===e.nodeName.toLowerCase())(e)&&"bookmark"===e.getAttribute("data-mce-type"),as=(e,t,o)=>aa(e)&&e.data.length>0&&((e,t,o)=>{const n=new Ur(e,t).prev(!1),r=new Ur(e,t).next(!1),a=y(n)||ns(n,o),s=y(r)||ns(r,o);return a&&s})(e,t,o),ss=(e,t,o,n)=>{var r;const a=n||t;if(Yr(t)&&rs(t))return t;const s=t.childNodes;for(let t=s.length-1;t>=0;t--)ss(e,s[t],o,a);if(Yr(t)){const e=t.childNodes;1===e.length&&rs(e[0])&&(null===(r=t.parentNode)||void 0===r||r.insertBefore(e[0],t))}return(e=>da(e)||ca(e))(t)||Ma(o,t)||(e=>!!Yr(e)&&e.childNodes.length>0)(t)||as(t,a,o)||e.remove(t),t},is=lo.makeMap,ls=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,cs=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ds=/[<>&\"\']/g,ms=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,us={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:"Ÿ"},gs={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},ps={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"},hs=(e,t)=>{const o={};if(e){const n=e.split(",");t=t||10;for(let e=0;e<n.length;e+=2){const r=String.fromCharCode(parseInt(n[e],t));if(!gs[r]){const t="&"+n[e+1]+";";o[r]=t,o[t]=r}}return o}},fs=hs("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),bs=(e,t)=>e.replace(t?ls:cs,e=>gs[e]||e),xs=(e,t)=>e.replace(t?ls:cs,e=>e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":gs[e]||"&#"+e.charCodeAt(0)+";"),vs=(e,t,o)=>{const n=o||fs;return e.replace(t?ls:cs,e=>gs[e]||n[e]||e)},ys={encodeRaw:bs,encodeAllRaw:e=>(""+e).replace(ds,e=>gs[e]||e),encodeNumeric:xs,encodeNamed:vs,getEncodeFunc:(e,t)=>{const o=hs(t)||fs,n=(e,t)=>e.replace(t?ls:cs,e=>void 0!==gs[e]?gs[e]:void 0!==o[e]?o[e]:e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";"),r=(e,t)=>vs(e,t,o),a=is(e.replace(/\+/g,","));return a.named&&a.numeric?n:a.named?t?r:vs:a.numeric?xs:bs},decode:e=>e.replace(ms,(e,t)=>t?(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))>65535?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):us[t]||String.fromCharCode(t):ps[e]||fs[e]||(e=>{const t=mo.fromTag("div").dom;return t.innerHTML=e,t.textContent||t.innerText||e})(e))},ws=(e,t)=>(e=lo.trim(e))?e.split(t||" "):[],_s=e=>new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$"),Cs=e=>{const t=e=>b(e)?$(e,t):(e=>h(e)&&e.source&&"[object RegExp]"===Object.prototype.toString.call(e))(e)?new RegExp(e.source,e.flags):h(e)?xe(e,t):e;return t(e)},ks=e=>Object.freeze(["id","accesskey","class","dir","lang","style","tabindex","title","role",..."html4"!==e?["contenteditable","contextmenu","draggable","dropzone","hidden","spellcheck","translate","itemprop","itemscope","itemtype"]:[],..."html5-strict"!==e?["xml:lang"]:[]]),Ss=e=>{let t,o;if(t="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",o="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==e){t+=" article aside details dialog figure main header footer hgroup section nav "+"a ins del canvas map",o+=" audio canvas command data datalist mark meter output picture progress time wbr video ruby bdi keygen svg"}if("html5-strict"!==e){o=[o,"acronym applet basefont big font strike tt"].join(" ");t=[t,"center dir isindex noframes"].join(" ")}const n=[t,o].join(" ");return{blockContent:t,phrasingContent:o,flowContent:n}},Es=e=>{const{blockContent:t,phrasingContent:o,flowContent:n}=Ss(e),r=e=>Object.freeze(e.split(" "));return Object.freeze({blockContent:r(t),phrasingContent:r(o),flowContent:r(n)})},Os={html4:it(()=>Es("html4")),html5:it(()=>Es("html5")),"html5-strict":it(()=>Es("html5-strict"))},Ts=(e,t)=>{const{blockContent:o,phrasingContent:n,flowContent:r}=Os[e]();return"blocks"===t?P.some(o):"phrasing"===t?P.some(n):"flow"===t?P.some(r):P.none()},As=e=>P.from(/^(@?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)$/.exec(e)).map(e=>({preset:"@"===e[1],name:e[2]})),Ds=(e,t)=>{const o=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/;return ne(ws(t,","),t=>{const n=o.exec(t);if(n){const t=n[1],o=n[2],r=n[3],a=n[4],s=n[5],i={attributes:{},attributesOrder:[]};if(e.each(e=>((e,t)=>{be(e.attributes,(e,o)=>{t.attributes[o]=e}),t.attributesOrder.push(...e.attributesOrder)})(e,i)),"#"===t?i.paddEmpty=!0:"-"===t&&(i.removeEmpty=!0),"!"===a&&(i.removeEmptyAttrs=!0),s&&((e,t)=>{const o=/^([!\-])?(\w+[\\:]:\w+|[^=~<]+)?(?:([=~<])(.*))?$/,n=/[*?+]/,{attributes:r,attributesOrder:a}=t;q(ws(e,"|"),e=>{const s=o.exec(e);if(s){const e={},o=s[1],i=s[2].replace(/[\\:]:/g,":"),l=s[3],c=s[4];if("!"===o&&(t.attributesRequired=t.attributesRequired||[],t.attributesRequired.push(i),e.required=!0),"-"===o)return delete r[i],void a.splice(lo.inArray(a,i),1);if(l&&("="===l?(t.attributesDefault=t.attributesDefault||[],t.attributesDefault.push({name:i,value:c}),e.defaultValue=c):"~"===l?(t.attributesForced=t.attributesForced||[],t.attributesForced.push({name:i,value:c}),e.forcedValue=c):"<"===l&&(e.validValues=lo.makeMap(c,"?"))),n.test(i)){const o=e;t.attributePatterns=t.attributePatterns||[],o.pattern=_s(i),t.attributePatterns.push(o)}else r[i]||a.push(i),r[i]=e}})})(s,i),r&&(i.outputName=o),"@"===o){if(!e.isNone())return[];e=P.some(i)}return[r?{name:o,element:i,aliasName:r}:{name:o,element:i}]}return[]})},Ms={},Rs=lo.makeMap,Ns=lo.each,Bs=lo.extend,zs=lo.explode,Hs=(e,t={})=>{const o=Rs(e," ",Rs(e.toUpperCase()," "));return Bs(o,t)},Ls=e=>Hs("td th li dt dd figcaption caption details summary",e.getTextBlockElements()),Is=(e,t)=>{if(e){const o={};return p(e)&&(e={"*":e}),Ns(e,(e,n)=>{o[n]=o[n.toUpperCase()]="map"===t?Rs(e,/[, ]/):zs(e,/[, ]/)}),o}},Ps=(e={})=>{var t;const o={},n={};let r=[];const a={},s={},i=(t,o,n)=>{const r=e[t];if(r)return Rs(r,/[, ]/,Rs(r.toUpperCase(),/[, ]/));{let e=Ms[t];return e||(e=Hs(o,n),Ms[t]=e),e}},l=null!==(t=e.schema)&&void 0!==t?t:"html5",c=(e=>{const t=ks(e),{phrasingContent:o,flowContent:n}=Ss(e),r={},a=(e,t,o)=>{r[e]={attributes:ie(t,A({})),attributesOrder:t,children:ie(o,A({}))}},s=(e,o="",n="")=>{const r=ws(n),s=ws(e);let i=s.length;const l=[...t,...ws(o)];for(;i--;)a(s[i],l.slice(),r)},i=(e,t)=>{const o=ws(e),n=ws(t);let a=o.length;for(;a--;){const e=r[o[a]];for(let t=0,o=n.length;t<o;t++)e.attributes[n[t]]={},e.attributesOrder.push(n[t])}};"html5-strict"!==e&&(q(ws("acronym applet basefont big font strike tt"),e=>{s(e,"",o)}),q(ws("center dir isindex noframes"),e=>{s(e,"",n)}));return s("html","manifest","head body"),s("head","","base command link meta noscript script style title"),s("title hr noscript br"),s("base","href target"),s("link","href rel media hreflang type sizes hreflang"),s("meta","name http-equiv content charset"),s("style","media type scoped"),s("script","src async defer type charset"),s("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",n),s("dd div","",n),s("address dt caption","","html4"===e?o:n),s("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",o),s("blockquote","cite",n),s("ol","reversed start type","li"),s("ul","","li"),s("li","value",n),s("dl","","dt dd"),s("a","href target rel media hreflang type","html4"===e?o:n),s("q","cite",o),s("ins del","cite datetime",n),s("img","src sizes srcset alt usemap ismap width height"),s("iframe","src name width height",n),s("embed","src type width height"),s("object","data type typemustmatch name usemap form width height",[n,"param"].join(" ")),s("param","name value"),s("map","name",[n,"area"].join(" ")),s("area","alt coords shape href target rel media hreflang type"),s("table","border","caption colgroup thead tfoot tbody tr"+("html4"===e?" col":"")),s("colgroup","span","col"),s("col","span"),s("tbody thead tfoot","","tr"),s("tr","","td th"),s("td","colspan rowspan headers",n),s("th","colspan rowspan headers scope abbr",n),s("form","accept-charset action autocomplete enctype method name novalidate target",n),s("fieldset","disabled form name",[n,"legend"].join(" ")),s("label","form for",o),s("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),s("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===e?n:o),s("select","disabled form multiple name required size","option optgroup"),s("optgroup","disabled label","option"),s("option","disabled label selected value"),s("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),s("menu","type label",[n,"li"].join(" ")),s("noscript","",n),"html4"!==e&&(s("wbr"),s("ruby","",[o,"rt rp"].join(" ")),s("figcaption","",n),s("mark rt rp bdi","",o),s("summary","",[o,"h1 h2 h3 h4 h5 h6"].join(" ")),s("canvas","width height",n),s("data","value",o),s("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[n,"track source"].join(" ")),s("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[n,"track source"].join(" ")),s("picture","","img source"),s("source","src srcset type media sizes"),s("track","kind src srclang label default"),s("datalist","",[o,"option"].join(" ")),s("article section nav aside main header footer","",n),s("hgroup","","h1 h2 h3 h4 h5 h6"),s("figure","",[n,"figcaption"].join(" ")),s("time","datetime",o),s("dialog","open",n),s("command","type label icon disabled checked radiogroup command"),s("output","for form name",o),s("progress","value max",o),s("meter","value min max low high optimum",o),s("details","open",[n,"summary"].join(" ")),s("keygen","autofocus challenge disabled form keytype name"),a("svg","id tabindex lang xml:space class style x y width height viewBox preserveAspectRatio zoomAndPan transform".split(" "),[])),"html5-strict"!==e&&(i("script","language xml:space"),i("style","xml:space"),i("object","declare classid code codebase codetype archive standby align border hspace vspace"),i("embed","align name hspace vspace"),i("param","valuetype type"),i("a","charset name rev shape coords"),i("br","clear"),i("applet","codebase archive code object alt name width height align hspace vspace"),i("img","name longdesc align border hspace vspace"),i("iframe","longdesc frameborder marginwidth marginheight scrolling align"),i("font basefont","size color face"),i("input","usemap align"),i("select"),i("textarea"),i("h1 h2 h3 h4 h5 h6 div p legend caption","align"),i("ul","type compact"),i("li","type"),i("ol dl menu dir","compact"),i("pre","width xml:space"),i("hr","align noshade size width"),i("isindex","prompt"),i("table","summary width frame rules cellspacing cellpadding align bgcolor"),i("col","width align char charoff valign"),i("colgroup","width align char charoff valign"),i("thead","align char charoff valign"),i("tr","align char charoff valign bgcolor"),i("th","axis align char charoff valign nowrap bgcolor width height"),i("form","accept"),i("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),i("tfoot","align char charoff valign"),i("tbody","align char charoff valign"),i("area","nohref"),i("body","background bgcolor text link vlink alink")),"html4"!==e&&(i("input button select textarea","autofocus"),i("input textarea","placeholder"),i("a","download"),i("link script img","crossorigin"),i("img","loading"),i("iframe","sandbox seamless allow allowfullscreen loading referrerpolicy")),"html4"!==e&&q([r.video,r.audio],e=>{delete e.children.audio,delete e.children.video}),q(ws("a form meter progress dfn"),e=>{r[e]&&delete r[e].children[e]}),delete r.caption.children.table,delete r.script,r})(l);!1===e.verify_html&&(e.valid_elements="*[*]");const d=Is(e.valid_styles),m=Is(e.invalid_styles,"map"),u=Is(e.valid_classes,"map"),g=i("whitespace_elements","pre script noscript style textarea video audio iframe object code"),f=i("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),x=i("void_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),y=i("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls allowfullscreen"),w="td th iframe video audio object script code",_=i("non_empty_elements",w+" pre svg textarea summary",x),C=i("move_caret_before_on_enter_elements",w+" table",x),k="h1 h2 h3 h4 h5 h6",S=i("text_block_elements",k+" p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),E=i("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary html body multicol listing",S),O=i("text_inline_elements","span strong b em i font s strike u var cite dfn code mark q sup sub samp"),T=i("transparent_elements","a ins del canvas map"),D=i("wrap_block_elements","pre "+k);Ns("script noscript iframe noframes noembed title style textarea xmp plaintext".split(" "),e=>{s[e]=new RegExp("</"+e+"[^>]*>","gi")});const M=e=>{const t=P.from(o["@"]),n=/[*?+]/;q(Ds(t,null!=e?e:""),({name:e,element:t,aliasName:a})=>{if(a&&(o[a]=t),n.test(e)){const o=t;o.pattern=_s(e),r.push(o)}else o[e]=t})},R=e=>{r=[],q(he(o),e=>{delete o[e]}),M(e)},N=(e,t)=>{var r,s;delete Ms.text_block_elements,delete Ms.block_elements;const i=!!t.extends&&!oe(t.extends),c=t.extends;if(n[e]=c?n[c]:{},a[e]=null!=c?c:e,_[e.toUpperCase()]={},_[e]={},i||(E[e.toUpperCase()]={},E[e]={}),c&&!o[e]&&o[c]){const t=Cs(o[c]);delete t.removeEmptyAttrs,delete t.removeEmpty,o[e]=t}else o[e]={attributesOrder:[],attributes:{}};if(b(t.attributes)){const n=e=>{a.attributesOrder.push(e),a.attributes[e]={}},a=null!==(r=o[e])&&void 0!==r?r:{};delete a.attributesDefault,delete a.attributesForced,delete a.attributePatterns,delete a.attributesRequired,a.attributesOrder=[],a.attributes={},q(t.attributes,e=>{const t=ks(l);As(e).each(({preset:e,name:o})=>{e?"global"===o&&q(t,n):n(o)})}),o[e]=a}if(v(t.padEmpty)){const n=null!==(s=o[e])&&void 0!==s?s:{};n.paddEmpty=t.padEmpty,o[e]=n}if(b(t.children)){const o={},r=e=>{o[e]={}},a=e=>{Ts(l,e).each(e=>{q(e,r)})};q(t.children,e=>{As(e).each(({preset:e,name:t})=>{e?a(t):r(t)})}),n[e]=o}c&&be(n,(t,o)=>{t[c]&&(n[o]=t=Bs({},n[o]),t[e]=t[c])})},B=e=>{q((e=>{const t=/^(~)?(.+)$/;return ne(ws(e,","),e=>{const o=t.exec(e);return o?[{cloneName:"~"===o[1]?"span":"div",name:o[2]}]:[]})})(null!=e?e:""),({name:e,cloneName:t})=>{N(e,{extends:t})})},z=e=>{h(e)?be(e,(e,t)=>N(t,e)):p(e)&&B(e)},H=e=>{q((e=>{const t=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;return ne(ws(e,","),e=>{const o=t.exec(e);if(o){const e=o[1],t=e?(e=>"-"===e?"remove":"add")(e):"replace";return[{operation:t,name:o[2],validChildren:ne(ws(o[3],"|"),e=>As(e).toArray())}]}return[]})})(null!=e?e:""),({operation:e,name:t,validChildren:o})=>{const r="replace"===e?{"#comment":{}}:n[t],a=t=>{"remove"===e?delete r[t]:r[t]={}};q(o,({preset:e,name:t})=>{e?(e=>{Ts(l,e).each(e=>{q(e,a)})})(t):a(t)}),n[t]=r})},L=e=>{const t=o[e];if(t)return t;let n=r.length;for(;n--;){const t=r[n];if(t.pattern.test(e))return t}},I=A(d),F=A(m),V=A(u),Z=A(y),U=A(E),j=A(S),W=A(O),$=A(Object.seal(x)),G=A(f),K=A(_),Y=A(C),X=A(g),J=A(T),Q=A(D),ee=A(Object.seal(s)),te=(e,t)=>{const o=L(e);if(o){if(!t)return!0;{if(o.attributes[t])return!0;const e=o.attributePatterns;if(e){let o=e.length;for(;o--;)if(e[o].pattern.test(t))return!0}}}return!1},oe=e=>Ee(U(),e),re=e=>!Ye(e,"#")&&te(e)&&!oe(e),ae=A(a);return e.valid_elements?(R(e.valid_elements),Ns(c,(e,t)=>{n[t]=e.children})):(Ns(c,(e,t)=>{o[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},n[t]=e.children}),Ns(ws("strong/b em/i"),e=>{const t=ws(e,"/");o[t[1]].outputName=t[0]}),Ns(O,(t,n)=>{o[n]&&(e.padd_empty_block_inline_children&&(o[n].paddInEmptyBlock=!0),o[n].removeEmpty=!0)}),Ns(ws("ol ul blockquote a table tbody"),e=>{o[e]&&(o[e].removeEmpty=!0)}),Ns(ws("p h1 h2 h3 h4 h5 h6 th td pre div address caption li summary"),e=>{o[e]&&(o[e].paddEmpty=!0)}),Ns(ws("span"),e=>{o[e].removeEmptyAttrs=!0})),delete o.svg,z(e.custom_elements),H(e.valid_children),M(e.extended_valid_elements),H("+ol[ul|ol],+ul[ul|ol]"),Ns({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},(e,t)=>{o[t]&&(o[t].parentsRequired=ws(e))}),e.invalid_elements&&Ns(zs(e.invalid_elements),e=>{o[e]&&delete o[e]}),L("span")||M("span[!data-mce-type|*]"),{type:l,children:n,elements:o,getValidStyles:I,getValidClasses:V,getBlockElements:U,getInvalidStyles:F,getVoidElements:$,getTextBlockElements:j,getTextInlineElements:W,getBoolAttrs:Z,getElementRule:L,getSelfClosingElements:G,getNonEmptyElements:K,getMoveCaretBeforeOnEnterElements:Y,getWhitespaceElements:X,getTransparentElements:J,getSpecialElements:ee,isValidChild:(e,t)=>{const o=n[e.toLowerCase()];return!(!o||!o[t.toLowerCase()])},isValid:te,isBlock:oe,isInline:re,isWrapper:e=>Ee(Q(),e)||re(e),getCustomElements:ae,addValidElements:M,setValidElements:R,addCustomElements:z,addValidChildren:H}},Fs=e=>Ge(e,"#").toUpperCase(),Vs=e=>{const t=e.toString(16);return(1===t.length?"0"+t:t).toUpperCase()},Zs=e=>(e=>({value:Fs(e)}))(Vs(e.red)+Vs(e.green)+Vs(e.blue)),Us=/^\s*rgb\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*\)\s*$/i,js=/^\s*rgba\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*((?:\d?\.\d+|\d+)%?)\s*\)\s*$/i,Ws=(e,t,o,n)=>((e,t,o,n)=>({red:e,green:t,blue:o,alpha:n}))(parseInt(e,10),parseInt(t,10),parseInt(o,10),parseFloat(n)),$s=e=>Us.test(e)?"rgb":js.test(e)?"rgba":"other",qs=e=>{const t=Us.exec(e);if(null!==t)return P.some(Ws(t[1],t[2],t[3],"1"));const o=js.exec(e);return null!==o?P.some(Ws(o[1],o[2],o[3],o[4])):P.none()},Gs=e=>`rgba(${e.red},${e.green},${e.blue},${e.alpha})`,Ks=e=>qs(e).map(Zs).map(e=>"#"+e.value).getOr(e),Ys=(e={},t)=>{const o=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,n=/\s*([^:]+):\s*([^;]+);?/g,r=/\s+$/,a={};let s,i;const l=lt;t&&(s=t.getValidStyles(),i=t.getInvalidStyles());const c="\\\" \\' \\; \\: ; : \ufeff".split(" ");for(let e=0;e<c.length;e++)a[c[e]]=l+e,a[l+e]=c[e];const d={parse:t=>{const s={};let i=!1;const c=e.url_converter,m=e.url_converter_scope||d,u=(e,t,o)=>{const n=s[e+"-top"+t];if(!n)return;const r=s[e+"-right"+t];if(!r)return;const a=s[e+"-bottom"+t];if(!a)return;const i=s[e+"-left"+t];if(!i)return;const l=[n,r,a,i];let c=l.length-1;for(;c--&&l[c]===l[c+1];);c>-1&&o||(s[e+t]=-1===c?l[0]:l.join(" "),delete s[e+"-top"+t],delete s[e+"-right"+t],delete s[e+"-bottom"+t],delete s[e+"-left"+t])},g=e=>{const t=s[e];if(!t)return;const o=t.indexOf(",")>-1?[t]:t.split(" ");let n=o.length;for(;n--;)if(o[n]!==o[0])return!1;return s[e]=o[0],!0},p=e=>(i=!0,a[e]),h=(e,t)=>(i&&(e=e.replace(/\uFEFF[0-9]/g,e=>a[e])),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e),f=e=>String.fromCharCode(parseInt(e.slice(1),16)),b=e=>e.replace(/\\[0-9a-f]+/gi,f),x=(t,o,n,r,a,s)=>{if(a=a||s)return"'"+(a=h(a)).replace(/\'/g,"\\'")+"'";if(o=h(o||n||r||""),!e.allow_script_urls){const t=o.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(t))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(t))return""}return c&&(o=c.call(m,o,"style")),"url('"+o.replace(/\'/g,"\\'")+"')"};if(t){let a;for(t=(t=t.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,p).replace(/\"[^\"]+\"|\'[^\']+\'/g,e=>e.replace(/[;:]/g,p));a=n.exec(t);){n.lastIndex=a.index+a[0].length;let t=a[1].replace(r,"").toLowerCase(),c=a[2].replace(r,"");if(t&&c){if(t=b(t),c=b(c),-1!==t.indexOf(l)||-1!==t.indexOf('"'))continue;if(!e.allow_script_urls&&("behavior"===t||/expression\s*\(|\/\*|\*\//.test(c)))continue;"font-weight"===t&&"700"===c?c="bold":"color"!==t&&"background-color"!==t||(c=c.toLowerCase()),"rgb"===$s(c)&&qs(c).each(e=>{c=Ks(Gs(e)).toLowerCase()}),c=c.replace(o,x),s[t]=i?h(c,!0):c}}u("border","",!0),u("border","-width"),u("border","-color"),u("border","-style"),u("padding",""),u("margin",""),v="border",w="border-style",_="border-color",g(y="border-width")&&g(w)&&g(_)&&(s[v]=s[y]+" "+s[w]+" "+s[_],delete s[y],delete s[w],delete s[_]),"medium none"===s.border&&delete s.border,"none"===s["border-image"]&&delete s["border-image"]}var v,y,w,_;return s},serialize:(e,t)=>{let o="";const n=(t,n)=>{const r=n[t];if(r)for(let t=0,n=r.length;t<n;t++){const n=r[t],a=e[n];a&&(o+=(o.length>0?" ":"")+n+": "+a+";")}};return t&&s?(n("*",s),n(t,s)):be(e,(e,n)=>{e&&((e,t)=>{if(!i||!t)return!0;let o=i["*"];return!(o&&o[e]||(o=i[t],o&&o[e]))})(n,t)&&(o+=(o.length>0?" ":"")+n+": "+e+";")}),o}};return d},Xs={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0,mozInputSource:!0},Js=e=>w(e.preventDefault)||(e=>e instanceof Event||C(e.initEvent))(e),Qs=(e,t)=>{const o=null!=t?t:{};for(const t in e)Ee(Xs,t)||(o[t]=e[t]);return _(e.composedPath)&&(o.composedPath=()=>e.composedPath()),_(e.getModifierState)&&(o.getModifierState=t=>e.getModifierState(t)),_(e.getTargetRanges)&&(o.getTargetRanges=()=>e.getTargetRanges()),o},ei=(e,t,o,n)=>{var r;const a=Qs(t,n);return a.type=e,w(a.target)&&(a.target=null!==(r=a.srcElement)&&void 0!==r?r:o),Js(t)&&(a.preventDefault=()=>{a.defaultPrevented=!0,a.isDefaultPrevented=I,C(t.preventDefault)&&t.preventDefault()},a.stopPropagation=()=>{a.cancelBubble=!0,a.isPropagationStopped=I,C(t.stopPropagation)&&t.stopPropagation()},a.stopImmediatePropagation=()=>{a.isImmediatePropagationStopped=I,a.stopPropagation()},(e=>e.isDefaultPrevented===I||e.isDefaultPrevented===L)(a)||(a.isDefaultPrevented=!0===a.defaultPrevented?I:L,a.isPropagationStopped=!0===a.cancelBubble?I:L,a.isImmediatePropagationStopped=L)),a},ti=/^(?:mouse|contextmenu)|click/,oi=(e,t,o,n)=>{e.addEventListener(t,o,n||!1)},ni=(e,t,o,n)=>{e.removeEventListener(t,o,n||!1)},ri=(e,t)=>{const o=ei(e.type,e,document,t);if((e=>_(e)&&ti.test(e.type))(e)&&y(e.pageX)&&!y(e.clientX)){const t=o.target.ownerDocument||document,n=t.documentElement,r=t.body,a=o;a.pageX=e.clientX+(n&&n.scrollLeft||r&&r.scrollLeft||0)-(n&&n.clientLeft||r&&r.clientLeft||0),a.pageY=e.clientY+(n&&n.scrollTop||r&&r.scrollTop||0)-(n&&n.clientTop||r&&r.clientTop||0)}return o},ai=(e,t,o)=>{const n=e.document,r={type:"ready"};if(o.domLoaded)return void t(r);const a=()=>{ni(e,"DOMContentLoaded",a),ni(e,"load",a),o.domLoaded||(o.domLoaded=!0,t(r)),e=null};"complete"===n.readyState||"interactive"===n.readyState&&n.body?a():oi(e,"DOMContentLoaded",a),o.domLoaded||oi(e,"load",a)};class si{constructor(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}bind(e,t,o,n){const r=this;let a;const s=window,i=e=>{r.executeHandlers(ri(e||s.event),l)};if(!e||aa(e)||la(e))return o;let l;e[r.expando]?l=e[r.expando]:(l=r.count++,e[r.expando]=l,r.events[l]={}),n=n||e;const c=t.split(" ");let d=c.length;for(;d--;){let t=c[d],m=i,u=!1,g=!1;"DOMContentLoaded"===t&&(t="ready"),r.domLoaded&&"ready"===t&&"complete"===e.readyState?o.call(n,ri({type:t})):(r.hasFocusIn||"focusin"!==t&&"focusout"!==t||(u=!0,g="focusin"===t?"focus":"blur",m=e=>{const t=ri(e||s.event);t.type="focus"===t.type?"focusin":"focusout",r.executeHandlers(t,l)}),a=r.events[l][t],a?"ready"===t&&r.domLoaded?o(ri({type:t})):a.push({func:o,scope:n}):(r.events[l][t]=a=[{func:o,scope:n}],a.fakeName=g,a.capture=u,a.nativeHandler=m,"ready"===t?ai(e,m,r):oi(e,g||t,m,u)))}return e=a=null,o}unbind(e,t,o){if(!e||aa(e)||la(e))return this;const n=e[this.expando];if(n){let r=this.events[n];if(t){const n=t.split(" ");let a=n.length;for(;a--;){const t=n[a],s=r[t];if(s){if(o){let e=s.length;for(;e--;)if(s[e].func===o){const o=s.nativeHandler,n=s.fakeName,a=s.capture,i=s.slice(0,e).concat(s.slice(e+1));i.nativeHandler=o,i.fakeName=n,i.capture=a,r[t]=i}}o&&0!==s.length||(delete r[t],ni(e,s.fakeName||t,s.nativeHandler,s.capture))}}}else be(r,(t,o)=>{ni(e,t.fakeName||o,t.nativeHandler,t.capture)}),r={};for(const e in r)if(Ee(r,e))return this;delete this.events[n];try{delete e[this.expando]}catch(t){e[this.expando]=null}}return this}fire(e,t,o){return this.dispatch(e,t,o)}dispatch(e,t,o){if(!e||aa(e)||la(e))return this;const n=ri({type:t,target:e},o);do{const t=e[this.expando];t&&this.executeHandlers(n,t),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow}while(e&&!n.isPropagationStopped());return this}clean(e){if(!e||aa(e)||la(e))return this;if(e[this.expando]&&this.unbind(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName){this.unbind(e);const t=e.getElementsByTagName("*");let o=t.length;for(;o--;)(e=t[o])[this.expando]&&this.unbind(e)}return this}destroy(){this.events={}}cancel(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}executeHandlers(e,t){const o=this.events[t],n=o&&o[e.type];if(n)for(let t=0,o=n.length;t<o;t++){const o=n[t];if(o&&!1===o.func.call(o.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return}}}si.Event=new si;const ii=lo.each,li=lo.grep,ci="data-mce-style",di=lo.makeMap("fill-opacity font-weight line-height opacity orphans widows z-index zoom"," "),mi=(e,t,o)=>{w(o)||""===o?vn(e,t):pn(e,t,o)},ui=e=>e.replace(/[A-Z]/g,e=>"-"+e.toLowerCase()),gi=(e,t)=>{let o=0;if(e)for(let n=e.nodeType,r=e.previousSibling;r;r=r.previousSibling){const e=r.nodeType;(!t||!aa(r)||e!==n&&r.data.length)&&(o++,n=e)}return o},pi=(e,t)=>{const o=fn(t,"style"),n=e.serialize(e.parse(o),_o(t));mi(t,ci,n)},hi=(e,t,o)=>{const n=ui(t);w(o)||""===o?Fn(e,n):Bn(e,n,((e,t)=>k(e)?Ee(di,t)?e+"":e+"px":e)(o,n))},fi=(e,t={})=>{const o={},n=window,r={};let a=0;const s=os.forElement(mo.fromDom(e),{contentCssCors:t.contentCssCors,referrerPolicy:t.referrerPolicy}),i=[],l=t.schema?t.schema:Ps({}),c=Ys({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),d=t.ownEvents?new si:si.Event,m=l.getBlockElements(),u=t=>t&&e&&p(t)?e.getElementById(t):t,g=e=>{const t=u(e);return _(t)?mo.fromDom(t):null},h=(e,t,o="")=>{let n;const r=g(e);if(_(r)&&Eo(r)){const e=G[t];n=e&&e.get?e.get(r.dom,t):fn(r,t)}return _(n)?n:o},x=e=>{const t=u(e);return w(t)?[]:t.attributes},v=(e,o,n)=>{R(e,e=>{if(Yr(e)){const r=mo.fromDom(e),a=""===n?null:n,s=fn(r,o),i=G[o];i&&i.set?i.set(r.dom,a,o):mi(r,o,a),s!==a&&t.onSetAttrib&&t.onSetAttrib({attrElm:r.dom,attrName:o,attrValue:a})}})},y=()=>t.root_element||e.body,k=(t,o)=>es(e.body,u(t),o),S=(e,t,o)=>{const n=u(e);var r;if(!w(n)&&(Xr(n)||Yr(r=n)&&"http://www.w3.org/2000/svg"===r.namespaceURI))return o?Hn(mo.fromDom(n),ui(t)):("float"===(t=t.replace(/-(\D)/g,(e,t)=>t.toUpperCase()))&&(t="cssFloat"),n.style?n.style[t]:void 0)},O=e=>{const t=u(e);if(!t)return{w:0,h:0};let o=S(t,"width"),n=S(t,"height");return o&&-1!==o.indexOf("px")||(o="0"),n&&-1!==n.indexOf("px")||(n="0"),{w:parseInt(o,10)||t.offsetWidth||t.clientWidth,h:parseInt(n,10)||t.offsetHeight||t.clientHeight}},T=(e,t)=>{if(!e)return!1;const o=b(e)?e:[e];return W(o,e=>bo(mo.fromDom(e),t))},D=(e,t,o,n)=>{const r=[];let a=u(e);n=void 0===n;const s=o||("BODY"!==y().nodeName?y().parentNode:null);if(p(t))if("*"===t)t=Yr;else{const e=t;t=t=>T(t,e)}for(;a&&!(a===s||w(a.nodeType)||ca(a)||da(a));){if(!t||t(a)){if(!n)return[a];r.push(a)}a=a.parentNode}return n?r:null},M=(e,t,o)=>{let n=t;if(e){p(t)&&(n=e=>T(e,t));for(let t=e[o];t;t=t[o])if(C(n)&&n(t))return t}return null},R=function(e,t,o){const n=null!=o?o:this;if(b(e)){const o=[];return ii(e,(e,r)=>{const a=u(e);a&&o.push(t.call(n,a,r))}),o}{const o=u(e);return!!o&&t.call(n,o)}},N=(e,t)=>{R(e,e=>{be(t,(t,o)=>{v(e,o,t)})})},B=(e,t)=>{R(e,e=>{const o=mo.fromDom(e);Dn(o,t)})},z=(t,o,n,r,a)=>R(t,t=>{const s=p(o)?e.createElement(o):o;return _(n)&&N(s,n),r&&(!p(r)&&r.nodeType?s.appendChild(r):p(r)&&B(s,r)),a?s:t.appendChild(s)}),H=(t,o,n)=>z(e.createElement(t),t,o,n,!0),L=ys.encodeAllRaw,I=(e,t)=>R(e,e=>{const o=mo.fromDom(e);return t&&q(Vo(o),e=>{Oo(e)&&0===e.dom.length?_n(e):sn(o,e)}),_n(o),o.dom}),P=(e,t,o)=>{R(e,e=>{if(Yr(e)){const n=mo.fromDom(e),r=t.split(" ");q(r,e=>{if(_(o)){(o?ur:pr)(n,e)}else hr(n,e)})}})},F=(e,t,o)=>R(t,n=>{var r;const a=b(t)?e.cloneNode(!0):e;return o&&ii(li(n.childNodes),e=>{a.appendChild(e)}),null===(r=n.parentNode)||void 0===r||r.replaceChild(a,n),n}),V=()=>e.createRange(),Z=(o,r,a,s)=>{if(b(o)){let e=o.length;const t=[];for(;e--;)t[e]=Z(o[e],r,a,s);return t}return!t.collect||o!==e&&o!==n||i.push([o,r,a,s]),d.bind(o,r,a,s||$)},U=(t,o,r)=>{if(b(t)){let e=t.length;const n=[];for(;e--;)n[e]=U(t[e],o,r);return n}if(i.length>0&&(t===e||t===n)){let e=i.length;for(;e--;){const[n,a,s]=i[e];t!==n||o&&o!==a||r&&r!==s||d.unbind(n,a,s)}}return d.unbind(t,o,r)},j=e=>{if(e&&Xr(e)){const t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},$={doc:e,settings:t,win:n,files:r,stdMode:!0,boxModel:!0,styleSheetLoader:s,boundEvents:i,styles:c,schema:l,events:d,isBlock:e=>p(e)?Ee(m,e):Yr(e)&&(Ee(m,e.nodeName)||Ga(l,e)),root:null,clone:(e,t)=>e.cloneNode(t),getRoot:y,getViewPort:e=>{const t=Zr(e);return{x:t.x,y:t.y,w:t.width,h:t.height}},getRect:e=>{const t=u(e),o=k(t),n=O(t);return{x:o.x,y:o.y,w:n.w,h:n.h}},getSize:O,getParent:(e,t,o)=>{const n=D(e,t,o,!1);return n&&n.length>0?n[0]:null},getParents:D,get:u,getNext:(e,t)=>M(e,t,"nextSibling"),getPrev:(e,t)=>M(e,t,"previousSibling"),select:(o,n)=>{var r,a;const s=null!==(a=null!==(r=u(n))&&void 0!==r?r:t.root_element)&&void 0!==a?a:e;return C(s.querySelectorAll)?ue(s.querySelectorAll(o)):[]},is:T,add:z,create:H,createHTML:(e,t,o="")=>{let n="<"+e;for(const e in t)Oe(t,e)&&(n+=" "+e+'="'+L(t[e])+'"');return nt(o)&&Ee(l.getVoidElements(),e)?n+" />":n+">"+o+"</"+e+">"},createFragment:t=>{const o=e.createElement("div"),n=e.createDocumentFragment();let r;for(n.appendChild(o),t&&(o.innerHTML=t);r=o.firstChild;)n.appendChild(r);return n.removeChild(o),n},remove:I,setStyle:(e,o,n)=>{R(e,e=>{const r=mo.fromDom(e);hi(r,o,n),t.update_styles&&pi(c,r)})},getStyle:S,setStyles:(e,o)=>{R(e,e=>{const n=mo.fromDom(e);be(o,(e,t)=>{hi(n,t,e)}),t.update_styles&&pi(c,n)})},removeAllAttribs:e=>R(e,e=>{const t=e.attributes;for(let o=t.length-1;o>=0;o--)e.removeAttributeNode(t.item(o))}),setAttrib:v,setAttribs:N,getAttrib:h,getPos:k,parseStyle:e=>c.parse(e),serializeStyle:(e,t)=>c.serialize(e,t),addStyle:t=>{if($!==fi.DOM&&e===document){if(o[t])return;o[t]=!0}let n=e.getElementById("mceDefaultStyles");if(!n){n=e.createElement("style"),n.id="mceDefaultStyles",n.type="text/css";const t=e.head;t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)}n.styleSheet?n.styleSheet.cssText+=t:n.appendChild(e.createTextNode(t))},loadCSS:e=>{e||(e=""),q(e.split(","),e=>{r[e]=!0,s.load(e).catch(E)})},addClass:(e,t)=>{P(e,t,!0)},removeClass:(e,t)=>{P(e,t,!1)},hasClass:(e,t)=>{const o=g(e),n=t.split(" ");return _(o)&&re(n,e=>fr(o,e))},toggleClass:P,show:e=>{R(e,e=>Fn(mo.fromDom(e),"display"))},hide:e=>{R(e,e=>Bn(mo.fromDom(e),"display","none"))},isHidden:e=>{const t=g(e);return _(t)&&Fe(In(t,"display"),"none")},uniqueId:e=>(e||"mce_")+a++,setHTML:B,getOuterHTML:e=>{const t=g(e);return _(t)?Yr(t.dom)?t.dom.outerHTML:(e=>{const t=mo.fromTag("div"),o=mo.fromDom(e.dom.cloneNode(!0));return dn(t,o),An(t)})(t):""},setOuterHTML:(e,t)=>{R(e,e=>{Yr(e)&&(e.outerHTML=t)})},decode:ys.decode,encode:L,insertAfter:(e,t)=>{const o=u(t);return R(e,e=>{const t=null==o?void 0:o.parentNode,n=null==o?void 0:o.nextSibling;return t&&(n?t.insertBefore(e,n):t.appendChild(e)),e})},replace:F,rename:(e,t)=>{if(e.nodeName!==t.toUpperCase()){const o=H(t);return ii(x(e),t=>{v(o,t.nodeName,h(e,t.nodeName))}),F(o,e,!0),o}return e},findCommonAncestor:(e,t)=>{let o=e;for(;o;){let e=t;for(;e&&o!==e;)e=e.parentNode;if(o===e)break;o=o.parentNode}return!o&&e.ownerDocument?e.ownerDocument.documentElement:o},run:R,getAttribs:x,isEmpty:(e,t,o)=>{if(f(t)){const n=e=>{const o=e.nodeName.toLowerCase();return Boolean(t[o])};return Aa(l,e,{...o,isContent:n})}return Aa(l,e,o)},createRng:V,nodeIndex:gi,split:(e,t,o)=>{let n,r,a=V();if(e&&t&&e.parentNode&&t.parentNode){const s=e.parentNode;return a.setStart(s,gi(e)),a.setEnd(t.parentNode,gi(t)),n=a.extractContents(),a=V(),a.setStart(t.parentNode,gi(t)+1),a.setEnd(s,gi(e)+1),r=a.extractContents(),s.insertBefore(ss($,n,l),e),o?s.insertBefore(o,e):s.insertBefore(t,e),s.insertBefore(ss($,r,l),e),I(e),o||t}},bind:Z,unbind:U,fire:(e,t,o)=>d.dispatch(e,t,o),dispatch:(e,t,o)=>d.dispatch(e,t,o),getContentEditable:j,getContentEditableParent:e=>{const t=y();let o=null;for(let n=e;n&&n!==t&&(o=j(n),null===o);n=n.parentNode);return o},isEditable:e=>{if(_(e)){const t=Yr(e)?e:e.parentElement;return _(t)&&Xr(t)&&br(mo.fromDom(t))}return!1},destroy:()=>{if(i.length>0){let e=i.length;for(;e--;){const[t,o,n]=i[e];d.unbind(t,o,n)}}be(r,(e,t)=>{s.unload(t),delete r[t]})},isChildOf:(e,t)=>e===t||t.contains(e),dumpRng:e=>"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},G=((e,t,o)=>{const n=t.keep_values,r={set:(e,n,r)=>{const a=mo.fromDom(e);C(t.url_converter)&&_(n)&&(n=t.url_converter.call(t.url_converter_scope||o(),String(n),r,e)),mi(a,"data-mce-"+r,n),mi(a,r,n)},get:(e,t)=>{const o=mo.fromDom(e);return fn(o,"data-mce-"+t)||fn(o,t)}},a={style:{set:(t,o)=>{const r=mo.fromDom(t);n&&mi(r,ci,o),vn(r,"style"),p(o)&&zn(r,e.parse(o))},get:t=>{const o=mo.fromDom(t),n=fn(o,ci)||fn(o,"style");return e.serialize(e.parse(n),_o(o))}}};return n&&(a.href=a.src=r),a})(c,t,A($));return $};fi.DOM=fi(document),fi.nodeIndex=gi;const bi=fi.DOM;class xi{constructor(e={}){this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=!1,this.settings=e}_setReferrerPolicy(e){this.settings.referrerPolicy=e}loadScript(e){return new Promise((t,o)=>{const n=bi;let r;const a=()=>{n.remove(s),r&&(r.onerror=r.onload=r=null)},s=n.uniqueId();r=document.createElement("script"),r.id=s,r.type="text/javascript",r.src=lo._addCacheSuffix(e),this.settings.referrerPolicy&&n.setAttrib(r,"referrerpolicy",this.settings.referrerPolicy),r.onload=()=>{a(),t()},r.onerror=()=>{a(),o("Failed to load script: "+e)},(document.getElementsByTagName("head")[0]||document.body).appendChild(r)})}isDone(e){return 2===this.states[e]}markDone(e){this.states[e]=2}add(e){const t=this;t.queue.push(e);return void 0===t.states[e]&&(t.states[e]=0),new Promise((o,n)=>{t.scriptLoadedCallbacks[e]||(t.scriptLoadedCallbacks[e]=[]),t.scriptLoadedCallbacks[e].push({resolve:o,reject:n})})}load(e){return this.add(e)}remove(e){delete this.states[e],delete this.scriptLoadedCallbacks[e]}loadQueue(){const e=this.queue;return this.queue=[],this.loadScripts(e)}loadScripts(e){const t=this,o=(e,o)=>{Se(t.scriptLoadedCallbacks,o).each(t=>{q(t,t=>t[e](o))}),delete t.scriptLoadedCallbacks[o]},n=e=>{const t=Y(e,e=>"rejected"===e.status);return t.length>0?Promise.reject(ne(t,({reason:e})=>b(e)?e:[e])):Promise.resolve()},r=e=>Promise.allSettled($(e,e=>2===t.states[e]?(o("resolve",e),Promise.resolve()):3===t.states[e]?(o("reject",e),Promise.reject(e)):(t.states[e]=1,t.loadScript(e).then(()=>{t.states[e]=2,o("resolve",e);const a=t.queue;return a.length>0?(t.queue=[],r(a).then(n)):Promise.resolve()},()=>(t.states[e]=3,o("reject",e),Promise.reject(e)))))),a=e=>(t.loading=!0,r(e).then(e=>{t.loading=!1;const o=t.queueLoadedCallbacks.shift();return P.from(o).each(H),n(e)})),s=mt(e);return t.loading?new Promise((e,o)=>{t.queueLoadedCallbacks.push(()=>{a(s).then(e,o)})}):a(s)}}xi.ScriptLoader=new xi;const vi={},yi=Ae("en"),wi=()=>Se(vi,yi.get()),_i={getData:()=>xe(vi,e=>({...e})),setCode:e=>{e&&yi.set(e)},getCode:()=>yi.get(),add:(e,t)=>{let o=vi[e];o||(vi[e]=o={});const n=$(he(t),e=>e.toLowerCase());be(t,(e,r)=>{const a=r.toLowerCase();a!==r&&((e,t)=>{const o=e.indexOf(t);return-1!==o&&e.indexOf(t,o+1)>o})(n,a)?(Ee(t,a)||(o[a]=e),o[r]=e):o[a]=e})},translate:e=>{const t=wi().getOr({}),o=e=>C(e)?Object.prototype.toString.call(e):n(e)?"":""+e,n=e=>""===e||null==e,r=e=>{const n=o(e);return Ee(t,n)?o(t[n]):Se(t,n.toLowerCase()).map(o).getOr(n)},a=e=>e.replace(/{context:\w+}$/,"");if(n(e))return"";if(h(s=e)&&Ee(s,"raw"))return o(e.raw);var s;if((e=>b(e)&&e.length>1)(e)){const t=e.slice(1);return a(r(e[0]).replace(/\{([0-9]+)\}/g,(e,n)=>Ee(t,n)?o(t[n]):e))}return a(r(e))},isRtl:()=>wi().bind(e=>Se(e,"_dir")).exists(e=>"rtl"===e),hasCode:e=>Ee(vi,e)},Ci=()=>{const e=[],t={},o={},n=[],r=(e,t)=>{const o=Y(n,o=>o.name===e&&o.state===t);q(o,e=>e.resolve())},a=e=>Ee(t,e),s=(e,o)=>{const n=_i.getCode();!n||o&&-1===(","+(o||"")+",").indexOf(","+n+",")||xi.ScriptLoader.add(t[e]+"/langs/"+n+".js")},i=(e,t="added")=>"added"===t&&(e=>Ee(o,e))(e)||"loaded"===t&&a(e)?Promise.resolve():new Promise(o=>{n.push({name:e,state:t,resolve:o})});return{items:e,urls:t,lookup:o,get:e=>{if(o[e])return o[e].instance},requireLangPack:(e,t)=>{!1!==Ci.languageLoad&&(a(e)?s(e,t):i(e,"loaded").then(()=>s(e,t)))},add:(t,n)=>(e.push(n),o[t]={instance:n},r(t,"added"),n),remove:e=>{delete t[e],delete o[e]},createUrl:(e,t)=>p(t)?p(e)?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}:t,load:(e,n)=>{if(t[e])return Promise.resolve();let a=p(n)?n:n.prefix+n.resource+n.suffix;0!==a.indexOf("/")&&-1===a.indexOf("://")&&(a=Ci.baseURL+"/"+a),t[e]=a.substring(0,a.lastIndexOf("/"));const s=()=>(r(e,"loaded"),Promise.resolve());return o[e]?s():xi.ScriptLoader.add(a).then(s)},waitFor:i}};Ci.languageLoad=!0,Ci.baseURL="",Ci.PluginManager=Ci(),Ci.ThemeManager=Ci(),Ci.ModelManager=Ci();const ki=A("mce-annotation"),Si=A("data-mce-annotation"),Ei=A("data-mce-annotation-uid"),Oi=A("data-mce-annotation-active"),Ti=A("data-mce-annotation-classes"),Ai=A("data-mce-annotation-attrs"),Di=e=>t=>vo(t,e),Mi=(e,t)=>{const o=e.selection.getRng(),n=mo.fromDom(o.startContainer),r=mo.fromDom(e.getBody()),a=t.fold(()=>"."+ki(),e=>`[${Si()}="${e}"]`),s=Zo(n,o.startOffset).getOr(n);return ir(s,a,Di(r)).bind(t=>bn(t,`${Ei()}`).bind(o=>bn(t,`${Si()}`).map(t=>{const n=Ni(e,o);return{uid:o,name:t,elements:n}})))},Ri=(e,t)=>xn(e,"data-mce-bogus")||((e,t,o)=>ar(e,t,o).isSome())(e,'[data-mce-bogus="all"]',Di(t)),Ni=(e,t)=>{const o=mo.fromDom(e.getBody()),n=wr(o,`[${Ei()}="${t}"]`);return Y(n,e=>!Ri(e,o))},Bi=(e,t)=>{const o=mo.fromDom(e.getBody()),n=wr(o,`[${Si()}="${t}"]`),r={};return q(n,e=>{if(!Ri(e,o)){const t=fn(e,Ei()),o=Se(r,t).getOr([]);r[t]=o.concat([e])}}),r},zi=(e,t)=>{const o=Ae({}),n=()=>({listeners:[],previous:$e()}),r=(e,t)=>{a(e,e=>(t(e),e))},a=(e,t)=>{const r=o.get(),a=t(Se(r,e).getOrThunk(n));r[e]=a,o.set(r)},s=(t,o)=>{q(Ni(e,t),e=>{o?pn(e,Oi(),"true"):vn(e,Oi())})},i=st(()=>{const o=le(t.getNames());q(o,t=>{a(t,o=>{const n=o.previous.get();return Mi(e,P.some(t)).fold(()=>{n.each(e=>{(e=>{r(e,t=>{q(t.listeners,t=>t(!1,e))})})(t),o.previous.clear(),s(e,!1)})},({uid:e,name:t,elements:a})=>{Fe(n,e)||(n.each(e=>s(e,!1)),((e,t,o)=>{r(e,n=>{q(n.listeners,n=>n(!0,e,{uid:t,nodes:$(o,e=>e.dom)}))})})(t,e,a),o.previous.set(e),s(e,!0))}),{previous:o.previous,listeners:o.listeners}})})},30);e.on("remove",()=>{i.cancel()}),e.on("NodeChange",()=>{i.throttle()});return{addListener:(e,t)=>{a(e,e=>({previous:e.previous,listeners:e.listeners.concat([t])}))}}},Hi=(e,t,o=L)=>{const n=new Ur(e,t),r=e=>{let t;do{t=n[e]()}while(t&&!aa(t)&&!o(t));return P.from(t).filter(aa)};return{current:()=>P.from(n.current()).filter(aa),next:()=>r("next"),prev:()=>r("prev"),prev2:()=>r("prev2")}},Li=(e,t)=>{const o=t||(t=>e.isBlock(t)||ma(t)||ha(t)),n=(e,t,o,r)=>{if(aa(e)){const o=r(e,t,e.data);if(-1!==o)return P.some({container:e,offset:o})}return o().bind(e=>n(e.container,e.offset,o,r))};return{backwards:(t,r,a,s)=>{const i=Hi(t,null!=s?s:e.getRoot(),o);return n(t,r,()=>i.prev().map(e=>({container:e,offset:e.length})),a).getOrNull()},forwards:(t,r,a,s)=>{const i=Hi(t,null!=s?s:e.getRoot(),o);return n(t,r,()=>i.next().map(e=>({container:e,offset:0})),a).getOrNull()}}},Ii=e=>{let t;return o=>(t=t||ie(e,I),Ee(t,_o(o)))},Pi=e=>Eo(e)&&"br"===_o(e),Fi=Ii(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),Vi=Ii(["ul","ol","dl"]),Zi=Ii(["li","dd","dt"]),Ui=Ii(["thead","tbody","tfoot"]),ji=Ii(["td","th"]),Wi=Ii(["pre","script","textarea","style"]),$i=e=>{const t=wr(e,"br"),o=Y((e=>{const t=[];let o=e.dom;for(;o;)t.push(mo.fromDom(o)),o=o.lastChild;return t})(e).slice(-1),Pi);t.length===o.length&&q(o,_n)},qi=()=>{const e=mo.fromTag("br");return pn(e,"data-mce-bogus","1"),e},Gi=e=>{wn(e),dn(e,qi())},Ki=lt,Yi=dt,Xi=e=>e.replace(/\uFEFF/g,""),Ji=Yr,Qi=aa,el=e=>(Qi(e)&&(e=e.parentNode),Ji(e)&&e.hasAttribute("data-mce-caret")),tl=e=>Qi(e)&&Yi(e.data),ol=e=>el(e)||tl(e),nl=e=>e.firstChild!==e.lastChild||!ma(e.firstChild),rl=e=>{const t=e.container();return!!aa(t)&&(t.data.charAt(e.offset())===Ki||e.isAtStart()&&tl(t.previousSibling))},al=e=>{const t=e.container();return!!aa(t)&&(t.data.charAt(e.offset()-1)===Ki||e.isAtEnd()&&tl(t.nextSibling))},sl=e=>Qi(e)&&e.data[0]===Ki,il=e=>Qi(e)&&e.data[e.data.length-1]===Ki,ll=e=>e&&e.hasAttribute("data-mce-caret")?((e=>{var t;const o=e.getElementsByTagName("br"),n=o[o.length-1];ta(n)&&(null===(t=n.parentNode)||void 0===t||t.removeChild(n))})(e),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("data-mce-style"),e.removeAttribute("_moz_abspos"),e):null,cl=e=>el(e.startContainer),dl=Math.round,ml=e=>e?{left:dl(e.left),top:dl(e.top),bottom:dl(e.bottom),right:dl(e.right),width:dl(e.width),height:dl(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0},ul=(e,t)=>(e=ml(e),t||(e.left=e.left+e.width),e.right=e.left,e.width=0,e),gl=(e,t,o)=>e>=0&&e<=Math.min(t.height,o.height)/2,pl=(e,t)=>{const o=Math.min(t.height/2,e.height/2);return e.bottom-o<t.top||!(e.top>t.bottom)&&gl(t.top-e.bottom,e,t)},hl=(e,t)=>e.top>t.bottom||!(e.bottom<t.top)&&gl(t.bottom-e.top,e,t),fl=(e,t,o)=>{const n=Math.max(Math.min(t,e.left+e.width),e.left),r=Math.max(Math.min(o,e.top+e.height),e.top);return Math.sqrt((t-n)*(t-n)+(o-r)*(o-r))},bl=e=>{const t=e.startContainer,o=e.startOffset;return t===e.endContainer&&t.hasChildNodes()&&e.endOffset===o+1?t.childNodes[o]:null},xl=(e,t)=>{if(Yr(e)&&e.hasChildNodes()){const o=e.childNodes,n=((e,t,o)=>Math.min(Math.max(e,t),o))(t,0,o.length-1);return o[n]}return e},vl=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿‌-‍⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-︯ﾞ-ﾟ]"),yl=e=>p(e)&&e.charCodeAt(0)>=768&&vl.test(e),wl=pa,_l=ha,Cl=ma,kl=aa,Sl=Qr(["script","style","textarea"]),El=Qr(["img","input","textarea","hr","iframe","video","audio","object","embed"]),Ol=Qr(["table"]),Tl=ol,Al=e=>!Tl(e)&&(kl(e)?!Sl(e.parentNode):El(e)||Cl(e)||Ol(e)||Dl(e)),Dl=e=>!(e=>Yr(e)&&"true"===e.getAttribute("unselectable"))(e)&&_l(e),Ml=(e,t)=>Al(e)&&((e,t)=>{for(let o=e.parentNode;o&&o!==t;o=o.parentNode){if(Dl(o))return!1;if(wl(o))return!0}return!0})(e,t),Rl=Yr,Nl=Al,Bl=ea("display","block table"),zl=ea("float","left right"),Hl=((...e)=>t=>{for(let o=0;o<e.length;o++)if(!e[o](t))return!1;return!0})(Rl,Nl,N(zl)),Ll=N(ea("white-space","pre pre-line pre-wrap")),Il=aa,Pl=ma,Fl=fi.nodeIndex,Vl=(e,t)=>t<0&&Yr(e)&&e.hasChildNodes()?void 0:xl(e,t),Zl=e=>e?e.createRange():fi.DOM.createRng(),Ul=e=>p(e)&&/[\r\n\t ]/.test(e),jl=e=>!!e.setStart&&!!e.setEnd,Wl=e=>{const t=e.startContainer,o=e.startOffset;if(Ul(e.toString())&&Ll(t.parentNode)&&aa(t)){const e=t.data;if(Ul(e[o-1])||Ul(e[o+1]))return!0}return!1},$l=e=>0===e.left&&0===e.right&&0===e.top&&0===e.bottom,ql=e=>{var t;let o;const n=e.getClientRects();return o=n.length>0?ml(n[0]):ml(e.getBoundingClientRect()),!jl(e)&&Pl(e)&&$l(o)?(e=>{const t=e.ownerDocument,o=Zl(t),n=t.createTextNode(ct),r=e.parentNode;r.insertBefore(n,e),o.setStart(n,0),o.setEnd(n,1);const a=ml(o.getBoundingClientRect());return r.removeChild(n),a})(e):$l(o)&&jl(e)&&null!==(t=(e=>{const t=e.startContainer,o=e.endContainer,n=e.startOffset,r=e.endOffset;if(t===o&&aa(o)&&0===n&&1===r){const t=e.cloneRange();return t.setEndAfter(o),ql(t)}return null})(e))&&void 0!==t?t:o},Gl=(e,t)=>{const o=ul(e,t);return o.width=1,o.right=o.left+1,o},Kl=e=>{const t=[],o=e=>{var o,n;0!==e.height&&(t.length>0&&(o=e,n=t[t.length-1],o.left===n.left&&o.top===n.top&&o.bottom===n.bottom&&o.right===n.right)||t.push(e))},n=(e,t)=>{const n=Zl(e.ownerDocument);if(t<e.data.length){if(yl(e.data[t]))return;if(yl(e.data[t-1])&&(n.setStart(e,t),n.setEnd(e,t+1),!Wl(n)))return void o(Gl(ql(n),!1))}t>0&&(n.setStart(e,t-1),n.setEnd(e,t),Wl(n)||o(Gl(ql(n),!1))),t<e.data.length&&(n.setStart(e,t),n.setEnd(e,t+1),Wl(n)||o(Gl(ql(n),!0)))},r=e.container(),a=e.offset();if(Il(r))return n(r,a),t;if(Rl(r))if(e.isAtEnd()){const e=Vl(r,a);Il(e)&&n(e,e.data.length),Hl(e)&&!Pl(e)&&o(Gl(ql(e),!1))}else{const s=Vl(r,a);if(Il(s)&&n(s,0),Hl(s)&&e.isAtEnd())return o(Gl(ql(s),!1)),t;const i=Vl(e.container(),e.offset()-1);Hl(i)&&!Pl(i)&&(Bl(i)||Bl(s)||!Hl(s))&&o(Gl(ql(i),!1)),Hl(s)&&o(Gl(ql(s),!0))}return t},Yl=(e,t,o)=>{const n=()=>(o||(o=Kl(Yl(e,t))),o);return{container:A(e),offset:A(t),toRange:()=>{const o=Zl(e.ownerDocument);return o.setStart(e,t),o.setEnd(e,t),o},getClientRects:n,isVisible:()=>n().length>0,isAtStart:()=>(Il(e),0===t),isAtEnd:()=>Il(e)?t>=e.data.length:t>=e.childNodes.length,isEqual:o=>o&&e===o.container()&&t===o.offset(),getNode:o=>Vl(e,o?t-1:t)}};Yl.fromRangeStart=e=>Yl(e.startContainer,e.startOffset),Yl.fromRangeEnd=e=>Yl(e.endContainer,e.endOffset),Yl.after=e=>Yl(e.parentNode,Fl(e)+1),Yl.before=e=>Yl(e.parentNode,Fl(e)),Yl.isAbove=(e,t)=>Ze(de(t.getClientRects()),me(e.getClientRects()),pl).getOr(!1),Yl.isBelow=(e,t)=>Ze(me(t.getClientRects()),de(e.getClientRects()),hl).getOr(!1),Yl.isAtStart=e=>!!e&&e.isAtStart(),Yl.isAtEnd=e=>!!e&&e.isAtEnd(),Yl.isTextPosition=e=>!!e&&aa(e.container()),Yl.isElementPosition=e=>!Yl.isTextPosition(e);const Xl=(e,t)=>{aa(t)&&0===t.data.length&&e.remove(t)},Jl=(e,t,o)=>{da(o)?((e,t,o)=>{const n=P.from(o.firstChild),r=P.from(o.lastChild);t.insertNode(o),n.each(t=>Xl(e,t.previousSibling)),r.each(t=>Xl(e,t.nextSibling))})(e,t,o):((e,t,o)=>{t.insertNode(o),Xl(e,o.previousSibling),Xl(e,o.nextSibling)})(e,t,o)},Ql=aa,ec=ta,tc=fi.nodeIndex,oc=e=>{const t=e.parentNode;return ec(t)?oc(t):t},nc=e=>e?bt(e.childNodes,(e,t)=>(ec(t)&&"BR"!==t.nodeName?e=e.concat(nc(t)):e.push(t),e),[]):[],rc=e=>t=>e===t,ac=e=>(Ql(e)?"text()":e.nodeName.toLowerCase())+"["+(e=>{let t,o;t=nc(oc(e)),o=xt(t,rc(e),e),t=t.slice(0,o+1);const n=bt(t,(e,o,n)=>(Ql(o)&&Ql(t[n-1])&&e++,e),0);return t=ft(t,Qr([e.nodeName])),o=xt(t,rc(e),e),o-n})(e)+"]",sc=(e,t)=>{let o,n=[],r=t.container(),a=t.offset();if(Ql(r))o=((e,t)=>{let o=e;for(;(o=o.previousSibling)&&Ql(o);)t+=o.data.length;return t})(r,a);else{const e=r.childNodes;a>=e.length?(o="after",a=e.length-1):o="before",r=e[a]}n.push(ac(r));let s=((e,t,o)=>{const n=[];for(let r=t.parentNode;r&&r!==e&&(!o||!o(r));r=r.parentNode)n.push(r);return n})(e,r);return s=ft(s,N(ta)),n=n.concat(ht(s,e=>ac(e))),n.reverse().join("/")+","+o},ic=(e,t)=>{if(!t)return null;const o=t.split(","),n=o[0].split("/"),r=o.length>1?o[1]:"before",a=bt(n,(e,t)=>{const o=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t);return o?("text()"===o[1]&&(o[1]="#text"),((e,t,o)=>{let n=nc(e);return n=ft(n,(e,t)=>!Ql(e)||!Ql(n[t-1])),n=ft(n,Qr([t])),n[o]})(e,o[1],parseInt(o[2],10))):null},e);if(!a)return null;if(!Ql(a)&&a.parentNode){let e;return e="after"===r?tc(a)+1:tc(a),Yl(a.parentNode,e)}return((e,t)=>{let o=e,n=0;for(;Ql(o);){const r=o.data.length;if(t>=n&&t<=n+r){e=o,t-=n;break}if(!Ql(o.nextSibling)){e=o,t=r;break}n+=r,o=o.nextSibling}return Ql(e)&&t>e.data.length&&(t=e.data.length),Yl(e,t)})(a,parseInt(r,10))},lc=ha,cc=(e,t,o,n,r)=>{const a=r?n.startContainer:n.endContainer;let s=r?n.startOffset:n.endOffset;const i=[],l=e.getRoot();if(aa(a))i.push(o?((e,t,o)=>{let n=e(t.data.slice(0,o)).length;for(let o=t.previousSibling;o&&aa(o);o=o.previousSibling)n+=e(o.data).length;return n})(t,a,s):s);else{let t=0;const n=a.childNodes;s>=n.length&&n.length&&(t=1,s=Math.max(0,n.length-1)),i.push(e.nodeIndex(n[s],o)+t)}for(let t=a;t&&t!==l;t=t.parentNode)i.push(e.nodeIndex(t,o));return i},dc=(e,t,o)=>{let n=0;return lo.each(e.select(t),e=>"all"===e.getAttribute("data-mce-bogus")?void 0:e!==o&&void n++),n},mc=(e,t)=>{let o=t?e.startContainer:e.endContainer,n=t?e.startOffset:e.endOffset;if(Yr(o)&&"TR"===o.nodeName){const r=o.childNodes;o=r[Math.min(t?n:n-1,r.length-1)],o&&(n=t?0:o.childNodes.length,t?e.setStart(o,n):e.setEnd(o,n))}},uc=e=>(mc(e,!0),mc(e,!1),e),gc=(e,t)=>{if(Yr(e)&&(e=xl(e,t),lc(e)))return e;if(ol(e)){aa(e)&&el(e)&&(e=e.parentNode);let t=e.previousSibling;if(lc(t))return t;if(t=e.nextSibling,lc(t))return t}},pc=(e,t,o)=>{const n=o.getNode(),r=o.getRng();if("IMG"===n.nodeName||lc(n)){const e=n.nodeName;return{name:e,index:dc(o.dom,e,n)}}const a=(e=>gc(e.startContainer,e.startOffset)||gc(e.endContainer,e.endOffset))(r);if(a){const e=a.tagName;return{name:e,index:dc(o.dom,e,a)}}return((e,t,o,n)=>{const r=t.dom,a=cc(r,e,o,n,!0),s=t.isForward(),i=cl(n)?{isFakeCaret:!0}:{};return t.isCollapsed()?{start:a,forward:s,...i}:{start:a,end:cc(r,e,o,n,!1),forward:s,...i}})(e,o,t,r)},hc=(e,t,o)=>{const n={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return o?e.create("span",n,"&#xFEFF;"):e.create("span",n)},fc=(e,t)=>{const o=e.dom;let n=e.getRng();const r=o.uniqueId(),a=e.isCollapsed(),s=e.getNode(),i=s.nodeName,l=e.isForward();if("IMG"===i)return{name:i,index:dc(o,i,s)};const c=uc(n.cloneRange());if(!a){c.collapse(!1);const e=hc(o,r+"_end",t);Jl(o,c,e)}n=uc(n),n.collapse(!0);const d=hc(o,r+"_start",t);return Jl(o,n,d),e.moveToBookmark({id:r,keep:!0,forward:l}),{id:r,forward:l}},bc=(e,t,o=!1)=>2===t?pc(Xi,o,e):3===t?(e=>{const t=e.getRng();return{start:sc(e.dom.getRoot(),Yl.fromRangeStart(t)),end:sc(e.dom.getRoot(),Yl.fromRangeEnd(t)),forward:e.isForward()}})(e):t?(e=>({rng:e.getRng(),forward:e.isForward()}))(e):fc(e,!1),xc=R(pc,D,!0),vc=e=>"inline-command"===e.type||"inline-format"===e.type,yc=e=>"block-command"===e.type||"block-format"===e.type,wc=e=>{var t;const o=t=>Re.error({message:t,pattern:e}),n=(t,n,r)=>{if(void 0!==e.format){let r;if(b(e.format)){if(!re(e.format,p))return o(t+" pattern has non-string items in the `format` array");r=e.format}else{if(!p(e.format))return o(t+" pattern has non-string `format` parameter");r=[e.format]}return Re.value(n(r))}return void 0!==e.cmd?p(e.cmd)?Re.value(r(e.cmd,e.value)):o(t+" pattern has non-string `cmd` parameter"):o(t+" pattern is missing both `format` and `cmd` parameters")};if(!h(e))return o("Raw pattern is not an object");if(!p(e.start))return o("Raw pattern is missing `start` parameter");if(void 0!==e.end){if(!p(e.end))return o("Inline pattern has non-string `end` parameter");if(0===e.start.length&&0===e.end.length)return o("Inline pattern has empty `start` and `end` parameters");let t=e.start,r=e.end;return 0===r.length&&(r=t,t=""),n("Inline",e=>({type:"inline-format",start:t,end:r,format:e}),(e,o)=>({type:"inline-command",start:t,end:r,cmd:e,value:o}))}if(void 0!==e.replacement)return p(e.replacement)?0===e.start.length?o("Replacement pattern has empty `start` parameter"):Re.value({type:"inline-command",start:"",end:e.start,cmd:"mceInsertContent",value:e.replacement}):o("Replacement pattern has non-string `replacement` parameter");{const r=null!==(t=e.trigger)&&void 0!==t?t:"space";return 0===e.start.length?o("Block pattern has empty `start` parameter"):n("Block",t=>({type:"block-format",start:e.start,format:t[0],trigger:r}),(t,o)=>({type:"block-command",start:e.start,cmd:t,value:o,trigger:r}))}},_c=e=>Y(e,yc),Cc=e=>Y(e,vc),kc=(e,t)=>({...e,blockPatterns:Y(e.blockPatterns,e=>((e,t)=>("block-command"===e.type||"block-format"===e.type)&&e.trigger===t)(e,t))}),Sc=e=>{const t=(e=>{const t=[],o=[];return q(e,e=>{e.fold(e=>{t.push(e)},e=>{o.push(e)})}),{errors:t,values:o}})($(e,wc));return q(t.errors,e=>console.error(e.message,e.pattern)),t.values},Ec=(e,t,o)=>{e.dispatch(t,o)},Oc=(e,t,o,n)=>{e.dispatch("FormatApply",{format:t,node:o,vars:n})},Tc=(e,t,o,n)=>{e.dispatch("FormatRemove",{format:t,node:o,vars:n})},Ac=(e,t)=>e.dispatch("SetContent",t),Dc=(e,t)=>e.dispatch("GetContent",t),Mc=(e,t)=>{e.dispatch("AutocompleterUpdateActiveRange",t)},Rc=(e,t)=>e.dispatch("PastePlainTextToggle",{state:t}),Nc=Gt().deviceType,Bc=Nc.isTouch(),zc=fi.DOM,Hc=e=>g(e,RegExp),Lc=e=>t=>t.options.get(e),Ic=e=>p(e)||h(e),Pc=(e,t="")=>o=>{const n=p(o);if(n){if(-1!==o.indexOf("=")){const r=(e=>{const t=e.indexOf("=")>0?e.split(/[;,](?![^=;,]*(?:[;,]|$))/):e.split(",");return J(t,(e,t)=>{const o=t.split("="),n=o[0],r=o.length>1?o[1]:n;return e[Qe(n)]=Qe(r),e},{})})(o);return{value:Se(r,e.id).getOr(t),valid:n}}return{value:o,valid:n}}return{valid:!1,message:"Must be a string."}},Fc=Lc("iframe_attrs"),Vc=Lc("doctype"),Zc=Lc("document_base_url"),Uc=Lc("body_id"),jc=Lc("body_class"),Wc=Lc("content_security_policy"),$c=Lc("br_in_pre"),qc=Lc("forced_root_block"),Gc=Lc("forced_root_block_attrs"),Kc=Lc("newline_behavior"),Yc=Lc("br_newline_selector"),Xc=Lc("no_newline_selector"),Jc=Lc("keep_styles"),Qc=Lc("end_container_on_empty_block"),ed=Lc("automatic_uploads"),td=Lc("images_reuse_filename"),od=Lc("images_replace_blob_uris"),nd=Lc("icons"),rd=Lc("icons_url"),ad=Lc("images_upload_url"),sd=Lc("images_upload_base_path"),id=Lc("images_upload_credentials"),ld=Lc("images_upload_handler"),cd=Lc("content_css_cors"),dd=Lc("referrer_policy"),md=Lc("language"),ud=Lc("language_url"),gd=Lc("indent_use_margin"),pd=Lc("indentation"),hd=Lc("content_css"),fd=Lc("content_style"),bd=Lc("font_css"),xd=Lc("directionality"),vd=Lc("inline_boundaries_selector"),yd=Lc("object_resizing"),wd=Lc("resize_img_proportional"),_d=Lc("placeholder"),Cd=Lc("event_root"),kd=Lc("service_message"),Sd=Lc("theme"),Ed=Lc("theme_url"),Od=Lc("model"),Td=Lc("model_url"),Ad=Lc("inline_boundaries"),Dd=Lc("formats"),Md=Lc("preview_styles"),Rd=Lc("format_empty_lines"),Nd=Lc("format_noneditable_selector"),Bd=Lc("custom_ui_selector"),zd=Lc("inline"),Hd=Lc("hidden_input"),Ld=Lc("submit_patch"),Id=Lc("add_form_submit_trigger"),Pd=Lc("add_unload_trigger"),Fd=Lc("custom_undo_redo_levels"),Vd=Lc("disable_nodechange"),Zd=Lc("readonly"),Ud=Lc("editable_root"),jd=Lc("content_css_cors"),Wd=Lc("plugins"),$d=Lc("external_plugins"),qd=Lc("block_unsupported_drop"),Gd=Lc("visual"),Kd=Lc("visual_table_class"),Yd=Lc("visual_anchor_class"),Xd=Lc("iframe_aria_text"),Jd=Lc("setup"),Qd=Lc("init_instance_callback"),em=Lc("urlconverter_callback"),tm=Lc("auto_focus"),om=Lc("browser_spellcheck"),nm=Lc("protect"),rm=Lc("paste_block_drop"),am=Lc("paste_data_images"),sm=Lc("paste_preprocess"),im=Lc("paste_postprocess"),lm=Lc("newdocument_content"),cm=Lc("paste_webkit_styles"),dm=Lc("paste_remove_styles_if_webkit"),mm=Lc("paste_merge_formats"),um=Lc("smart_paste"),gm=Lc("paste_as_text"),pm=Lc("paste_tab_spaces"),hm=Lc("allow_html_data_urls"),fm=Lc("text_patterns"),bm=Lc("text_patterns_lookup"),xm=Lc("noneditable_class"),vm=Lc("editable_class"),ym=Lc("noneditable_regexp"),wm=Lc("preserve_cdata"),_m=Lc("highlight_on_focus"),Cm=Lc("xss_sanitization"),km=Lc("init_content_sync"),Sm=e=>lo.explode(e.options.get("images_file_types")),Em=Lc("table_tab_navigation"),Om=Lc("details_initial_state"),Tm=Lc("details_serialized_state"),Am=Lc("sandbox_iframes"),Dm=e=>e.options.get("sandbox_iframes_exclusions"),Mm=Lc("convert_unsafe_embeds"),Rm=Lc("license_key"),Nm=Lc("api_key"),Bm=Lc("disabled"),zm=Yr,Hm=aa,Lm=e=>{const t=e.parentNode;t&&t.removeChild(e)},Im=e=>{const t=Xi(e);return{count:e.length-t.length,text:t}},Pm=e=>{let t;for(;-1!==(t=e.data.lastIndexOf(Ki));)e.deleteData(t,1)},Fm=(e,t)=>(jm(e),t),Vm=(e,t)=>{const o=t.container(),n=((e,t)=>{const o=U(e,t);return-1===o?P.none():P.some(o)})(ue(o.childNodes),e).map(e=>e<t.offset()?Yl(o,t.offset()-1):t).getOr(t);return jm(e),n},Zm=(e,t)=>Hm(e)&&t.container()===e?((e,t)=>{const o=Im(e.data.substr(0,t.offset())),n=Im(e.data.substr(t.offset()));return(o.text+n.text).length>0?(Pm(e),Yl(e,t.offset()-o.count)):t})(e,t):Fm(e,t),Um=(e,t)=>Yl.isTextPosition(t)?Zm(e,t):((e,t)=>t.container()===e.parentNode?Vm(e,t):Fm(e,t))(e,t),jm=e=>{zm(e)&&ol(e)&&(nl(e)?e.removeAttribute("data-mce-caret"):Lm(e)),Hm(e)&&(Pm(e),0===e.data.length&&Lm(e))},Wm=ha,$m=va,qm=ba,Gm=(e,t,o)=>{const n=ul(t.getBoundingClientRect(),o);let r,a;if("BODY"===e.tagName){const t=e.ownerDocument.documentElement;r=e.scrollLeft||t.scrollLeft,a=e.scrollTop||t.scrollTop}else{const t=e.getBoundingClientRect();r=e.scrollLeft-t.left,a=e.scrollTop-t.top}n.left+=r,n.right+=r,n.top+=a,n.bottom+=a,n.width=1;let s=t.offsetWidth-t.clientWidth;return s>0&&(o&&(s*=-1),n.left+=s,n.right+=s),n},Km=(e,t,o,n)=>{const r=$e();let a,s;const i=qc(e),l=e.dom,c=()=>{(e=>{var t,o;const n=wr(mo.fromDom(e),"*[contentEditable=false],video,audio,embed,object");for(let e=0;e<n.length;e++){const r=n[e].dom;let a=r.previousSibling;if(il(a)){const e=a.data;1===e.length?null===(t=a.parentNode)||void 0===t||t.removeChild(a):a.deleteData(e.length-1,1)}a=r.nextSibling,sl(a)&&(1===a.data.length?null===(o=a.parentNode)||void 0===o||o.removeChild(a):a.deleteData(0,1))}})(t),s&&(jm(s),s=null),r.on(e=>{l.remove(e.caret),r.clear()}),a&&(clearInterval(a),a=void 0)},d=()=>{a=window.setInterval(()=>{r.on(e=>{n()?l.toggleClass(e.caret,"mce-visual-caret-hidden"):l.addClass(e.caret,"mce-visual-caret-hidden")})},500)};return{isShowing:r.isSet,show:(e,n)=>{let a;if(c(),qm(n))return null;if(!o(n))return s=((e,t)=>{var o;const n=(null!==(o=e.ownerDocument)&&void 0!==o?o:document).createTextNode(Ki),r=e.parentNode;if(t){const t=e.previousSibling;if(Qi(t)){if(ol(t))return t;if(il(t))return t.splitText(t.data.length-1)}null==r||r.insertBefore(n,e)}else{const t=e.nextSibling;if(Qi(t)){if(ol(t))return t;if(sl(t))return t.splitText(1),t}e.nextSibling?null==r||r.insertBefore(n,e.nextSibling):null==r||r.appendChild(n)}return n})(n,e),a=n.ownerDocument.createRange(),Xm(s.nextSibling)?(a.setStart(s,0),a.setEnd(s,0)):(a.setStart(s,1),a.setEnd(s,1)),a;{const o=((e,t,o)=>{var n;const r=(null!==(n=t.ownerDocument)&&void 0!==n?n:document).createElement(e);r.setAttribute("data-mce-caret",o?"before":"after"),r.setAttribute("data-mce-bogus","all"),r.appendChild(qi().dom);const a=t.parentNode;return o?null==a||a.insertBefore(r,t):t.nextSibling?null==a||a.insertBefore(r,t.nextSibling):null==a||a.appendChild(r),r})(i,n,e),c=Gm(t,n,e);l.setStyle(o,"top",c.top),l.setStyle(o,"caret-color","transparent"),s=o;const m=l.create("div",{class:"mce-visual-caret","data-mce-bogus":"all"});l.setStyles(m,{...c}),l.add(t,m),r.set({caret:m,element:n,before:e}),e&&l.addClass(m,"mce-visual-caret-before"),d(),a=n.ownerDocument.createRange(),a.setStart(o,0),a.setEnd(o,0)}return a},hide:c,getCss:()=>".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}",reposition:()=>{r.on(e=>{const o=Gm(t,e.element,e.before);l.setStyles(e.caret,{...o})})},destroy:()=>clearInterval(a)}},Ym=()=>ro.browser.isFirefox(),Xm=e=>Wm(e)||$m(e),Jm=e=>(Xm(e)||oa(e)&&Ym())&&zo(mo.fromDom(e)).exists(br),Qm=pa,eu=ha,tu=va,ou=ea("display","block table table-cell table-row table-caption list-item"),nu=ol,ru=el,au=Yr,su=aa,iu=Al,lu=e=>1===e,cu=e=>-1===e,du=(e,t)=>{let o;for(;o=e(t);)if(!ru(o))return o;return null},mu=(e,t,o,n,r)=>{const a=new Ur(e,n),s=eu(e)||ru(e);let i;if(cu(t)){if(s&&(i=du(a.prev.bind(a),!0),o(i)))return i;for(;i=du(a.prev.bind(a),r);)if(o(i))return i}if(lu(t)){if(s&&(i=du(a.next.bind(a),!0),o(i)))return i;for(;i=du(a.next.bind(a),r);)if(o(i))return i}return null},uu=(e,t)=>{for(;e&&e!==t;){if(ou(e))return e;e=e.parentNode}return null},gu=(e,t,o)=>uu(e.container(),o)===uu(t.container(),o),pu=(e,t)=>{if(!t)return P.none();const o=t.container(),n=t.offset();return au(o)?P.from(o.childNodes[n+e]):P.none()},hu=(e,t)=>{var o;const n=(null!==(o=t.ownerDocument)&&void 0!==o?o:document).createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n},fu=(e,t,o)=>uu(t,e)===uu(o,e),bu=(e,t,o)=>{const n=e?"previousSibling":"nextSibling";let r=o;for(;r&&r!==t;){let e=r[n];if(e&&nu(e)&&(e=e[n]),eu(e)||tu(e)){if(fu(t,e,r))return e;break}if(iu(e))break;r=r.parentNode}return null},xu=R(hu,!0),vu=R(hu,!1),yu=(e,t,o)=>{let n;const r=R(bu,!0,t),a=R(bu,!1,t),s=o.startContainer,i=o.startOffset;if(el(s)){const e=su(s)?s.parentNode:s,t=e.getAttribute("data-mce-caret");if("before"===t&&(n=e.nextSibling,Jm(n)))return xu(n);if("after"===t&&(n=e.previousSibling,Jm(n)))return vu(n)}if(!o.collapsed)return o;if(aa(s)){if(nu(s)){if(1===e){if(n=a(s),n)return xu(n);if(n=r(s),n)return vu(n)}if(-1===e){if(n=r(s),n)return vu(n);if(n=a(s),n)return xu(n)}return o}if(il(s)&&i>=s.data.length-1)return 1===e&&(n=a(s),n)?xu(n):o;if(sl(s)&&i<=1)return-1===e&&(n=r(s),n)?vu(n):o;if(i===s.data.length)return n=a(s),n?xu(n):o;if(0===i)return n=r(s),n?vu(n):o}return o},wu=(e,t)=>pu(e?0:-1,t).filter(eu),_u=(e,t,o)=>{const n=yu(e,t,o);return-1===e?Yl.fromRangeStart(n):Yl.fromRangeEnd(n)},Cu=e=>P.from(e.getNode()).map(mo.fromDom),ku=(e,t)=>{let o=t;for(;o=e(o);)if(o.isVisible())return o;return o},Su=(e,t)=>{const o=gu(e,t);return!(o||!ma(e.getNode()))||o},Eu=ha,Ou=aa,Tu=Yr,Au=ma,Du=Al,Mu=e=>El(e)||(e=>!!Dl(e)&&!J(ue(e.getElementsByTagName("*")),(e,t)=>e||wl(t),!1))(e),Ru=Ml,Nu=(e,t)=>e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null,Bu=(e,t)=>{if(lu(e)){if(Du(t.previousSibling)&&!Ou(t.previousSibling))return Yl.before(t);if(Ou(t))return Yl(t,0)}if(cu(e)){if(Du(t.nextSibling)&&!Ou(t.nextSibling))return Yl.after(t);if(Ou(t))return Yl(t,t.data.length)}return cu(e)?Au(t)?Yl.before(t):Yl.after(t):Yl.before(t)},zu=(e,t,o)=>{let n,r,a,s;if(!Tu(o)||!t)return null;if(t.isEqual(Yl.after(o))&&o.lastChild){if(s=Yl.after(o.lastChild),cu(e)&&Du(o.lastChild)&&Tu(o.lastChild))return Au(o.lastChild)?Yl.before(o.lastChild):s}else s=t;const i=s.container();let l=s.offset();if(Ou(i)){if(cu(e)&&l>0)return Yl(i,--l);if(lu(e)&&l<i.length)return Yl(i,++l);n=i}else{if(cu(e)&&l>0&&(r=Nu(i,l-1),Du(r)))return!Mu(r)&&(a=mu(r,e,Ru,r),a)?Ou(a)?Yl(a,a.data.length):Yl.after(a):Ou(r)?Yl(r,r.data.length):Yl.before(r);if(lu(e)&&l<i.childNodes.length&&(r=Nu(i,l),Du(r)))return Au(r)?((e,t)=>{const o=t.nextSibling;return o&&Du(o)?Ou(o)?Yl(o,0):Yl.before(o):zu(1,Yl.after(t),e)})(o,r):!Mu(r)&&(a=mu(r,e,Ru,r),a)?Ou(a)?Yl(a,0):Yl.before(a):Ou(r)?Yl(r,0):Yl.after(r);n=r||s.getNode()}if(n&&(lu(e)&&s.isAtEnd()||cu(e)&&s.isAtStart())&&(n=mu(n,e,I,o,!0),Ru(n,o)))return Bu(e,n);r=n?mu(n,e,Ru,o):n;const c=vt(Y(((e,t)=>{const o=[];let n=e;for(;n&&n!==t;)o.push(n),n=n.parentNode;return o})(i,o),Eu));return!c||r&&c.contains(r)?r?Bu(e,r):null:(s=lu(e)?Yl.after(c):Yl.before(c),s)},Hu=e=>({next:t=>zu(1,t,e),prev:t=>zu(-1,t,e)}),Lu=e=>Yl.isTextPosition(e)?0===e.offset():Al(e.getNode()),Iu=e=>{if(Yl.isTextPosition(e)){const t=e.container();return e.offset()===t.data.length}return Al(e.getNode(!0))},Pu=(e,t)=>!Yl.isTextPosition(e)&&!Yl.isTextPosition(t)&&e.getNode()===t.getNode(!0),Fu=(e,t,o)=>{return e?!Pu(t,o)&&(n=t,!(!Yl.isTextPosition(n)&&ma(n.getNode())))&&Iu(t)&&Lu(o):!Pu(o,t)&&Lu(t)&&Iu(o);var n},Vu=(e,t,o)=>{const n=Hu(t);return P.from(e?n.next(o):n.prev(o))},Zu=(e,t,o)=>Vu(e,t,o).bind(n=>gu(o,n,t)&&Fu(e,o,n)?Vu(e,t,n):P.some(n)),Uu=(e,t,o,n)=>Zu(e,t,o).bind(o=>n(o)?Uu(e,t,o,n):P.some(o)),ju=(e,t)=>{const o=e?t.firstChild:t.lastChild;return aa(o)?P.some(Yl(o,e?0:o.data.length)):o?Al(o)?P.some(e?Yl.before(o):ma(n=o)?Yl.before(n):Yl.after(n)):((e,t,o)=>{const n=e?Yl.before(o):Yl.after(o);return Vu(e,t,n)})(e,t,o):P.none();var n},Wu=R(Vu,!0),$u=R(Vu,!1),qu=R(ju,!0),Gu=R(ju,!1),Ku="_mce_caret",Yu=e=>Yr(e)&&e.id===Ku,Xu=(e,t)=>{let o=t;for(;o&&o!==e;){if(Yu(o))return o;o=o.parentNode}return null},Ju=e=>Ee(e,"name"),Qu=e=>lo.isArray(e.start),eg=e=>!(!Ju(e)&&v(e.forward))||e.forward,tg=(e,t)=>(Yr(t)&&e.isBlock(t)&&!t.innerHTML&&(t.innerHTML='<br data-mce-bogus="1" />'),t),og=(e,t)=>Gu(e).fold(L,e=>(t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0)),ng=(e,t,o)=>!(!(e=>!e.hasChildNodes())(t)||!Xu(e,t))&&(((e,t)=>{var o;const n=(null!==(o=e.ownerDocument)&&void 0!==o?o:document).createTextNode(Ki);e.appendChild(n),t.setStart(n,0),t.setEnd(n,0)})(t,o),!0),rg=(e,t,o,n)=>{const r=o[t?"start":"end"],a=e.getRoot();if(r){let e=a,o=r[0];for(let t=r.length-1;e&&t>=1;t--){const o=e.childNodes;if(ng(a,e,n))return!0;if(r[t]>o.length-1)return!!ng(a,e,n)||og(e,n);e=o[r[t]]}aa(e)&&(o=Math.min(r[0],e.data.length)),Yr(e)&&(o=Math.min(r[0],e.childNodes.length)),t?n.setStart(e,o):n.setEnd(e,o)}return!0},ag=e=>aa(e)&&e.data.length>0,sg=(e,t,o)=>{const n=e.get(o.id+"_"+t),r=null==n?void 0:n.parentNode,a=o.keep;if(n&&r){let s,i;if("start"===t?a?n.hasChildNodes()?(s=n.firstChild,i=1):ag(n.nextSibling)?(s=n.nextSibling,i=0):ag(n.previousSibling)?(s=n.previousSibling,i=n.previousSibling.data.length):(s=r,i=e.nodeIndex(n)+1):(s=r,i=e.nodeIndex(n)):a?n.hasChildNodes()?(s=n.firstChild,i=1):ag(n.previousSibling)?(s=n.previousSibling,i=n.previousSibling.data.length):(s=r,i=e.nodeIndex(n)):(s=r,i=e.nodeIndex(n)),!a){const r=n.previousSibling,a=n.nextSibling;let l;for(lo.each(lo.grep(n.childNodes),e=>{aa(e)&&(e.data=e.data.replace(/\uFEFF/g,""))});l=e.get(o.id+"_"+t);)e.remove(l,!0);if(aa(a)&&aa(r)&&!ro.browser.isOpera()){const t=r.data.length;r.appendData(a.data),e.remove(a),s=r,i=t}}return P.some(Yl(s,i))}return P.none()},ig=(e,t)=>{const o=e.dom;if(t){if(Qu(t))return((e,t)=>{const o=e.createRng();return rg(e,!0,t,o)&&rg(e,!1,t,o)?P.some({range:o,forward:eg(t)}):P.none()})(o,t);if((e=>p(e.start))(t))return((e,t)=>{const o=P.from(ic(e.getRoot(),t.start)),n=P.from(ic(e.getRoot(),t.end));return Ze(o,n,(o,n)=>{const r=e.createRng();return r.setStart(o.container(),o.offset()),r.setEnd(n.container(),n.offset()),{range:r,forward:eg(t)}})})(o,t);if((e=>Ee(e,"id"))(t))return((e,t)=>{const o=sg(e,"start",t),n=sg(e,"end",t);return Ze(o,n.or(o),(o,n)=>{const r=e.createRng();return r.setStart(tg(e,o.container()),o.offset()),r.setEnd(tg(e,n.container()),n.offset()),{range:r,forward:eg(t)}})})(o,t);if(Ju(t))return((e,t)=>P.from(e.select(t.name)[t.index]).map(t=>{const o=e.createRng();return o.selectNode(t),{range:o,forward:!0}}))(o,t);if((e=>Ee(e,"rng"))(t))return P.some({range:t.rng,forward:eg(t)})}return P.none()},lg=(e,t,o)=>bc(e,t,o),cg=(e,t)=>{ig(e,t).each(({range:t,forward:o})=>{e.setRng(t,o)})},dg=e=>Yr(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type"),mg=(ug=ct,e=>ug===e);var ug;const gg=e=>""!==e&&-1!==" \f\n\r\t\v".indexOf(e),pg=e=>!gg(e)&&!mg(e)&&!dt(e),hg=e=>{const t=[];if(e)for(let o=0;o<e.rangeCount;o++)t.push(e.getRangeAt(o));return t},fg=e=>Y((e=>ne(e,e=>{const t=bl(e);return t?[mo.fromDom(t)]:[]}))(e),ji),bg=(e,t)=>{const o=wr(t,"td[data-mce-selected],th[data-mce-selected]");return o.length>0?o:fg(e)},xg=e=>bg(hg(e.selection.getSel()),mo.fromDom(e.getBody())),vg=(e,t)=>ar(e,"table",t),yg=e=>Uo(e).fold(A([e]),t=>[e].concat(yg(t))),wg=e=>jo(e).fold(A([e]),t=>"br"===_o(t)?Lo(t).map(t=>[e].concat(wg(t))).getOr([]):[e].concat(wg(t))),_g=(e,t)=>Ze((e=>{const t=e.startContainer,o=e.startOffset;return aa(t)?0===o?P.some(mo.fromDom(t)):P.none():P.from(t.childNodes[o]).map(mo.fromDom)})(t),(e=>{const t=e.endContainer,o=e.endOffset;return aa(t)?o===t.data.length?P.some(mo.fromDom(t)):P.none():P.from(t.childNodes[o-1]).map(mo.fromDom)})(t),(t,o)=>{const n=ee(yg(e),R(vo,t)),r=ee(wg(e),R(vo,o));return n.isSome()&&r.isSome()}).getOr(!1),Cg=(e,t,o,n)=>{const r=o,a=new Ur(o,r),s=_e(e.schema.getMoveCaretBeforeOnEnterElements(),(e,t)=>!j(["td","th","table"],t.toLowerCase()));let i=o;do{if(aa(i)&&0!==lo.trim(i.data).length)return void(n?t.setStart(i,0):t.setEnd(i,i.data.length));if(s[i.nodeName])return void(n?t.setStartBefore(i):"BR"===i.nodeName?t.setEndBefore(i):t.setEndAfter(i))}while(i=n?a.next():a.prev());"BODY"===r.nodeName&&(n?t.setStart(r,0):t.setEnd(r,r.childNodes.length))},kg=e=>{const t=e.selection.getSel();return _(t)&&t.rangeCount>0},Sg=(e,t)=>{const o=xg(e);o.length>0?q(o,o=>{const n=o.dom,r=e.dom.createRng();r.setStartBefore(n),r.setEndAfter(n),t(r,!0)}):t(e.selection.getRng(),!1)},Eg=(e,t,o)=>{const n=fc(e,t);o(n),e.moveToBookmark(n)},Og=e=>k(null==e?void 0:e.nodeType),Tg=e=>Yr(e)&&!dg(e)&&!Yu(e)&&!ta(e),Ag=(e,t,o)=>{const{selection:n,dom:r}=e,a=n.getNode(),s=ha(a);Eg(n,!0,()=>{t()});s&&ha(a)&&r.isChildOf(a,e.getBody())?e.selection.select(a):o(n.getStart())&&Dg(r,n)},Dg=(e,t)=>{var o,n;const r=t.getRng(),{startContainer:a,startOffset:s}=r;if(!((e,t)=>{if(Tg(t)&&!/^(TD|TH)$/.test(t.nodeName)){const o=e.getAttrib(t,"data-mce-selected"),n=parseInt(o,10);return!isNaN(n)&&n>0}return!1})(e,t.getNode())&&Yr(a)){const i=a.childNodes,l=e.getRoot();let c;if(s<i.length){const t=i[s];c=new Ur(t,null!==(o=e.getParent(t,e.isBlock))&&void 0!==o?o:l)}else{const t=i[i.length-1];c=new Ur(t,null!==(n=e.getParent(t,e.isBlock))&&void 0!==n?n:l),c.next(!0)}for(let o=c.current();o;o=c.next()){if("false"===e.getContentEditable(o))return;if(aa(o)&&!Bg(o))return r.setStart(o,0),void t.setRng(r)}}},Mg=(e,t,o)=>{if(e){const n=t?"nextSibling":"previousSibling";for(e=o?e:e[n];e;e=e[n])if(Yr(e)||!Bg(e))return e}},Rg=(e,t)=>!!e.getTextBlockElements()[t.nodeName.toLowerCase()]||Ga(e,t),Ng=(e,t,o)=>e.schema.isValidChild(t,o),Bg=(e,t=!1)=>{if(_(e)&&aa(e)){const o=t?e.data.replace(/ /g," "):e.data;return Wr(o)}return!1},zg=(e,t)=>{const o=e.dom;return Tg(t)&&"false"===o.getContentEditable(t)&&((e,t)=>{const o="[data-mce-cef-wrappable]",n=Nd(e),r=nt(n)?o:`${o},${n}`;return bo(mo.fromDom(t),r)})(e,t)&&0===o.select('[contenteditable="true"]',t).length},Hg=(e,t)=>C(e)?e(t):(_(t)&&(e=e.replace(/%(\w+)/g,(e,o)=>t[o]||e)),e),Lg=(e,t)=>(t=t||"",e=""+((e=e||"").nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()===t.toLowerCase()),Ig=(e,t)=>{if(w(e))return null;{let o=String(e);return"color"!==t&&"backgroundColor"!==t||(o=Ks(o)),"fontWeight"===t&&700===e&&(o="bold"),"fontFamily"===t&&(o=o.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),o}},Pg=(e,t,o)=>{const n=e.getStyle(t,o);return Ig(n,o)},Fg=(e,t)=>{let o;return e.getParent(t,t=>!!Yr(t)&&(o=e.getStyle(t,"text-decoration"),!!o&&"none"!==o)),o},Vg=(e,t,o)=>e.getParents(t,o,e.getRoot()),Zg=(e,t,o)=>{const n=e.formatter.get(t);return _(n)&&W(n,o)},Ug=(e,t,o)=>{const n=["inline","block","selector","attributes","styles","classes"],r=e=>_e(e,(e,t)=>W(n,e=>e===t));return Zg(e,t,t=>{const n=r(t);return Zg(e,o,e=>{const t=r(e);return((e,t,o=i)=>s(o).eq(e,t))(n,t)})})},jg=e=>Oe(e,"block"),Wg=e=>Oe(e,"selector"),$g=e=>Oe(e,"inline"),qg=e=>Wg(e)&&!1!==e.expand&&!$g(e),Gg=e=>(e=>{const t=[];let o=e;for(;o;){if(aa(o)&&o.data!==Ki||o.childNodes.length>1)return[];Yr(o)&&t.push(o),o=o.firstChild}return t})(e).length>0,Kg=e=>Yu(e.dom)&&Gg(e.dom),Yg=dg,Xg=Vg,Jg=Bg,Qg=Rg,ep=e=>ma(e)&&e.getAttribute("data-mce-bogus")&&!e.nextSibling,tp=(e,t)=>{let o=t;for(;o;){if(Yr(o)&&e.getContentEditable(o))return"false"===e.getContentEditable(o)?o:t;o=o.parentNode}return t},op=(e,t,o,n)=>{const r=t.data;if(e){for(let e=o;e>0;e--)if(n(r.charAt(e-1)))return e}else for(let e=o;e<r.length;e++)if(n(r.charAt(e)))return e;return-1},np=(e,t,o)=>op(e,t,o,e=>mg(e)||gg(e)),rp=(e,t,o)=>op(e,t,o,pg),ap=(e,t,o,n,r,a)=>{let s;const i=e.getParent(o,t=>fa(t)||e.isBlock(t)),l=_(i)?i:t,c=(t,o,n)=>{const a=Li(e),i=r?a.backwards:a.forwards;return P.from(i(t,o,(e,t)=>Yg(e.parentNode)?-1:(s=e,n(r,e,t)),l))};return c(o,n,np).bind(e=>a?c(e.container,e.offset+(r?-1:0),rp):P.some(e)).orThunk(()=>s?P.some({container:s,offset:r?0:s.length}):P.none())},sp=(e,t,o,n,r)=>{const a=n[r];aa(n)&&nt(n.data)&&a&&(n=a);const s=Xg(e,n);for(let n=0;n<s.length;n++)for(let r=0;r<t.length;r++){const a=t[r];if((!_(a.collapsed)||a.collapsed===o.collapsed)&&(Wg(a)&&e.is(s[n],a.selector)))return s[n]}return n},ip=(e,t,o,n)=>{var r;let a=o;const s=e.getRoot(),i=t[0];if(jg(i)&&(a=i.wrapper?null:e.getParent(o,i.block,s)),!a){const t=null!==(r=e.getParent(o,"LI,TD,TH,SUMMARY"))&&void 0!==r?r:s;a=e.getParent(aa(o)?o.parentNode:o,t=>t!==s&&Qg(e.schema,t),t)}if(a&&jg(i)&&i.wrapper&&(a=Xg(e,a,"ul,ol").reverse()[0]||a),!a)for(a=o;a&&a[n]&&!e.isBlock(a[n])&&(a=a[n],!Lg(a,"br")););return a||o},lp=(e,t,o,n)=>{const r=o.parentNode;return!_(o[n])&&(!(r!==t&&!w(r)&&!e.isBlock(r))||lp(e,t,r,n))},cp=(e,t,o,n,r,a)=>{let s=o;const i=r?"previousSibling":"nextSibling",l=e.getRoot();if(aa(o)&&!Jg(o)&&(r?n>0:n<o.data.length))return o;for(;s;){if(fa(s))return o;if(!t[0].block_expand&&e.isBlock(s))return a?s:o;for(let t=s[i];t;t=t[i]){const o=aa(t)&&!lp(e,l,t,i);if(!Yg(t)&&!ep(t)&&!Jg(t,o))return s}if(s===l||s.parentNode===l){o=s;break}s=s.parentNode}return o},dp=e=>Yg(e.parentNode)||Yg(e),mp=(e,t,o,n={})=>{const{includeTrailingSpace:r=!1,expandToBlock:a=!0}=n,s=e.getParent(t.commonAncestorContainer,e=>fa(e)),i=_(s)?s:e.getRoot();let{startContainer:l,startOffset:c,endContainer:d,endOffset:m}=t;const u=o[0];if(Yr(l)&&l.hasChildNodes()&&(l=xl(l,c),aa(l)&&(c=0)),Yr(d)&&d.hasChildNodes()&&(d=xl(d,t.collapsed?m:m-1),aa(d)&&(m=d.data.length)),l=tp(e,l),d=tp(e,d),dp(l)&&(l=Yg(l)?l:l.parentNode,l=t.collapsed?l.previousSibling||l:l.nextSibling||l,aa(l)&&(c=t.collapsed?l.length:0)),dp(d)&&(d=Yg(d)?d:d.parentNode,d=t.collapsed?d.nextSibling||d:d.previousSibling||d,aa(d)&&(m=t.collapsed?0:d.length)),t.collapsed){ap(e,i,l,c,!0,r).each(({container:e,offset:t})=>{l=e,c=t});ap(e,i,d,m,!1,r).each(({container:e,offset:t})=>{d=e,m=t})}return($g(u)||u.block_expand)&&($g(u)&&aa(l)&&0!==c||(l=cp(e,o,l,c,!0,a)),$g(u)&&aa(d)&&m!==d.data.length||(d=cp(e,o,d,m,!1,a))),qg(u)&&(l=sp(e,o,t,l,"previousSibling"),d=sp(e,o,t,d,"nextSibling")),(jg(u)||Wg(u))&&(l=ip(e,o,l,"previousSibling"),d=ip(e,o,d,"nextSibling"),jg(u)&&(e.isBlock(l)||(l=cp(e,o,l,c,!0,a),aa(l)&&(c=0)),e.isBlock(d)||(d=cp(e,o,d,m,!1,a),aa(d)&&(m=d.data.length)))),Yr(l)&&l.parentNode&&(c=e.nodeIndex(l),l=l.parentNode),Yr(d)&&d.parentNode&&(m=e.nodeIndex(d)+1,d=d.parentNode),{startContainer:l,startOffset:c,endContainer:d,endOffset:m}},up=(e,t,o)=>{var n;const r=t.startOffset,a=xl(t.startContainer,r),s=t.endOffset,i=xl(t.endContainer,s-1),l=e=>{const t=e[0];aa(t)&&t===a&&r>=t.data.length&&e.splice(0,1);const o=e[e.length-1];return 0===s&&e.length>0&&o===i&&aa(o)&&e.splice(e.length-1,1),e},c=(e,t,o)=>{const n=[];for(;e&&e!==o;e=e[t])n.push(e);return n},d=(t,o)=>e.getParent(t,e=>e.parentNode===o,o),m=(e,t,n)=>{const r=n?"nextSibling":"previousSibling";for(let a=e,s=a.parentNode;a&&a!==t;a=s){s=a.parentNode;const t=c(a===e?a:a[r],r);t.length&&(n||t.reverse(),o(l(t)))}};if(a===i)return o(l([a]));const u=null!==(n=e.findCommonAncestor(a,i))&&void 0!==n?n:e.getRoot();if(e.isChildOf(a,i))return m(a,u,!0);if(e.isChildOf(i,a))return m(i,u);const g=d(a,u)||a,p=d(i,u)||i;m(a,g,!0);const h=c(g===a?g:g.nextSibling,"nextSibling",p===i?p.nextSibling:p);h.length&&o(l(h)),m(i,p)},gp=['pre[class*=language-][contenteditable="false"]',"figure.image","div[data-ephox-embed-iri]","div.tiny-pageembed","div.mce-toc","div[data-mce-toc]","div.mce-footnotes"],pp=(e,t,o,n)=>zo(t).fold(()=>"skipping",r=>"br"===n||(e=>Oo(e)&&Xn(e)===Ki)(t)?"valid":(e=>Eo(e)&&fr(e,ki()))(t)?"existing":Yu(t.dom)?"caret":W(gp,e=>bo(t,e))?"valid-block":Ng(e,o,n)&&Ng(e,_o(r),o)?"valid":"invalid-child"),hp=(e,t,o,n,r,a)=>{const{uid:s=t,...i}=o;ur(e,ki()),pn(e,`${Ei()}`,s),pn(e,`${Si()}`,n);const{attributes:l={},classes:c=[]}=r(s,i);if(hn(e,l),((e,t)=>{q(t,t=>{ur(e,t)})})(e,c),a){c.length>0&&pn(e,`${Ti()}`,c.join(","));const t=he(l);t.length>0&&pn(e,`${Ai()}`,t.join(","))}},fp=e=>{pr(e,ki()),vn(e,`${Ei()}`),vn(e,`${Si()}`),vn(e,`${Oi()}`);const t=bn(e,`${Ai()}`).map(e=>e.split(",")).getOr([]),o=bn(e,`${Ti()}`).map(e=>e.split(",")).getOr([]);var n;q(t,t=>vn(e,t)),n=e,q(o,e=>{pr(n,e)}),vn(e,`${Ti()}`),vn(e,`${Ai()}`)},bp=(e,t,o,n,r)=>{const a=mo.fromTag("span",e);return hp(a,t,o,n,r,!1),a},xp=(e,t,o,n,r,a)=>{const s=[],i=bp(e.getDoc(),o,a,n,r),l=$e(),c=()=>{l.clear()},d=e=>{q(e,m)},m=t=>{switch(pp(e,t,"span",_o(t))){case"invalid-child":{c();const e=Vo(t);d(e),c();break}case"valid-block":c(),hp(t,o,a,n,r,!0);break;case"valid":{const e=l.get().getOrThunk(()=>{const e=Sn(i);return s.push(e),l.set(e),e});mn(t,e);break}}};return up(e.dom,t,e=>{c(),(e=>{const t=$(e,mo.fromDom);d(t)})(e)}),s},vp=(e,t,o,n)=>{e.undoManager.transact(()=>{const r=e.selection,a=r.getRng(),s=xg(e).length>0,i=He("mce-annotation");if(a.collapsed&&!s&&((e,t)=>{const o=mp(e.dom,t,[{inline:"span"}]);t.setStart(o.startContainer,o.startOffset),t.setEnd(o.endContainer,o.endOffset),e.selection.setRng(t)})(e,a),r.getRng().collapsed&&!s){const a=bp(e.getDoc(),i,n,t,o.decorate);Dn(a,ct),r.getRng().insertNode(a.dom),r.select(a.dom)}else Eg(r,!1,()=>{Sg(e,r=>{xp(e,r,i,t,o.decorate,n)})})})},yp=e=>{const t=(()=>{const e={};return{register:(t,o)=>{e[t]={name:t,settings:o}},lookup:t=>Se(e,t).map(e=>e.settings),getNames:()=>he(e)}})();((e,t)=>{const o=Si(),n=e=>P.from(e.attr(o)).bind(t.lookup),r=e=>{var t,o;e.attr(Ei(),null),e.attr(Si(),null),e.attr(Oi(),null);const n=P.from(e.attr(Ai())).map(e=>e.split(",")).getOr([]),r=P.from(e.attr(Ti())).map(e=>e.split(",")).getOr([]);q(n,t=>e.attr(t,null));const a=null!==(o=null===(t=e.attr("class"))||void 0===t?void 0:t.split(" "))&&void 0!==o?o:[],s=se(a,[ki()].concat(r));e.attr("class",s.length>0?s.join(" "):null),e.attr(Ti(),null),e.attr(Ai(),null)};e.serializer.addTempAttr(Oi()),e.serializer.addAttributeFilter(o,e=>{for(const t of e)n(t).each(e=>{!1===e.persistent&&("span"===t.name?t.unwrap():r(t))})})})(e,t);const o=zi(e,t),n=Do("span"),r=e=>{q(e,e=>{n(e)?Cn(e):fp(e)})};return{register:(e,o)=>{t.register(e,o)},annotate:(o,n)=>{t.lookup(o).each(t=>{vp(e,o,t,n)})},annotationChanged:(e,t)=>{o.addListener(e,t)},remove:t=>{Mi(e,P.some(t)).each(({elements:t})=>{const o=e.selection.getBookmark();r(t),e.selection.moveToBookmark(o)})},removeAll:t=>{const o=e.selection.getBookmark();be(Bi(e,t),(e,t)=>{r(e)}),e.selection.moveToBookmark(o)},getAll:t=>{const o=Bi(e,t);return xe(o,e=>$(e,e=>e.dom))}}},wp=e=>({getBookmark:R(lg,e),moveToBookmark:R(cg,e)});wp.isBookmarkNode=dg;const _p=(e,t,o)=>!o.collapsed&&W(o.getClientRects(),o=>((e,t,o)=>t>=e.left&&t<=e.right&&o>=e.top&&o<=e.bottom)(o,e,t)),Cp=(e,t)=>{const o=Oo(t)?Xn(t).length:Vo(t).length+1;return e>o?o:e<0?0:e},kp=e=>Br.range(e.start,Cp(e.soffset,e.start),e.finish,Cp(e.foffset,e.finish)),Sp=(e,t)=>!Kr(t.dom)&&(yo(e,t)||vo(e,t)),Ep=e=>t=>Sp(e,t.start)&&Sp(e,t.finish),Op=e=>Br.range(mo.fromDom(e.startContainer),e.startOffset,mo.fromDom(e.endContainer),e.endOffset),Tp=e=>(e=>{const t=e.getSelection();return(t&&0!==t.rangeCount?P.from(t.getRangeAt(0)):P.none()).map(Op)})(No(e).dom).filter(Ep(e)),Ap=e=>{const t=document.createRange();try{return t.setStart(e.start.dom,e.soffset),t.setEnd(e.finish.dom,e.foffset),P.some(t)}catch(e){return P.none()}},Dp=e=>{const t=(e=>e.inline||ro.browser.isFirefox())(e)?Tp(mo.fromDom(e.getBody())):P.none();e.bookmark=t.isSome()?t:e.bookmark},Mp=e=>(e.bookmark?e.bookmark:P.none()).bind(t=>((e,t)=>P.from(t).filter(Ep(e)).map(kp))(mo.fromDom(e.getBody()),t)).bind(Ap),Rp={isEditorUIElement:e=>{const t=e.className.toString();return-1!==t.indexOf("tox-")||-1!==t.indexOf("mce-")}},Np={setEditorTimeout:(e,t,o)=>((e,t)=>(k(t)||(t=0),window.setTimeout(e,t)))(()=>{e.removed||t()},o),setEditorInterval:(e,t,o)=>{const n=((e,t)=>(k(t)||(t=0),window.setInterval(e,t)))(()=>{e.removed?window.clearInterval(n):t()},o);return n}},Bp=(e,t)=>e.view(t).fold(A([]),t=>{const o=e.owner(t),n=Bp(e,o);return[t].concat(n)});var zp=Object.freeze({__proto__:null,view:e=>{var t;return(e.dom===document?P.none():P.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement)).map(mo.fromDom)},owner:e=>Ro(e)});const Hp=e=>{const t=on(),o=$n(t),n=((e,t)=>{const o=t.owner(e);return Bp(t,o)})(e,zp),r=Wn(e),a=X(n,(e,t)=>{const o=Wn(t);return{left:e.left+o.left,top:e.top+o.top}},{left:0,top:0});return Un(a.left+r.left+o.left,a.top+r.top+o.top)},Lp=e=>{const t=at(()=>{Dp(e)},0);e.on("init",()=>{e.inline&&((e,t)=>{const o=()=>{t.throttle()};fi.DOM.bind(document,"mouseup",o),e.on("remove",()=>{fi.DOM.unbind(document,"mouseup",o)})})(e,t),((e,t)=>{((e,t)=>{e.on("mouseup touchend",e=>{t.throttle()})})(e,t),e.on("keyup NodeChange AfterSetSelectionRange",t=>{(e=>"nodechange"===e.type&&e.selectionChange)(t)||Dp(e)})})(e,t)}),e.on("remove",()=>{t.cancel()})};let Ip;const Pp=fi.DOM,Fp=e=>{const t=e.classList;return void 0!==t&&(t.contains("tox-edit-area")||t.contains("tox-edit-area__iframe")||t.contains("mce-content-body"))},Vp=(e,t)=>{const o=Bd(e),n=Pp.getParent(t,t=>(e=>Yr(e)&&Rp.isEditorUIElement(e))(t)||!!o&&e.dom.is(t,o));return null!==n},Zp=e=>{try{const t=qo(mo.fromDom(e.getElement()));return an(t).fold(()=>document.body,e=>e.dom)}catch(e){return document.body}},Up=(e,t)=>{const o=t.editor;Lp(o);const n=(e,t)=>{if(_m(e)&&!0!==e.inline){t(mo.fromDom(e.getContainer()),"tox-edit-focus")}};o.on("focusin",()=>{const t=e.focusedEditor;if(Fp(Zp(o))&&n(o,ur),t!==o){t&&t.dispatch("blur",{focusedEditor:o}),e.setActive(o),e.focusedEditor=o,o.dispatch("focus",{blurredEditor:t}),o.focus(!0);const n=Gt().browser;!0!==o.inline&&(n.isSafari()||n.isChromium())&&(e=>{if(!e.iframeElement)return;const t=mo.fromDom(e.iframeElement),o=Hp(t),n=Zr(window);(o.top<n.y||o.top>n.bottom-25)&&t.dom.scrollIntoView({block:"center"})})(o)}}),o.on("focusout",()=>{Np.setEditorTimeout(o,()=>{const t=e.focusedEditor;Fp(Zp(o))&&t===o||n(o,pr),Vp(o,Zp(o))||t!==o||(o.dispatch("blur",{focusedEditor:null}),e.focusedEditor=null)})}),Ip||(Ip=t=>{const o=e.activeEditor;o&&Yo(t).each(t=>{const n=t;n.ownerDocument===document&&(n===document.body||Vp(o,n)||e.focusedEditor!==o||(o.dispatch("blur",{focusedEditor:null}),e.focusedEditor=null))})},Pp.bind(document,"focusin",Ip))},jp=(e,t)=>{e.focusedEditor===t.editor&&(e.focusedEditor=null),!e.activeEditor&&Ip&&(Pp.unbind(document,"focusin",Ip),Ip=null)},Wp=(e,t)=>(e=>e.collapsed?P.from(xl(e.startContainer,e.startOffset)).map(mo.fromDom):P.none())(t).bind(t=>Ui(t)?P.some(t):yo(e,t)?P.none():P.some(e)),$p=(e,t)=>{Wp(mo.fromDom(e.getBody()),t).bind(e=>qu(e.dom)).fold(()=>{e.selection.normalize()},t=>e.selection.setRng(t.toRange()))},qp=e=>{if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},Gp=e=>{return rn(e)||(t=e,an(qo(t)).filter(e=>t.dom.contains(e.dom))).isSome();var t},Kp=e=>e.inline?(e=>{const t=e.getBody();return t&&Gp(mo.fromDom(t))})(e):(e=>_(e.iframeElement)&&rn(mo.fromDom(e.iframeElement)))(e),Yp=e=>Kp(e)||(e=>{const t=qo(mo.fromDom(e.getElement()));return an(t).filter(t=>!Fp(t.dom)&&Vp(e,t.dom)).isSome()})(e),Xp=e=>e.editorManager.setActive(e),Jp=(e,t)=>{e.removed||(t?Xp(e):(e=>{const t=e.selection,o=e.getBody();let n=t.getRng();e.quirks.refreshContentEditable();const r=e=>{Mp(e).each(t=>{e.selection.setRng(t),n=t})};!Kp(e)&&e.hasEditableRoot()&&r(e);const a=((e,t)=>e.dom.getParent(t,t=>"true"===e.dom.getContentEditable(t)))(e,t.getNode());if(a&&e.dom.isChildOf(a,o))return((e,t)=>null!==e.dom.getParent(t,t=>"false"===e.dom.getContentEditable(t)))(e,a)||qp(o),qp(a),e.hasEditableRoot()||r(e),$p(e,n),void Xp(e);e.inline||(ro.browser.isOpera()||qp(o),e.getWin().focus()),(ro.browser.isFirefox()||e.inline)&&(qp(o),$p(e,n)),Xp(e)})(e))},Qp={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:e=>e.shiftKey||e.ctrlKey||e.altKey||Qp.metaKeyPressed(e),metaKeyPressed:e=>ro.os.isMacOS()||ro.os.isiOS()?e.metaKey:e.ctrlKey&&!e.altKey},eh="data-mce-selected",th=Math.abs,oh=Math.round,nh={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},rh=(e,t)=>{const o=t.dom,n=t.getDoc(),r=document,a=t.getBody();let s,i,l,c,d,m,u,g,p,h,f,b,x,v,y;const w=e=>_(e)&&(ua(e)||o.is(e,"figure.image")),C=e=>va(e)||o.hasClass(e,"mce-preview-object"),k=e=>{const o=e.target;((e,t)=>{if((e=>"longpress"===e.type||0===e.type.indexOf("touch"))(e)){const o=e.touches[0];return w(e.target)&&!_p(o.clientX,o.clientY,t)}return w(e.target)&&!_p(e.clientX,e.clientY,t)})(e,t.selection.getRng())&&!e.isDefaultPrevented()&&t.selection.select(o)},S=e=>o.hasClass(e,"mce-preview-object")&&_(e.firstElementChild)?[e,e.firstElementChild]:o.is(e,"figure.image")?[e.querySelector("img")]:[e],E=e=>{const n=yd(t);return!(!n||t.mode.isReadOnly())&&("false"!==e.getAttribute("data-mce-resize")&&(e!==t.getBody()&&(o.hasClass(e,"mce-preview-object")&&_(e.firstElementChild)?bo(mo.fromDom(e.firstElementChild),n):bo(mo.fromDom(e),n))))},O=(e,n,r)=>{if(_(r)){const a=S(e);q(a,e=>{e.style[n]||!t.schema.isValid(e.nodeName.toLowerCase(),n)?o.setStyle(e,n,r):o.setAttrib(e,n,""+r)})}},T=(e,t,o)=>{O(e,"width",t),O(e,"height",o)},A=e=>{let n,r,d,_,k;n=e.screenX-m,r=e.screenY-u,b=n*c[2]+g,x=r*c[3]+p,b=b<5?5:b,x=x<5?5:x,d=(w(s)||C(s))&&!1!==wd(t)?!Qp.modifierPressed(e):Qp.modifierPressed(e),d&&(th(n)>th(r)?(x=oh(b*h),b=oh(x/h)):(b=oh(x/h),x=oh(b*h))),T(i,b,x),_=c.startPos.x+n,k=c.startPos.y+r,_=_>0?_:0,k=k>0?k:0,o.setStyles(l,{left:_,top:k,display:"block"}),l.innerHTML=b+" &times; "+x,n=a.scrollWidth-v,r=a.scrollHeight-y,n+r!==0&&o.setStyles(l,{left:_-n,top:k-r}),f||(((e,t,o,n,r)=>{e.dispatch("ObjectResizeStart",{target:t,width:o,height:n,origin:r})})(t,s,g,p,"corner-"+c.name),f=!0)},D=()=>{const e=f;f=!1,e&&(O(s,"width",b),O(s,"height",x)),o.unbind(n,"mousemove",A),o.unbind(n,"mouseup",D),r!==n&&(o.unbind(r,"mousemove",A),o.unbind(r,"mouseup",D)),o.remove(i),o.remove(l),o.remove(d),M(s),e&&(((e,t,o,n,r)=>{e.dispatch("ObjectResized",{target:t,width:o,height:n,origin:r})})(t,s,b,x,"corner-"+c.name),o.setAttrib(s,"style",o.getAttrib(s,"style"))),t.nodeChanged()},M=e=>{H();const f=o.getPos(e,a),w=f.x,_=f.y,k=e.getBoundingClientRect(),O=k.width||k.right-k.left,M=k.height||k.bottom-k.top;s!==e&&(N(),s=e,b=x=0);const R=t.dispatch("ObjectSelected",{target:e});E(e)&&!R.isDefaultPrevented()?be(nh,(e,t)=>{const f=f=>{const b=S(s)[0];m=f.screenX,u=f.screenY,g=b.clientWidth,p=b.clientHeight,h=p/g,c=e,c.name=t,c.startPos={x:O*e[0]+w,y:M*e[1]+_},v=a.scrollWidth,y=a.scrollHeight,d=o.add(a,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),o.setStyles(d,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),i=((e,t)=>{if(C(t))return e.create("img",{src:ro.transparentSrc});if(oa(t)){const o=Ye(c.name,"n")?de:me,n=t.cloneNode(!0);return o(e.select("tr",n)).each(t=>{const o=e.select("td,th",t);e.setStyle(t,"height",null),q(o,t=>e.setStyle(t,"height",null))}),n}return t.cloneNode(!0)})(o,s),o.addClass(i,"mce-clonedresizable"),o.setAttrib(i,"data-mce-bogus","all"),i.contentEditable="false",o.setStyles(i,{left:w,top:_,margin:0}),T(i,O,M),i.removeAttribute(eh),a.appendChild(i),o.bind(n,"mousemove",A),o.bind(n,"mouseup",D),r!==n&&(o.bind(r,"mousemove",A),o.bind(r,"mouseup",D)),l=o.add(a,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},g+" &times; "+p)};let b=o.get("mceResizeHandle"+t);b&&o.remove(b),b=o.add(a,"div",{id:"mceResizeHandle"+t,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+t+"-resize; margin:0; padding:0"}),o.bind(b,"mousedown",e=>{e.stopImmediatePropagation(),e.preventDefault(),f(e)}),e.elm=b,o.setStyles(b,{left:O*e[0]+w-b.offsetWidth/2,top:M*e[1]+_-b.offsetHeight/2})}):N(!1)},R=at(M,0),N=(e=!0)=>{R.cancel(),H(),s&&e&&s.removeAttribute(eh),be(nh,(e,t)=>{const n=o.get("mceResizeHandle"+t);n&&(o.unbind(n),o.remove(n))})},B=(e,t)=>o.isChildOf(e,t),z=n=>{if(f||t.removed||t.composing)return;const r="mousedown"===n.type?n.target:e.getNode(),s=ir(mo.fromDom(r),"table,img,figure.image,hr,video,span.mce-preview-object,details").map(e=>e.dom).filter(e=>o.isEditable(e.parentElement)||"IMG"===e.nodeName&&o.isEditable(e)).getOrUndefined(),i=_(s)?o.getAttrib(s,eh,"1"):"1";if(q(o.select(`img[${eh}],hr[${eh}]`),e=>{e.removeAttribute(eh)}),_(s)&&B(s,a)&&Yp(t)){L();const t=e.getStart(!0);if(B(t,s)&&B(e.getEnd(!0),s))return o.setAttrib(s,eh,i),void R.throttle(s)}N()},H=()=>{be(nh,e=>{e.elm&&(o.unbind(e.elm),delete e.elm)})},L=()=>{try{t.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(e){}};t.on("init",()=>{L(),t.on("NodeChange ResizeEditor ResizeWindow ResizeContent drop",z),t.on("keyup compositionend",e=>{s&&"TABLE"===s.nodeName&&z(e)}),t.on("hide blur",N),t.on("contextmenu longpress",k,!0)}),t.on("remove",H);return{isResizable:E,showResizeRect:M,hideResizeRect:N,updateResizeRect:z,destroy:()=>{R.cancel(),s=i=d=null}}},ah=(e,t,o)=>{const n=No(mo.fromDom(o));return Fr(n.dom,e,t).map(e=>{const t=o.createRange();return t.setStart(e.start.dom,e.soffset),t.setEnd(e.finish.dom,e.foffset),t}).getOrUndefined()},sh=(e,t)=>_(e)&&_(t)&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset,ih=(e,t,o)=>null!==((e,t,o)=>{let n=e;for(;n&&n!==t;){if(o(n))return n;n=n.parentNode}return null})(e,t,o),lh=(e,t,o)=>ih(e,t,e=>e.nodeName===o),ch=(e,t)=>ol(e)&&!ih(e,t,Yu),dh=(e,t,o)=>{const n=t.parentNode;if(n){const r=new Ur(t,e.getParent(n,e.isBlock)||e.getRoot());let a;for(;a=r[o?"prev":"next"]();)if(ma(a))return!0}return!1},mh=(e,t,o,n,r)=>{const a=e.getRoot(),s=e.schema.getNonEmptyElements(),i=r.parentNode;let l,c;if(!i)return P.none();const d=e.getParent(i,e.isBlock)||a;if(n&&ma(r)&&t&&e.isEmpty(d))return P.some(Yl(i,e.nodeIndex(r)));const m=new Ur(r,d);for(;c=m[n?"prev":"next"]();){if("false"===e.getContentEditableParent(c)||ch(c,a))return P.none();if(aa(c)&&c.data.length>0)return lh(c,a,"A")?P.none():P.some(Yl(c,n?c.data.length:0));if(e.isBlock(c)||s[c.nodeName.toLowerCase()])return P.none();l=c}return la(l)?P.none():o&&l?P.some(Yl(l,0)):P.none()},uh=(e,t,o,n)=>{const r=e.getRoot();let a,s=!1,i=o?n.startContainer:n.endContainer,l=o?n.startOffset:n.endOffset;const c=Yr(i)&&l===i.childNodes.length,d=e.schema.getNonEmptyElements();let m=o;if(ol(i))return P.none();if(Yr(i)&&l>i.childNodes.length-1&&(m=!1),ca(i)&&(i=r,l=0),i===r){if(m&&(a=i.childNodes[l>0?l-1:0],a)){if(ol(a))return P.none();if(d[a.nodeName]||oa(a))return P.none()}if(i.hasChildNodes()){if(l=Math.min(!m&&l>0?l-1:l,i.childNodes.length-1),i=i.childNodes[l],l=aa(i)&&c?i.data.length:0,!t&&i===r.lastChild&&oa(i))return P.none();if(((e,t)=>{let o=t;for(;o&&o!==e;){if(ha(o))return!0;o=o.parentNode}return!1})(r,i)||ol(i))return P.none();if(wa(i))return P.none();if(i.hasChildNodes()&&!oa(i)){a=i;const t=new Ur(i,r);do{if(ha(a)||ol(a)){s=!1;break}if(aa(a)&&a.data.length>0){l=m?0:a.data.length,i=a,s=!0;break}if(d[a.nodeName.toLowerCase()]&&!xa(a)){l=e.nodeIndex(a),i=a.parentNode,m||l++,s=!0;break}}while(a=m?t.next():t.prev())}}}return t&&(aa(i)&&0===l&&mh(e,c,t,!0,i).each(e=>{i=e.container(),l=e.offset(),s=!0}),Yr(i)&&(a=i.childNodes[l],a||(a=i.childNodes[l-1]),!a||!ma(a)||((e,t)=>{var o;return(null===(o=e.previousSibling)||void 0===o?void 0:o.nodeName)===t})(a,"A")||dh(e,a,!1)||dh(e,a,!0)||mh(e,c,t,!0,a).each(e=>{i=e.container(),l=e.offset(),s=!0}))),m&&!t&&aa(i)&&l===i.data.length&&mh(e,c,t,!1,i).each(e=>{i=e.container(),l=e.offset(),s=!0}),s&&i?P.some(Yl(i,l)):P.none()},gh=(e,t)=>{const o=t.collapsed,n=t.cloneRange(),r=Yl.fromRangeStart(t);return uh(e,o,!0,n).each(e=>{o&&Yl.isAbove(r,e)||n.setStart(e.container(),e.offset())}),o||uh(e,o,!1,n).each(e=>{n.setEnd(e.container(),e.offset())}),o&&n.collapse(!0),sh(t,n)?P.none():P.some(n)},ph=(e,t)=>e.splitText(t),hh=e=>{let t=e.startContainer,o=e.startOffset,n=e.endContainer,r=e.endOffset;if(t===n&&aa(t)){if(o>0&&o<t.data.length)if(n=ph(t,o),t=n.previousSibling,r>o){r-=o;const e=ph(n,r).previousSibling;t=n=e,r=e.data.length,o=0}else r=0}else if(aa(t)&&o>0&&o<t.data.length&&(t=ph(t,o),o=0),aa(n)&&r>0&&r<n.data.length){const e=ph(n,r).previousSibling;n=e,r=e.data.length}return{startContainer:t,startOffset:o,endContainer:n,endOffset:r}},fh=e=>({walk:(t,o)=>up(e,t,o),split:hh,expand:(t,o={type:"word"})=>{if("word"===o.type){const o=mp(e,t,[{inline:"span"}],{includeTrailingSpace:!1,expandToBlock:!1}),n=e.createRng();return n.setStart(o.startContainer,o.startOffset),n.setEnd(o.endContainer,o.endOffset),n}return t},normalize:t=>gh(e,t).fold(L,e=>(t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0))});fh.compareRanges=sh,fh.getCaretRangeFromPoint=ah,fh.getSelectedNode=bl,fh.getNode=xl;const bh=e=>"textarea"===_o(e),xh=(e,t)=>{const o=(e=>{const t=e.dom.ownerDocument,o=t.body,n=t.defaultView,r=t.documentElement;if(o===e.dom)return Un(o.offsetLeft,o.offsetTop);const a=jn(null==n?void 0:n.pageYOffset,r.scrollTop),s=jn(null==n?void 0:n.pageXOffset,r.scrollLeft),i=jn(r.clientTop,o.clientTop),l=jn(r.clientLeft,o.clientLeft);return Wn(e).translate(s-l,a-i)})(e),n=(e=>Vn.get(e))(e);return{element:e,bottom:o.top+n,height:n,pos:o,cleanup:t}},vh=(e,t)=>{const o=((e,t)=>{const o=Vo(e);if(0===o.length||bh(e))return{element:e,offset:t};if(t<o.length&&!bh(o[t]))return{element:o[t],offset:0};{const n=o[o.length-1];return bh(n)?{element:e,offset:t}:"img"===_o(n)?{element:n,offset:1}:Oo(n)?{element:n,offset:Xn(n).length}:{element:n,offset:Vo(n).length}}})(e,t),n=mo.fromHtml('<span data-mce-bogus="all" style="display: inline-block;">\ufeff</span>');return sn(o.element,n),xh(n,()=>_n(n))},yh=(e,t,o,n)=>{kh(e,(r,a)=>_h(e,t,o,n),o)},wh=(e,t,o,n,r)=>{const a={elm:n.element.dom,alignToTop:r};if(((e,t)=>e.dispatch("ScrollIntoView",t).isDefaultPrevented())(e,a))return;o(e,t,$n(t).top,n,r),((e,t)=>{e.dispatch("AfterScrollIntoView",t)})(e,a)},_h=(e,t,o,n)=>{const r=mo.fromDom(e.getBody()),a=mo.fromDom(e.getDoc());r.dom.offsetWidth;const s=vh(mo.fromDom(o.startContainer),o.startOffset);wh(e,a,t,s,n),s.cleanup()},Ch=(e,t,o,n)=>{const r=mo.fromDom(e.getDoc());wh(e,r,o,(e=>xh(mo.fromDom(e),E))(t),n)},kh=(e,t,o)=>{const n=o.startContainer,r=o.startOffset,a=o.endContainer,s=o.endOffset;t(mo.fromDom(n),mo.fromDom(a));const i=e.dom.createRng();i.setStart(n,r),i.setEnd(a,s),e.selection.setRng(o)},Sh=(e,t,o,n,r)=>{const a=t.pos;if(n)qn(a.left,Math.max(0,a.top-30),r);else{const n=a.top-o+t.height+30;qn(-e.getBody().getBoundingClientRect().left,n,r)}},Eh=(e,t,o,n,r,a)=>{const s=n+o,i=r.pos.top,l=r.bottom,c=l-i>=n;if(i<o)Sh(e,r,n,!1!==a,t);else if(i>s){Sh(e,r,n,c?!1!==a:!0===a,t)}else l>s&&!c&&Sh(e,r,n,!0===a,t)},Oh=(e,t,o,n,r)=>{const a=No(t).dom.innerHeight;Eh(e,t,o,a,n,r)},Th=(e,t,o,n,r)=>{const a=No(t).dom.innerHeight;Eh(e,t,o,a,n,r);const s=Hp(n.element),i=Zr(window);s.top<i.y?Gn(n.element,!1!==r):s.top>i.bottom&&Gn(n.element,!0===r)},Ah=(e,t,o)=>yh(e,Oh,t,o),Dh=(e,t,o)=>Ch(e,t,Oh,o),Mh=(e,t,o)=>yh(e,Th,t,o),Rh=(e,t,o)=>Ch(e,t,Th,o),Nh=(e,t,o)=>{(e.inline?Ah:Mh)(e,t,o)},Bh=(e,t)=>t.collapsed?e.isEditable(t.startContainer):e.isEditable(t.startContainer)&&e.isEditable(t.endContainer),zh=(e,t,o,n,r)=>{const a=o?t.startContainer:t.endContainer,s=o?t.startOffset:t.endOffset;return P.from(a).map(mo.fromDom).map(e=>n&&t.collapsed?e:Zo(e,r(e,s)).getOr(e)).bind(e=>Eo(e)?P.some(e):Bo(e).filter(Eo)).map(e=>e.dom).getOr(e)},Hh=(e,t,o=!1)=>zh(e,t,!0,o,(e,t)=>Math.min(Wo(e),t)),Lh=(e,t,o=!1)=>zh(e,t,!1,o,(e,t)=>t>0?t-1:t),Ih=(e,t)=>{const o=e;for(;e&&aa(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||o},Ph=(e,t)=>$(t,t=>{const o=e.dispatch("GetSelectionRange",{range:t});return o.range!==t?o.range:t}),Fh={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Vh=(e,t,o)=>{const n=o?"lastChild":"firstChild",r=o?"prev":"next";if(e[n])return e[n];if(e!==t){let o=e[r];if(o)return o;for(let n=e.parent;n&&n!==t;n=n.parent)if(o=n[r],o)return o}},Zh=e=>{var t;const o=null!==(t=e.value)&&void 0!==t?t:"";if(!Wr(o))return!1;const n=e.parent;return!n||"span"===n.name&&!n.attr("style")||!/^[ ]+$/.test(o)},Uh=e=>{const t="a"===e.name&&!e.attr("href")&&e.attr("id");return e.attr("name")||e.attr("id")&&!e.firstChild||e.attr("data-mce-bookmark")||t};class jh{static create(e,t){const o=new jh(e,Fh[e]||1);return t&&be(t,(e,t)=>{o.attr(t,e)}),o}constructor(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}replace(e){const t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t}attr(e,t){const o=this;if(!p(e))return _(e)&&be(e,(e,t)=>{o.attr(t,e)}),o;const n=o.attributes;if(n){if(void 0!==t){if(null===t){if(e in n.map){delete n.map[e];let t=n.length;for(;t--;)if(n[t].name===e)return n.splice(t,1),o}return o}if(e in n.map){let o=n.length;for(;o--;)if(n[o].name===e){n[o].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,o}return n.map[e]}}clone(){const e=this,t=new jh(e.name,e.type),o=e.attributes;if(o){const e=[];e.map={};for(let t=0,n=o.length;t<n;t++){const n=o[t];"id"!==n.name&&(e[e.length]={name:n.name,value:n.value},e.map[n.name]=n.value)}t.attributes=e}return t.value=e.value,t}wrap(e){const t=this;return t.parent&&(t.parent.insert(e,t),e.append(t)),t}unwrap(){const e=this;for(let t=e.firstChild;t;){const o=t.next;e.insert(t,e,!0),t=o}e.remove()}remove(){const e=this,t=e.parent,o=e.next,n=e.prev;return t&&(t.firstChild===e?(t.firstChild=o,o&&(o.prev=null)):n&&(n.next=o),t.lastChild===e?(t.lastChild=n,n&&(n.next=null)):o&&(o.prev=n),e.parent=e.next=e.prev=null),e}append(e){const t=this;e.parent&&e.remove();const o=t.lastChild;return o?(o.next=e,e.prev=o,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e}insert(e,t,o){e.parent&&e.remove();const n=t.parent||this;return o?(t===n.firstChild?n.firstChild=e:t.prev&&(t.prev.next=e),e.prev=t.prev,e.next=t,t.prev=e):(t===n.lastChild?n.lastChild=e:t.next&&(t.next.prev=e),e.next=t.next,e.prev=t,t.next=e),e.parent=n,e}getAll(e){const t=this,o=[];for(let n=t.firstChild;n;n=Vh(n,t))n.name===e&&o.push(n);return o}children(){const e=[];for(let t=this.firstChild;t;t=t.next)e.push(t);return e}empty(){const e=this;if(e.firstChild){const t=[];for(let o=e.firstChild;o;o=Vh(o,e))t.push(o);let o=t.length;for(;o--;){const e=t[o];e.parent=e.firstChild=e.lastChild=e.next=e.prev=null}}return e.firstChild=e.lastChild=null,e}isEmpty(e,t={},o){var n;const r=this;let a=r.firstChild;if(Uh(r))return!1;if(a)do{if(1===a.type){if(a.attr("data-mce-bogus"))continue;if(e[a.name])return!1;if(Uh(a))return!1}if(8===a.type)return!1;if(3===a.type&&!Zh(a))return!1;if(3===a.type&&a.parent&&t[a.parent.name]&&Wr(null!==(n=a.value)&&void 0!==n?n:""))return!1;if(o&&o(a))return!1}while(a=Vh(a,r));return!0}walk(e){return Vh(this,null,e)}}const Wh=lo.makeMap("NOSCRIPT STYLE SCRIPT XMP IFRAME NOEMBED NOFRAMES PLAINTEXT"," "),$h=e=>p(e.nodeValue)&&e.nodeValue.includes(Ki),qh=e=>(0===e.length?"":`${$(e,e=>`[${e}]`).join(",")},`)+'[data-mce-bogus="all"]',Gh=e=>document.createTreeWalker(e,NodeFilter.SHOW_COMMENT,e=>$h(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP),Kh=e=>document.createTreeWalker(e,NodeFilter.SHOW_TEXT,e=>{if($h(e)){const t=e.parentNode;return t&&Ee(Wh,t.nodeName)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}return NodeFilter.FILTER_SKIP}),Yh=e=>null!==Gh(e).nextNode(),Xh=e=>null!==Kh(e).nextNode(),Jh=(e,t)=>null!==t.querySelector(qh(e)),Qh=(e,t)=>{q(((e,t)=>t.querySelectorAll(qh(e)))(e,t),t=>{const o=mo.fromDom(t);"all"===fn(o,"data-mce-bogus")?_n(o):q(e,e=>{xn(o,e)&&vn(o,e)})})},ef=e=>{let t=e.nextNode();for(;null!==t;)t.nodeValue=null,t=e.nextNode()},tf=O(ef,Gh),of=O(ef,Kh),nf=(e,t)=>{const o=[{condition:R(Jh,t),action:R(Qh,t)},{condition:Yh,action:tf},{condition:Xh,action:of}];let n=e,r=!1;return q(o,({condition:t,action:o})=>{t(n)&&(r||(n=e.cloneNode(!0),r=!0),o(n))}),n},rf=e=>{const t=wr(e,"[data-mce-bogus]");q(t,e=>{"all"===fn(e,"data-mce-bogus")?_n(e):Pi(e)?(sn(e,mo.fromText(lt)),_n(e)):Cn(e)})},af=e=>{const t=wr(e,"input");q(t,e=>{vn(e,"name")})},sf=(e,t)=>{const o=e.getDoc(),n=qo(mo.fromDom(e.getBody())),r=mo.fromTag("div",o);pn(r,"data-mce-bogus","all"),zn(r,{position:"fixed",left:"-9999999px",top:"0"}),Dn(r,t.innerHTML),rf(r),af(r);const a=(e=>$o(e)?e:mo.fromDom(Ro(e).dom.body))(n);dn(a,r);const s=Xi(r.dom.innerText);return _n(r),s},lf=(e,t,o)=>{let n;n="raw"===t.format?lo.trim(Xi(nf(o,e.serializer.getTempAttrs()).innerHTML)):"text"===t.format?sf(e,o):"tree"===t.format?e.serializer.serialize(o,t):((e,t)=>{const o=qc(e),n=new RegExp(`^(<${o}[^>]*>(&nbsp;|&#160;|\\s| |<br \\/>|)<\\/${o}>[\r\n]*|<br \\/>[\r\n]*)$`);return t.replace(n,"")})(e,e.serializer.serialize(o,t));return"text"!==t.format&&!Wi(mo.fromDom(o))&&p(n)?lo.trim(n):n},cf=lo.makeMap,df=e=>{const t=[],o=(e=e||{}).indent,n=cf(e.indent_before||""),r=cf(e.indent_after||""),a=ys.getEncodeFunc(e.entity_encoding||"raw",e.entities),s="xhtml"!==e.element_format;return{start:(e,i,l)=>{if(o&&n[e]&&t.length>0){const e=t[t.length-1];e.length>0&&"\n"!==e&&t.push("\n")}if(t.push("<",e),i)for(let e=0,o=i.length;e<o;e++){const o=i[e];t.push(" ",o.name,'="',a(o.value,!0),'"')}if(t[t.length]=!l||s?">":" />",l&&o&&r[e]&&t.length>0){const e=t[t.length-1];e.length>0&&"\n"!==e&&t.push("\n")}},end:e=>{let n;t.push("</",e,">"),o&&r[e]&&t.length>0&&(n=t[t.length-1],n.length>0&&"\n"!==n&&t.push("\n"))},text:(e,o)=>{e.length>0&&(t[t.length]=o?e:a(e))},cdata:e=>{t.push("<![CDATA[",e,"]]>")},comment:e=>{t.push("\x3c!--",e,"--\x3e")},pi:(e,n)=>{n?t.push("<?",e," ",a(n),"?>"):t.push("<?",e,"?>"),o&&t.push("\n")},doctype:e=>{t.push("<!DOCTYPE",e,">",o?"\n":"")},reset:()=>{t.length=0},getContent:()=>t.join("").replace(/\n$/,"")}},mf=(e={},t=Ps())=>{const o=df(e);e.validate=!("validate"in e)||e.validate;return{serialize:n=>{const r=e.validate,a={3:e=>{var t;o.text(null!==(t=e.value)&&void 0!==t?t:"",e.raw)},8:e=>{var t;o.comment(null!==(t=e.value)&&void 0!==t?t:"")},7:e=>{o.pi(e.name,e.value)},10:e=>{var t;o.doctype(null!==(t=e.value)&&void 0!==t?t:"")},4:e=>{var t;o.cdata(null!==(t=e.value)&&void 0!==t?t:"")},11:e=>{let t=e;if(t=t.firstChild)do{s(t)}while(t=t.next)}};o.reset();const s=e=>{var n;const i=a[e.type];if(i)i(e);else{const a=e.name,i=a in t.getVoidElements();let l=e.attributes;if(r&&l&&l.length>1){const o=[];o.map={};const n=t.getElementRule(e.name);if(n){for(let e=0,t=n.attributesOrder.length;e<t;e++){const t=n.attributesOrder[e];if(t in l.map){const e=l.map[t];o.map[t]=e,o.push({name:t,value:e})}}for(let e=0,t=l.length;e<t;e++){const t=l[e].name;if(!(t in o.map)){const e=l.map[t];o.map[t]=e,o.push({name:t,value:e})}}l=o}}if(o.start(a,l,i),Na(a))p(e.value)&&o.text(e.value,!0),o.end(a);else if(!i){let t=e.firstChild;if(t){"pre"!==a&&"textarea"!==a||3!==t.type||"\n"!==(null===(n=t.value)||void 0===n?void 0:n[0])||o.text("\n",!0);do{s(t)}while(t=t.next)}o.end(a)}}};return 1!==n.type||e.inner?3===n.type?a[3](n):a[11](n):s(n),o.getContent()}}},uf=new Set;q(["margin","margin-left","margin-right","margin-top","margin-bottom","padding","padding-left","padding-right","padding-top","padding-bottom","border","border-width","border-style","border-color","background","background-attachment","background-clip","background-image","background-origin","background-position","background-repeat","background-size","float","position","left","right","top","bottom","z-index","display","transform","width","max-width","min-width","height","max-height","min-height","overflow","overflow-x","overflow-y","text-overflow","vertical-align","transition","transition-delay","transition-duration","transition-property","transition-timing-function"],e=>{uf.add(e)});const gf=new Set;q(["background-color"],e=>{gf.add(e)});const pf=["font","text-decoration","text-emphasis"],hf=(e,t)=>he(((e,t)=>e.parseStyle(e.getAttrib(t,"style")))(e,t)),ff=(e,t)=>W(hf(e,t),e=>(e=>uf.has(e))(e)),bf=(e,t)=>ff(e,t)&&W(hf(e,t),e=>(e=>gf.has(e))(e)),xf=(e,t,o)=>{const n=hf(e,t),r=hf(e,o),a=n=>{var r,a;const s=null!==(r=e.getStyle(t,n))&&void 0!==r?r:"",i=null!==(a=e.getStyle(o,n))&&void 0!==a?a:"";return ot(s)&&ot(i)&&s!==i};return W(n,e=>{const t=t=>W(t,t=>t===e);if(!t(r)&&t(pf)){const e=Y(r,e=>W(pf,t=>Ye(e,t)));return W(e,a)}return a(e)})},vf=(e,t,o)=>P.from(o.container()).filter(aa).exists(n=>{const r=e?0:-1;return t(n.data.charAt(o.offset()+r))}),yf=R(vf,!0,gg),wf=R(vf,!1,gg),_f=e=>{const t=e.container();return aa(t)&&(0===t.data.length||Yi(t.data)&&wp.isBookmarkNode(t.parentNode))},Cf=(e,t)=>o=>pu(e?0:-1,o).filter(t).isSome(),kf=e=>ua(e)&&"block"===Hn(mo.fromDom(e),"display"),Sf=e=>ha(e)&&!(e=>Yr(e)&&"all"===e.getAttribute("data-mce-bogus"))(e),Ef=Cf(!0,kf),Of=Cf(!1,kf),Tf=Cf(!0,va),Af=Cf(!1,va),Df=Cf(!0,oa),Mf=Cf(!1,oa),Rf=Cf(!0,Sf),Nf=Cf(!1,Sf),Bf=(e,t)=>((e,t,o)=>yo(t,e)?Ho(e,e=>o(e)||vo(e,t)).slice(0,-1):[])(e,t,L),zf=(e,t)=>[e].concat(Bf(e,t)),Hf=(e,t,o)=>Uu(e,t,o,_f),Lf=(e,t,o)=>ee(zf(mo.fromDom(t.container()),e),(e=>t=>e.isBlock(_o(t)))(o)),If=(e,t,o,n)=>Hf(e,t.dom,o).forall(e=>Lf(t,o,n).fold(()=>!gu(e,o,t.dom),n=>!gu(e,o,t.dom)&&yo(n,mo.fromDom(e.container())))),Pf=(e,t,o,n)=>Lf(t,o,n).fold(()=>Hf(e,t.dom,o).forall(e=>!gu(e,o,t.dom)),t=>Hf(e,t.dom,o).isNone()),Ff=R(Pf,!1),Vf=R(Pf,!0),Zf=R(If,!1),Uf=R(If,!0),jf=e=>Cu(e).exists(Pi),Wf=(e,t,o,n)=>{const r=Y(zf(mo.fromDom(o.container()),t),e=>n.isBlock(_o(e))),a=de(r).getOr(t);return Vu(e,a.dom,o).filter(jf)},$f=(e,t,o)=>Cu(t).exists(Pi)||Wf(!0,e,t,o).isSome(),qf=(e,t,o)=>(e=>P.from(e.getNode(!0)).map(mo.fromDom))(t).exists(Pi)||Wf(!1,e,t,o).isSome(),Gf=R(Wf,!1),Kf=R(Wf,!0),Yf=e=>Yl.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd(),Xf=(e,t,o)=>{const n=Y(zf(mo.fromDom(t.container()),e),e=>o.isBlock(_o(e)));return de(n).getOr(e)},Jf=(e,t,o)=>Yf(t)?wf(t):wf(t)||$u(Xf(e,t,o).dom,t).exists(wf),Qf=(e,t,o)=>Yf(t)?yf(t):yf(t)||Wu(Xf(e,t,o).dom,t).exists(yf),eb=e=>Cu(e).bind(e=>or(e,Eo)).exists(e=>(e=>j(["pre","pre-wrap"],e))(Hn(e,"white-space"))),tb=(e,t,o)=>((e,t)=>$u(e.dom,t).isNone())(e,t)||((e,t)=>Wu(e.dom,t).isNone())(e,t)||Ff(e,t,o)||Vf(e,t,o)||qf(e,t,o)||$f(e,t,o),ob=(e,t)=>o=>{return n=new Ur(o,e)[t](),_(n)&&ha(n)&&ou(n);var n},nb=(e,t,o)=>!eb(t)&&(tb(e,t,o)||Jf(e,t,o)||Qf(e,t,o)),rb=(e,t,o)=>!eb(t)&&(Ff(e,t,o)||Zf(e,t,o)||qf(e,t,o)||Jf(e,t,o)||((e,t)=>{const o=$u(e.dom,t).getOr(t),n=ob(e.dom,"prev");return t.isAtStart()&&(n(t.container())||n(o.container()))})(e,t)),ab=(e,t,o)=>!eb(t)&&(Vf(e,t,o)||Uf(e,t,o)||$f(e,t,o)||Qf(e,t,o)||((e,t)=>{const o=Wu(e.dom,t).getOr(t),n=ob(e.dom,"next");return t.isAtEnd()&&(n(t.container())||n(o.container()))})(e,t)),sb=(e,t,o)=>rb(e,t,o)||ab(e,(e=>{const t=e.container(),o=e.offset();return aa(t)&&o<t.data.length?Yl(t,o+1):e})(t),o),ib=(e,t)=>mg(e.charAt(t)),lb=(e,t)=>gg(e.charAt(t)),cb=(e,t,o,n)=>{const r=t.data,a=Yl(t,0);return o||!ib(r,0)||sb(e,a,n)?!!(o&&lb(r,0)&&rb(e,a,n))&&(t.data=ct+r.slice(1),!0):(t.data=" "+r.slice(1),!0)},db=e=>{const t=e.data,o=(e=>{const t=e.split("");return $(t,(e,o)=>mg(e)&&o>0&&o<t.length-1&&pg(t[o-1])&&pg(t[o+1])?" ":e).join("")})(t);return o!==t&&(e.data=o,!0)},mb=(e,t,o,n)=>{const r=t.data,a=Yl(t,r.length-1);return o||!ib(r,r.length-1)||sb(e,a,n)?!!(o&&lb(r,r.length-1)&&ab(e,a,n))&&(t.data=r.slice(0,-1)+ct,!0):(t.data=r.slice(0,-1)+" ",!0)},ub=(e,t,o)=>{const n=t.container();if(!aa(n))return P.none();if((e=>{const t=e.container();return aa(t)&&Ke(t.data,ct)})(t)){const r=cb(e,n,!1,o)||db(n)||mb(e,n,!1,o);return Ue(r,t)}if(sb(e,t,o)){const r=cb(e,n,!0,o)||mb(e,n,!0,o);return Ue(r,t)}return P.none()},gb=(e,t,o,n)=>{if(0===o)return;const r=mo.fromDom(e),a=tr(r,e=>n.isBlock(_o(e))).getOr(r),s=e.data.slice(t,t+o),i=t+o>=e.data.length&&ab(a,Yl(e,e.data.length),n),l=0===t&&rb(a,Yl(e,0),n);e.replaceData(t,o,qr(s,4,l,i))},pb=(e,t,o)=>{const n=e.data.slice(t),r=n.length-et(n).length;gb(e,t,r,o)},hb=(e,t,o)=>{const n=e.data.slice(0,t),r=n.length-tt(n).length;gb(e,t-r,r,o)},fb=(e,t,o,n,r=!0)=>{const a=tt(e.data).length,s=r?e:t,i=r?t:e;return r?s.appendData(i.data):s.insertData(0,i.data),_n(mo.fromDom(i)),n&&pb(s,a,o),s},bb=(e,t)=>((e,t)=>{const o=e.container(),n=e.offset();return!Yl.isTextPosition(e)&&o===t.parentNode&&n>Yl.before(t).offset()})(t,e)?Yl(t.container(),t.offset()-1):t,xb=e=>{return Al(e.previousSibling)?P.some((t=e.previousSibling,aa(t)?Yl(t,t.data.length):Yl.after(t))):e.previousSibling?Gu(e.previousSibling):P.none();var t},vb=e=>{return Al(e.nextSibling)?P.some((t=e.nextSibling,aa(t)?Yl(t,0):Yl.before(t))):e.nextSibling?qu(e.nextSibling):P.none();var t},yb=(e,t)=>xb(t).orThunk(()=>vb(t)).orThunk(()=>((e,t)=>P.from(t.previousSibling?t.previousSibling:t.parentNode).bind(t=>$u(e,Yl.before(t))).orThunk(()=>Wu(e,Yl.after(t))))(e,t)),wb=(e,t)=>vb(t).orThunk(()=>xb(t)).orThunk(()=>((e,t)=>Wu(e,Yl.after(t)).orThunk(()=>$u(e,Yl.before(t))))(e,t)),_b=(e,t,o)=>((e,t,o)=>e?wb(t,o):yb(t,o))(e,t,o).map(R(bb,o)),Cb=(e,t,o)=>{o.fold(()=>{e.focus()},o=>{e.selection.setRng(o.toRange(),t)})},kb=(e,t)=>t&&Ee(e.schema.getBlockElements(),_o(t)),Sb=(e,t,o,n)=>{const r=Lo(e).filter(Oo),a=Io(e).filter(Oo);return _n(e),(s=r,i=a,l=t,c=(e,t,r)=>{const a=e.dom,s=t.dom,i=a.data.length;return fb(a,s,o,n),r.container()===s?Yl(a,i):r},s.isSome()&&i.isSome()&&l.isSome()?P.some(c(s.getOrDie(),i.getOrDie(),l.getOrDie())):P.none()).orThunk(()=>(n&&(r.each(e=>hb(e.dom,e.dom.length,o)),a.each(e=>pb(e.dom,0,o))),t));var s,i,l,c},Eb=(e,t,o,n=!0,r=!1)=>{const a=_b(t,e.getBody(),o.dom),s=tr(o,R(kb,e),(i=e.getBody(),e=>e.dom===i));var i;const l=Sb(o,a,e.schema,((e,t)=>Ee(e.schema.getTextInlineElements(),_o(t)))(e,o));e.dom.isEmpty(e.getBody())?(e.setContent(""),e.selection.setCursorLocation()):s.bind(t=>((e,t,o)=>{if(Da(e,t)){const e=mo.fromHtml('<br data-mce-bogus="1">');return o?q(Vo(t),e=>{Kg(e)||_n(e)}):wn(t),dn(t,e),P.some(Yl.before(e.dom))}return P.none()})(e.schema,t,r)).fold(()=>{n&&Cb(e,t,l)},o=>{n&&Cb(e,t,P.some(o))})},Ob=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,Tb=(e,t)=>bo(mo.fromDom(t),vd(e))&&!Ga(e.schema,t)&&e.dom.isEditable(t),Ab=e=>{var t;return"rtl"===fi.DOM.getStyle(e,"direction",!0)||(e=>Ob.test(e))(null!==(t=e.textContent)&&void 0!==t?t:"")},Db=(e,t,o)=>{const n=((e,t,o)=>Y(fi.DOM.getParents(o.container(),"*",t),e))(e,t,o);return P.from(n[n.length-1])},Mb=(e,t)=>{const o=t.container(),n=t.offset();return e?tl(o)?aa(o.nextSibling)?Yl(o.nextSibling,0):Yl.after(o):rl(t)?Yl(o,n+1):t:tl(o)?aa(o.previousSibling)?Yl(o.previousSibling,o.previousSibling.data.length):Yl.before(o):al(t)?Yl(o,n-1):t},Rb=R(Mb,!0),Nb=R(Mb,!1),Bb=(e,t)=>{const o=e=>e.stopImmediatePropagation();e.on("beforeinput input",o,!0),e.getDoc().execCommand(t),e.off("beforeinput input",o)},zb=e=>Bb(e,"Delete"),Hb=e=>Bb(e,"ForwardDelete"),Lb=e=>Fi(e)||Zi(e),Ib=(e,t)=>yo(e,t)?or(t,Lb,(e=>t=>Fe(Bo(t),e,vo))(e)):P.none(),Pb=(e,t=!0)=>{e.dom.isEmpty(e.getBody())&&e.setContent("",{no_selection:!t})},Fb=(e,t,o)=>Ze(qu(o),Gu(o),(n,r)=>{const a=Mb(!0,n),s=Mb(!1,r),i=Mb(!1,t);return e?Wu(o,i).exists(e=>e.isEqual(s)&&t.isEqual(a)):$u(o,i).exists(e=>e.isEqual(a)&&t.isEqual(s))}).getOr(!0),Vb=e=>{var t;return(8===Co(t=e)||"#comment"===_o(t)?Lo(e):jo(e)).bind(Vb).orThunk(()=>P.some(e))},Zb=(e,t,o,n=!0)=>{var r;t.deleteContents();const a=Vb(o).getOr(o),s=mo.fromDom(null!==(r=e.dom.getParent(a.dom,e.dom.isBlock))&&void 0!==r?r:o.dom);if(s.dom===e.getBody()?Pb(e,n):Da(e.schema,s,{checkRootAsContent:!1})&&(Gi(s),n&&e.selection.setCursorLocation(s.dom,0)),!vo(o,s)){const t=Fe(Bo(s),o)?[]:Bo(i=s).map(Vo).map(e=>Y(e,e=>!vo(i,e))).getOr([]);q(t.concat(Vo(o)),t=>{vo(t,s)||yo(t,s)||!Da(e.schema,t)||_n(t)})}var i},Ub=e=>wr(e,"td,th"),jb=(e,t)=>vg(mo.fromDom(e),t),Wb=e=>(e=>Ze(e.startTable,e.endTable,(t,o)=>{const n=kr(t,e=>vo(e,o)),r=kr(o,e=>vo(e,t));return n||r?{...e,startTable:n?P.none():e.startTable,endTable:r?P.none():e.endTable,isSameTable:!1,isMultiTable:!1}:e}).getOr(e))(e),$b=(e,t)=>({start:e,end:t}),qb=Te([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),Gb=(e,t)=>ir(mo.fromDom(e),"td,th",t),Kb=e=>!vo(e.start,e.end),Yb=(e,t)=>vg(e.start,t).bind(o=>vg(e.end,t).bind(e=>Ue(vo(o,e),o))),Xb=e=>t=>Yb(t,e).map(e=>((e,t,o)=>({rng:e,table:t,cells:o}))(t,e,Ub(e))),Jb=(e,t,o,n)=>{if(o.collapsed||!e.forall(Kb))return P.none();if(t.isSameTable){const t=e.bind(Xb(n));return P.some({start:t,end:t})}{const e=Gb(o.startContainer,n),t=Gb(o.endContainer,n),r=e.bind((e=>t=>vg(t,e).bind(e=>me(Ub(e)).map(e=>$b(t,e))))(n)).bind(Xb(n)),a=t.bind((e=>t=>vg(t,e).bind(e=>de(Ub(e)).map(e=>$b(e,t))))(n)).bind(Xb(n));return P.some({start:r,end:a})}},Qb=(e,t)=>te(e,e=>vo(e,t)),ex=e=>Ze(Qb(e.cells,e.rng.start),Qb(e.cells,e.rng.end),(t,o)=>e.cells.slice(t,o+1)),tx=(e,t,o)=>e.exists(e=>((e,t)=>!Kb(e)&&Yb(e,t).exists(e=>{const t=e.dom.rows;return 1===t.length&&1===t[0].cells.length}))(e,o)&&_g(e.start,t)),ox=(e,t)=>{const{startTable:o,endTable:n}=t,r=e.cloneRange();return o.each(e=>r.setStartAfter(e.dom)),n.each(e=>r.setEndBefore(e.dom)),r},nx=(e,t)=>{const o=(e=>t=>vo(e,t))(e),n=((e,t)=>{const o=Gb(e.startContainer,t),n=Gb(e.endContainer,t);return Ze(o,n,$b)})(t,o),r=((e,t)=>{const o=jb(e.startContainer,t),n=jb(e.endContainer,t),r=o.isSome(),a=n.isSome(),s=Ze(o,n,vo).getOr(!1);return Wb({startTable:o,endTable:n,isStartInTable:r,isEndInTable:a,isSameTable:s,isMultiTable:!s&&r&&a})})(t,o);return tx(n,t,o)?n.map(e=>qb.singleCellTable(t,e.start)):r.isMultiTable?((e,t,o,n)=>Jb(e,t,o,n).bind(({start:e,end:n})=>{const r=e.bind(ex).getOr([]),a=n.bind(ex).getOr([]);if(r.length>0&&a.length>0){const e=ox(o,t);return P.some(qb.multiTable(r,a,e))}return P.none()}))(n,r,t,o):((e,t,o,n)=>Jb(e,t,o,n).bind(({start:e,end:t})=>e.or(t)).bind(e=>{const{isSameTable:n}=t,r=ex(e).getOr([]);if(n&&e.cells.length===r.length)return P.some(qb.fullTable(e.table));if(r.length>0){if(n)return P.some(qb.partialTable(r,P.none()));{const e=ox(o,t);return P.some(qb.partialTable(r,P.some({...t,rng:e})))}}return P.none()}))(n,r,t,o)},rx=e=>q(e,e=>{vn(e,"contenteditable"),Gi(e)}),ax=(e,t,o,n)=>{const r=o.cloneRange();n?(r.setStart(o.startContainer,o.startOffset),r.setEndAfter(t.dom.lastChild)):(r.setStartBefore(t.dom.firstChild),r.setEnd(o.endContainer,o.endOffset)),cx(e,r,t,!1).each(e=>e())},sx=e=>{const t=xg(e),o=mo.fromDom(e.selection.getNode());ba(o.dom)&&Da(e.schema,o)?e.selection.setCursorLocation(o.dom,0):e.selection.collapse(!0),t.length>1&&W(t,e=>vo(e,o))&&pn(o,"data-mce-selected","1")},ix=(e,t,o)=>P.some(()=>{const n=e.selection.getRng(),r=o.bind(({rng:o,isStartInTable:r})=>{const a=((e,t)=>P.from(e.dom.getParent(t,e.dom.isBlock)).map(mo.fromDom))(e,r?o.endContainer:o.startContainer);o.deleteContents(),((e,t,o)=>{o.each(o=>{t?_n(o):(Gi(o),e.selection.setCursorLocation(o.dom,0))})})(e,r,a.filter(R(Da,e.schema)));const s=r?t[0]:t[t.length-1];return ax(e,s,n,r),Da(e.schema,s)?P.none():P.some(r?t.slice(1):t.slice(0,-1))}).getOr(t);rx(r),sx(e)}),lx=(e,t,o,n)=>P.some(()=>{const r=e.selection.getRng(),a=t[0],s=o[o.length-1];ax(e,a,r,!0),ax(e,s,r,!1);const i=Da(e.schema,a)?t:t.slice(1),l=Da(e.schema,s)?o:o.slice(0,-1);rx(i.concat(l)),n.deleteContents(),sx(e)}),cx=(e,t,o,n=!0)=>P.some(()=>{Zb(e,t,o,n)}),dx=(e,t)=>P.some(()=>Eb(e,!1,t)),mx=(e,t,o,n)=>gx(t,n).fold(()=>((e,t,o)=>nx(t,o).bind(t=>t.fold(R(cx,e),R(dx,e),R(ix,e),R(lx,e))))(e,t,o),t=>((e,t)=>px(e,t))(e,t)),ux=(e,t)=>ee(zf(t,e),ji),gx=(e,t)=>ee(zf(t,e),Do("caption")),px=(e,t)=>P.some(()=>{Gi(t),e.selection.setCursorLocation(t.dom,0)}),hx=(e,t,o,n,r)=>Zu(o,e.getBody(),r).fold(()=>P.some(E),a=>((e,t,o,n)=>qu(e.dom).bind(r=>Gu(e.dom).map(e=>t?o.isEqual(r)&&n.isEqual(e):o.isEqual(e)&&n.isEqual(r))).getOr(!0))(n,o,r,a)?((e,t)=>px(e,t))(e,n):((e,t,o)=>gx(e,mo.fromDom(o.getNode())).fold(()=>P.some(E),e=>Ue(!vo(e,t),E)))(t,n,a)),fx=(e,t,o,n)=>{const r=Yl.fromRangeStart(e.selection.getRng());return ux(o,n).bind(n=>Da(e.schema,n,{checkRootAsContent:!1})?px(e,n):((e,t,o,n,r)=>Zu(o,e.getBody(),r).bind(e=>ux(t,mo.fromDom(e.getNode())).bind(e=>vo(e,n)?P.none():P.some(E))))(e,o,t,n,r))},bx=(e,t)=>e?Df(t):Mf(t),xx=(e,t,o)=>{const n=mo.fromDom(e.getBody());return gx(n,o).fold(()=>fx(e,t,n,o).orThunk(()=>Ue(((e,t)=>{const o=Yl.fromRangeStart(e.selection.getRng());return bx(t,o)||Vu(t,e.getBody(),o).exists(e=>bx(t,e))})(e,t),E)),o=>((e,t,o,n)=>{const r=Yl.fromRangeStart(e.selection.getRng());return Da(e.schema,n)?px(e,n):hx(e,o,t,n,r)})(e,t,n,o))},vx=(e,t)=>{const o=mo.fromDom(e.selection.getStart(!0)),n=xg(e);return e.selection.isCollapsed()&&0===n.length?xx(e,t,o):((e,t,o)=>{const n=mo.fromDom(e.getBody()),r=e.selection.getRng();return 0!==o.length?ix(e,o,P.none()):mx(e,n,r,t)})(e,o,n)},yx=(e,t)=>{let o=t;for(;o&&o!==e;){if(pa(o)||ha(o))return o;o=o.parentNode}return null},wx=["data-ephox-","data-mce-","data-alloy-","data-snooker-","_"],_x=lo.each,Cx=e=>{const t=e.dom,o=new Set(e.serializer.getTempAttrs()),n=e=>W(wx,t=>Ye(e,t))||o.has(e);return{compare:(e,o)=>{if(e.nodeName!==o.nodeName||e.nodeType!==o.nodeType)return!1;const r=e=>{const o={};return _x(t.getAttribs(e),r=>{const a=r.nodeName.toLowerCase();"style"===a||n(a)||(o[a]=t.getAttrib(e,a))}),o},a=(e,t)=>{for(const o in e)if(Ee(e,o)){const n=t[o];if(y(n))return!1;if(e[o]!==n)return!1;delete t[o]}for(const e in t)if(Ee(t,e))return!1;return!0};if(Yr(e)&&Yr(o)){if(!a(r(e),r(o)))return!1;if(!a(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(o,"style"))))return!1}return!dg(e)&&!dg(o)},isAttributeInternal:n}},kx=e=>["h1","h2","h3","h4","h5","h6"].includes(e.name),Sx=(e,t,o,n)=>{const r=o.name;for(let t=0,a=e.length;t<a;t++){const a=e[t];if(a.name===r){const e=n.nodes[r];e?e.nodes.push(o):n.nodes[r]={filter:a,nodes:[o]}}}if(o.attributes)for(let e=0,r=t.length;e<r;e++){const r=t[e],a=r.name;if(a in o.attributes.map){const e=n.attributes[a];e?e.nodes.push(o):n.attributes[a]={filter:r,nodes:[o]}}}},Ex=(e,t)=>{const o=(e,o)=>{be(e,e=>{const n=ue(e.nodes);q(e.filter.callbacks,r=>{for(let t=n.length-1;t>=0;t--){const r=n[t];(o?void 0!==r.attr(e.filter.name):r.name===e.filter.name)&&!w(r.parent)||n.splice(t,1)}n.length>0&&r(n,e.filter.name,t)})})};o(e.nodes,!1),o(e.attributes,!0)},Ox=(e,t,o,n={})=>{const r=((e,t,o)=>{const n={nodes:{},attributes:{}};return o.firstChild&&((e,t)=>{let o=e;for(;o=o.walk();)t(o)})(o,o=>{Sx(e,t,o,n)}),n})(e,t,o);Ex(r,n)},Tx=(e,t,o,n)=>{if((e.pad_empty_with_br||t.insert)&&o(n)){const e=new jh("br",1);t.insert&&e.attr("data-mce-bogus","1"),n.empty().append(e)}else n.empty().append(new jh("#text",3)).value=ct},Ax=(e,t)=>{const o=null==e?void 0:e.firstChild;return _(o)&&o===e.lastChild&&o.name===t},Dx=(e,t,o,n)=>n.isEmpty(t,o,t=>((e,t)=>{const o=e.getElementRule(t.name);return!0===(null==o?void 0:o.paddEmpty)})(e,t)),Mx=e=>{let t;for(let o=e;o;o=o.parent){const e=o.attr("contenteditable");if("false"===e)break;"true"===e&&(t=o)}return P.from(t)},Rx=(e,t,o=e.parent)=>{if(t.getSpecialElements()[e.name])e.empty().remove();else{const n=e.children();for(const e of n)o&&!t.isValidChild(o.name,e.name)&&Rx(e,t,o);e.unwrap()}},Nx=(e,t,o,n=E)=>{const r=t.getTextBlockElements(),a=t.getNonEmptyElements(),s=t.getWhitespaceElements(),i=lo.makeMap("tr,td,th,tbody,thead,tfoot,table,summary"),l=new Set,c=e=>e!==o&&!i[e.name];for(let o=0;o<e.length;o++){const i=e[o];let d,m,u;if(!i.parent||l.has(i))continue;if(r[i.name]&&"li"===i.parent.name){let e=i.next;for(;e&&r[e.name];)e.name="li",l.add(e),i.parent.insert(e,i.parent),e=e.next;i.unwrap();continue}const g=[i];for(d=i.parent;d&&!t.isValidChild(d.name,i.name)&&c(d);d=d.parent)g.push(d);if(d&&g.length>1)if(Bx(t,i,d))Rx(i,t);else{g.reverse(),m=g[0].clone(),n(m);let e=m;for(let o=0;o<g.length-1;o++){t.isValidChild(e.name,g[o].name)&&o>0?(u=g[o].clone(),n(u),e.append(u)):u=e;for(let e=g[o].firstChild;e&&e!==g[o+1];){const t=e.next;u.append(e),e=t}e=u}Dx(t,a,s,m)?d.insert(i,g[0],!0):(d.insert(m,g[0],!0),d.insert(i,m)),d=g[0],(Dx(t,a,s,d)||Ax(d,"br"))&&d.empty().remove()}else if(i.parent){if("li"===i.name){let e=i.prev;if(e&&("ul"===e.name||"ol"===e.name)){e.append(i);continue}if(e=i.next,e&&("ul"===e.name||"ol"===e.name)&&e.firstChild){e.insert(i,e.firstChild,!0);continue}const t=new jh("ul",1);n(t),i.wrap(t);continue}if(t.isValidChild(i.parent.name,"div")&&t.isValidChild("div",i.name)){const e=new jh("div",1);n(e),i.wrap(e)}else Rx(i,t)}}},Bx=(e,t,o=t.parent)=>!!o&&(!(!e.children[t.name]||e.isValidChild(o.name,t.name))||(!("a"!==t.name||!((e,t)=>{let o=e;for(;o;){if(o.name===t)return!0;o=o.parent}return!1})(o,"a"))||!(!(e=>"summary"===e.name)(o)||!kx(t))&&!((null==o?void 0:o.firstChild)===t&&(null==o?void 0:o.lastChild)===t))),zx=e=>{const t=Yl.fromRangeStart(e),o=Yl.fromRangeEnd(e),n=e.commonAncestorContainer;return Vu(!1,n,o).map(r=>!gu(t,o,n)&&gu(t,r,n)?((e,t,o,n)=>{const r=document.createRange();return r.setStart(e,t),r.setEnd(o,n),r})(t.container(),t.offset(),r.container(),r.offset()):e).getOr(e)},Hx=e=>e.collapsed?e:zx(e),Lx=(e,t)=>e.getBlockElements()[t.name]&&(e=>_(e.firstChild)&&e.firstChild===e.lastChild)(t)&&(e=>"br"===e.name||e.value===ct)(t.firstChild),Ix=(e,t)=>{let o=t.firstChild,n=t.lastChild;return o&&"meta"===o.name&&(o=o.next),n&&"mce_marker"===n.attr("id")&&(n=n.prev),((e,t)=>{const o=e.getNonEmptyElements();return _(t)&&(t.isEmpty(o)||Lx(e,t))})(e,n)&&(n=null==n?void 0:n.prev),!(!o||o!==n)&&("ul"===o.name||"ol"===o.name)},Px=e=>_(null==e?void 0:e.firstChild)&&e.firstChild===e.lastChild&&(e=>e.data===ct||ma(e))(e.firstChild),Fx=e=>{return e.length>0&&(!(t=e[e.length-1]).firstChild||Px(t))?e.slice(0,-1):e;var t},Vx=(e,t)=>{const o=e.getParent(t,e.isBlock);return o&&"LI"===o.nodeName?o:null},Zx=(e,t)=>{const o=Yl.after(e),n=Hu(t).prev(o);return n?n.toRange():null},Ux=(e,t,o)=>{const n=e.parentNode;return n&&lo.each(t,t=>{n.insertBefore(t,e)}),((e,t)=>{const o=Yl.before(e),n=Hu(t).next(o);return n?n.toRange():null})(e,o)},jx=(e,t,o,n)=>{const r=((e,t,o)=>{const n=t.serialize(o);return(e=>{var t,o;const n=e.firstChild,r=e.lastChild;return n&&"META"===n.nodeName&&(null===(t=n.parentNode)||void 0===t||t.removeChild(n)),r&&"mce_marker"===r.id&&(null===(o=r.parentNode)||void 0===o||o.removeChild(r)),e})(e.createFragment(n))})(t,e,n),a=Vx(t,o.startContainer),s=Fx((i=r.firstChild,Y(null!==(l=null==i?void 0:i.childNodes)&&void 0!==l?l:[],e=>"LI"===e.nodeName)));var i,l;const c=t.getRoot(),d=e=>{const n=Yl.fromRangeStart(o),r=Hu(t.getRoot()),s=1===e?r.prev(n):r.next(n),i=null==s?void 0:s.getNode();return!i||Vx(t,i)!==a};return a?d(1)?Ux(a,s,c):d(2)?((e,t,o,n)=>(n.insertAfter(t.reverse(),e),Zx(t[0],o)))(a,s,c,t):((e,t,o,n)=>{const r=((e,t)=>{const o=t.cloneRange(),n=t.cloneRange();return o.setStartBefore(e),n.setEndAfter(e),[o.cloneContents(),n.cloneContents()]})(e,n),a=e.parentNode;return a&&(a.insertBefore(r[0],e),lo.each(t,t=>{a.insertBefore(t,e)}),a.insertBefore(r[1],e),a.removeChild(e)),Zx(t[t.length-1],o)})(a,s,c,o):null},Wx=["pre"],$x=ba,qx=(e,t,o)=>{var n;"all"===o.getAttribute("data-mce-bogus")?null===(n=o.parentNode)||void 0===n||n.insertBefore(e.dom.createFragment(t),o):((e,t)=>{if(e.isBlock(t)&&e.isEditable(t)){const e=t.childNodes;return 1===e.length&&ma(e[0])||0===e.length}return!1})(e.dom,o)?e.dom.setHTML(o,t):e.selection.setContent(t,{no_events:!0})},Gx=(e,t,o)=>{P.from(e.getParent(t,"td,th")).map(mo.fromDom).each(e=>((e,t)=>{jo(e).each(o=>{Lo(o).each(n=>{t.isBlock(_o(e))&&Pi(o)&&t.isBlock(_o(n))&&_n(o)})})})(e,o))},Kx=(e,t)=>{var o,n,r;let a;const s=e.dom,i=e.selection;if(!t)return;i.scrollIntoView(t);const l=yx(e.getBody(),t);if(l&&"false"===s.getContentEditable(l))return s.remove(t),void i.select(l);let c=s.createRng();const d=t.previousSibling;if(aa(d)){c.setStart(d,null!==(n=null===(o=d.nodeValue)||void 0===o?void 0:o.length)&&void 0!==n?n:0);const e=t.nextSibling;aa(e)&&(d.appendData(e.data),null===(r=e.parentNode)||void 0===r||r.removeChild(e))}else c.setStartBefore(t),c.setEndBefore(t);const m=s.getParent(t,s.isBlock);if(s.remove(t),m&&s.isEmpty(m)){const t=$x(m);wn(mo.fromDom(m)),c.setStart(m,0),c.setEnd(m,0),t||(e=>!!e.getAttribute("data-mce-fragment"))(m)||!(a=(t=>{let o=Yl.fromRangeStart(t);return o=Hu(e.getBody()).next(o),null==o?void 0:o.toRange()})(c))?s.add(m,s.create("br",t?{}:{"data-mce-bogus":"1"})):(c=a,s.remove(m))}i.setRng(c)},Yx=e=>{const t=e.dom,o=Hx(e.selection.getRng());e.selection.setRng(o);const n=t.getParent(o.startContainer,$x);((e,t,o)=>{if(_(o))return o===e.getParent(t.endContainer,$x)&&_g(mo.fromDom(o),t);return!1})(t,o,n)?cx(e,o,mo.fromDom(n)):Jx(o)||Xx(o)?o.deleteContents():e.getDoc().execCommand("Delete",!1)},Xx=e=>Qx(e,aa),Jx=e=>Qx(e,ga),Qx=(e,t)=>e.startContainer===e.endContainer&&e.endOffset-e.startOffset===1&&t(e.startContainer.childNodes[e.startOffset]),ev=(e,t,o)=>{var n,r;const a=e.selection,s=e.dom,i=e.parser,l=o.merge,c=mf({validate:!0},e.schema),d='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;</span>';o.preserve_zwsp||(t=Xi(t)),-1===t.indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,d);let m=a.getRng();const u=m.startContainer,g=e.getBody();u===g&&a.isCollapsed()&&s.isBlock(g.firstChild)&&((e,t)=>_(t)&&!e.schema.getVoidElements()[t.nodeName])(e,g.firstChild)&&s.isEmpty(g.firstChild)&&(m=s.createRng(),m.setStart(g.firstChild,0),m.setEnd(g.firstChild,0),a.setRng(m)),a.isCollapsed()||Yx(e);const p=a.getNode(),h={context:p.nodeName.toLowerCase(),data:o.data,insert:!0},f=i.parse(t,h);if(!0===o.paste&&Ix(e.schema,f)&&((e,t)=>!!Vx(e,t))(s,p))return m=jx(c,s,a.getRng(),f),m&&a.setRng(m),t;!0===o.paste&&((e,t,o,n)=>{var r;const a=t.firstChild,s=t.lastChild,i=a===("bookmark"===s.attr("data-mce-type")?s.prev:s),l=j(Wx,a.name);if(i&&l){const t="false"!==a.attr("contenteditable"),s=(null===(r=e.getParent(o,e.isBlock))||void 0===r?void 0:r.nodeName.toLowerCase())===a.name,i=P.from(yx(n,o)).forall(pa);return t&&s&&i}return!1})(s,f,p,e.getBody())&&(null===(n=f.firstChild)||void 0===n||n.unwrap()),(e=>{let t=e;for(;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")})(f);let b=f.lastChild;if(b&&"mce_marker"===b.attr("id")){const t=b;for(b=b.prev;b&&"table"!==b.name;b=b.walk(!0))if(3===b.type||!s.isBlock(b.name)){b.parent&&e.schema.isValidChild(b.parent.name,"span")&&b.parent.insert(t,b,"br"===b.name);break}}if(e._selectionOverrides.showBlockCaretContainer(p),h.invalid||((e,t,o)=>{var n;return W(o.children(),kx)&&"SUMMARY"===(null===(n=e.getParent(t,e.isBlock))||void 0===n?void 0:n.nodeName)})(s,p,f)){e.selection.setContent(d);let o,n=a.getNode();const l=e.getBody();for(ca(n)?n=o=l:o=n;o&&o!==l;)n=o,o=o.parentNode;t=n===l?l.innerHTML:s.getOuterHTML(n);const m=i.parse(t),u=(e=>{for(let t=e;t;t=t.walk())if("mce_marker"===t.attr("id"))return P.some(t);return P.none()})(m),g=u.bind(Mx).getOr(m);u.each(e=>e.replace(f));const p=f.children(),h=null!==(r=f.parent)&&void 0!==r?r:m;f.unwrap();const b=Y(p,t=>Bx(e.schema,t,h));Nx(b,e.schema,g),Ox(i.getNodeFilters(),i.getAttributeFilters(),m),t=c.serialize(m),n===l?s.setHTML(l,t):s.setOuterHTML(n,t)}else t=c.serialize(f),qx(e,t,p);var x;return((e,t)=>{const o=e.schema.getTextInlineElements(),n=e.dom;if(t){const t=e.getBody(),r=Cx(e),a="*[data-mce-fragment]",s=n.select(a);lo.each(s,e=>{const s=e=>_(o[e.nodeName.toLowerCase()]),i=e=>1===e.childNodes.length;if(!ff(n,l=e)&&!bf(n,l)&&s(e)&&i(e)){const o=hf(n,e),l=(e,t)=>re(e,e=>j(t,e)),c=t=>i(e)&&n.is(t,a)&&s(t)&&(t.nodeName===e.nodeName&&l(o,hf(n,t))||c(t.children[0])),d=o=>_(o)&&o!==t&&(r.compare(e,o)||d(o.parentElement)),m=o=>_(o)&&o!==t&&n.is(o,a)&&(xf(n,e,o)||m(o.parentElement));(c(e.children[0])||d(e.parentElement)&&!m(e.parentElement))&&n.remove(e,!0)}var l})}})(e,l),Kx(e,s.get("mce_marker")),x=e.getBody(),lo.each(x.getElementsByTagName("*"),e=>{e.removeAttribute("data-mce-fragment")}),Gx(s,a.getStart(),e.schema),((e,t,o)=>{const n=Ho(mo.fromDom(o),e=>vo(e,mo.fromDom(t)));ce(n,n.length-2).filter(Eo).fold(()=>Ua(e,t),t=>Ua(e,t.dom))})(e.schema,e.getBody(),a.getStart()),t},tv=e=>e instanceof jh,ov=(e,t,o)=>{e.dom.setHTML(e.getBody(),t),!0!==o&&(e=>{Kp(e)&&qu(e.getBody()).each(t=>{const o=t.getNode(),n=oa(o)?qu(o).getOr(t):t;e.selection.setRng(n.toRange())})})(e)},nv=(e,t,o)=>P.from(e.getBody()).map(n=>tv(t)?((e,t,o,n)=>{Ox(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),o);const r=mf({validate:!1},e.schema).serialize(o),a=Xi(Wi(mo.fromDom(t))?r:lo.trim(r));return ov(e,a,n.no_selection),{content:o,html:a}})(e,n,t,o):((e,t,o,n)=>{if(0===(o=Xi(o)).length||/^\s+$/.test(o)){const r='<br data-mce-bogus="1">';"TABLE"===t.nodeName?o="<tr><td>"+r+"</td></tr>":/^(UL|OL)$/.test(t.nodeName)&&(o="<li>"+r+"</li>");const a=qc(e);return e.schema.isValidChild(t.nodeName.toLowerCase(),a.toLowerCase())?(o=r,o=e.dom.createHTML(a,Gc(e),o)):o||(o=r),ov(e,o,n.no_selection),{content:o,html:o}}{"raw"!==n.format&&(o=mf({validate:!1},e.schema).serialize(e.parser.parse(o,{isRootContent:!0,insert:!0})));const r=Wi(mo.fromDom(t))?o:lo.trim(o);return ov(e,r,n.no_selection),{content:r,html:r}}})(e,n,t,o)).getOr({content:t,html:tv(o.content)?"":o.content}),rv=Lg,av=(e,t,o)=>{const n=e.formatter.get(o);if(n)for(let o=0;o<n.length;o++){const r=n[o];if(Wg(r)&&!1===r.inherit&&e.dom.is(t,r.selector))return!0}return!1},sv=(e,t,o,n,r)=>{const a=e.dom.getRoot();if(t===a)return!1;const s=e.dom.getParent(t,t=>!!av(e,t,o)||(t.parentNode===a||!!cv(e,t,o,n,!0)));return!!cv(e,s,o,n,r)},iv=(e,t,o)=>!(!$g(o)||!rv(t,o.inline))||(!(!jg(o)||!rv(t,o.block))||!!Wg(o)&&(Yr(t)&&e.is(t,o.selector))),lv=(e,t,o,n,r,a)=>{const s=o[n],i="attributes"===n;if(C(o.onmatch))return o.onmatch(t,o,n);if(s)if(ut(s)){for(let o=0;o<s.length;o++)if(i?e.getAttrib(t,s[o]):Pg(e,t,s[o]))return!0}else for(const n in s)if(Ee(s,n)){const l=i?e.getAttrib(t,n):Pg(e,t,n),c=Hg(s[n],a),d=w(l)||nt(l);if(d&&w(c))continue;if(r&&d&&!o.exact)return!1;if((!r||o.exact)&&!rv(l,Ig(c,n)))return!1}return!0},cv=(e,t,o,n,r)=>{const a=e.formatter.get(o),s=e.dom;if(a&&Yr(t))for(let o=0;o<a.length;o++){const i=a[o];if(iv(e.dom,t,i)&&lv(s,t,i,"attributes",r,n)&&lv(s,t,i,"styles",r,n)){const o=i.classes;if(o)for(let r=0;r<o.length;r++)if(!e.dom.hasClass(t,Hg(o[r],n)))return;return i}}},dv=(e,t,o,n,r)=>{if(n)return sv(e,n,t,o,r);if(n=e.selection.getNode(),sv(e,n,t,o,r))return!0;const a=e.selection.getStart();return!(a===n||!sv(e,a,t,o,r))},mv=(e,t)=>{const o=t=>vo(t,mo.fromDom(e.getBody()));return P.from(e.selection.getStart(!0)).bind(n=>Er(mo.fromDom(n),o=>ge(t,t=>((t,o)=>cv(e,t.dom,o)?P.some(o):P.none())(o,t)),o)).getOrNull()},uv=(e,t,o)=>J(o,(o,n)=>{const r=((e,t)=>Zg(e,t,e=>{const t=e=>C(e)||e.length>1&&"%"===e.charAt(0);return W(["styles","attributes"],o=>Se(e,o).exists(e=>{const o=b(e)?e:ke(e);return W(o,t)}))}))(e,n);return e.formatter.matchNode(t,n,{},r)?o.concat([n]):o},[]),gv=Ki,pv=e=>{if(e){const t=new Ur(e,e);for(let e=t.current();e;e=t.next())if(aa(e))return e}return null},hv=e=>{const t=mo.fromTag("span");return hn(t,{id:Ku,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&dn(t,mo.fromText(gv)),t},fv=(e,t,o)=>{const n=e.dom,r=e.selection;if(Gg(t))Eb(e,!1,mo.fromDom(t),o,!0);else{const e=r.getRng(),o=n.getParent(t,n.isBlock),a=e.startContainer,s=e.startOffset,i=e.endContainer,l=e.endOffset,c=(e=>{const t=pv(e);return t&&t.data.charAt(0)===gv&&t.deleteData(0,1),t})(t);n.remove(t,!0),a===c&&s>0&&e.setStart(c,s-1),i===c&&l>0&&e.setEnd(c,l-1),o&&n.isEmpty(o)&&Gi(mo.fromDom(o)),r.setRng(e)}},bv=(e,t,o)=>{const n=e.dom,r=e.selection;if(t)fv(e,t,o);else if(!(t=Xu(e.getBody(),r.getStart())))for(;t=n.get(Ku);)fv(e,t,o)},xv=(e,t)=>(e.appendChild(t),t),vv=(e,t)=>{var o;const n=X(e,(e,t)=>xv(e,t.cloneNode(!1)),t),r=null!==(o=n.ownerDocument)&&void 0!==o?o:document;return xv(n,r.createTextNode(gv))},yv=e=>Jn(e,Xn(e).replace(new RegExp(`${ct}$`)," ")),wv=(e,t)=>{const o=()=>{null===t||e.dom.isEmpty(t)||Lo(mo.fromDom(t)).each(e=>{Oo(e)?yv(e):rr(e,e=>Oo(e)).each(e=>{Oo(e)&&yv(e)})})};e.once("input",t=>{t.data&&!gg(t.data)&&(t.isComposing?e.once("compositionend",()=>{o()}):o())})},_v=(e,t,o,n)=>{const r=e.dom,a=e.selection;let s=!1;const i=e.formatter.get(t);if(!i)return;const l=a.getRng(),c=l.startContainer,d=l.startOffset;let m=c;aa(c)&&(d!==c.data.length&&(s=!0),m=m.parentNode);const u=[];let g;for(;m;){if(cv(e,m,t,o,n)){g=m;break}m.nextSibling&&(s=!0),u.push(m),m=m.parentNode}if(g)if(s){const s=a.getBookmark();l.collapse(!0);let c=mp(r,l,i,{includeTrailingSpace:!0});c=hh(c),e.formatter.remove(t,o,c,n),a.moveToBookmark(s)}else{const s=Xu(e.getBody(),g),i=_(s)?r.getParents(g.parentNode,I,s):[],l=hv(!1).dom;((e,t,o)=>{var n,r;const a=e.dom,s=a.getParent(o,R(Rg,e.schema));s&&a.isEmpty(s)?null===(n=o.parentNode)||void 0===n||n.replaceChild(t,o):($i(mo.fromDom(o)),a.isEmpty(o)?null===(r=o.parentNode)||void 0===r||r.replaceChild(t,o):a.insertAfter(t,o))})(e,l,null!=s?s:g);const c=((e,t,o,n,r,a)=>{const s=e.formatter,i=e.dom,l=Y(he(s.get()),e=>e!==n&&!Ke(e,"removeformat")),c=uv(e,o,l);if(Y(c,t=>!Ug(e,t,n)).length>0){const e=o.cloneNode(!1);return i.add(t,e),s.remove(n,r,e,a),i.remove(e),P.some(e)}return P.none()})(e,l,g,t,o,n),d=vv([...u,...c.toArray(),...i],l);s&&fv(e,s,_(s)),a.setCursorLocation(d,1),wv(e,l),r.isEmpty(g)&&r.remove(g)}},Cv=e=>{e.on("mouseup keydown",t=>{var o;((e,t,o)=>{const n=e.selection,r=e.getBody();bv(e,null,o),8!==t&&46!==t||!n.isCollapsed()||n.getStart().innerHTML!==gv||bv(e,Xu(r,n.getStart()),!0),37!==t&&39!==t||bv(e,Xu(r,n.getStart()),!0)})(e,t.keyCode,(o=e.selection.getRng().endContainer,aa(o)&&Xe(o.data,ct)))})},kv=e=>{const t=hv(!1),o=vv(e,t.dom);return{caretContainer:t,caretPosition:Yl(o,0)}},Sv=(e,t)=>{const{caretContainer:o,caretPosition:n}=kv(t);return sn(mo.fromDom(e),o),_n(mo.fromDom(e)),n},Ev=(e,t)=>{if(Yu(t.dom))return!1;const o=e.schema.getTextInlineElements();return Ee(o,_o(t))&&!Yu(t.dom)&&!ta(t.dom)},Ov={},Tv=Qr(["pre"]);((e,t)=>{Ov[e]||(Ov[e]=[]),Ov[e].push(t)})("pre",e=>{const t=e.selection.getRng();if(!t.collapsed){const t=e.selection.getSelectedBlocks(),o=Y(Y(t,Tv),(e=>t=>{const o=t.previousSibling;return Tv(o)&&j(e,o)})(t));q(o,e=>{((e,t)=>{const o=mo.fromDom(t),n=Ro(o).dom;_n(o),un(mo.fromDom(e),[mo.fromTag("br",n),mo.fromTag("br",n),...Vo(o)])})(e.previousSibling,e)})}});const Av=["fontWeight","fontStyle","color","fontSize","fontFamily"],Dv=e=>ee(e,e=>$g(e)&&"span"===e.inline&&(e=>h(e.styles)&&W(he(e.styles),e=>j(Av,e)))(e)),Mv=(e,t)=>{const o=e.get(t);return b(o)?Dv(o):P.none()},Rv=(e,t)=>$u(t,Yl.fromRangeStart(e)).isNone(),Nv=(e,t)=>!1===Wu(t,Yl.fromRangeEnd(e)).exists(e=>!ma(e.getNode())||Wu(t,e).isSome()),Bv=e=>t=>ya(t)&&e.isEditable(t),zv=e=>Y((e=>{const t=e.getSelectedBlocks(),o=e.getRng();if(e.isCollapsed())return[];if(1===t.length)return Rv(o,t[0])&&Nv(o,t[0])?t:[];{const e=de(t).filter(e=>Rv(o,e)).toArray(),n=me(t).filter(e=>Nv(o,e)).toArray(),r=t.slice(1,-1);return e.concat(r).concat(n)}})(e),Bv(e.dom)),Hv=e=>Y(e.getSelectedBlocks(),Bv(e.dom)),Lv=lo.each,Iv=e=>Yr(e)&&!dg(e)&&!Yu(e)&&!ta(e),Pv=(e,t)=>{for(let o=e;o;o=o[t]){if(aa(o)&&ot(o.data))return e;if(Yr(o)&&!dg(o))return o}return e},Fv=(e,t,o)=>{const n=Cx(e),r=Xr(t)&&e.dom.isEditable(t),a=Xr(o)&&e.dom.isEditable(o);if(r&&a){const r=Pv(t,"previousSibling"),a=Pv(o,"nextSibling");if(n.compare(r,a)){for(let e=r.nextSibling;e&&e!==a;){const t=e;e=e.nextSibling,r.appendChild(t)}return e.dom.remove(a),lo.each(lo.grep(a.childNodes),e=>{r.appendChild(e)}),r}}return o},Vv=(e,t,o,n)=>{var r;if(n&&!1!==t.merge_siblings){const t=null!==(r=Fv(e,Mg(n),n))&&void 0!==r?r:n;Fv(e,t,Mg(t,!0))}},Zv=(e,t,o)=>{Lv(e.childNodes,e=>{Iv(e)&&(t(e)&&o(e),e.hasChildNodes()&&Zv(e,t,o))})},Uv=(e,t)=>o=>!(!o||!Pg(e,o,t)),jv=(e,t,o)=>n=>{e.setStyle(n,t,o),""===n.getAttribute("style")&&n.removeAttribute("style"),((e,t)=>{"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0)})(e,n)},Wv=Te([{keep:[]},{rename:["name"]},{removed:[]}]),$v=/^(src|href|style)$/,qv=lo.each,Gv=Lg,Kv=(e,t,o)=>e.isChildOf(t,o)&&t!==o&&!e.isBlock(o),Yv=(e,t,o)=>{let n=t[o?"startContainer":"endContainer"],r=t[o?"startOffset":"endOffset"];if(Yr(n)){const e=n.childNodes.length-1;!o&&r&&r--,n=n.childNodes[r>e?e:r]}return aa(n)&&o&&r>=n.data.length&&(n=new Ur(n,e.getBody()).next()||n),aa(n)&&!o&&0===r&&(n=new Ur(n,e.getBody()).prev()||n),n},Xv=(e,t)=>{const o=t?"firstChild":"lastChild",n=e[o];return(e=>/^(TR|TH|TD)$/.test(e.nodeName))(e)&&n?"TR"===e.nodeName&&n[o]||n:e},Jv=(e,t,o,n)=>{var r;const a=e.create(o,n);return null===(r=t.parentNode)||void 0===r||r.insertBefore(a,t),a.appendChild(t),a},Qv=(e,t,o,n,r)=>{const a=mo.fromDom(t),s=mo.fromDom(e.create(n,r)),i=o?Fo(a):Po(a);return un(s,i),o?(sn(a,s),cn(s,a)):(ln(a,s),dn(s,a)),s.dom},ey=(e,t,o)=>{const n=t.parentNode;let r;const a=e.dom,s=qc(e);jg(o)&&n===a.getRoot()&&(o.list_block&&Gv(t,o.list_block)||q(ue(t.childNodes),t=>{Ng(e,s,t.nodeName.toLowerCase())?r?r.appendChild(t):(r=Jv(a,t,s),a.setAttribs(r,Gc(e))):r=null})),(e=>Wg(e)&&$g(e)&&Fe(Se(e,"mixed"),!0))(o)&&!Gv(o.inline,t)||a.remove(t,!0)},ty=(e,t,o)=>k(e)?{name:t,value:null}:{name:e,value:Hg(t,o)},oy=(e,t)=>{""===e.getAttrib(t,"style")&&(t.removeAttribute("style"),t.removeAttribute("data-mce-style"))},ny=(e,t,o,n,r)=>{let a=!1;qv(o.styles,(s,i)=>{const{name:l,value:c}=ty(i,s,n),d=Ig(c,l);(o.remove_similar||x(c)||!Yr(r)||Gv(Pg(e,r,l),d))&&e.setStyle(t,l,""),a=!0}),a&&oy(e,t)},ry=(e,t,o,n,r)=>{const a=e.dom,s=Cx(e),i=e.schema;if($g(t)&&$a(i,t.inline)&&Ga(i,n)&&n.parentElement===e.getBody())return ey(e,n,t),Wv.removed();if(!t.ceFalseOverride&&n&&"false"===a.getContentEditableParent(n))return Wv.keep();if(n&&!iv(a,n,t)&&!((e,t)=>t.links&&"A"===e.nodeName)(n,t))return Wv.keep();const l=n,c=t.preserve_attributes;if($g(t)&&"all"===t.remove&&b(c)){const e=Y(a.getAttribs(l),e=>j(c,e.name.toLowerCase()));if(a.removeAllAttribs(l),q(e,e=>a.setAttrib(l,e.name,e.value)),e.length>0)return Wv.rename("span")}if("all"!==t.remove){ny(a,l,t,o,r),qv(t.attributes,(e,n)=>{const{name:s,value:i}=ty(n,e,o);if(t.remove_similar||x(i)||!Yr(r)||Gv(a.getAttrib(r,s),i)){if("class"===s){const e=a.getAttrib(l,s);if(e){let t="";if(q(e.split(/\s+/),e=>{/mce\-\w+/.test(e)&&(t+=(t?" ":"")+e)}),t)return void a.setAttrib(l,s,t)}}if($v.test(s)&&l.removeAttribute("data-mce-"+s),"style"===s&&Qr(["li"])(l)&&"none"===a.getStyle(l,"list-style-type"))return l.removeAttribute(s),void a.setStyle(l,"list-style-type","none");"class"===s&&l.removeAttribute("className"),l.removeAttribute(s)}}),qv(t.classes,e=>{e=Hg(e,o),Yr(r)&&!a.hasClass(r,e)||a.removeClass(l,e)});const e=a.getAttribs(l);for(let t=0;t<e.length;t++){const o=e[t].nodeName;if(!s.isAttributeInternal(o))return Wv.keep()}}return"none"!==t.remove?(ey(e,l,t),Wv.removed()):Wv.keep()},ay=(e,t,o,n)=>ry(e,t,o,n,n).fold(A(n),t=>(e.dom.createFragment().appendChild(n),e.dom.rename(n,t)),A(null)),sy=(e,t,o,n,r)=>{const a=e.formatter.get(t),s=a[0],i=e.dom,l=e.selection,c=n=>{const i=((e,t,o,n,r)=>{let a;return t.parentNode&&q(Vg(e.dom,t.parentNode).reverse(),t=>{if(!a&&Yr(t)&&"_start"!==t.id&&"_end"!==t.id){const s=cv(e,t,o,n,r);s&&!1!==s.split&&(a=t)}}),a})(e,n,t,o,r);return((e,t,o,n,r,a,s,i)=>{var l,c;let d,m;const u=e.dom;if(o){const g=o.parentNode;for(let o=n.parentNode;o&&o!==g;o=o.parentNode){let n=u.clone(o,!1);for(let o=0;o<t.length&&(n=ay(e,t[o],i,n),null!==n);o++);n&&(d&&n.appendChild(d),m||(m=n),d=n)}!a||s.mixed&&u.isBlock(o)||(n=null!==(l=u.split(o,n))&&void 0!==l?l:n),d&&m&&(null===(c=r.parentNode)||void 0===c||c.insertBefore(d,r),m.appendChild(r),$g(s)&&Vv(e,s,0,d))}return n})(e,a,i,n,n,!0,s,o)},d=t=>W(a,n=>ly(e,n,o,t,t)),m=t=>{const o=ue(t.childNodes),n=d(t)||W(a,e=>iv(i,t,e)),r=t.parentNode;if(!n&&_(r)&&qg(s)&&d(r),s.deep&&o.length)for(let e=0;e<o.length;e++)m(o[e]);q(["underline","line-through","overline"],o=>{Yr(t)&&e.dom.getStyle(t,"text-decoration")===o&&t.parentNode&&Fg(i,t.parentNode)===o&&ly(e,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:o}},void 0,t)})},u=e=>{const t=i.get(e?"_start":"_end");if(t){let o=t[e?"firstChild":"lastChild"];return(e=>dg(e)&&Yr(e)&&("_start"===e.id||"_end"===e.id))(o)&&(o=o[e?"firstChild":"lastChild"]),aa(o)&&0===o.data.length&&(o=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),i.remove(t,!0),o}return null},g=t=>{let o,n,r=mp(i,t,a,{includeTrailingSpace:t.collapsed});if(s.split){if(r=hh(r),o=Yv(e,r,!0),n=Yv(e,r),o!==n){if(o=Xv(o,!0),n=Xv(n,!1),Kv(i,o,n)){const e=P.from(o.firstChild).getOr(o);return c(Qv(i,e,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void u(!0)}if(Kv(i,n,o)){const e=P.from(n.lastChild).getOr(n);return c(Qv(i,e,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void u(!1)}o=Jv(i,o,"span",{id:"_start","data-mce-type":"bookmark"}),n=Jv(i,n,"span",{id:"_end","data-mce-type":"bookmark"});const e=i.createRng();e.setStartAfter(o),e.setEndBefore(n),up(i,e,e=>{q(e,e=>{dg(e)||dg(e.parentNode)||c(e)})}),c(o),c(n),o=u(!0),n=u()}else o=n=c(o);r.startContainer=o.parentNode?o.parentNode:o,r.startOffset=i.nodeIndex(o),r.endContainer=n.parentNode?n.parentNode:n,r.endOffset=i.nodeIndex(n)+1}up(i,r,e=>{q(e,m)})};if(n){if(Og(n)){const e=i.createRng();e.setStartBefore(n),e.setEndAfter(n),g(e)}else g(n);Tc(e,t,n,o)}else l.isCollapsed()&&$g(s)&&!xg(e).length?_v(e,t,o,r):(Ag(e,()=>Sg(e,g),n=>$g(s)&&dv(e,t,o,n)),e.nodeChanged()),((e,t,o)=>{"removeformat"===t?q(Hv(e.selection),t=>{q(Av,o=>e.dom.setStyle(t,o,"")),oy(e.dom,t)}):Mv(e.formatter,t).each(t=>{q(Hv(e.selection),n=>ny(e.dom,n,t,o,null))})})(e,t,o),Tc(e,t,n,o)},iy=(e,t,o,n,r)=>{(n||e.selection.isEditable())&&sy(e,t,o,n,r)},ly=(e,t,o,n,r)=>ry(e,t,o,n,r).fold(L,t=>(e.dom.rename(n,t),!0),I),cy=lo.each,dy=(e,t,o,n)=>{cy(t,t=>{$g(t)&&cy(e.dom.select(t.inline,n),n=>{Iv(n)&&ly(e,t,o,n,t.exact?n:null)}),((e,t,o)=>{if(t.clear_child_styles){const n=t.links?"*:not(a)":"*";Lv(e.select(n,o),o=>{Iv(o)&&e.isEditable(o)&&Lv(t.styles,(t,n)=>{e.setStyle(o,n,"")})})}})(e.dom,t,n)})},my=lo.each,uy=(e,t,o,n)=>{if(my(o.styles,(o,r)=>{e.setStyle(t,r,Hg(o,n))}),o.styles){const o=e.getAttrib(t,"style");o&&e.setAttrib(t,"data-mce-style",o)}},gy=(e,t,o,n)=>{const r=e.formatter.get(t),a=r[0],s=!n&&e.selection.isCollapsed(),i=e.dom,l=e.selection,c=(e,t=a)=>{C(t.onformat)&&t.onformat(e,t,o,n),uy(i,e,t,o),my(t.attributes,(t,n)=>{i.setAttrib(e,n,Hg(t,o))}),my(t.classes,t=>{const n=Hg(t,o);i.hasClass(e,n)||i.addClass(e,n)})},d=(e,t)=>{let o=!1;return my(e,e=>!!Wg(e)&&("false"===i.getContentEditable(t)&&!e.ceFalseOverride||(!(!_(e.collapsed)||e.collapsed===s)||(!(i.is(t,e.selector)&&!Yu(t))||(c(t,e),o=!0,!1))))),o},m=e=>{if(p(e)){const t=i.create(e);return c(t),t}return null},u=(n,s,i)=>{const l=[];let u=!0;const g=a.inline||a.block,p=m(g),h=n=>(e=>jg(e)&&!0===e.wrapper)(a)&&cv(e,n,t,o),f=(t,o,n)=>{const r=(e=>jg(e)&&!0!==e.wrapper)(a)&&Rg(e.schema,t)&&Ng(e,o,g);return n&&r};up(n,s,t=>{let o;const s=t=>{let m=!1,b=u,x=!1;const v=t.parentNode,y=v.nodeName.toLowerCase(),w=n.getContentEditable(t);_(w)&&(b=u,u="true"===w,m=!0,x=zg(e,t));const C=u&&!m;if(ma(t)&&!((e,t,o,n)=>{if(Rd(e)&&$g(t)&&o.parentNode){const t=Ls(e.schema),r=Cr(mo.fromDom(o),e=>Yu(e.dom));return Oe(t,n)&&Aa(e.schema,o.parentNode,{skipBogus:!1,includeZwsp:!0})&&!r}return!1})(e,a,t,y))return o=null,void(jg(a)&&n.remove(t));if(h(t))o=null;else{if(f(t,y,C)){const e=n.rename(t,g);return c(e),l.push(e),void(o=null)}if(Wg(a)){let e=d(r,t);if(!e&&_(v)&&qg(a)&&(e=d(r,v)),!$g(a)||e)return void(o=null)}_(p)&&((t,o,r,s)=>{const l=t.nodeName.toLowerCase(),c=Ng(e,g,l)&&Ng(e,o,g),d=!i&&aa(t)&&Yi(t.data),m=Yu(t),u=!$g(a)||!n.isBlock(t);return(r||s)&&c&&!d&&!m&&u})(t,y,C,x)?(o||(o=n.clone(p,!1),v.insertBefore(o,t),l.push(o)),x&&m&&(u=b),o.appendChild(t)):(o=null,q(ue(t.childNodes),s),m&&(u=b),o=null)}};q(t,s)}),!0===a.links&&q(l,e=>{const t=e=>{"A"===e.nodeName&&c(e,a),q(ue(e.childNodes),t)};t(e)}),q(l,s=>{const i=(e=>{let t=0;return q(e.childNodes,e=>{(e=>_(e)&&aa(e)&&0===e.length)(e)||dg(e)||t++}),t})(s);!(l.length>1)&&n.isBlock(s)||0!==i?($g(a)||jg(a)&&a.wrapper)&&(a.exact||1!==i||(s=(e=>{const t=ee(e.childNodes,Tg).filter(e=>"false"!==n.getContentEditable(e)&&iv(n,e,a));return t.map(t=>{const o=n.clone(t,!1);return c(o),n.replace(o,e,!0),n.remove(t,!0),o}).getOr(e)})(s)),dy(e,r,o,s),((e,t,o,n,r)=>{const a=r.parentNode;cv(e,a,o,n)&&ly(e,t,n,r)||t.merge_with_parents&&a&&e.dom.getParent(a,a=>!!cv(e,a,o,n)&&(ly(e,t,n,r),!0))})(e,a,t,o,s),((e,t,o,n)=>{if(t.styles&&t.styles.backgroundColor){const r=Uv(e,"fontSize");Zv(n,t=>r(t)&&e.isEditable(t),jv(e,"backgroundColor",Hg(t.styles.backgroundColor,o)))}})(n,a,o,s),((e,t,o,n)=>{const r=t=>{if(Xr(t)&&Yr(t.parentNode)&&e.isEditable(t)){const o=Fg(e,t.parentNode);e.getStyle(t,"color")&&o?e.setStyle(t,"text-decoration",o):e.getStyle(t,"text-decoration")===o&&e.setStyle(t,"text-decoration",null)}};t.styles&&(t.styles.color||t.styles.textDecoration)&&(lo.walk(n,r,"childNodes"),r(n))})(n,a,0,s),((e,t,o,n)=>{if($g(t)&&("sub"===t.inline||"sup"===t.inline)){const o=Uv(e,"fontSize");Zv(n,t=>o(t)&&e.isEditable(t),jv(e,"fontSize",""));const r=Y(e.select("sup"===t.inline?"sub":"sup",n),e.isEditable);e.remove(r,!0)}})(n,a,0,s),Vv(e,a,0,s)):n.remove(s,!0)})},g=Og(n)?n:l.getNode();if("false"===i.getContentEditable(g)&&!zg(e,g))return d(r,n=g),void Oc(e,t,n,o);if(a){if(n)if(Og(n)){if(!d(r,n)){const e=i.createRng();e.setStartBefore(n),e.setEndAfter(n),u(i,mp(i,e,r),!0)}}else u(i,n,!0);else s&&$g(a)&&!xg(e).length?((e,t,o)=>{let n;const r=e.selection,a=e.formatter.get(t);if(!a)return;const s=r.getRng();let i=s.startOffset;const l=s.startContainer.nodeValue;n=Xu(e.getBody(),r.getStart());const c=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(l&&i>0&&i<l.length&&c.test(l.charAt(i))&&c.test(l.charAt(i-1))){const n=r.getBookmark();s.collapse(!0);let i=mp(e.dom,s,a);i=hh(i),e.formatter.apply(t,o,i),r.moveToBookmark(n)}else{let a=n?pv(n):null;n&&(null==a?void 0:a.data)===gv||(d=e.getDoc(),m=hv(!0).dom,n=d.importNode(m,!0),a=n.firstChild,s.insertNode(n),i=1,wv(e,n)),e.formatter.apply(t,o,n),r.setCursorLocation(a,i)}var d,m})(e,t,o):(l.setRng(Hx(l.getRng())),Ag(e,()=>{Sg(e,(e,t)=>{const o=t?e:mp(i,e,r);u(i,o,!1)})},I),e.nodeChanged()),Mv(e.formatter,t).each(t=>{q(zv(e.selection),e=>uy(i,e,t,o))});((e,t)=>{Ee(Ov,e)&&q(Ov[e],e=>{e(t)})})(t,e)}Oc(e,t,n,o)},py=(e,t,o,n)=>{(n||e.selection.isEditable())&&gy(e,t,o,n)},hy=e=>Ee(e,"vars"),fy=e=>e.selection.getStart(),by=(e,t,o,n,r)=>Q(t,t=>{const a=e.formatter.matchNode(t,o,null!=r?r:{},n);return!y(a)},t=>!!av(e,t,o)||!n&&_(e.formatter.matchNode(t,o,r,!0))),xy=(e,t)=>{const o=null!=t?t:fy(e);return Y(Vg(e.dom,o),e=>Yr(e)&&!ta(e))},vy=(e,t,o)=>{const n=xy(e,t);be(o,(o,r)=>{const a=o=>{const a=by(e,n,r,o.similar,hy(o)?o.vars:void 0),s=a.isSome();if(o.state.get()!==s){o.state.set(s);const e=a.getOr(t);hy(o)?o.callback(s,{node:e,format:r,parents:n}):q(o.callbacks,t=>t(s,{node:e,format:r,parents:n}))}};q([o.withSimilar,o.withoutSimilar],a),q(o.withVars,a)})},yy=(e,t,o,n,r,a)=>(((e,t,o,n,r,a)=>{const s=t.get();q(o.split(","),t=>{const o=Se(s,t).getOrThunk(()=>{const e={withSimilar:{state:Ae(!1),similar:!0,callbacks:[]},withoutSimilar:{state:Ae(!1),similar:!1,callbacks:[]},withVars:[]};return s[t]=e,e}),i=()=>{const o=xy(e);return by(e,o,t,r,a).isSome()};if(y(a)){const e=r?o.withSimilar:o.withoutSimilar;e.callbacks.push(n),1===e.callbacks.length&&e.state.set(i())}else o.withVars.push({state:Ae(i()),similar:r,vars:a,callback:n})}),t.set(s)})(e,t,o,n,r,a),{unbind:()=>((e,t,o)=>{const n=e.get();q(t.split(","),e=>Se(n,e).each(t=>{n[e]={withSimilar:{...t.withSimilar,callbacks:Y(t.withSimilar.callbacks,e=>e!==o)},withoutSimilar:{...t.withoutSimilar,callbacks:Y(t.withoutSimilar.callbacks,e=>e!==o)},withVars:Y(t.withVars,e=>e.callback!==o)}})),e.set(n)})(t,o,n)}),wy=lo.explode,_y=()=>{const e={};return{addFilter:(t,o)=>{q(wy(t),t=>{Ee(e,t)||(e[t]={name:t,callbacks:[]}),e[t].callbacks.push(o)})},getFilters:()=>ke(e),removeFilter:(t,o)=>{q(wy(t),t=>{if(Ee(e,t))if(_(o)){const n=e[t],r=Y(n.callbacks,e=>e!==o);r.length>0?n.callbacks=r:delete e[t]}else delete e[t]})}}},Cy=e=>e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&"),ky=(e,t,o)=>{e.addNodeFilter("font",e=>{q(e,e=>{const n=t.parse(e.attr("style")),r=e.attr("color"),a=e.attr("face"),s=e.attr("size");r&&(n.color=r),a&&(n["font-family"]=a),s&&rt(s).each(e=>{n["font-size"]=o[e-1]}),e.name="span",e.attr("style",t.serialize(n)),((e,t)=>{q(t,t=>{e.attr(t,null)})})(e,["color","face","size"])})})},Sy=(e,t,o)=>{var n;const r=Ys();t.convert_fonts_to_spans&&ky(e,r,lo.explode(null!==(n=t.font_size_legacy_values)&&void 0!==n?n:"")),((e,t,o)=>{e.addNodeFilter("strike",e=>{const n="html4"!==t.type;q(e,e=>{if(n)e.name="s";else{const t=o.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",o.serialize(t))}})})})(e,o,r)},Ey=e=>{const[t,...o]=e.split(","),n=o.join(","),r=/data:([^/]+\/[^;]+)(;.+)?/.exec(t);if(r){const e=";base64"===r[2],t=(e=>{try{return decodeURIComponent(e)}catch(t){return e}})(n),o=e?(e=>{const t=/([a-z0-9+\/=\s]+)/i.exec(e);return t?t[1]:""})(t):t;return P.some({type:r[1],data:o,base64Encoded:e})}return P.none()},Oy=(e,t,o=!0)=>{let n=t;if(o)try{n=atob(t)}catch(e){return P.none()}const r=new Uint8Array(n.length);for(let e=0;e<r.length;e++)r[e]=n.charCodeAt(e);return P.some(new Blob([r],{type:e}))},Ty=e=>{return Ye(e,"blob:")?(e=>fetch(e).then(e=>e.ok?e.blob():Promise.reject()).catch(()=>Promise.reject({message:`Cannot convert ${e} to Blob. Resource might not exist or is inaccessible.`,uriType:"blob"})))(e):Ye(e,"data:")?(t=e,new Promise((e,o)=>{Ey(t).bind(({type:e,data:t,base64Encoded:o})=>Oy(e,t,o)).fold(()=>o("Invalid data URI"),e)})):Promise.reject("Unknown URI format");var t},Ay=e=>new Promise((t,o)=>{const n=new FileReader;n.onloadend=()=>{t(n.result)},n.onerror=()=>{var e;o(null===(e=n.error)||void 0===e?void 0:e.message)},n.readAsDataURL(e)});let Dy=0;const My=(e,t,o)=>Ey(e).bind(({data:e,type:n,base64Encoded:r})=>{if(t&&!r)return P.none();{const t=r?e:btoa(e);return o(t,n)}}),Ry=(e,t,o)=>{const n=e.create((r||"blobid")+Dy++,t,o);var r;return e.add(n),n},Ny=(e,t,o=!1)=>My(t,o,(t,o)=>P.from(e.getByData(t,o)).orThunk(()=>Oy(o,t).map(o=>Ry(e,o,t)))),By=/^(?:(?:(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)([A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*))(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+)?)?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+)?)?)$/,zy=e=>P.from(e.match(By)).bind(e=>ce(e,1)).map(e=>Ye(e,"www.")?e.substring(4):e),Hy=(e,t)=>{P.from(e.attr("src")).bind(zy).forall(e=>!j(t,e))&&e.attr("sandbox","")},Ly=(e,t)=>Ye(e,`${t}/`),Iy=({type:e,src:t,width:o,height:n}={},r,a)=>{const s=(e=>y(e)?"iframe":Ly(e,"image")?"img":Ly(e,"video")?"video":Ly(e,"audio")?"audio":"iframe")(e),i=new jh(s,1);return i.attr("audio"===s?{src:t}:{src:t,width:o,height:n}),"audio"!==s&&"video"!==s||i.attr("controls",""),"iframe"===s&&r&&Hy(i,a),i},Py=(e,t)=>{const{blob_cache:o}=t;if(o){const t=e=>{const t=e.attr("src");(e=>e.attr("src")===ro.transparentSrc||_(e.attr("data-mce-placeholder")))(e)||(e=>_(e.attr("data-mce-bogus")))(e)||w(t)||Ny(o,t,!0).each(t=>{e.attr("src",t.blobUri())})};e.addAttributeFilter("src",e=>q(e,t))}},{entries:Fy,setPrototypeOf:Vy,isFrozen:Zy,getPrototypeOf:Uy,getOwnPropertyDescriptor:jy}=Object;let{freeze:Wy,seal:$y,create:qy}=Object,{apply:Gy,construct:Ky}="undefined"!=typeof Reflect&&Reflect;Wy||(Wy=function(e){return e}),$y||($y=function(e){return e}),Gy||(Gy=function(e,t,o){return e.apply(t,o)}),Ky||(Ky=function(e,t){return new e(...t)});const Yy=mw(Array.prototype.forEach),Xy=mw(Array.prototype.lastIndexOf),Jy=mw(Array.prototype.pop),Qy=mw(Array.prototype.push),ew=mw(Array.prototype.splice),tw=mw(String.prototype.toLowerCase),ow=mw(String.prototype.toString),nw=mw(String.prototype.match),rw=mw(String.prototype.replace),aw=mw(String.prototype.indexOf),sw=mw(String.prototype.trim),iw=mw(Object.prototype.hasOwnProperty),lw=mw(RegExp.prototype.test),cw=(dw=TypeError,function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return Ky(dw,t)});var dw;function mw(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return Gy(e,t,n)}}function uw(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:tw;Vy&&Vy(e,null);let n=t.length;for(;n--;){let r=t[n];if("string"==typeof r){const e=o(r);e!==r&&(Zy(t)||(t[n]=e),r=e)}e[r]=!0}return e}function gw(e){for(let t=0;t<e.length;t++){iw(e,t)||(e[t]=null)}return e}function pw(e){const t=qy(null);for(const[o,n]of Fy(e)){iw(e,o)&&(Array.isArray(n)?t[o]=gw(n):n&&"object"==typeof n&&n.constructor===Object?t[o]=pw(n):t[o]=n)}return t}function hw(e,t){for(;null!==e;){const o=jy(e,t);if(o){if(o.get)return mw(o.get);if("function"==typeof o.value)return mw(o.value)}e=Uy(e)}return function(){return null}}const fw=Wy(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),bw=Wy(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),xw=Wy(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),vw=Wy(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),yw=Wy(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ww=Wy(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),_w=Wy(["#text"]),Cw=Wy(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),kw=Wy(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Sw=Wy(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ew=Wy(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ow=$y(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Tw=$y(/<%[\w\W]*|[\w\W]*%>/gm),Aw=$y(/\$\{[\w\W]*/gm),Dw=$y(/^data-[\-\w.\u00B7-\uFFFF]+$/),Mw=$y(/^aria-[\-\w]+$/),Rw=$y(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Nw=$y(/^(?:\w+script|data):/i),Bw=$y(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),zw=$y(/^html$/i),Hw=$y(/^[a-z][.\w]*(-[.\w]+)+$/i);var Lw=Object.freeze({__proto__:null,ARIA_ATTR:Mw,ATTR_WHITESPACE:Bw,CUSTOM_ELEMENT:Hw,DATA_ATTR:Dw,DOCTYPE_NAME:zw,ERB_EXPR:Tw,IS_ALLOWED_URI:Rw,IS_SCRIPT_OR_DATA:Nw,MUSTACHE_EXPR:Ow,TMPLIT_EXPR:Aw});const Iw=1,Pw=3,Fw=7,Vw=8,Zw=9,Uw=function(){return"undefined"==typeof window?null:window};var jw=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Uw();const o=t=>e(t);if(o.version="3.2.6",o.removed=[],!t||!t.document||t.document.nodeType!==Zw||!t.Element)return o.isSupported=!1,o;let{document:n}=t;const r=n,a=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:i,Node:l,Element:c,NodeFilter:d,NamedNodeMap:m=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:u,DOMParser:g,trustedTypes:p}=t,h=c.prototype,f=hw(h,"cloneNode"),b=hw(h,"remove"),x=hw(h,"nextSibling"),v=hw(h,"childNodes"),y=hw(h,"parentNode");if("function"==typeof i){const e=n.createElement("template");e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let w,_="";const{implementation:C,createNodeIterator:k,createDocumentFragment:S,getElementsByTagName:E}=n,{importNode:O}=r;let T={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof Fy&&"function"==typeof y&&C&&void 0!==C.createHTMLDocument;const{MUSTACHE_EXPR:A,ERB_EXPR:D,TMPLIT_EXPR:M,DATA_ATTR:R,ARIA_ATTR:N,IS_SCRIPT_OR_DATA:B,ATTR_WHITESPACE:z,CUSTOM_ELEMENT:H}=Lw;let{IS_ALLOWED_URI:L}=Lw,I=null;const P=uw({},[...fw,...bw,...xw,...yw,..._w]);let F=null;const V=uw({},[...Cw,...kw,...Sw,...Ew]);let Z=Object.seal(qy(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),U=null,j=null,W=!0,$=!0,q=!1,G=!0,K=!1,Y=!0,X=!1,J=!1,Q=!1,ee=!1,te=!1,oe=!1,ne=!0,re=!1,ae=!0,se=!1,ie={},le=null;const ce=uw({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let de=null;const me=uw({},["audio","video","img","source","image","track"]);let ue=null;const ge=uw({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pe="http://www.w3.org/1998/Math/MathML",he="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml";let be=fe,xe=!1,ve=null;const ye=uw({},[pe,he,fe],ow);let we=uw({},["mi","mo","mn","ms","mtext"]),_e=uw({},["annotation-xml"]);const Ce=uw({},["title","style","font","a","script"]);let ke=null;const Se=["application/xhtml+xml","text/html"];let Ee=null,Oe=null;const Te=n.createElement("form"),Ae=function(e){return e instanceof RegExp||e instanceof Function},De=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Oe||Oe!==e){if(e&&"object"==typeof e||(e={}),e=pw(e),ke=-1===Se.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ee="application/xhtml+xml"===ke?ow:tw,I=iw(e,"ALLOWED_TAGS")?uw({},e.ALLOWED_TAGS,Ee):P,F=iw(e,"ALLOWED_ATTR")?uw({},e.ALLOWED_ATTR,Ee):V,ve=iw(e,"ALLOWED_NAMESPACES")?uw({},e.ALLOWED_NAMESPACES,ow):ye,ue=iw(e,"ADD_URI_SAFE_ATTR")?uw(pw(ge),e.ADD_URI_SAFE_ATTR,Ee):ge,de=iw(e,"ADD_DATA_URI_TAGS")?uw(pw(me),e.ADD_DATA_URI_TAGS,Ee):me,le=iw(e,"FORBID_CONTENTS")?uw({},e.FORBID_CONTENTS,Ee):ce,U=iw(e,"FORBID_TAGS")?uw({},e.FORBID_TAGS,Ee):pw({}),j=iw(e,"FORBID_ATTR")?uw({},e.FORBID_ATTR,Ee):pw({}),ie=!!iw(e,"USE_PROFILES")&&e.USE_PROFILES,W=!1!==e.ALLOW_ARIA_ATTR,$=!1!==e.ALLOW_DATA_ATTR,q=e.ALLOW_UNKNOWN_PROTOCOLS||!1,G=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,K=e.SAFE_FOR_TEMPLATES||!1,Y=!1!==e.SAFE_FOR_XML,X=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,oe=e.RETURN_TRUSTED_TYPE||!1,Q=e.FORCE_BODY||!1,ne=!1!==e.SANITIZE_DOM,re=e.SANITIZE_NAMED_PROPS||!1,ae=!1!==e.KEEP_CONTENT,se=e.IN_PLACE||!1,L=e.ALLOWED_URI_REGEXP||Rw,be=e.NAMESPACE||fe,we=e.MATHML_TEXT_INTEGRATION_POINTS||we,_e=e.HTML_INTEGRATION_POINTS||_e,Z=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ae(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Z.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ae(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Z.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Z.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),K&&($=!1),te&&(ee=!0),ie&&(I=uw({},_w),F=[],!0===ie.html&&(uw(I,fw),uw(F,Cw)),!0===ie.svg&&(uw(I,bw),uw(F,kw),uw(F,Ew)),!0===ie.svgFilters&&(uw(I,xw),uw(F,kw),uw(F,Ew)),!0===ie.mathMl&&(uw(I,yw),uw(F,Sw),uw(F,Ew))),e.ADD_TAGS&&(I===P&&(I=pw(I)),uw(I,e.ADD_TAGS,Ee)),e.ADD_ATTR&&(F===V&&(F=pw(F)),uw(F,e.ADD_ATTR,Ee)),e.ADD_URI_SAFE_ATTR&&uw(ue,e.ADD_URI_SAFE_ATTR,Ee),e.FORBID_CONTENTS&&(le===ce&&(le=pw(le)),uw(le,e.FORBID_CONTENTS,Ee)),ae&&(I["#text"]=!0),X&&uw(I,["html","head","body"]),I.table&&(uw(I,["tbody"]),delete U.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw cw('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw cw('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=e.TRUSTED_TYPES_POLICY,_=w.createHTML("")}else void 0===w&&(w=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let o=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(o=t.getAttribute(n));const r="dompurify"+(o?"#"+o:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(p,a)),null!==w&&"string"==typeof _&&(_=w.createHTML(""));Wy&&Wy(e),Oe=e}},Me=uw({},[...bw,...xw,...vw]),Re=uw({},[...yw,...ww]),Ne=function(e){Qy(o.removed,{element:e});try{y(e).removeChild(e)}catch(t){b(e)}},Be=function(e,t){try{Qy(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Qy(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ee||te)try{Ne(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ze=function(e){let t=null,o=null;if(Q)e="<remove></remove>"+e;else{const t=nw(e,/^[\r\n\t ]+/);o=t&&t[0]}"application/xhtml+xml"===ke&&be===fe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=w?w.createHTML(e):e;if(be===fe)try{t=(new g).parseFromString(r,ke)}catch(e){}if(!t||!t.documentElement){t=C.createDocument(be,"template",null);try{t.documentElement.innerHTML=xe?_:r}catch(e){}}const a=t.body||t.documentElement;return e&&o&&a.insertBefore(n.createTextNode(o),a.childNodes[0]||null),be===fe?E.call(t,X?"html":"body")[0]:X?t.documentElement:a},He=function(e){return k.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Le=function(e){return e instanceof u&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof m)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Ie=function(e){return"function"==typeof l&&e instanceof l};function Pe(e,t,n){Yy(e,e=>{e.call(o,t,n,Oe)})}const Fe=function(e){let t=null;if(Pe(T.beforeSanitizeElements,e,null),Le(e))return Ne(e),!0;const n=Ee(e.nodeName);if(Pe(T.uponSanitizeElement,e,{tagName:n,allowedTags:I}),Y&&e.hasChildNodes()&&!Ie(e.firstElementChild)&&lw(/<[/\w!]/g,e.innerHTML)&&lw(/<[/\w!]/g,e.textContent))return Ne(e),!0;if(e.nodeType===Fw)return Ne(e),!0;if(Y&&e.nodeType===Vw&&lw(/<[/\w]/g,e.data))return Ne(e),!0;if(!I[n]||U[n]){if(!U[n]&&Ze(n)){if(Z.tagNameCheck instanceof RegExp&&lw(Z.tagNameCheck,n))return!1;if(Z.tagNameCheck instanceof Function&&Z.tagNameCheck(n))return!1}if(ae&&!le[n]){const t=y(e)||e.parentNode,o=v(e)||e.childNodes;if(o&&t){for(let n=o.length-1;n>=0;--n){const r=f(o[n],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,x(e))}}}return Ne(e),!0}return e instanceof c&&!function(e){let t=y(e);t&&t.tagName||(t={namespaceURI:be,tagName:"template"});const o=tw(e.tagName),n=tw(t.tagName);return!!ve[e.namespaceURI]&&(e.namespaceURI===he?t.namespaceURI===fe?"svg"===o:t.namespaceURI===pe?"svg"===o&&("annotation-xml"===n||we[n]):Boolean(Me[o]):e.namespaceURI===pe?t.namespaceURI===fe?"math"===o:t.namespaceURI===he?"math"===o&&_e[n]:Boolean(Re[o]):e.namespaceURI===fe?!(t.namespaceURI===he&&!_e[n])&&!(t.namespaceURI===pe&&!we[n])&&!Re[o]&&(Ce[o]||!Me[o]):!("application/xhtml+xml"!==ke||!ve[e.namespaceURI]))}(e)?(Ne(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!lw(/<\/no(script|embed|frames)/i,e.innerHTML)?(K&&e.nodeType===Pw&&(t=e.textContent,Yy([A,D,M],e=>{t=rw(t,e," ")}),e.textContent!==t&&(Qy(o.removed,{element:e.cloneNode()}),e.textContent=t)),Pe(T.afterSanitizeElements,e,null),!1):(Ne(e),!0)},Ve=function(e,t,o){if(ne&&("id"===t||"name"===t)&&(o in n||o in Te))return!1;if($&&!j[t]&&lw(R,t));else if(W&&lw(N,t));else if(!F[t]||j[t]){if(!(Ze(e)&&(Z.tagNameCheck instanceof RegExp&&lw(Z.tagNameCheck,e)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(e))&&(Z.attributeNameCheck instanceof RegExp&&lw(Z.attributeNameCheck,t)||Z.attributeNameCheck instanceof Function&&Z.attributeNameCheck(t))||"is"===t&&Z.allowCustomizedBuiltInElements&&(Z.tagNameCheck instanceof RegExp&&lw(Z.tagNameCheck,o)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(o))))return!1}else if(ue[t]);else if(lw(L,rw(o,z,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==aw(o,"data:")||!de[e]){if(q&&!lw(B,rw(o,z,"")));else if(o)return!1}else;return!0},Ze=function(e){return"annotation-xml"!==e&&nw(e,H)},Ue=function(e){Pe(T.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Le(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:F,forceKeepAttr:void 0};let r=t.length;for(;r--;){const a=t[r],{name:s,namespaceURI:i,value:l}=a,c=Ee(s),d=l;let m="value"===s?d:sw(d);if(n.attrName=c,n.attrValue=m,n.keepAttr=!0,n.forceKeepAttr=void 0,Pe(T.uponSanitizeAttribute,e,n),m=n.attrValue,!re||"id"!==c&&"name"!==c||(Be(s,e),m="user-content-"+m),Y&&lw(/((--!?|])>)|<\/(style|title)/i,m)){Be(s,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){Be(s,e);continue}if(!G&&lw(/\/>/i,m)){Be(s,e);continue}K&&Yy([A,D,M],e=>{m=rw(m,e," ")});const u=Ee(e.nodeName);if(Ve(u,c,m)){if(w&&"object"==typeof p&&"function"==typeof p.getAttributeType)if(i);else switch(p.getAttributeType(u,c)){case"TrustedHTML":m=w.createHTML(m);break;case"TrustedScriptURL":m=w.createScriptURL(m)}if(m!==d)try{i?e.setAttributeNS(i,s,m):e.setAttribute(s,m),Le(e)?Ne(e):Jy(o.removed)}catch(t){Be(s,e)}}else Be(s,e)}Pe(T.afterSanitizeAttributes,e,null)},je=function e(t){let o=null;const n=He(t);for(Pe(T.beforeSanitizeShadowDOM,t,null);o=n.nextNode();)Pe(T.uponSanitizeShadowNode,o,null),Fe(o),Ue(o),o.content instanceof s&&e(o.content);Pe(T.afterSanitizeShadowDOM,t,null)};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,a=null,i=null,c=null;if(xe=!e,xe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ie(e)){if("function"!=typeof e.toString)throw cw("toString is not a function");if("string"!=typeof(e=e.toString()))throw cw("dirty is not a string, aborting")}if(!o.isSupported)return e;if(J||De(t),o.removed=[],"string"==typeof e&&(se=!1),se){if(e.nodeName){const t=Ee(e.nodeName);if(!I[t]||U[t])throw cw("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)n=ze("\x3c!----\x3e"),a=n.ownerDocument.importNode(e,!0),a.nodeType===Iw&&"BODY"===a.nodeName||"HTML"===a.nodeName?n=a:n.appendChild(a);else{if(!ee&&!K&&!X&&-1===e.indexOf("<"))return w&&oe?w.createHTML(e):e;if(n=ze(e),!n)return ee?null:oe?_:""}n&&Q&&Ne(n.firstChild);const d=He(se?e:n);for(;i=d.nextNode();)Fe(i),Ue(i),i.content instanceof s&&je(i.content);if(se)return e;if(ee){if(te)for(c=S.call(n.ownerDocument);n.firstChild;)c.appendChild(n.firstChild);else c=n;return(F.shadowroot||F.shadowrootmode)&&(c=O.call(r,c,!0)),c}let m=X?n.outerHTML:n.innerHTML;return X&&I["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&lw(zw,n.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+m),K&&Yy([A,D,M],e=>{m=rw(m,e," ")}),w&&oe?w.createHTML(m):m},o.setConfig=function(){De(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),J=!0},o.clearConfig=function(){Oe=null,J=!1},o.isValidAttribute=function(e,t,o){Oe||De({});const n=Ee(e),r=Ee(t);return Ve(n,r,o)},o.addHook=function(e,t){"function"==typeof t&&Qy(T[e],t)},o.removeHook=function(e,t){if(void 0!==t){const o=Xy(T[e],t);return-1===o?void 0:ew(T[e],o,1)[0]}return Jy(T[e])},o.removeHooks=function(e){T[e]=[]},o.removeAllHooks=function(){T={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();const Ww=lo.each,$w=lo.trim,qw=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],Gw={ftp:21,http:80,https:443,mailto:25},Kw=["img","video"],Yw=(e,t,o)=>{const n=(e=>{try{return decodeURIComponent(e)}catch(t){return unescape(e)}})(t).replace(/\s/g,"");return!e.allow_script_urls&&(!!/((java|vb)script|mhtml):/i.test(n)||!e.allow_html_data_urls&&(/^data:image\//i.test(n)?((e,t)=>_(e)?!e:!_(t)||!j(Kw,t))(e.allow_svg_data_urls,o)&&/^data:image\/svg\+xml/i.test(n):/^data:/i.test(n)))};class Xw{static parseDataUri(e){let t;const o=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(o[0]);return n&&(t=n[1]),{type:t,data:o[1]}}static isDomSafe(e,t,o={}){if(o.allow_script_urls)return!0;{const n=ys.decode(e).replace(/[\s\u0000-\u001F]+/g,"");return!Yw(o,n,t)}}static getDocumentBaseUrl(e){var t;let o;return o=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?null!==(t=e.href)&&void 0!==t?t:"":e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(o)&&(o=o.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(o)||(o+="/")),o}constructor(e,t={}){this.path="",this.directory="",e=$w(e),this.settings=t;const o=t.base_uri,n=this;if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))return void(n.source=e);const r=0===e.indexOf("//");if(0!==e.indexOf("/")||r||(e=(o&&o.protocol||"http")+"://mce_host"+e),!/^[\w\-]*:?\/\//.test(e)){const t=o?o.path:new Xw(document.location.href).directory;if(""===(null==o?void 0:o.protocol))e="//mce_host"+n.toAbsPath(t,e);else{const r=/([^#?]*)([#?]?.*)/.exec(e);r&&(e=(o&&o.protocol||"http")+"://mce_host"+n.toAbsPath(t,r[1])+r[2])}}e=e.replace(/@@/g,"(mce_at)");const a=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a&&Ww(qw,(e,t)=>{let o=a[t];o&&(o=o.replace(/\(mce_at\)/g,"@@")),n[e]=o}),o&&(n.protocol||(n.protocol=o.protocol),n.userInfo||(n.userInfo=o.userInfo),n.port||"mce_host"!==n.host||(n.port=o.port),n.host&&"mce_host"!==n.host||(n.host=o.host),n.source=""),r&&(n.protocol="")}setPath(e){const t=/^(.*?)\/?(\w+)?$/.exec(e);t&&(this.path=t[0],this.directory=t[1],this.file=t[2]),this.source="",this.getURI()}toRelative(e){if("./"===e)return e;const t=new Xw(e,{base_uri:this});if("mce_host"!==t.host&&this.host!==t.host&&t.host||this.port!==t.port||this.protocol!==t.protocol&&""!==t.protocol)return t.getURI();const o=this.getURI(),n=t.getURI();if(o===n||"/"===o.charAt(o.length-1)&&o.substr(0,o.length-1)===n)return o;let r=this.toRelPath(this.path,t.path);return t.query&&(r+="?"+t.query),t.anchor&&(r+="#"+t.anchor),r}toAbsolute(e,t){const o=new Xw(e,{base_uri:this});return o.getURI(t&&this.isSameOrigin(o))}isSameOrigin(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;const t=this.protocol?Gw[this.protocol]:null;if(t&&(this.port||t)==(e.port||t))return!0}return!1}toRelPath(e,t){let o,n,r=0,a="";const s=e.substring(0,e.lastIndexOf("/")).split("/"),i=t.split("/");if(s.length>=i.length)for(o=0,n=s.length;o<n;o++)if(o>=i.length||s[o]!==i[o]){r=o+1;break}if(s.length<i.length)for(o=0,n=i.length;o<n;o++)if(o>=s.length||s[o]!==i[o]){r=o+1;break}if(1===r)return t;for(o=0,n=s.length-(r-1);o<n;o++)a+="../";for(o=r-1,n=i.length;o<n;o++)a+=o!==r-1?"/"+i[o]:i[o];return a}toAbsPath(e,t){let o=0;const n=/\/$/.test(t)?"/":"",r=e.split("/"),a=t.split("/"),s=[];Ww(r,e=>{e&&s.push(e)});const i=[];for(let e=a.length-1;e>=0;e--)0!==a[e].length&&"."!==a[e]&&(".."!==a[e]?o>0?o--:i.push(a[e]):o++);const l=s.length-o;let c;return c=l<=0?ae(i).join("/"):s.slice(0,l).join("/")+"/"+ae(i).join("/"),0!==c.indexOf("/")&&(c="/"+c),n&&c.lastIndexOf("/")!==c.length-1&&(c+=n),c}getURI(e=!1){let t;return this.source&&!e||(t="",e||(this.protocol?t+=this.protocol+"://":t+="//",this.userInfo&&(t+=this.userInfo+"@"),this.host&&(t+=this.host),this.port&&(t+=":"+this.port)),this.path&&(t+=this.path),this.query&&(t+="?"+this.query),this.anchor&&(t+="#"+this.anchor),this.source=t),this.source}}const Jw=lo.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),Qw="data-mce-type";let e_=0;const t_=(e,t,o,n,r)=>{var a,s,i,l;const c=t.validate,d=o.getSpecialElements();8===e.nodeType&&(!t.allow_conditional_comments&&/^\[if/i.test(null!==(a=e.nodeValue)&&void 0!==a?a:"")&&(e.nodeValue=" "+e.nodeValue),t.sanitize&&t.allow_html_in_comments&&p(e.nodeValue)&&(e.nodeValue=(e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"))(e.nodeValue)));const m=null!==(s=null==r?void 0:r.tagName)&&void 0!==s?s:e.nodeName.toLowerCase();if("html"!==n&&o.isValid(n))return void(_(r)&&(r.allowedTags[m]=!0));if(1!==e.nodeType||"body"===m)return;const u=mo.fromDom(e),g=xn(u,Qw),h=fn(u,"data-mce-bogus");if(!g&&p(h))return void("all"===h?_n(u):Cn(u));const f=o.getElementRule(m);if(!c||f){if(_(r)&&(r.allowedTags[m]=!0),c&&f&&!g){if(q(null!==(i=f.attributesForced)&&void 0!==i?i:[],e=>{pn(u,e.name,"{$uid}"===e.value?"mce_"+e_++:e.value)}),q(null!==(l=f.attributesDefault)&&void 0!==l?l:[],e=>{xn(u,e.name)||pn(u,e.name,"{$uid}"===e.value?"mce_"+e_++:e.value)}),f.attributesRequired&&!W(f.attributesRequired,e=>xn(u,e)))return void Cn(u);if(f.removeEmptyAttrs&&(e=>{const t=e.dom.attributes;return null==t||0===t.length})(u))return void Cn(u);f.outputName&&f.outputName!==m&&On(u,f.outputName)}}else Ee(d,m)?_n(u):Cn(u)},o_=(e,t,o,n,r,a)=>"html"!==o&&!Na(n)||!(r in Jw&&Yw(e,a,n))&&(!e.validate||t.isValid(n,r)||Ye(r,"data-")||Ye(r,"aria-")),n_=(e,t)=>e.hasAttribute(Qw)&&("id"===t||"class"===t||"style"===t),r_=(e,t)=>e in t.getBoolAttrs(),a_=(e,t,o,n)=>{const{attributes:r}=e;for(let a=r.length-1;a>=0;a--){const s=r[a],i=s.name,l=s.value;o_(t,o,n,e.tagName.toLowerCase(),i,l)||n_(e,i)?r_(i,o)&&e.setAttribute(i,i):e.removeAttribute(i)}},s_=(e,t,o)=>{const n=jw();return n.addHook("uponSanitizeElement",(n,r)=>{t_(n,e,t,o.track(n),r)}),n.addHook("uponSanitizeAttribute",(n,r)=>{((e,t,o,n,r)=>{const a=e.tagName.toLowerCase(),{attrName:s,attrValue:i}=r;r.keepAttr=o_(t,o,n,a,s,i),r.keepAttr?(r.allowedAttributes[s]=!0,r_(s,o)&&(r.attrValue=s),t.allow_svg_data_urls&&Ye(i,"data:image/svg+xml")&&(r.forceKeepAttr=!0)):n_(e,s)&&(r.forceKeepAttr=!0)})(n,e,t,o.current(),r)}),n},i_=(e,t)=>{const o=jw(),n=t.allow_mathml_annotation_encodings,r=b(n)&&n.length>0,a=(e,o)=>r&&"semantics"===o?P.some(!0):"annotation"===o?P.some(Yr(e)&&(e=>{const t=e.getAttribute("encoding");return r&&p(t)&&j(n,t)})(e)):b(t.extended_mathml_elements)&&t.extended_mathml_elements.includes(o)?P.from(!0):P.none();o.addHook("uponSanitizeElement",(e,o)=>{var n;const r=null!==(n=o.tagName)&&void 0!==n?n:e.nodeName.toLowerCase();a(e,r).each(n=>{o.allowedTags[r]=n,!n&&t.sanitize&&Yr(e)&&e.remove()})}),o.addHook("uponSanitizeAttribute",(e,o)=>{if(b(t.extended_mathml_attributes)){t.extended_mathml_attributes.includes(o.attrName)&&(o.forceKeepAttr=!0)}}),o.sanitize(e,{IN_PLACE:!0,USE_PROFILES:{mathMl:!0}})},l_=e=>t=>{const o=za(t);if("svg"===o)(e=>{const t=["type","href","role","arcrole","title","show","actuate","label","from","to"].map(e=>`xlink:${e}`),o={IN_PLACE:!0,USE_PROFILES:{html:!0,svg:!0,svgFilters:!0},ALLOWED_ATTR:t};jw().sanitize(e,o)})(t);else{if("math"!==o)throw new Error("Not a namespace element");i_(t,e)}},c_=(e,t)=>{const o=(()=>{const e=$e(),t=()=>e.get().map(za).getOr("html");return{track:o=>(Ba(o)?e.set(o):e.get().exists(e=>!e.contains(o))&&e.clear(),t()),current:t,reset:()=>{e.clear()}}})();if(e.sanitize){const n=s_(e,t,o),r=(t,r)=>{n.sanitize(t,((e,t)=>{const o={IN_PLACE:!0,ALLOW_UNKNOWN_PROTOCOLS:!0,ALLOWED_TAGS:["#comment","#cdata-section","body"],ALLOWED_ATTR:[]};return o.PARSER_MEDIA_TYPE=t,e.allow_script_urls?o.ALLOWED_URI_REGEXP=/.*/:e.allow_html_data_urls&&(o.ALLOWED_URI_REGEXP=/^(?!(\w+script|mhtml):)/i),o})(e,r)),n.removed=[],o.reset()};return{sanitizeHtmlElement:r,sanitizeNamespaceElement:l_(e)}}return{sanitizeHtmlElement:(n,r)=>{const a=document.createNodeIterator(n,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_TEXT);let s;for(;s=a.nextNode();){const n=o.track(s);t_(s,e,t,n),Yr(s)&&a_(s,e,t,n)}o.reset()},sanitizeNamespaceElement:E}},d_=lo.makeMap,m_=lo.extend,u_=(e,t,o,n,r)=>{const a=e.name,s=a in o&&"title"!==a&&"textarea"!==a&&"noscript"!==a,i=t.childNodes;for(let t=0,a=i.length;t<a;t++){const a=i[t],l=new jh(a.nodeName.toLowerCase(),a.nodeType);if(Yr(a)){const e=a.attributes;for(let t=0,o=e.length;t<o;t++){const o=e[t];l.attr(o.name,o.value)}Na(l.name)&&(n(a),l.value=a.innerHTML)}else aa(a)?(l.value=a.data,s&&(l.raw=!0)):la(a)?l.value=r?Cy(a.data):a.data:(sa(a)||ia(a))&&(l.value=a.data);Na(l.name)||u_(l,a,o,n,r),e.append(l)}},g_=(e,t,o,n)=>{const r=o.validate,a=t.getNonEmptyElements(),s=t.getWhitespaceElements(),i=m_(d_("script,style,head,html,body,title,meta,param"),t.getBlockElements()),l=Ls(t),c=/[ \t\r\n]+/g,d=/^[ \t\r\n]+/,m=/[ \t\r\n]+$/,u=e=>{let t=e.parent;for(;_(t);){if(t.name in s)return!0;t=t.parent}return!1},g=o=>o.name in i||Ya(t,o)||Na(o.name)&&o.parent===e,p=(t,o)=>{const r=o?t.prev:t.next;return!_(r)&&!w(t.parent)&&(g(t.parent)&&(t.parent!==e||!0===n.isRootContent))};return[e=>{var t;if(3===e.type&&!u(e)){let o=null!==(t=e.value)&&void 0!==t?t:"";o=o.replace(c," "),(((e,t)=>_(e)&&(t(e)||"br"===e.name))(e.prev,g)||p(e,!0))&&(o=o.replace(d,"")),0===o.length||" "===o&&e.prev&&8===e.prev.type&&e.next&&8===e.next.type?e.remove():e.value=o}},e=>{var i;if(1===e.type){const i=t.getElementRule(e.name);if(r&&i){const r=Dx(t,a,s,e);i.paddInEmptyBlock&&r&&(e=>{let o=e;for(;_(o);){if(o.name in l)return Dx(t,a,s,o);o=o.parent}return!1})(e)?Tx(o,n,g,e):i.removeEmpty&&r?g(e)?e.remove():e.unwrap():i.paddEmpty&&(r||(e=>{var t;return Ax(e,"#text")&&(null===(t=null==e?void 0:e.firstChild)||void 0===t?void 0:t.value)===ct})(e))&&Tx(o,n,g,e)}}else if(3===e.type&&!u(e)){let t=null!==(i=e.value)&&void 0!==i?i:"";(e.next&&g(e.next)||p(e,!1))&&(t=t.replace(m,"")),0===t.length?e.remove():e.value=t}}]},p_=(e={},t=Ps())=>{const o=_y(),n=_y(),r={validate:!0,root_name:"body",sanitize:!0,allow_html_in_comments:!0,...e},a=new DOMParser,s=c_(r,t),i=o.addFilter,l=o.getFilters,c=o.removeFilter,d=n.addFilter,m=n.getFilters,u=n.removeFilter,g=(e,o)=>{const n=p(o.attr(Qw)),r=1===o.type&&!Ee(e,o.name)&&!Ya(t,o)&&!Na(o.name);return 3===o.type||r&&!n},h={schema:t,addAttributeFilter:d,getAttributeFilters:m,removeAttributeFilter:u,addNodeFilter:i,getNodeFilters:l,removeNodeFilter:c,parse:(e,o={})=>{var n;const i=r.validate,c=null!==(n=o.context)&&void 0!==n?n:r.root_name,d=((e,o,n="html")=>{const r="xhtml"===n?"application/xhtml+xml":"text/html",i=Ee(t.getSpecialElements(),o.toLowerCase()),l=i?`<${o}>${e}</${o}>`:e,c=a.parseFromString("xhtml"===n?`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>${l}</body></html>`:/^[\s]*<head/i.test(e)||/^[\s]*<html/i.test(e)||/^[\s]*<!DOCTYPE/i.test(e)?`<html>${l}</html>`:`<body>${l}</body>`,r).body;return s.sanitizeHtmlElement(c,r),i?c.firstChild:c})(e,c,o.format);Ua(t,d);const u=new jh(c,11);u_(u,d,t.getSpecialElements(),s.sanitizeNamespaceElement,r.sanitize&&r.allow_html_in_comments),d.innerHTML="";const[p,h]=g_(u,t,r,o),f=[],b=i?e=>((e,o)=>{Bx(t,e)&&o.push(e)})(e,f):E,x={nodes:{},attributes:{}},v=e=>Sx(l(),m(),e,x);if(((e,t,o)=>{const n=[];for(let o=e,r=o;o;r=o,o=o.walk()){const a=o;q(t,e=>e(a)),w(a.parent)&&a!==e?o=r:n.push(a)}for(let e=n.length-1;e>=0;e--){const t=n[e];q(o,e=>e(t))}})(u,[p,v],[h,b]),f.reverse(),i&&f.length>0)if(o.context){const{pass:e,fail:n}=K(f,e=>e.parent===u);Nx(n,t,u,v),o.invalid=e.length>0}else Nx(f,t,u,v);const y=((e,t)=>{var o;const n=null!==(o=t.forced_root_block)&&void 0!==o?o:e.forced_root_block;return!1===n?"":!0===n?"p":n})(r,o);return y&&("body"===u.name||o.isRootContent)&&((e,o)=>{const n=m_(d_("script,style,head,html,body,title,meta,param"),t.getBlockElements()),a=/^[ \t\r\n]+/,s=/[ \t\r\n]+$/;let i=e.firstChild,l=null;const c=e=>{var t,o;e&&(i=e.firstChild,i&&3===i.type&&(i.value=null===(t=i.value)||void 0===t?void 0:t.replace(a,"")),i=e.lastChild,i&&3===i.type&&(i.value=null===(o=i.value)||void 0===o?void 0:o.replace(s,"")))};if(t.isValidChild(e.name,o.toLowerCase())){for(;i;){const t=i.next;g(n,i)?(l||(l=new jh(o,1),l.attr(r.forced_root_block_attrs),e.insert(l,i)),l.append(i)):(c(l),l=null),i=t}c(l)}})(u,y),o.invalid||Ex(x,o),u}};return((e,t)=>{var o,n;const r=e.schema;e.addAttributeFilter("href",e=>{let o=e.length;const n=e=>{const t=e?lo.trim(e):"";return/\b(noopener)\b/g.test(t)?t:(e=>e.split(" ").filter(e=>e.length>0).concat(["noopener"]).sort().join(" "))(t)};if(!t.allow_unsafe_link_target)for(;o--;){const t=e[o];"a"===t.name&&"_blank"===t.attr("target")&&t.attr("rel",n(t.attr("rel")))}}),t.allow_html_in_named_anchor||e.addAttributeFilter("id,name",e=>{let t,o,n,r,a=e.length;for(;a--;)if(r=e[a],"a"===r.name&&r.firstChild&&!r.attr("href"))for(n=r.parent,t=r.lastChild;t&&n;)o=t.prev,n.insert(t,r),t=o}),t.fix_list_elements&&e.addNodeFilter("ul,ol",e=>{let t,o,n=e.length;for(;n--;)if(t=e[n],o=t.parent,o&&("ul"===o.name||"ol"===o.name))if(t.prev&&"li"===t.prev.name)t.prev.append(t);else{const e=new jh("li",1);e.attr("style","list-style-type: none"),t.wrap(e)}});const a=r.getValidClasses();t.validate&&a&&e.addAttributeFilter("class",e=>{var t;let o=e.length;for(;o--;){const n=e[o],r=null!==(t=n.attr("class"))&&void 0!==t?t:"",s=lo.explode(r," ");let i="";for(let e=0;e<s.length;e++){const t=s[e];let o=!1,r=a["*"];r&&r[t]&&(o=!0),r=a[n.name],!o&&r&&r[t]&&(o=!0),o&&(i&&(i+=" "),i+=t)}i.length||(i=null),n.attr("class",i)}}),Py(e,t);const s=null!==(o=t.sandbox_iframes)&&void 0!==o&&o,i=pe(null!==(n=t.sandbox_iframes_exclusions)&&void 0!==n?n:[]);t.convert_unsafe_embeds&&e.addNodeFilter("object,embed",e=>q(e,e=>{e.replace(Iy({type:e.attr("type"),src:"object"===e.name?e.attr("data"):e.attr("src"),width:e.attr("width"),height:e.attr("height")},s,i))})),s&&e.addNodeFilter("iframe",e=>q(e,e=>Hy(e,i)))})(h,r),((e,t,o)=>{t.inline_styles&&Sy(e,t,o)})(h,r,t),h},h_=(e,t,o)=>{const n=(e=>tv(e)?mf({validate:!1}).serialize(e):e)(e),r=t(n);if(r.isDefaultPrevented())return r;if(tv(e)){if(r.content!==n){const t=p_({validate:!1,forced_root_block:!1,...o}).parse(r.content,{context:e.name});return{...r,content:t}}return{...r,content:e}}return r},f_=e=>({sanitize:Cm(e),sandbox_iframes:Am(e),sandbox_iframes_exclusions:Dm(e)}),b_=(e,t)=>{if(t.no_events)return Re.value(t);{const o=((e,t)=>e.dispatch("BeforeGetContent",t))(e,t);return o.isDefaultPrevented()?Re.error(Dc(e,{content:"",...o}).content):Re.value(o)}},x_=(e,t,o)=>{if(o.no_events)return t;{const n=h_(t,t=>Dc(e,{...o,content:t}),f_(e));return n.content}},v_=(e,t)=>{if(t.no_events)return Re.value(t);{const o=h_(t.content,o=>((e,t)=>e.dispatch("BeforeSetContent",t))(e,{...t,content:o}),f_(e));return o.isDefaultPrevented()?(Ac(e,o),Re.error(void 0)):Re.value(o)}},y_=(e,t,o)=>{o.no_events||Ac(e,{...o,content:t})},w_=(e,t,o)=>({element:e,width:t,rows:o}),__=(e,t)=>({element:e,cells:t}),C_=(e,t)=>({x:e,y:t}),k_=(e,t)=>bn(e,t).bind(rt).getOr(1),S_=(e,t,o)=>{const n=e.rows;return!!(n[o]?n[o].cells:[])[t]},E_=e=>J(e,(e,t)=>t.cells.length>e?t.cells.length:e,0),O_=(e,t)=>{const o=e.rows;for(let e=0;e<o.length;e++){const n=o[e].cells;for(let o=0;o<n.length;o++)if(vo(n[o],t))return P.some(C_(o,e))}return P.none()},T_=(e,t,o,n,r)=>{const a=[],s=e.rows;for(let e=o;e<=r;e++){const o=s[e].cells,r=t<n?o.slice(t,n+1):o.slice(n,t+1);a.push(__(s[e].element,r))}return a},A_=e=>{const t=w_(Sn(e),0,[]);return q(wr(e,"tr"),(e,o)=>{q(wr(e,"td,th"),(n,r)=>{((e,t,o,n,r)=>{const a=k_(r,"rowspan"),s=k_(r,"colspan"),i=e.rows;for(let e=o;e<o+a;e++){i[e]||(i[e]=__(En(n),[]));for(let n=t;n<t+s;n++)i[e].cells[n]=e===o&&n===t?r:Sn(r)}})(t,((e,t,o)=>{for(;S_(e,t,o);)t++;return t})(t,r,o),o,e,n)})}),w_(t.element,E_(t.rows),t.rows)},D_=e=>((e,t)=>{const o=Sn(e.element),n=mo.fromTag("tbody");return un(n,t),dn(o,n),o})(e,(e=>$(e.rows,e=>{const t=$(e.cells,e=>{const t=En(e);return vn(t,"colspan"),vn(t,"rowspan"),t}),o=Sn(e.element);return un(o,t),o}))(e)),M_=(e,t,o)=>O_(e,t).bind(t=>O_(e,o).map(o=>((e,t,o)=>{const n=t.x,r=t.y,a=o.x,s=o.y,i=r<s?T_(e,n,r,a,s):T_(e,n,s,a,r);return w_(e.element,E_(i),i)})(e,t,o))),R_=(e,t)=>ee(e,e=>"li"===_o(e)&&_g(e,t)).fold(A([]),t=>(e=>ee(e,e=>"ul"===_o(e)||"ol"===_o(e)))(e).map(e=>{const t=mo.fromTag(_o(e)),o=_e(Pn(e),(e,t)=>Ye(t,"list-style"));return zn(t,o),[mo.fromTag("li"),t]}).getOr([])),N_=(e,t,o)=>{const n=mo.fromDom(t.commonAncestorContainer),r=zf(n,e),a=Y(r,e=>o.isWrapper(_o(e))),s=R_(r,t),i=a.concat(s.length?s:(e=>Zi(e)?Bo(e).filter(Vi).fold(A([]),t=>[e,t]):Vi(e)?[e]:[])(n));return $(i,Sn)},B_=()=>Kn([]),z_=(e,t,o)=>((e,t)=>{const o=J(t,(e,t)=>(dn(t,e),t),e);return t.length>0?Kn([o]):o})(mo.fromDom(t.cloneContents()),N_(e,t,o)),H_=(e,t)=>((e,t)=>ar(t,"table",R(vo,e)))(e,t[0]).bind(e=>{const o=t[0],n=t[t.length-1],r=A_(e);return M_(r,o,n).map(e=>Kn([D_(e)]))}).getOrThunk(B_),L_=(e,t,o)=>{const n=bg(t,e);return n.length>0?H_(e,n):((e,t,o)=>t.length>0&&t[0].collapsed?B_():z_(e,t[0],o))(e,t,o)},I_=(e,t)=>t>=0&&t<e.length&&gg(e.charAt(t)),P_=e=>Xi(e.innerText),F_=(e,t)=>{if("text"===t.format)return(e=>P.from(e.selection.getRng()).map(t=>{var o;const n=P.from(e.dom.getParent(t.commonAncestorContainer,e.dom.isBlock)),r=e.getBody(),a=(e=>e.map(e=>e.nodeName).getOr("div").toLowerCase())(n),s=mo.fromDom(t.cloneContents());rf(s),af(s);const i=e.dom.add(r,a,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},s.dom),l=P_(i),c=Xi(null!==(o=i.textContent)&&void 0!==o?o:"");if(e.dom.remove(i),I_(c,0)||I_(c,c.length-1)){const e=n.getOr(r),t=P_(e),o=t.indexOf(l);return-1===o?l:(I_(t,o-1)?" ":"")+l+(I_(t,o+l.length)?" ":"")}return l}).getOr(""))(e);{const o=((e,t)=>{const o=e.selection.getRng(),n=e.dom.create("body"),r=e.selection.getSel(),a=Ph(e,hg(r)),s=t.contextual?L_(mo.fromDom(e.getBody()),a,e.schema).dom:o.cloneContents();return s&&n.appendChild(s),e.selection.serializer.serialize(n,t)})(e,t);return"tree"===t.format?o:e.selection.isCollapsed()?"":o}},V_=e=>Yr(e)?e.outerHTML:aa(e)?ys.encodeRaw(e.data,!1):la(e)?"\x3c!--"+e.data+"--\x3e":"",Z_=(e,t,o)=>{const n=(e=>{let t;const o=document.createElement("div"),n=document.createDocumentFragment();for(e&&(o.innerHTML=e);t=o.firstChild;)n.appendChild(t);return n})(t);if(e.hasChildNodes()&&o<e.childNodes.length){const t=e.childNodes[o];e.insertBefore(n,t)}else e.appendChild(n)},U_=(e,t)=>(((e,t)=>{let o=0;q(e,e=>{0===e[0]?o++:1===e[0]?(Z_(t,e[1],o),o++):2===e[0]&&((e,t)=>{if(e.hasChildNodes()&&t<e.childNodes.length){const o=e.childNodes[t];e.removeChild(o)}})(t,o)})})(((e,t)=>{const o=e.length+t.length+2,n=new Array(o),r=new Array(o),a=(o,n,r,s,l)=>{const c=i(o,n,r,s);if(null===c||c.start===n&&c.diag===n-s||c.end===o&&c.diag===o-r){let a=o,i=r;for(;a<n||i<s;)a<n&&i<s&&e[a]===t[i]?(l.push([0,e[a]]),++a,++i):n-o>s-r?(l.push([2,e[a]]),++a):(l.push([1,t[i]]),++i)}else{a(o,c.start,r,c.start-c.diag,l);for(let t=c.start;t<c.end;++t)l.push([0,e[t]]);a(c.end,n,c.end-c.diag,s,l)}},s=(o,n,r,a)=>{let s=o;for(;s-n<a&&s<r&&e[s]===t[s-n];)++s;return((e,t,o)=>({start:e,end:t,diag:o}))(o,s,n)},i=(o,a,i,l)=>{const c=a-o,d=l-i;if(0===c||0===d)return null;const m=c-d,u=d+c,g=(u%2==0?u:u+1)/2;let p,h,f,b,x;for(n[1+g]=o,r[1+g]=a+1,p=0;p<=g;++p){for(h=-p;h<=p;h+=2){for(f=h+g,h===-p||h!==p&&n[f-1]<n[f+1]?n[f]=n[f+1]:n[f]=n[f-1]+1,b=n[f],x=b-o+i-h;b<a&&x<l&&e[b]===t[x];)n[f]=++b,++x;if(m%2!=0&&m-p<=h&&h<=m+p&&r[f-m]<=n[f])return s(r[f-m],h+o-i,a,l)}for(h=m-p;h<=m+p;h+=2){for(f=h+g-m,h===m-p||h!==m+p&&r[f+1]<=r[f-1]?r[f]=r[f+1]-1:r[f]=r[f-1],b=r[f]-1,x=b-o+i-h;b>=o&&x>=i&&e[b]===t[x];)r[f]=b--,x--;if(m%2==0&&-p<=h&&h<=p&&r[f]<=n[f+m])return s(r[f],h+o-i,a,l)}}return null},l=[];return a(0,e.length,0,t.length,l),l})($(ue(t.childNodes),V_),e),t),t),j_=it(()=>document.implementation.createHTMLDocument("undo")),W_=e=>{const t=e.serializer.getTempAttrs(),o=nf(e.getBody(),t);return(e=>null!==e.querySelector("iframe"))(o)?(n=((e,t)=>Y($(ue(e.childNodes),t?O(Xi,V_):V_),e=>e.length>0))(o,!0),{type:"fragmented",fragments:n,content:"",bookmark:null,beforeBookmark:null}):{type:"complete",fragments:null,content:Xi(o.innerHTML),bookmark:null,beforeBookmark:null};var n},$_=(e,t,o)=>{const n=o?t.beforeBookmark:t.bookmark;"fragmented"===t.type?U_(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw",no_selection:!_(n)||!Qu(n)||!n.isFakeCaret}),n&&(e.selection.moveToBookmark(n),e.selection.scrollIntoView())},q_=e=>"fragmented"===e.type?e.fragments.join(""):e.content,G_=e=>{const t=mo.fromTag("body",j_());return Dn(t,q_(e)),q(wr(t,"*[data-mce-bogus]"),Cn),An(t)},K_=(e,t)=>!(!e||!t)&&(!!((e,t)=>q_(e)===q_(t))(e,t)||((e,t)=>G_(e)===G_(t))(e,t)),Y_=e=>0===e.get(),X_=(e,t,o)=>{Y_(o)&&(e.typing=t)},J_=(e,t)=>{e.typing&&(X_(e,!1,t),e.add())},Q_=e=>({init:{bindEvents:E},undoManager:{beforeChange:(t,o)=>((e,t,o)=>{Y_(t)&&o.set(xc(e.selection))})(e,t,o),add:(t,o,n,r,a,s)=>((e,t,o,n,r,a,s)=>{const i=W_(e),l=lo.extend(a||{},i);if(!Y_(n)||e.removed)return null;const c=t.data[o.get()];if(e.dispatch("BeforeAddUndo",{level:l,lastLevel:c,originalEvent:s}).isDefaultPrevented())return null;if(c&&K_(c,l))return null;t.data[o.get()]&&r.get().each(e=>{t.data[o.get()].beforeBookmark=e});const d=Fd(e);if(d&&t.data.length>d){for(let e=0;e<t.data.length-1;e++)t.data[e]=t.data[e+1];t.data.length--,o.set(t.data.length)}l.bookmark=xc(e.selection),o.get()<t.data.length-1&&(t.data.length=o.get()+1),t.data.push(l),o.set(t.data.length-1);const m={level:l,lastLevel:c,originalEvent:s};return o.get()>0?(e.setDirty(!0),e.dispatch("AddUndo",m),e.dispatch("change",m)):e.dispatch("AddUndo",m),l})(e,t,o,n,r,a,s),undo:(t,o,n)=>((e,t,o,n)=>{let r;return t.typing&&(t.add(),t.typing=!1,X_(t,!1,o)),n.get()>0&&(n.set(n.get()-1),r=t.data[n.get()],$_(e,r,!0),e.setDirty(!0),e.dispatch("Undo",{level:r})),r})(e,t,o,n),redo:(t,o)=>((e,t,o)=>{let n;return t.get()<o.length-1&&(t.set(t.get()+1),n=o[t.get()],$_(e,n,!1),e.setDirty(!0),e.dispatch("Redo",{level:n})),n})(e,t,o),clear:(t,o)=>((e,t,o)=>{t.data=[],o.set(0),t.typing=!1,e.dispatch("ClearUndos")})(e,t,o),reset:e=>(e=>{e.clear(),e.add()})(e),hasUndo:(t,o)=>((e,t,o)=>o.get()>0||t.typing&&t.data[0]&&!K_(W_(e),t.data[0]))(e,t,o),hasRedo:(e,t)=>((e,t)=>t.get()<e.data.length-1&&!e.typing)(e,t),transact:(e,t,o)=>((e,t,o)=>(J_(e,t),e.beforeChange(),e.ignore(o),e.add()))(e,t,o),ignore:(e,t)=>((e,t)=>{try{e.set(e.get()+1),t()}finally{e.set(e.get()-1)}})(e,t),extra:(t,o,n,r)=>((e,t,o,n,r)=>{if(t.transact(n)){const n=t.data[o.get()].bookmark,a=t.data[o.get()-1];$_(e,a,!0),t.transact(r)&&(t.data[o.get()-1].beforeBookmark=n)}})(e,t,o,n,r)},formatter:{match:(t,o,n,r)=>dv(e,t,o,n,r),matchAll:(t,o)=>((e,t,o)=>{const n=[],r={},a=e.selection.getStart();return e.dom.getParent(a,a=>{for(let s=0;s<t.length;s++){const i=t[s];!r[i]&&cv(e,a,i,o)&&(r[i]=!0,n.push(i))}},e.dom.getRoot()),n})(e,t,o),matchNode:(t,o,n,r)=>cv(e,t,o,n,r),canApply:t=>((e,t)=>{const o=e.formatter.get(t),n=e.dom;if(o&&e.selection.isEditable()){const t=e.selection.getStart(),r=Vg(n,t);for(let e=o.length-1;e>=0;e--){const t=o[e];if(!Wg(t))return!0;for(let e=r.length-1;e>=0;e--)if(n.is(r[e],t.selector))return!0}}return!1})(e,t),closest:t=>mv(e,t),apply:(t,o,n)=>py(e,t,o,n),remove:(t,o,n,r)=>iy(e,t,o,n,r),toggle:(t,o,n)=>((e,t,o,n)=>{const r=e.formatter.get(t);r&&(!dv(e,t,o,n)||"toggle"in r[0]&&!r[0].toggle?py(e,t,o,n):iy(e,t,o,n))})(e,t,o,n),formatChanged:(t,o,n,r,a)=>yy(e,t,o,n,r,a)},editor:{getContent:t=>((e,t)=>P.from(e.getBody()).fold(A("tree"===t.format?new jh("body",11):""),o=>lf(e,t,o)))(e,t),setContent:(t,o)=>nv(e,t,o),insertContent:(t,o)=>ev(e,t,o),addVisual:t=>((e,t)=>{const o=e.dom,n=_(t)?t:e.getBody();q(o.select("table,a",n),t=>{switch(t.nodeName){case"TABLE":const n=Kd(e),r=o.getAttrib(t,"border");r&&"0"!==r||!e.hasVisual?o.removeClass(t,n):o.addClass(t,n);break;case"A":if(!o.getAttrib(t,"href")){const n=o.getAttrib(t,"name")||t.id,r=Yd(e);n&&e.hasVisual?o.addClass(t,r):o.removeClass(t,r)}}}),e.dispatch("VisualAid",{element:t,hasVisual:e.hasVisual})})(e,t)},selection:{getContent:(t,o)=>((e,t,o={})=>{const n=((e,t)=>({...e,format:t,get:!0,selection:!0,getInner:!0}))(o,t);return b_(e,n).fold(D,t=>{const o=F_(e,t);return x_(e,o,t)})})(e,t,o)},autocompleter:{addDecoration:E,removeDecoration:E},raw:{getModel:()=>P.none()}}),eC=e=>Ee(e.plugins,"rtc"),tC=e=>{const t=e;return(e=>Se(e.plugins,"rtc").bind(e=>P.from(e.setup)))(e).fold(()=>(t.rtcInstance=Q_(e),P.none()),e=>(t.rtcInstance=(()=>{const e=A(null),t=A("");return{init:{bindEvents:E},undoManager:{beforeChange:E,add:e,undo:e,redo:e,clear:E,reset:E,hasUndo:L,hasRedo:L,transact:e,ignore:E,extra:E},formatter:{match:L,matchAll:A([]),matchNode:A(void 0),canApply:L,closest:t,apply:E,remove:E,toggle:E,formatChanged:A({unbind:E})},editor:{getContent:t,setContent:A({content:"",html:""}),insertContent:A(""),addVisual:E},selection:{getContent:t},autocompleter:{addDecoration:E,removeDecoration:E},raw:{getModel:A(P.none())}}})(),P.some(()=>e().then(e=>(t.rtcInstance=(e=>{const t=e=>h(e)?e:{},{init:o,undoManager:n,formatter:r,editor:a,selection:s,autocompleter:i,raw:l}=e;return{init:{bindEvents:o.bindEvents},undoManager:{beforeChange:n.beforeChange,add:n.add,undo:n.undo,redo:n.redo,clear:n.clear,reset:n.reset,hasUndo:n.hasUndo,hasRedo:n.hasRedo,transact:(e,t,o)=>n.transact(o),ignore:(e,t)=>n.ignore(t),extra:(e,t,o,r)=>n.extra(o,r)},formatter:{match:(e,o,n,a)=>r.match(e,t(o),a),matchAll:r.matchAll,matchNode:r.matchNode,canApply:e=>r.canApply(e),closest:e=>r.closest(e),apply:(e,o,n)=>r.apply(e,t(o)),remove:(e,o,n,a)=>r.remove(e,t(o)),toggle:(e,o,n)=>r.toggle(e,t(o)),formatChanged:(e,t,o,n,a)=>r.formatChanged(t,o,n,a)},editor:{getContent:e=>a.getContent(e),setContent:(e,t)=>({content:a.setContent(e,t),html:""}),insertContent:(e,t)=>(a.insertContent(e),""),addVisual:a.addVisual},selection:{getContent:(e,t)=>s.getContent(t)},autocompleter:{addDecoration:i.addDecoration,removeDecoration:i.removeDecoration},raw:{getModel:()=>P.some(l.getRawModel())}}})(e),e.rtc.isRemote)))))},oC=e=>e.rtcInstance?e.rtcInstance:Q_(e),nC=e=>{const t=e.rtcInstance;if(t)return t;throw new Error("Failed to get RTC instance not yet initialized.")},rC=e=>nC(e).init.bindEvents(),aC=(e,t={})=>((e,t,o)=>nC(e).selection.getContent(t,o))(e,t.format?t.format:"html",t),sC=e=>0===e.dom.length?(_n(e),P.none()):P.some(e),iC=(e,t,o,n,r)=>{e.bind(e=>((n?hb:pb)(e.dom,n?e.dom.length:0,r),t.filter(Oo).map(t=>((e,t,o,n,r)=>{const a=e.dom,s=t.dom,i=n?a.length:s.length;n?(fb(a,s,r,!1,!n),o.setStart(s,i)):(fb(s,a,r,!1,!n),o.setEnd(s,i))})(e,t,o,n,r)))).orThunk(()=>{const e=((e,t)=>e.filter(e=>wp.isBookmarkNode(e.dom)).bind(t?Io:Lo))(t,n).or(t).filter(Oo);return e.map(e=>((e,t,o)=>{Bo(e).each(n=>{const r=e.dom;t&&rb(n,Yl(r,0),o)?pb(r,0,o):!t&&ab(n,Yl(r,r.length),o)&&hb(r,r.length,o)})})(e,n,r))})},lC=(e,t,o={})=>{const n=((e,t)=>({format:"html",...e,set:!0,selection:!0,content:t}))(o,t);v_(e,n).each(t=>{const o=((e,t)=>{if("raw"!==t.format){const o=e.selection.getRng(),n=e.dom.getParent(o.commonAncestorContainer,e.dom.isBlock),r=n?{context:n.nodeName.toLowerCase()}:{},a=e.parser.parse(t.content,{forced_root_block:!1,...r,...t});return mf({validate:!1},e.schema).serialize(a)}return t.content})(e,t),n=e.selection.getRng();((e,t,o)=>{const n=P.from(t.firstChild).map(mo.fromDom),r=P.from(t.lastChild).map(mo.fromDom);e.deleteContents(),e.insertNode(t);const a=n.bind(Lo).filter(Oo).bind(sC),s=r.bind(Io).filter(Oo).bind(sC);iC(a,n,e,!0,o),iC(s,r,e,!1,o),e.collapse(!1)})(n,n.createContextualFragment(o),e.schema),e.selection.setRng(n),Nh(e,n),y_(e,o,t)})},cC=(e,t,o)=>{if(Ee(e,t)){const n=Y(e[t],e=>e!==o);0===n.length?delete e[t]:e[t]=n}};var dC=(e,t)=>{let o,n;const r=(t,o)=>ee(o,o=>e.is(o,t)),a=t=>e.getParents(t,void 0,e.getRoot());return{selectorChangedWithUnbind:(e,s)=>(o||(o={},n={},t.on("NodeChange",e=>{const t=e.element,s=a(t),i={};be(o,(e,t)=>{r(t,s).each(o=>{n[t]||(q(e,e=>{e(!0,{node:o,selector:t,parents:s})}),n[t]=e),i[t]=e})}),be(n,(e,o)=>{i[o]||(delete n[o],q(e,e=>{e(!1,{node:t,selector:o,parents:s})}))})})),o[e]||(o[e]=[]),o[e].push(s),r(e,a(t.selection.getStart())).each(()=>{n[e]=o[e]}),{unbind:()=>{cC(o,e,s),cC(n,e,s)}})}};const mC=e=>!(!e||!e.ownerDocument)&&yo(mo.fromDom(e.ownerDocument),mo.fromDom(e)),uC=(e,t,o,n)=>{let r,a;const{selectorChangedWithUnbind:s}=dC(e,n),i=(e,t)=>lC(n,e,t),l=e=>{const t=d();t.collapse(!!e),m(t)},c=()=>t.getSelection?t.getSelection():t.document.selection,d=()=>{let o;const s=(e,t,o)=>{try{return t.compareBoundaryPoints(e,o)}catch(e){return-1}},i=t.document;if(_(n.bookmark)&&!Kp(n)){const e=Mp(n);if(e.isSome())return e.map(e=>Ph(n,[e])[0]).getOr(i.createRange())}try{const e=c();e&&!Kr(e.anchorNode)&&(o=e.rangeCount>0?e.getRangeAt(0):i.createRange(),o=Ph(n,[o])[0])}catch(e){}if(o||(o=i.createRange()),ca(o.startContainer)&&o.collapsed){const t=e.getRoot();o.setStart(t,0),o.setEnd(t,0)}return r&&a&&(0===s(o.START_TO_START,o,r)&&0===s(o.END_TO_END,o,r)?o=a:(r=null,a=null)),o},m=(e,t)=>{if(!(e=>!!e&&mC(e.startContainer)&&mC(e.endContainer))(e))return;const o=c();if(e=n.dispatch("SetSelectionRange",{range:e,forward:t}).range,o){a=e;try{o.removeAllRanges(),o.addRange(e)}catch(e){}!1===t&&o.extend&&(o.collapse(e.endContainer,e.endOffset),o.extend(e.startContainer,e.startOffset)),r=o.rangeCount>0?o.getRangeAt(0):null}if(!e.collapsed&&e.startContainer===e.endContainer&&(null==o?void 0:o.setBaseAndExtent)&&e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()){const t=e.startContainer.childNodes[e.startOffset];t&&"IMG"===t.nodeName&&(o.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),o.anchorNode===e.startContainer&&o.focusNode===e.endContainer||o.setBaseAndExtent(t,0,t,1))}n.dispatch("AfterSetSelectionRange",{range:e,forward:t})},u=()=>{const t=c(),o=null==t?void 0:t.anchorNode,n=null==t?void 0:t.focusNode;if(!t||!o||!n||Kr(o)||Kr(n))return!0;const r=e.createRng(),a=e.createRng();try{r.setStart(o,t.anchorOffset),r.collapse(!0),a.setStart(n,t.focusOffset),a.collapse(!0)}catch(e){return!0}return r.compareBoundaryPoints(r.START_TO_START,a)<=0},g={dom:e,win:t,serializer:o,editor:n,expand:(t={type:"word"})=>m(fh(e).expand(d(),t)),collapse:l,setCursorLocation:(t,o)=>{const r=e.createRng();_(t)&&_(o)?(r.setStart(t,o),r.setEnd(t,o),m(r),l(!1)):(Cg(e,r,n.getBody(),!0),m(r))},getContent:e=>aC(n,e),setContent:i,getBookmark:(e,t)=>p.getBookmark(e,t),moveToBookmark:e=>p.moveToBookmark(e),select:(t,o)=>(((e,t,o)=>P.from(t).bind(t=>P.from(t.parentNode).map(n=>{const r=e.nodeIndex(t),a=e.createRng();return a.setStart(n,r),a.setEnd(n,r+1),o&&(Cg(e,a,t,!0),Cg(e,a,t,!1)),a})))(e,t,o).each(m),t),isCollapsed:()=>{const e=d(),t=c();return!(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},isEditable:()=>{if(n.mode.isReadOnly())return!1;const t=d(),o=n.getBody().querySelectorAll('[data-mce-selected="1"]');return o.length>0?re(o,t=>e.isEditable(t.parentElement)):Bh(e,t)},isForward:u,setNode:t=>(i(e.getOuterHTML(t)),t),getNode:()=>((e,t)=>{if(!t)return e;let o=t.startContainer,n=t.endContainer;const r=t.startOffset,a=t.endOffset;let s=t.commonAncestorContainer;t.collapsed||(o===n&&a-r<2&&o.hasChildNodes()&&(s=o.childNodes[r]),aa(o)&&aa(n)&&(o=o.length===r?Ih(o.nextSibling,!0):o.parentNode,n=0===a?Ih(n.previousSibling,!1):n.parentNode,o&&o===n&&(s=o)));const i=aa(s)?s.parentNode:s;return Xr(i)?i:e})(n.getBody(),d()),getSel:c,setRng:m,getRng:d,getStart:e=>Hh(n.getBody(),d(),e),getEnd:e=>Lh(n.getBody(),d(),e),getSelectedBlocks:(t,o)=>((e,t,o,n)=>{const r=[],a=e.getRoot(),s=e.getParent(o||Hh(a,t,t.collapsed),e.isBlock),i=e.getParent(n||Lh(a,t,t.collapsed),e.isBlock);if(s&&s!==a&&r.push(s),s&&i&&s!==i){let t;const o=new Ur(s,a);for(;(t=o.next())&&t!==i;)e.isBlock(t)&&r.push(t)}return i&&s!==i&&i!==a&&r.push(i),r})(e,d(),t,o),normalize:()=>{const t=d(),o=c();if(!(hg(o).length>1)&&kg(n)){const o=gh(e,t);return o.each(e=>{m(e,u())}),o.getOr(t)}return t},selectorChanged:(e,t)=>(s(e,t),g),selectorChangedWithUnbind:s,getScrollContainer:()=>{let t,o=e.getRoot();for(;o&&"BODY"!==o.nodeName;){if(o.scrollHeight>o.clientHeight){t=o;break}o=o.parentNode}return t},scrollIntoView:(e,t)=>{_(e)?((e,t,o)=>{(e.inline?Dh:Rh)(e,t,o)})(n,e,t):Nh(n,d(),t)},placeCaretAt:(e,t)=>m(ah(e,t,n.getDoc())),getBoundingClientRect:()=>{const e=d();return e.collapsed?Yl.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:()=>{t=r=a=null,h.destroy()}},p=wp(g),h=rh(g,n);return g.bookmarkManager=p,g.controlSelection=h,g},gC=(e,t,o)=>{e.addAttributeFilter("data-mce-tabindex",(e,t)=>{let o=e.length;for(;o--;){const n=e[o];n.attr("tabindex",n.attr("data-mce-tabindex")),n.attr(t,null)}}),e.addAttributeFilter("src,href,style",(e,n)=>{const r="data-mce-"+n,a=t.url_converter,s=t.url_converter_scope;let i=e.length;for(;i--;){const t=e[i];let l=t.attr(r);void 0!==l?(t.attr(n,l.length>0?l:null),t.attr(r,null)):(l=t.attr(n),"style"===n?l=o.serializeStyle(o.parseStyle(l),t.name):a&&(l=a.call(s,l,n,t.name)),t.attr(n,l.length>0?l:null))}}),e.addAttributeFilter("class",e=>{let t=e.length;for(;t--;){const o=e[t];let n=o.attr("class");n&&(n=n.replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),o.attr("class",n.length>0?n:null))}}),e.addAttributeFilter("data-mce-type",(e,t,o)=>{let n=e.length;for(;n--;){const t=e[n];if("bookmark"===t.attr("data-mce-type")&&!o.cleanup){const e=P.from(t.firstChild).exists(e=>{var t;return!Yi(null!==(t=e.value)&&void 0!==t?t:"")});e?t.unwrap():t.remove()}}}),e.addNodeFilter("script,style",(e,o)=>{var n;const r=e=>e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"");let a=e.length;for(;a--;){const s=e[a],i=s.firstChild,l=null!==(n=null==i?void 0:i.value)&&void 0!==n?n:"";if("script"===o){const e=s.attr("type");e&&s.attr("type","mce-no/type"===e?null:e.replace(/^mce\-/,"")),"xhtml"===t.element_format&&i&&l.length>0&&(i.value="// <![CDATA[\n"+r(l)+"\n// ]]>")}else"xhtml"===t.element_format&&i&&l.length>0&&(i.value="\x3c!--\n"+r(l)+"\n--\x3e")}}),e.addNodeFilter("#comment",e=>{let n=e.length;for(;n--;){const r=e[n],a=r.value;t.preserve_cdata&&0===(null==a?void 0:a.indexOf("[CDATA["))?(r.name="#cdata",r.type=4,r.value=o.decode(a.replace(/^\[CDATA\[|\]\]$/g,""))):0===(null==a?void 0:a.indexOf("mce:protected "))&&(r.name="#text",r.type=3,r.raw=!0,r.value=unescape(a).substr(14))}}),e.addNodeFilter("xml:namespace,input",(e,t)=>{let o=e.length;for(;o--;){const n=e[o];7===n.type?n.remove():1===n.type&&("input"!==t||n.attr("type")||n.attr("type","text"))}}),e.addAttributeFilter("data-mce-type",t=>{q(t,t=>{"format-caret"===t.attr("data-mce-type")&&(t.isEmpty(e.schema.getNonEmptyElements())?t.remove():t.unwrap())})}),e.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-block,data-mce-type,data-mce-resize,data-mce-placeholder",(e,t)=>{let o=e.length;for(;o--;)e[o].attr(t,null)}),t.remove_trailing_brs&&((e,t,o)=>{t.addNodeFilter("br",(t,n,r)=>{const a=lo.extend({},o.getBlockElements()),s=o.getNonEmptyElements(),i=o.getWhitespaceElements();a.body=1;const l=e=>e.name in a||Ya(o,e);for(let n=0,c=t.length;n<c;n++){let c=t[n],d=c.parent;if(d&&l(d)&&c===d.lastChild){let t=c.prev;for(;t;){const e=t.name;if("span"!==e||"bookmark"!==t.attr("data-mce-type")){"br"===e&&(c=null);break}t=t.prev}if(c&&(c.remove(),Dx(o,s,i,d))){const t=o.getElementRule(d.name);t&&(t.removeEmpty?d.remove():t.paddEmpty&&Tx(e,r,l,d))}}else{let e=c;for(;d&&d.firstChild===e&&d.lastChild===e&&(e=d,!a[d.name]);)d=d.parent;if(e===d){const e=new jh("#text",3);e.value=ct,c.replace(e)}}}})})(t,e,e.schema)},pC=(e,t,o)=>((e,t)=>_(e)&&e.hasEventListeners("PreProcess")&&!t.no_events)(e,o)?((e,t,o)=>{let n;const r=e.dom;let a=t.cloneNode(!0);const s=document.implementation;if(s.createHTMLDocument){const e=s.createHTMLDocument("");lo.each("BODY"===a.nodeName?a.childNodes:[a],t=>{e.body.appendChild(e.importNode(t,!0))}),a="BODY"!==a.nodeName?e.body.firstChild:e.body,n=r.doc,r.doc=e}return((e,t)=>{e.dispatch("PreProcess",t)})(e,{...o,node:a}),n&&(r.doc=n),a})(e,t,o):t,hC=(e,t,o)=>{-1===lo.inArray(t,o)&&(e.addAttributeFilter(o,(e,t)=>{let o=e.length;for(;o--;)e[o].attr(t,null)}),t.push(o))},fC=(e,t,o,n,r)=>{const a=((e,t,o)=>mf(e,t).serialize(o))(t,o,n);return((e,t,o)=>{if(!t.no_events&&e){const n=((e,t)=>e.dispatch("PostProcess",t))(e,{...t,content:o});return n.content}return o})(e,r,a)},bC=(e,t)=>{const o=["data-mce-selected"],n={entity_encoding:"named",remove_trailing_brs:!0,pad_empty_with_br:!1,...e},r=t&&t.dom?t.dom:fi.DOM,a=t&&t.schema?t.schema:Ps(n),s=p_(n,a);gC(s,n,r);return{schema:a,addNodeFilter:s.addNodeFilter,addAttributeFilter:s.addAttributeFilter,serialize:(e,o={})=>{const i={format:"html",...o},l=pC(t,e,i),c=((e,t,o)=>{const n=Xi(o.getInner?t.innerHTML:e.getOuterHTML(t));return o.selection||Wi(mo.fromDom(t))?n:lo.trim(n)})(r,l,i),d=((e,t,o)=>{const n=o.selection?{forced_root_block:!1,...o}:o,r=e.parse(t,n);return(e=>{const t=e=>"br"===(null==e?void 0:e.name),o=e.lastChild;if(t(o)){const e=o.prev;t(e)&&(o.remove(),e.remove())}})(r),r})(s,c,i);return"tree"===i.format?d:fC(t,n,a,d,i)},addRules:a.addValidElements,setRules:a.setValidElements,addTempAttr:R(hC,s,o),getTempAttrs:A(o),getNodeFilters:s.getNodeFilters,getAttributeFilters:s.getAttributeFilters,removeNodeFilter:s.removeNodeFilter,removeAttributeFilter:s.removeAttributeFilter}},xC=(e,t)=>{const o=bC(e,t);return{schema:o.schema,addNodeFilter:o.addNodeFilter,addAttributeFilter:o.addAttributeFilter,serialize:o.serialize,addRules:o.addRules,setRules:o.setRules,addTempAttr:o.addTempAttr,getTempAttrs:o.getTempAttrs,getNodeFilters:o.getNodeFilters,getAttributeFilters:o.getAttributeFilters,removeNodeFilter:o.removeNodeFilter,removeAttributeFilter:o.removeAttributeFilter}},vC=(e,t={})=>{const o=((e,t)=>({...e,format:t,get:!0,getInner:!0}))(t,t.format?t.format:"html");return b_(e,o).fold(D,t=>{const o=((e,t)=>oC(e).editor.getContent(t))(e,t);return x_(e,o,t)})},yC=(e,t,o={})=>{const n=((e,t)=>({format:"html",...e,set:!0,content:t}))(o,t);return v_(e,n).map(t=>{const o=((e,t,o)=>oC(e).editor.setContent(t,o))(e,t.content,t);return y_(e,o.html,t),o.content}).getOr(t)},wC="autoresize_on_init,content_editable_state,padd_empty_with_br,block_elements,boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,tab_focus,tabfocus_elements,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,paste_enable_default_filters,paste_filter_drop,paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists,template_cdate_classes,template_mdate_classes,template_selected_content_classes,template_preview_replace_values,template_replace_values,templates,template_cdate_format,template_mdate_format".split(","),_C=[],CC="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,template,textcolor,rtc".split(","),kC=[{name:"export",replacedWith:"Export to PDF"}],SC=(e,t)=>{const o=Y(t,t=>Ee(e,t));return le(o)},EC=e=>{const t=SC(e,wC),o=e.forced_root_block;return!1!==o&&""!==o||t.push("forced_root_block (false only)"),le(t)},OC=e=>SC(e,_C),TC=(e,t)=>{const o=lo.makeMap(e.plugins," "),n=Y(t,e=>Ee(o,e));return le(n)},AC=e=>TC(e,CC),DC=e=>TC(e,kC.map(e=>e.name)),MC=e=>ee(kC,t=>t.name===e).fold(()=>e,t=>t.replacedWith?`${e}, replaced by ${t.replacedWith}`:e),RC=(e,t)=>{((e,t)=>{const o=EC(e),n=AC(t),r=n.length>0,a=o.length>0,s="mobile"===t.theme;if(r||a||s){const e="\n- ",t=s?`\n\nThemes:${e}mobile`:"",i=r?`\n\nPlugins:${e}${n.join(e)}`:"",l=a?`\n\nOptions:${e}${o.join(e)}`:"";console.warn("The following deprecated features are currently enabled and have been removed in TinyMCE 7.0. These features will no longer work and should be removed from the TinyMCE configuration. See https://www.tiny.cloud/docs/tinymce/7/migration-from-6x/ for more information."+t+i+l)}})(e,t),((e,t)=>{const o=OC(e),n=DC(t),r=n.length>0,a=o.length>0;if(r||a){const e="\n- ",t=r?`\n\nPlugins:${e}${n.map(MC).join(e)}`:"",s=a?`\n\nOptions:${e}${o.join(e)}`:"";console.warn("The following deprecated features are currently enabled but will be removed soon."+t+s)}})(e,t)},NC=fi.DOM,BC=e=>P.from(e).each(e=>e.destroy()),zC=e=>{if(!e.removed){const{_selectionOverrides:t,editorUpload:o}=e,n=e.getBody(),r=e.getElement();n&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&_(null==r?void 0:r.nextSibling)&&NC.remove(r.nextSibling),(e=>{e.dispatch("remove")})(e),e.editorManager.remove(e),!e.inline&&n&&(e=>{NC.setStyle(e.id,"display",e.orgDisplay)})(e),(e=>{e.dispatch("detach")})(e),NC.remove(e.getContainer()),BC(t),BC(o),e.destroy()}},HC=(e,t)=>{const{selection:o,dom:n}=e;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),BC(o),BC(n)),(e=>{const t=e.formElement;t&&(t._mceOldSubmit&&(t.submit=t._mceOldSubmit,delete t._mceOldSubmit),NC.unbind(t,"submit reset",e.formEventDelegate))})(e),(e=>{const t=e;t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null;const o=e.selection;if(o){const e=o.dom;t.selection=o.win=o.dom=e.doc=null}})(e),e.destroyed=!0):e.remove())},LC=(()=>{const e={};return{add:(t,o)=>{e[t]=o},get:t=>e[t]?e[t]:{icons:{}},has:t=>Ee(e,t)}})(),IC=Ci.ModelManager,PC=(e,t)=>t.dom[e],FC=(e,t)=>parseInt(Hn(t,e),10),VC=R(PC,"clientWidth"),ZC=R(PC,"clientHeight"),UC=R(FC,"margin-top"),jC=R(FC,"margin-left"),WC=(e,t,o)=>{const n=mo.fromDom(e.getBody()),r=e.inline?n:(a=n,mo.fromDom(Ro(a).dom.documentElement));var a;const s=((e,t,o,n)=>{const r=(e=>e.dom.getBoundingClientRect())(t);return{x:o-(e?r.left+t.dom.clientLeft+jC(t):0),y:n-(e?r.top+t.dom.clientTop+UC(t):0)}})(e.inline,r,t,o);return((e,t,o)=>{const n=VC(e),r=ZC(e);return t>=0&&o>=0&&t<=n&&o<=r})(r,s.x,s.y)},$C=e=>{const t=e.inline?e.getBody():e.getContentAreaContainer();return(o=t,P.from(o).map(mo.fromDom)).map(Rn).getOr(!1);var o};const qC=e=>{const t=[],o=()=>{const t=e.theme;return t&&t.getNotificationManagerImpl?t.getNotificationManagerImpl():(()=>{const e=()=>{throw new Error("Theme did not provide a NotificationManager implementation.")};return{open:e,close:e,getArgs:e}})()},n=()=>P.from(t[0]),r=()=>{n().each(e=>{e.reposition()})},a=e=>{te(t,t=>t===e).each(e=>{t.splice(e,1)})},s=(n,s=!0)=>e.removed||!$C(e)?{}:(s&&e.dispatch("BeforeOpenNotification",{notification:n}),ee(t,e=>{return t=o().getArgs(e),r=n,!(t.type!==r.type||t.text!==r.text||t.progressBar||t.timeout||r.progressBar||r.timeout);var t,r}).getOrThunk(()=>{e.editorManager.setActive(e);const s=o().open(n,()=>{a(s)},()=>Yp(e));return(e=>{t.push(e)})(s),r(),e.dispatch("OpenNotification",{notification:{...s}}),s})),i=A(t);return(e=>{e.on("SkinLoaded",()=>{const t=kd(e);t&&s({text:t,type:"warning",timeout:0},!1),r()}),e.on("show ResizeEditor ResizeWindow NodeChange ToggleView FullscreenStateChanged",()=>{requestAnimationFrame(r)}),e.on("remove",()=>{q(t.slice(),e=>{o().close(e)})}),e.on("keydown",e=>{var t;const o="f12"===(null===(t=e.key)||void 0===t?void 0:t.toLowerCase())||123===e.keyCode;e.altKey&&o&&(e.preventDefault(),n().map(e=>mo.fromDom(e.getEl())).each(e=>nn(e)))})})(e),{open:s,close:()=>{n().each(e=>{o().close(e),a(e),r()})},getNotifications:i}},GC=Ci.PluginManager,KC=Ci.ThemeManager;const YC=e=>{let t=[];const o=()=>{const t=e.theme;return t&&t.getWindowManagerImpl?t.getWindowManagerImpl():(()=>{const e=()=>{throw new Error("Theme did not provide a WindowManager implementation.")};return{open:e,openUrl:e,alert:e,confirm:e,close:e}})()},n=(e,t)=>(...o)=>t?t.apply(e,o):void 0,r=o=>{t.push(o),(t=>{e.dispatch("OpenWindow",{dialog:t})})(o)},a=o=>{(t=>{e.dispatch("CloseWindow",{dialog:t})})(o),t=Y(t,e=>e!==o),0===t.length&&e.focus()},s=t=>{e.editorManager.setActive(e),Dp(e),e.ui.show();const o=t();return r(o),o};return e.on("remove",()=>{q(t,e=>{o().close(e)})}),{open:(e,t)=>s(()=>o().open(e,t,a)),openUrl:e=>s(()=>o().openUrl(e,a)),alert:(e,t,r)=>{const a=o();a.alert(e,n(r||a,t))},confirm:(e,t,r)=>{const a=o();a.confirm(e,n(r||a,t))},close:()=>{P.from(t[t.length-1]).each(e=>{o().close(e),a(e)})}}},XC=(e,t)=>{e.notificationManager.open({type:"error",text:t})},JC=(e,t)=>{e._skinLoaded?XC(e,t):e.on("SkinLoaded",()=>{XC(e,t)})},QC=(e,t,o)=>{Ec(e,t,{message:o}),console.error(o)},ek=(e,t,o)=>o?`Failed to load ${e}: ${o} from url ${t}`:`Failed to load ${e} url: ${t}`,tk=(e,...t)=>{const o=window.console;o&&(o.error?o.error(e,...t):o.log(e,...t))},ok=(e,t,o)=>{try{e.getDoc().execCommand(t,!1,String(o))}catch(e){}},nk=(e,t,o)=>{fr(e,t)&&!o?pr(e,t):o&&ur(e,t)},rk=e=>{const t=mo.fromDom(e.getBody());nk(t,"mce-content-readonly",!0),e.selection.controlSelection.hideResizeRect(),e._selectionOverrides.hideFakeCaret(),(e=>{P.from(e.selection.getNode()).each(e=>{e.removeAttribute("data-mce-selected")})})(e)},ak=e=>{const t=mo.fromDom(e.getBody());nk(t,"mce-content-readonly",!1),e.hasEditableRoot()&&vr(t,!0),((e,t)=>{ok(e,"StyleWithCSS",t),ok(e,"enableInlineTableEditing",t),ok(e,"enableObjectResizing",t)})(e,!1),Yp(e)&&e.focus(),(e=>{e.selection.setRng(e.selection.getRng())})(e),e.nodeChanged()},sk=e=>Bm(e),ik="data-mce-contenteditable",lk=(e,t)=>{const o=mo.fromDom(e.getBody());t?(rk(e),vr(o,!1),q(wr(o,'*[contenteditable="true"]'),e=>{pn(e,ik,"true"),vr(e,!1)})):((e=>{q(wr(e,`*[${ik}="true"]`),e=>{vn(e,ik),vr(e,!0)})})(o),ak(e))},ck=e=>{e.parser.addAttributeFilter("contenteditable",t=>{sk(e)&&q(t,e=>{e.attr(ik,e.attr("contenteditable")),e.attr("contenteditable","false")})}),e.serializer.addAttributeFilter(ik,t=>{sk(e)&&q(t,e=>{e.attr("contenteditable",e.attr(ik))})}),e.serializer.addTempAttr(ik)},dk=["copy"],mk=(e,t)=>{if((e=>"click"===e.type)(t)&&!Qp.metaKeyPressed(t)){const o=mo.fromDom(t.target);((e,t)=>ir(t,"a",t=>vo(t,mo.fromDom(e.getBody()))).bind(e=>bn(e,"href")))(e,o).each(o=>{if(t.preventDefault(),/^#/.test(o)){const t=e.dom.select(`${o},[name="${Ge(o,"#")}"]`);t.length&&e.selection.scrollIntoView(t[0],!0)}else window.open(o,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes")})}else(e=>j(dk,e.type))(t)&&e.dispatch(t.type,t)},uk=e=>{(e=>{e.serializer?ck(e):e.on("PreInit",()=>{ck(e)})})(e),(e=>{e.on("ShowCaret ObjectSelected",t=>{sk(e)&&t.preventDefault()}),e.on("DisabledStateChange",t=>{t.isDefaultPrevented()||lk(e,t.state)})})(e)},gk=e=>"content/"+e+"/content.css",pk=(e,t)=>{const o=e.editorManager.baseURL+"/skins/content",n=`content${e.editorManager.suffix}.css`;return $(t,t=>(e=>tinymce.Resource.has(gk(e)))(t)?t:(e=>/^[a-z0-9\-]+$/i.test(e))(t)&&!e.inline?`${o}/${t}/${n}`:e.documentBaseURI.toAbsolute(t))},hk=e=>{e.contentCSS=e.contentCSS.concat((e=>pk(e,hd(e)))(e),(e=>pk(e,bd(e)))(e))},fk=(e,t)=>{const o={};return{findAll:(n,r=I)=>{const a=Y((e=>e?ue(e.getElementsByTagName("img")):[])(n),t=>{const o=t.src;return!t.hasAttribute("data-mce-bogus")&&(!t.hasAttribute("data-mce-placeholder")&&(!(!o||o===ro.transparentSrc)&&(Ye(o,"blob:")?!e.isUploaded(o)&&r(t):!!Ye(o,"data:")&&r(t))))}),s=$(a,e=>{const n=e.src;if(Ee(o,n))return o[n].then(t=>p(t)?t:{image:e,blobInfo:t.blobInfo});{const r=((e,t)=>{const o=()=>Promise.reject("Invalid data URI");if(Ye(t,"blob:")){const n=e.getByUri(t);return _(n)?Promise.resolve(n):Ty(t).then(t=>Ay(t).then(n=>My(n,!1,o=>P.some(Ry(e,t,o))).getOrThunk(o)))}return Ye(t,"data:")?Ny(e,t).fold(o,e=>Promise.resolve(e)):Promise.reject("Unknown image data format")})(t,n).then(t=>(delete o[n],{image:e,blobInfo:t})).catch(e=>(delete o[n],e));return o[n]=r,r}});return Promise.all(s)}}},bk=()=>{let e={};const t=(e,t)=>({status:e,resultUri:t}),o=t=>t in e;return{hasBlobUri:o,getResultUri:t=>{const o=e[t];return o?o.resultUri:null},isPending:t=>!!o(t)&&1===e[t].status,isUploaded:t=>!!o(t)&&2===e[t].status,markPending:o=>{e[o]=t(1,null)},markUploaded:(o,n)=>{e[o]=t(2,n)},removeFailed:t=>{delete e[t]},destroy:()=>{e={}}}};let xk=0;const vk=e=>e+xk+++(()=>{const e=()=>Math.round(4294967295*Be()).toString(36);return"s"+(new Date).getTime().toString(36)+e()+e()+e()})(),yk=(e,t)=>{const o={},n=(e,o)=>new Promise((n,r)=>{const a=new XMLHttpRequest;a.open("POST",t.url),a.withCredentials=t.credentials,a.upload.onprogress=e=>{o(e.loaded/e.total*100)},a.onerror=()=>{r("Image upload failed due to a XHR Transport error. Code: "+a.status)},a.onload=()=>{if(a.status<200||a.status>=300)return void r("HTTP Error: "+a.status);const e=JSON.parse(a.responseText);var o,s;e&&p(e.location)?n((o=t.basePath,s=e.location,o?o.replace(/\/$/,"")+"/"+s.replace(/^\//,""):s)):r("Invalid JSON: "+a.responseText)};const s=new FormData;s.append("file",e.blob(),e.filename()),a.send(s)}),r=C(t.handler)?t.handler:n,a=(e,t)=>({url:t,blobInfo:e,status:!0}),s=(e,t)=>({url:"",blobInfo:e,status:!1,error:t}),i=(e,t)=>{lo.each(o[e],e=>{e(t)}),delete o[e]},l=(t,n)=>(t=lo.grep(t,t=>!e.isUploaded(t.blobUri())),Promise.all(lo.map(t,t=>e.isPending(t.blobUri())?(e=>{const t=e.blobUri();return new Promise(e=>{o[t]=o[t]||[],o[t].push(e)})})(t):((t,o,n)=>(e.markPending(t.blobUri()),new Promise(r=>{let l,c;try{const d=()=>{l&&(l.close(),c=E)},m=o=>{d(),e.markUploaded(t.blobUri(),o),i(t.blobUri(),a(t,o)),r(a(t,o))},u=o=>{d(),e.removeFailed(t.blobUri()),i(t.blobUri(),s(t,o)),r(s(t,o))};c=e=>{e<0||e>100||P.from(l).orThunk(()=>P.from(n).map(z)).each(t=>{l=t,t.progressBar.value(e)})},o(t,c).then(m,e=>{u(p(e)?{message:e}:e)})}catch(e){r(s(t,e))}})))(t,r,n))));return{upload:(e,o)=>t.url||r!==n?l(e,o):new Promise(e=>{e([])})}},wk=e=>()=>e.notificationManager.open({text:e.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0}),_k=(e,t)=>yk(t,{url:ad(e),basePath:sd(e),credentials:id(e),handler:ld(e)}),Ck=e=>t=>{((e,t)=>e.dom.isEmpty(t.dom)&&_(e.schema.getTextBlockElements()[_o(t)]))(e,t)&&dn(t,mo.fromHtml('<br data-mce-bogus="1" />'))},kk=e=>{const t=(()=>{let e=[];const t=e=>{if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");const t=e.id||vk("blobid"),o=e.name||t,n=e.blob;return{id:A(t),name:A(o),filename:A(e.filename||o+"."+(r=n.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"}[r.toLowerCase()]||"dat")),blob:A(n),base64:A(e.base64),blobUri:A(e.blobUri||URL.createObjectURL(n)),uri:A(e.uri)};var r},o=t=>ee(e,t).getOrUndefined(),n=e=>o(t=>t.id()===e);return{create:(e,o,n,r,a)=>{if(p(e))return t({id:e,name:r,filename:a,blob:o,base64:n});if(h(e))return t(e);throw new Error("Unknown input type")},add:t=>{n(t.id())||e.push(t)},get:n,getByUri:e=>o(t=>t.blobUri()===e),getByData:(e,t)=>o(o=>o.base64()===e&&o.blob().type===t),findFirst:o,removeByUri:t=>{e=Y(e,e=>e.blobUri()!==t||(URL.revokeObjectURL(e.blobUri()),!1))},destroy:()=>{q(e,e=>{URL.revokeObjectURL(e.blobUri())}),e=[]}}})();let o,n;const r=bk(),a=[],s=t=>o=>e.selection?t(o):[],i=(e,t,o)=>{let n=0;do{n=e.indexOf(t,n),-1!==n&&(e=e.substring(0,n)+o+e.substr(n+t.length),n+=o.length-t.length+1)}while(-1!==n);return e},l=(e,t,o)=>{const n=`src="${o}"${o===ro.transparentSrc?' data-mce-placeholder="1"':""}`;return e=i(e,`src="${t}"`,n),e=i(e,'data-mce-src="'+t+'"','data-mce-src="'+o+'"')},c=(t,o)=>{q(e.undoManager.data,e=>{"fragmented"===e.type?e.fragments=$(e.fragments,e=>l(e,t,o)):e.content=l(e.content,t,o)})},d=()=>(o||(o=_k(e,r)),g().then(s(n=>{const r=$(n,e=>e.blobInfo);return o.upload(r,wk(e)).then(s(o=>{const r=[];let a=!1;const s=$(o,(o,s)=>{const{blobInfo:i,image:l}=n[s];let d=!1;return o.status&&od(e)?(o.url&&!Ke(l.src,o.url)&&(a=!0),t.removeByUri(l.src),eC(e)||((t,o)=>{const n=e.convertURL(o,"src");var r;c(t.src,o),hn(mo.fromDom(t),{src:td(e)?(r=o,r+(-1===r.indexOf("?")?"?":"&")+(new Date).getTime()):o,"data-mce-src":n})})(l,o.url)):o.error&&(o.error.remove&&(c(l.src,ro.transparentSrc),r.push(l),d=!0),((e,t)=>{JC(e,_i.translate(["Failed to upload image: {0}",t]))})(e,o.error.message)),{element:l,status:o.status,uploadUri:o.url,blobInfo:i,removed:d}});return r.length>0&&!eC(e)?e.undoManager.transact(()=>{q(Tn(r),o=>{const n=Bo(o);_n(o),n.each(Ck(e)),t.removeByUri(o.dom.src)})}):a&&e.undoManager.dispatchChange(),s}))}))),m=()=>ed(e)?d():Promise.resolve([]),u=e=>re(a,t=>t(e)),g=()=>(n||(n=fk(r,t)),n.findAll(e.getBody(),u).then(s(t=>{const o=Y(t,t=>p(t)?(JC(e,t),!1):"blob"!==t.uriType);return eC(e)||q(o,e=>{c(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")}),o}))),f=o=>o.replace(/src="(blob:[^"]+)"/g,(o,n)=>{const a=r.getResultUri(n);if(a)return'src="'+a+'"';let s=t.getByUri(n);if(s||(s=J(e.editorManager.get(),(e,t)=>e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n),void 0)),s){return'src="data:'+s.blob().type+";base64,"+s.base64()+'"'}return o});return e.on("SetContent",()=>{ed(e)?m():g()}),e.on("RawSaveContent",e=>{e.content=f(e.content)}),e.on("GetContent",e=>{e.source_view||"raw"===e.format||"tree"===e.format||(e.content=f(e.content))}),e.on("PostRender",()=>{e.parser.addNodeFilter("img",e=>{q(e,e=>{const o=e.attr("src");if(!o||t.getByUri(o))return;const n=r.getResultUri(o);n&&e.attr("src",n)})})}),{blobCache:t,addFilter:e=>{a.push(e)},uploadImages:d,uploadImagesAuto:m,scanForImages:g,destroy:()=>{t.destroy(),r.destroy(),n=o=null}}},Sk={remove_similar:!0,inherit:!1},Ek={selector:"td,th",...Sk},Ok={tablecellbackgroundcolor:{styles:{backgroundColor:"%value"},...Ek},tablecellverticalalign:{styles:{"vertical-align":"%value"},...Ek},tablecellbordercolor:{styles:{borderColor:"%value"},...Ek},tablecellclass:{classes:["%value"],...Ek},tableclass:{selector:"table",classes:["%value"],...Sk},tablecellborderstyle:{styles:{borderStyle:"%value"},...Ek},tablecellborderwidth:{styles:{borderWidth:"%value"},...Ek}},Tk=A(Ok),Ak=e=>{const t={},o=(e,n)=>{e&&(p(e)?(b(n)||(n=[n]),q(n,e=>{y(e.deep)&&(e.deep=!Wg(e)),y(e.split)&&(e.split=!Wg(e)||$g(e)),y(e.remove)&&Wg(e)&&!$g(e)&&(e.remove="none"),Wg(e)&&$g(e)&&(e.mixed=!0,e.block_expand=!0),p(e.classes)&&(e.classes=e.classes.split(/\s+/))}),t[e]=n):be(e,(e,t)=>{o(t,e)}))};return o((e=>{const t=e.dom,o=e.schema.type,n={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"left"},inherit:!1,preview:!1},{selector:"img,audio,video",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"},{selector:".mce-placeholder",styles:{float:"left"},ceFalseOverride:!0},{selector:"table",collapsed:!1,styles:{marginLeft:"0px",marginRight:"auto"},onformat:e=>{t.setStyle(e,"float",null)},preview:"font-family font-size"},{selector:".mce-preview-object,[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{float:"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:".mce-placeholder",styles:{display:"block",marginLeft:"auto",marginRight:"auto"},ceFalseOverride:!0},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"},{selector:".mce-preview-object",ceFalseOverride:!0,styles:{display:"table",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{marginLeft:"auto",marginRight:"auto"},preview:!1}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"},{selector:".mce-placeholder",styles:{float:"right"},ceFalseOverride:!0},{selector:"table",collapsed:!1,styles:{marginRight:"0px",marginLeft:"auto"},onformat:e=>{t.setStyle(e,"float",null)},preview:"font-family font-size"},{selector:".mce-preview-object,[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{float:"right"},preview:!1}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"justify"},inherit:!1,preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:(()=>{const e={inline:"span",styles:{textDecoration:"line-through"},exact:!0},t={inline:"strike",remove:"all",preserve_attributes:["class","style"]},n={inline:"s",remove:"all",preserve_attributes:["class","style"]};return"html4"!==o?[n,e,t]:[e,n,t]})(),forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},samp:{inline:"samp"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:(e,t,o)=>Yr(e)&&e.hasAttribute("href"),onformat:(e,o,n)=>{lo.each(n,(o,n)=>{t.setAttrib(e,n,o)})}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":e=>{var t;return null!==(t=null==e?void 0:e.customValue)&&void 0!==t?t:null}}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return lo.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd".split(/\s/),e=>{n[e]={block:e,remove:"all"}}),n})(e)),o(Tk()),o(Dd(e)),{get:e=>_(e)?t[e]:t,has:e=>Ee(t,e),register:o,unregister:e=>(e&&t[e]&&delete t[e],t)}},Dk=lo.each,Mk=fi.DOM,Rk=e=>_(e)&&h(e),Nk=(e,t)=>{const o=t&&t.schema||Ps({}),n=e=>{const t=p(e)?{name:e,classes:[],attrs:{}}:e,o=Mk.create(t.name);return((e,t)=>{t.classes.length>0&&Mk.addClass(e,t.classes.join(" ")),Mk.setAttribs(e,t.attrs)})(o,t),o},r=(e,t,a)=>{let s;const i=t[0],l=Rk(i)?i.name:void 0,c=((e,t)=>{const n=o.getElementRule(e.nodeName.toLowerCase()),r=null==n?void 0:n.parentsRequired;return!(!r||!r.length)&&(t&&j(r,t)?t:r[0])})(e,l);if(c)l===c?(s=i,t=t.slice(1)):s=c;else if(i)s=i,t=t.slice(1);else if(!a)return e;const d=s?n(s):Mk.create("div");d.appendChild(e),a&&lo.each(a,t=>{const o=n(t);d.insertBefore(o,e)});const m=Rk(s)?s.siblings:void 0;return r(d,t,m)},a=Mk.create("div");if(e.length>0){const t=e[0],o=n(t),s=Rk(t)?t.siblings:void 0;a.appendChild(r(o,e.slice(1),s))}return a},Bk=e=>{let t="div";const o={name:t,classes:[],attrs:{},selector:e=lo.trim(e)};return"*"!==e&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(e,t,n,r,a)=>{switch(t){case"#":o.attrs.id=n;break;case".":o.classes.push(n);break;case":":-1!==lo.inArray("checked disabled enabled read-only required".split(" "),n)&&(o.attrs[n]=n)}if("["===r){const e=a.match(/([\w\-]+)(?:\=\"([^\"]+))?/);e&&(o.attrs[e[1]]=e[2])}return""})),o.name=t||"div",o},zk=(e,t)=>{let o="",n=Md(e);if(""===n)return"";const r=e=>p(e)?e.replace(/%(\w+)/g,""):"",a=(t,o)=>Mk.getStyle(null!=o?o:e.getBody(),t,!0);if(p(t)){const o=e.formatter.get(t);if(!o)return"";t=o[0]}if("preview"in t){const e=t.preview;if(!1===e)return"";n=e||n}let s,i=t.block||t.inline||"span";const l=(c=t.selector,p(c)?(c=(c=c.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),lo.map(c.split(/(?:>|\s+(?![^\[\]]+\]))/),e=>{const t=lo.map(e.split(/(?:~\+|~|\+)/),Bk),o=t.pop();return t.length&&(o.siblings=t),o}).reverse()):[]);var c;l.length>0?(l[0].name||(l[0].name=i),i=t.selector,s=Nk(l,e)):s=Nk([i],e);const d=Mk.select(i,s)[0]||s.firstChild;Dk(t.styles,(e,t)=>{const o=r(e);o&&Mk.setStyle(d,t,o)}),Dk(t.attributes,(e,t)=>{const o=r(e);o&&Mk.setAttrib(d,t,o)}),Dk(t.classes,e=>{const t=r(e);Mk.hasClass(d,t)||Mk.addClass(d,t)}),e.dispatch("PreviewFormats"),Mk.setStyles(s,{position:"absolute",left:-65535}),e.getBody().appendChild(s);const m=a("fontSize"),u=/px$/.test(m)?parseInt(m,10):0;return Dk(n.split(" "),e=>{let t=a(e,d);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=a(e),"#ffffff"===Ks(t).toLowerCase())||"color"===e&&"#000000"===Ks(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===u)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*u+"px"}"border"===e&&t&&(o+="padding:0 2px;"),o+=e+":"+t+";"}}),e.dispatch("AfterPreviewFormats"),Mk.remove(s),o},Hk=e=>{const t=Ak(e),o=Ae({});return(e=>{e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(let t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])})(e),Cv(e),eC(e)||((e,t)=>{e.set({}),t.on("NodeChange",o=>{vy(t,o.element,e.get())}),t.on("FormatApply FormatRemove",o=>{const n=P.from(o.node).map(e=>Og(e)?e:e.startContainer).bind(e=>Yr(e)?P.some(e):P.from(e.parentElement)).getOrThunk(()=>fy(t));vy(t,n,e.get())})})(o,e),{get:t.get,has:t.has,register:t.register,unregister:t.unregister,apply:(t,o,n)=>{((e,t,o,n)=>{nC(e).formatter.apply(t,o,n)})(e,t,o,n)},remove:(t,o,n,r)=>{((e,t,o,n,r)=>{nC(e).formatter.remove(t,o,n,r)})(e,t,o,n,r)},toggle:(t,o,n)=>{((e,t,o,n)=>{nC(e).formatter.toggle(t,o,n)})(e,t,o,n)},match:(t,o,n,r)=>((e,t,o,n,r)=>nC(e).formatter.match(t,o,n,r))(e,t,o,n,r),closest:t=>((e,t)=>nC(e).formatter.closest(t))(e,t),matchAll:(t,o)=>((e,t,o)=>nC(e).formatter.matchAll(t,o))(e,t,o),matchNode:(t,o,n,r)=>((e,t,o,n,r)=>nC(e).formatter.matchNode(t,o,n,r))(e,t,o,n,r),canApply:t=>((e,t)=>nC(e).formatter.canApply(t))(e,t),formatChanged:(t,n,r,a)=>((e,t,o,n,r,a)=>nC(e).formatter.formatChanged(t,o,n,r,a))(e,o,t,n,r,a),getCssText:R(zk,e)}},Lk=e=>{switch(e.toLowerCase()){case"undo":case"redo":case"mcefocus":return!0;default:return!1}},Ik=e=>{const t=$e(),o=Ae(0),n=Ae(0),r={data:[],typing:!1,beforeChange:()=>{((e,t,o)=>{nC(e).undoManager.beforeChange(t,o)})(e,o,t)},add:(a,s)=>((e,t,o,n,r,a,s)=>nC(e).undoManager.add(t,o,n,r,a,s))(e,r,n,o,t,a,s),dispatchChange:()=>{e.setDirty(!0);const t=W_(e);t.bookmark=xc(e.selection),e.dispatch("change",{level:t,lastLevel:ce(r.data,n.get()).getOrUndefined()})},undo:()=>((e,t,o,n)=>nC(e).undoManager.undo(t,o,n))(e,r,o,n),redo:()=>((e,t,o)=>nC(e).undoManager.redo(t,o))(e,n,r.data),clear:()=>{((e,t,o)=>{nC(e).undoManager.clear(t,o)})(e,r,n)},reset:()=>{((e,t)=>{nC(e).undoManager.reset(t)})(e,r)},hasUndo:()=>((e,t,o)=>nC(e).undoManager.hasUndo(t,o))(e,r,n),hasRedo:()=>((e,t,o)=>nC(e).undoManager.hasRedo(t,o))(e,r,n),transact:t=>((e,t,o,n)=>nC(e).undoManager.transact(t,o,n))(e,r,o,t),ignore:t=>{((e,t,o)=>{nC(e).undoManager.ignore(t,o)})(e,o,t)},extra:(t,o)=>{((e,t,o,n,r)=>{nC(e).undoManager.extra(t,o,n,r)})(e,r,n,t,o)}};return eC(e)||((e,t,o)=>{const n=Ae(!1),r=e=>{X_(t,!1,o),t.add({},e)};e.on("init",()=>{t.add()}),e.on("BeforeExecCommand",e=>{const n=e.command;Lk(n)||(J_(t,o),t.beforeChange())}),e.on("ExecCommand",e=>{const t=e.command;Lk(t)||r(e)}),e.on("ObjectResizeStart cut",()=>{t.beforeChange()}),e.on("SaveContent ObjectResized blur",r),e.on("dragend",r),e.on("keyup",o=>{const a=o.keyCode;if(o.isDefaultPrevented())return;const s=ro.os.isMacOS()&&"Meta"===o.key;(a>=33&&a<=36||a>=37&&a<=40||45===a||o.ctrlKey||s)&&(r(),e.nodeChanged()),46!==a&&8!==a||e.nodeChanged(),n.get()&&t.typing&&!K_(W_(e),t.data[0])&&(e.isDirty()||e.setDirty(!0),e.dispatch("TypingUndo"),n.set(!1),e.nodeChanged())}),e.on("keydown",e=>{const a=e.keyCode;if(e.isDefaultPrevented())return;if(a>=33&&a<=36||a>=37&&a<=40||45===a)return void(t.typing&&r(e));const s=e.ctrlKey&&!e.altKey||e.metaKey;if((a<16||a>20)&&224!==a&&91!==a&&!t.typing&&!s)return t.beforeChange(),X_(t,!0,o),t.add({},e),void n.set(!0);(ro.os.isMacOS()?e.metaKey:e.ctrlKey&&!e.altKey)&&t.beforeChange()}),e.on("mousedown",e=>{t.typing&&r(e)}),e.on("input",e=>{var t;e.inputType&&("insertReplacementText"===e.inputType||"insertText"===(t=e).inputType&&null===t.data||(e=>"insertFromPaste"===e.inputType||"insertFromDrop"===e.inputType)(e))&&r(e)}),e.on("AddUndo Undo Redo ClearUndos",t=>{t.isDefaultPrevented()||e.nodeChanged()})})(e,r,o),(e=>{e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo")})(e),r},Pk=[9,27,Qp.HOME,Qp.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,Qp.DOWN,Qp.UP,Qp.LEFT,Qp.RIGHT].concat(ro.browser.isFirefox()?[224]:[]),Fk="data-mce-placeholder",Vk=e=>"keydown"===e.type||"keyup"===e.type,Zk=e=>{const t=e.keyCode;return t===Qp.BACKSPACE||t===Qp.DELETE},Uk=e=>{var t;const o=e.dom,n=qc(e),r=null!==(t=_d(e))&&void 0!==t?t:"",a=(t,s)=>{if((e=>{if(Vk(e)){const t=e.keyCode;return!Zk(e)&&(Qp.metaKeyPressed(e)||e.altKey||t>=112&&t<=123||j(Pk,t))}return!1})(t))return;const i=e.getBody(),l=!(e=>Vk(e)&&!(Zk(e)||"keyup"===e.type&&229===e.keyCode))(t)&&((e,t,o)=>{if(e.isEmpty(t,void 0,{skipBogus:!1,includeZwsp:!0})){const n=t.firstElementChild;return!n||!e.getStyle(t.firstElementChild,"padding-left")&&!e.getStyle(t.firstElementChild,"padding-right")&&o===n.nodeName.toLowerCase()}return!1})(o,i,n);(""!==o.getAttrib(i,Fk)!==l||s)&&(o.setAttrib(i,Fk,l?r:null),((e,t)=>{e.dispatch("PlaceholderToggle",{state:t})})(e,l),e.on(l?"keydown":"keyup",a),e.off(l?"keyup":"keydown",a))};ot(r)&&e.on("init",t=>{a(t,!0),e.on("change SetContent ExecCommand",a),e.on("paste",t=>Np.setEditorTimeout(e,()=>a(t)))})},jk=(e,t)=>({from:e,to:t}),Wk=(e,t)=>{const o=mo.fromDom(e),n=mo.fromDom(t.container());return Ib(o,n).map(e=>((e,t)=>({block:e,position:t}))(e,t))},$k=(e,t)=>or(t,e=>ji(e)||pa(e.dom),t=>vo(t,e)).filter(Eo).getOr(e),qk=(e,t,o,n)=>{const r=Wk(t,Yl.fromRangeStart(n)),a=r.bind(n=>Vu(o,t,n.position).bind(n=>Wk(t,n).map(n=>((e,t,o,n)=>ma(n.position.getNode())&&!Da(e,n.block)?ju(!1,n.block.dom).bind(e=>e.isEqual(n.position)?Vu(o,t,e).bind(e=>Wk(t,e)):P.some(n)).getOr(n):n)(e,t,o,n))));return Ze(r,a,jk).filter(e=>(e=>!vo(e.from.block,e.to.block))(e)&&((e,t)=>{const o=mo.fromDom(e);return vo($k(o,t.from.block),$k(o,t.to.block))})(t,e)&&(e=>!1===ha(e.from.block.dom)&&!1===ha(e.to.block.dom))(e)&&(e=>{const t=e=>Fi(e)||Wa(e.dom)||Zi(e);return t(e.from.block)&&t(e.to.block)})(e)&&(e=>!(yo(e.to.block,e.from.block)||yo(e.from.block,e.to.block)))(e))},Gk=(e,t)=>{const o=((e,t)=>{const o=Vo(e);return te(o,e=>t.isBlock(_o(e))).fold(A(o),e=>o.slice(0,e))})(e,t);return q(o,_n),o},Kk=(e,t,o)=>{const n=zf(o,t);return ee(n.reverse(),t=>Da(e,t)).each(_n)},Yk=(e,t,o,n,r)=>{if(Da(n,o))return Gi(o),qu(o.dom);((e,t)=>0===Y(Po(t),t=>!Da(e,t)).length)(n,r)&&Da(n,t)&&sn(r,mo.fromTag("br"));const a=$u(o.dom,Yl.before(r.dom));return q(Gk(t,n),e=>{sn(r,e)}),Kk(n,e,t),a},Xk=(e,t,o,n)=>{if(Da(n,o)){if(Da(n,t)){const e=e=>{const t=(e,o)=>Uo(e).fold(()=>o,e=>((e,t)=>e.isInline(_o(t)))(n,e)?t(e,o.concat(Sn(e))):o);return t(e,[])},r=X(e(o),(e,t)=>(mn(e,t),t),qi());wn(t),dn(t,r)}return _n(o),qu(t.dom)}const r=Gu(o.dom);return q(Gk(t,n),e=>{dn(o,e)}),Kk(n,e,t),r},Jk=(e,t)=>yo(t,e)?((e,t)=>{const o=zf(t,e);return P.from(o[o.length-1])})(t,e):P.none(),Qk=(e,t)=>{ju(e,t.dom).bind(e=>P.from(e.getNode())).map(mo.fromDom).filter(Pi).each(_n)},eS=(e,t,o,n)=>(Qk(!0,t),Qk(!1,o),Jk(t,o).fold(R(Xk,e,t,o,n),R(Yk,e,t,o,n))),tS=(e,t,o,n,r)=>t?eS(e,n,o,r):eS(e,o,n,r),oS=(e,t)=>{const o=mo.fromDom(e.getBody()),n=((e,t,o,n)=>n.collapsed?qk(e,t,o,n):P.none())(e.schema,o.dom,t,e.selection.getRng()).map(n=>()=>{tS(o,t,n.from.block,n.to.block,e.schema).each(t=>{e.selection.setRng(t.toRange())})});return n},nS=(e,t)=>{const o=mo.fromDom(t),n=R(vo,e);return tr(o,ji,n).isSome()},rS=(e,t)=>{const o=$u(e.dom,Yl.fromRangeStart(t)).isNone(),n=Wu(e.dom,Yl.fromRangeEnd(t)).isNone();return!((e,t)=>nS(e,t.startContainer)||nS(e,t.endContainer))(e,t)&&o&&n},aS=e=>{const t=mo.fromDom(e.getBody()),o=e.selection.getRng();return rS(t,o)?(e=>P.some(()=>{e.setContent(""),e.selection.setCursorLocation()}))(e):((e,t,o)=>{const n=t.getRng();return Ze(Ib(e,mo.fromDom(n.startContainer)),Ib(e,mo.fromDom(n.endContainer)),(r,a)=>vo(r,a)?P.none():P.some(()=>{n.deleteContents(),tS(e,!0,r,a,o).each(e=>{t.setRng(e.toRange())})})).getOr(P.none())})(t,e.selection,e.schema)},sS=(e,t)=>e.selection.isCollapsed()?P.none():aS(e),iS=(e,t,o,n,r)=>P.from(t._selectionOverrides.showCaret(e,o,n,r)),lS=(e,t)=>e.dispatch("BeforeObjectSelected",{target:t}).isDefaultPrevented()?P.none():P.some((e=>{const t=e.ownerDocument.createRange();return t.selectNode(e),t})(t)),cS=(e,t,o)=>t.collapsed?((e,t,o)=>{const n=yu(1,e.getBody(),t),r=Yl.fromRangeStart(n),a=r.getNode();if(Xm(a))return iS(1,e,a,!r.isAtEnd(),!1);const s=r.getNode(!0);if(Xm(s))return iS(1,e,s,!1,!1);const i=yx(e.dom.getRoot(),r.getNode());return Xm(i)?iS(1,e,i,!1,o):P.none()})(e,t,o).getOr(t):t,dS=e=>Rf(e)||Tf(e),mS=e=>Nf(e)||Af(e),uS=(e,t,o,n,r,a)=>{iS(n,e,a.getNode(!r),r,!0).each(o=>{if(t.collapsed){const e=t.cloneRange();r?e.setEnd(o.startContainer,o.startOffset):e.setStart(o.endContainer,o.endOffset),e.deleteContents()}else t.deleteContents();e.selection.setRng(o)}),((e,t)=>{aa(t)&&0===t.data.length&&e.remove(t)})(e.dom,o)},gS=(e,t)=>((e,t)=>{const o=e.selection.getRng();if(!aa(o.commonAncestorContainer))return P.none();const n=t?1:-1,r=Hu(e.getBody()),a=R(ku,t?r.next:r.prev),s=t?dS:mS,i=_u(n,e.getBody(),o),l=a(i),c=l?Mb(t,l):l;if(!c||!Su(i,c))return P.none();if(s(c))return P.some(()=>uS(e,o,i.getNode(),n,t,c));const d=a(c);return d&&s(d)&&Su(c,d)?P.some(()=>uS(e,o,i.getNode(),n,t,d)):P.none()})(e,t),pS=(e,t)=>{const o=e.getBody();return t?qu(o).filter(Rf):Gu(o).filter(Nf)},hS=e=>{const t=e.selection.getRng();return!t.collapsed&&(pS(e,!0).exists(e=>e.isEqual(Yl.fromRangeStart(t)))||pS(e,!1).exists(e=>e.isEqual(Yl.fromRangeEnd(t))))},fS=Te([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),bS=(e,t,o,n,r)=>{const a=r.getNode(!o);return Ib(mo.fromDom(t),mo.fromDom(n.getNode())).map(t=>Da(e,t)?fS.remove(t.dom):fS.moveToElement(a)).orThunk(()=>P.some(fS.moveToElement(a)))},xS=(e,t,o,n)=>Vu(t,e,o).bind(r=>{return a=r.getNode(),_(a)&&(ji(mo.fromDom(a))||Zi(mo.fromDom(a)))||((e,t,o,n,r)=>{const a=t=>r.isInline(t.nodeName.toLowerCase())&&!gu(o,n,e);return wu(!t,o).fold(()=>wu(t,n).fold(L,a),a)})(e,t,o,r,n)?P.none():t&&ha(r.getNode())||!t&&ha(r.getNode(!0))?bS(n,e,t,o,r):t&&Nf(o)||!t&&Rf(o)?P.some(fS.moveToPosition(r)):P.none();var a}),vS=(e,t,o,n)=>((e,t)=>{const o=t.getNode(!e),n=e?"after":"before";return Yr(o)&&o.getAttribute("data-mce-caret")===n})(t,o)?((e,t)=>w(t)?P.none():e&&ha(t.nextSibling)?P.some(fS.moveToElement(t.nextSibling)):!e&&ha(t.previousSibling)?P.some(fS.moveToElement(t.previousSibling)):P.none())(t,o.getNode(!t)).orThunk(()=>xS(e,t,o,n)):xS(e,t,o,n).bind(t=>((e,t,o)=>o.fold(e=>P.some(fS.remove(e)),e=>P.some(fS.moveToElement(e)),o=>gu(t,o,e)?P.none():P.some(fS.moveToPosition(o))))(e,o,t)),yS=(e,t)=>P.from(yx(e.getBody(),t)),wS=(e,t)=>{const o=e.selection.getNode();return yS(e,o).filter(ha).fold(()=>((e,t,o,n)=>{const r=yu(t?1:-1,e,o),a=Yl.fromRangeStart(r),s=mo.fromDom(e);return!t&&Nf(a)?P.some(fS.remove(a.getNode(!0))):t&&Rf(a)?P.some(fS.remove(a.getNode())):!t&&Rf(a)&&qf(s,a,n)?Gf(s,a,n).map(e=>fS.remove(e.getNode())):t&&Nf(a)&&$f(s,a,n)?Kf(s,a,n).map(e=>fS.remove(e.getNode())):vS(e,t,a,n)})(e.getBody(),t,e.selection.getRng(),e.schema).map(o=>()=>o.fold(((e,t)=>o=>(e._selectionOverrides.hideFakeCaret(),Eb(e,t,mo.fromDom(o)),!0))(e,t),((e,t)=>o=>{const n=t?Yl.before(o):Yl.after(o);return e.selection.setRng(n.toRange()),!0})(e,t),(e=>t=>(e.selection.setRng(t.toRange()),!0))(e))),()=>P.some(E))},_S=(e,t)=>{const o=e.selection.getNode();if(ha(o)&&!ba(o)){return yS(e,o.parentNode).filter(ha).fold(()=>P.some(()=>{var o;o=mo.fromDom(e.getBody()),q(wr(o,".mce-offscreen-selection"),_n),Eb(e,t,mo.fromDom(e.selection.getNode())),Pb(e)}),()=>P.some(E))}return hS(e)?P.some(()=>{Zb(e,e.selection.getRng(),mo.fromDom(e.getBody()))}):P.none()},CS=e=>{const t=e.dom,o=e.selection,n=yx(e.getBody(),o.getNode());if(pa(n)&&t.isBlock(n)&&t.isEmpty(n)){const e=t.create("br",{"data-mce-bogus":"1"});t.setHTML(n,""),n.appendChild(e),o.setRng(Yl.before(e).toRange())}return!0},kS=(e,t)=>e.selection.isCollapsed()?wS(e,t):_S(e,t),SS=e=>e.hasOwnProperty("text"),ES=e=>e.hasOwnProperty("marker"),OS=(e,t)=>{const o=(e,o)=>{if(aa(e))return{text:e,offset:o};{const n=t(),r=e.childNodes;return o<r.length?(e.insertBefore(n,r[o]),{marker:n,before:!0}):(e.appendChild(n),{marker:n,before:!1})}},n=o(e.endContainer,e.endOffset);return{start:o(e.startContainer,e.startOffset),end:n}},TS=e=>{var t,o;const{start:n,end:r}=e,a=new window.Range;return SS(n)?a.setStart(n.text,n.offset):ES(n)&&(n.before?a.setStartBefore(n.marker):a.setStartAfter(n.marker),null===(t=n.marker.parentNode)||void 0===t||t.removeChild(n.marker)),SS(r)?a.setEnd(r.text,r.offset):ES(r)&&(r.before?a.setEndBefore(r.marker):a.setEndAfter(r.marker),null===(o=r.marker.parentNode)||void 0===o||o.removeChild(r.marker)),a},AS=(e,t)=>{var o;const n=e.dom,r=n.getParent(e.selection.getStart(),n.isBlock),a=n.getParent(e.selection.getEnd(),n.isBlock),s=e.getBody();if("div"===(null===(o=null==r?void 0:r.nodeName)||void 0===o?void 0:o.toLowerCase())&&r&&a&&r===s.firstChild&&a===s.lastChild&&!n.isEmpty(s)){const o=r.cloneNode(!1),n=()=>{if(t?Hb(e):zb(e),s.firstChild!==r){const t=OS(e.selection.getRng(),()=>document.createElement("span"));Array.from(s.childNodes).forEach(e=>o.appendChild(e)),s.appendChild(o),e.selection.setRng(TS(t))}};return P.some(n)}return P.none()},DS=(e,t)=>e.selection.isCollapsed()?((e,t)=>{const o=Yl.fromRangeStart(e.selection.getRng());return Vu(t,e.getBody(),o).filter(e=>t?Ef(e):Of(e)).bind(e=>pu(t?0:-1,e)).map(t=>()=>e.selection.select(t))})(e,t):P.none(),MS=aa,RS=e=>MS(e)&&e.data[0]===Ki,NS=e=>MS(e)&&e.data[e.data.length-1]===Ki,BS=e=>{var t;return(null!==(t=e.ownerDocument)&&void 0!==t?t:document).createTextNode(Ki)},zS=(e,t)=>e?(e=>{var t;if(MS(e.previousSibling))return NS(e.previousSibling)||e.previousSibling.appendData(Ki),e.previousSibling;if(MS(e))return RS(e)||e.insertData(0,Ki),e;{const o=BS(e);return null===(t=e.parentNode)||void 0===t||t.insertBefore(o,e),o}})(t):(e=>{var t,o;if(MS(e.nextSibling))return RS(e.nextSibling)||e.nextSibling.insertData(0,Ki),e.nextSibling;if(MS(e))return NS(e)||e.appendData(Ki),e;{const n=BS(e);return e.nextSibling?null===(t=e.parentNode)||void 0===t||t.insertBefore(n,e.nextSibling):null===(o=e.parentNode)||void 0===o||o.appendChild(n),n}})(t),HS=R(zS,!0),LS=R(zS,!1),IS=(e,t)=>aa(e.container())?zS(t,e.container()):zS(t,e.getNode()),PS=(e,t)=>{const o=t.get();return o&&e.container()===o&&tl(o)},FS=(e,t)=>t.fold(t=>{jm(e.get());const o=HS(t);return e.set(o),P.some(Yl(o,o.length-1))},t=>qu(t).map(t=>{if(PS(t,e)){const t=e.get();return Yl(t,1)}{jm(e.get());const o=IS(t,!0);return e.set(o),Yl(o,1)}}),t=>Gu(t).map(t=>{if(PS(t,e)){const t=e.get();return Yl(t,t.length-1)}{jm(e.get());const o=IS(t,!1);return e.set(o),Yl(o,o.length-1)}}),t=>{jm(e.get());const o=LS(t);return e.set(o),P.some(Yl(o,1))}),VS=(e,t)=>{for(let o=0;o<e.length;o++){const n=e[o].apply(null,t);if(n.isSome())return n}return P.none()},ZS=Te([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),US=(e,t)=>{const o=uu(t,e);return o||e},jS=(e,t,o)=>{const n=Rb(o),r=US(t,n.container());return Db(e,r,n).fold(()=>Wu(r,n).bind(R(Db,e,r)).map(e=>ZS.before(e)),P.none)},WS=(e,t)=>null===Xu(e,t),$S=(e,t,o)=>Db(e,t,o).filter(R(WS,t)),qS=(e,t,o)=>{const n=Nb(o);return $S(e,t,n).bind(e=>$u(e,n).isNone()?P.some(ZS.start(e)):P.none())},GS=(e,t,o)=>{const n=Rb(o);return $S(e,t,n).bind(e=>Wu(e,n).isNone()?P.some(ZS.end(e)):P.none())},KS=(e,t,o)=>{const n=Nb(o),r=US(t,n.container());return Db(e,r,n).fold(()=>$u(r,n).bind(R(Db,e,r)).map(e=>ZS.after(e)),P.none)},YS=e=>!Ab(JS(e)),XS=(e,t,o)=>VS([jS,qS,GS,KS],[e,t,o]).filter(YS),JS=e=>e.fold(D,D,D,D),QS=e=>e.fold(A("before"),A("start"),A("end"),A("after")),eE=e=>e.fold(ZS.before,ZS.before,ZS.after,ZS.after),tE=e=>e.fold(ZS.start,ZS.start,ZS.end,ZS.end),oE=(e,t,o,n,r,a)=>Ze(Db(t,o,n),Db(t,o,r),(t,n)=>t!==n&&((e,t,o)=>{const n=uu(t,e),r=uu(o,e);return _(n)&&n===r})(o,t,n)?ZS.after(e?t:n):a).getOr(a),nE=(e,t)=>e.fold(I,e=>{return n=t,!(QS(o=e)===QS(n)&&JS(o)===JS(n));var o,n}),rE=(e,t)=>e?t.fold(O(P.some,ZS.start),P.none,O(P.some,ZS.after),P.none):t.fold(P.none,O(P.some,ZS.before),P.none,O(P.some,ZS.end)),aE=(e,t,o,n)=>{const r=Mb(e,n),a=XS(t,o,r);return XS(t,o,r).bind(R(rE,e)).orThunk(()=>((e,t,o,n,r)=>{const a=Mb(e,r);return Vu(e,o,a).map(R(Mb,e)).fold(()=>n.map(eE),r=>XS(t,o,r).map(R(oE,e,t,o,a,r)).filter(R(nE,n))).filter(YS)})(e,t,o,a,n))},sE=(e,t,o)=>{const n=e?1:-1;return t.setRng(Yl(o.container(),o.offset()+n).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0},iE=(e,t)=>{const o=t.selection.getRng(),n=e?Yl.fromRangeEnd(o):Yl.fromRangeStart(o);return!!(e=>C(e.selection.getSel().modify))(t)&&(e&&rl(n)?sE(!0,t.selection,n):!(e||!al(n))&&sE(!1,t.selection,n))};var lE;!function(e){e[e.Br=0]="Br",e[e.Block=1]="Block",e[e.Wrap=2]="Wrap",e[e.Eol=3]="Eol"}(lE||(lE={}));const cE=(e,t)=>-1===e?ae(t):t,dE=(e,t,o)=>1===e?t.next(o):t.prev(o),mE=(e,t,o,n)=>ma(n.getNode(1===t))?lE.Br:!1===gu(o,n)?lE.Block:lE.Wrap,uE=(e,t,o,n)=>{const r=Hu(o);let a=n;const s=[];for(;a;){const o=dE(t,r,a);if(!o)break;if(ma(o.getNode(!1)))return 1===t?{positions:cE(t,s).concat([o]),breakType:lE.Br,breakAt:P.some(o)}:{positions:cE(t,s),breakType:lE.Br,breakAt:P.some(o)};if(o.isVisible()){if(e(a,o)){const e=mE(0,t,a,o);return{positions:cE(t,s),breakType:e,breakAt:P.some(o)}}s.push(o),a=o}else a=o}return{positions:cE(t,s),breakType:lE.Eol,breakAt:P.none()}},gE=(e,t,o,n)=>t(o,n).breakAt.map(n=>{const r=t(o,n).positions;return-1===e?r.concat(n):[n].concat(r)}).getOr([]),pE=(e,t)=>J(e,(e,o)=>e.fold(()=>P.some(o),n=>Ze(de(n.getClientRects()),de(o.getClientRects()),(e,r)=>{const a=Math.abs(t-e.left);return Math.abs(t-r.left)<=a?o:n}).or(e)),P.none()),hE=(e,t)=>de(t.getClientRects()).bind(t=>pE(e,t.left)),fE=R(uE,Yl.isAbove,-1),bE=R(uE,Yl.isBelow,1),xE=R(gE,-1,fE),vE=R(gE,1,bE),yE=(e,t)=>fE(e,t).breakAt.isNone(),wE=(e,t)=>bE(e,t).breakAt.isNone(),_E=(e,t)=>hE(xE(e,t),t),CE=(e,t)=>hE(vE(e,t),t),kE=ha,SE=(e,t)=>Math.abs(e.left-t),EE=(e,t)=>Math.abs(e.right-t),OE=(e,t)=>bt(e,(e,o)=>{const n=Math.min(SE(e,t),EE(e,t)),r=Math.min(SE(o,t),EE(o,t));return r===n&&Oe(o,"node")&&kE(o.node)||r<n?o:e}),TE=e=>{const t=t=>$(t,t=>{const o=ml(t);return o.node=e,o});if(Yr(e))return t(e.getClientRects());if(aa(e)){const o=e.ownerDocument.createRange();return o.setStart(e,0),o.setEnd(e,e.data.length),t(o.getClientRects())}return[]},AE=e=>ne(e,TE);var DE;!function(e){e[e.Up=-1]="Up",e[e.Down=1]="Down"}(DE||(DE={}));const ME=(e,t,o,n,r,a)=>{let s=0;const i=[],l=n=>{let a=AE([n]);e===DE.Up&&(a=a.reverse());for(let e=0;e<a.length;e++){const n=a[e];if(!o(n,c)){if(i.length>0&&t(n,vt(i))&&s++,n.line=s,r(n))return!0;i.push(n)}}return!1},c=vt(a.getClientRects());if(!c)return i;const d=a.getNode();return d&&(l(d),((e,t,o,n)=>{let r=n;for(;r=mu(r,e,Ml,t);)if(o(r))return})(e,n,l,d)),i},RE=R(ME,DE.Up,pl,hl),NE=R(ME,DE.Down,hl,pl),BE=e=>vt(e.getClientRects()),zE=e=>t=>((e,t)=>t.line>e)(e,t),HE=e=>t=>((e,t)=>t.line===e)(e,t),LE=(e,t)=>{e.selection.setRng(t),Nh(e,e.selection.getRng())},IE=(e,t,o)=>P.some(cS(e,t,o)),PE=(e,t,o,n,r,a)=>{const s=1===t,i=Hu(e.getBody()),l=R(ku,s?i.next:i.prev),c=s?n:r;if(!o.collapsed){const n=bl(o);if(a(n))return iS(t,e,n,-1===t,!1);if(hS(e)){const e=o.cloneRange();return e.collapse(-1===t),P.from(e)}}const d=_u(t,e.getBody(),o);if(c(d))return lS(e,d.getNode(!s));let m=l(d);const u=cl(o);if(!m)return u?P.some(o):P.none();if(m=Mb(s,m),c(m))return iS(t,e,m.getNode(!s),s,!1);const g=l(m);return g&&c(g)&&Su(m,g)?iS(t,e,g.getNode(!s),s,!1):u?IE(e,m.toRange(),!1):P.none()},FE=(e,t,o,n,r,a)=>{const s=_u(t,e.getBody(),o),i=vt(s.getClientRects()),l=t===DE.Down,c=e.getBody();if(!i)return P.none();if(hS(e)){const e=l?Yl.fromRangeEnd(o):Yl.fromRangeStart(o);return(l?CE:_E)(c,e).orThunk(()=>P.from(e)).map(e=>e.toRange())}const d=(l?NE:RE)(c,zE(1),s),m=Y(d,HE(1)),u=i.left,g=OE(m,u);if(g&&a(g.node)){const o=Math.abs(u-g.left),n=Math.abs(u-g.right);return iS(t,e,g.node,o<n,!1)}let p;if(p=n(s)?s.getNode():r(s)?s.getNode(!0):bl(o),p){const o=((e,t,o,n)=>{const r=Hu(t);let a,s,i,l;const c=[];let d=0;e===DE.Down?(a=r.next,s=hl,i=pl,l=Yl.after(n)):(a=r.prev,s=pl,i=hl,l=Yl.before(n));const m=BE(l);do{if(!l.isVisible())continue;const e=BE(l);if(i(e,m))continue;c.length>0&&s(e,vt(c))&&d++;const t=ml(e);if(t.position=l,t.line=d,o(t))return c;c.push(t)}while(l=a(l));return c})(t,c,zE(1),p);let n=OE(Y(o,HE(1)),u);if(n)return IE(e,n.position.toRange(),!1);if(n=vt(Y(o,HE(0))),n)return IE(e,n.position.toRange(),!1)}return 0===m.length?VE(e,l).filter(l?r:n).map(t=>cS(e,t.toRange(),!1)):P.none()},VE=(e,t)=>{const o=e.selection.getRng(),n=t?Yl.fromRangeEnd(o):Yl.fromRangeStart(o),r=(a=n.container(),s=e.getBody(),tr(mo.fromDom(a),e=>Qm(e.dom),e=>e.dom===s).map(e=>e.dom).getOr(s));var a,s;if(t){const e=bE(r,n);return me(e.positions)}{const e=fE(r,n);return de(e.positions)}},ZE=(e,t,o)=>VE(e,t).filter(o).exists(t=>(e.selection.setRng(t.toRange()),!0)),UE=(e,t)=>{const o=e.dom.createRng();o.setStart(t.container(),t.offset()),o.setEnd(t.container(),t.offset()),e.selection.setRng(o)},jE=(e,t)=>{e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected")},WE=(e,t,o)=>FS(t,o).map(t=>(UE(e,t),o)),$E=(e,t,o)=>{const n=e.getBody(),r=((e,t,o)=>{const n=Yl.fromRangeStart(e);if(e.collapsed)return n;{const r=Yl.fromRangeEnd(e);return o?$u(t,r).getOr(r):Wu(t,n).getOr(n)}})(e.selection.getRng(),n,o),a=R(Tb,e);return aE(o,a,n,r).bind(o=>WE(e,t,o))},qE=(e,t)=>{const o=t.get();if(e.selection.isCollapsed()&&!e.composing&&o){const n=Yl.fromRangeStart(e.selection.getRng());Yl.isTextPosition(n)&&!(e=>rl(e)||al(e))(n)&&(UE(e,Um(o,n)),t.set(null))}},GE=(e,t,o)=>!!Ad(e)&&$E(e,t,o).isSome(),KE=(e,t,o)=>!!Ad(t)&&iE(e,t),YE=e=>{const t=Ae(null),o=R(Tb,e);return e.on("NodeChange",n=>{Ad(e)&&(((e,t,o)=>{const n=$(wr(mo.fromDom(t.getRoot()),'*[data-mce-selected="inline-boundary"]'),e=>e.dom),r=Y(n,e),a=Y(o,e);q(se(r,a),R(jE,!1)),q(se(a,r),R(jE,!0))})(o,e.dom,n.parents),qE(e,t),((e,t,o,n)=>{if(t.selection.isCollapsed()){const r=Y(n,e);q(r,n=>{const r=Yl.fromRangeStart(t.selection.getRng());XS(e,t.getBody(),r).bind(e=>WE(t,o,e))})}})(o,e,t,n.parents))}),t},XE=R(KE,!0),JE=R(KE,!1),QE=(e,t,o)=>{if(Ad(e)){const n=VE(e,t).getOrThunk(()=>{const o=e.selection.getRng();return t?Yl.fromRangeEnd(o):Yl.fromRangeStart(o)});return XS(R(Tb,e),e.getBody(),n).exists(t=>{const n=eE(t);return FS(o,n).exists(t=>(UE(e,t),!0))})}return!1},eO=(e,t)=>o=>FS(t,o).map(t=>()=>UE(e,t)),tO=(e,t,o,n)=>{const r=e.getBody(),a=R(Tb,e);e.undoManager.ignore(()=>{e.selection.setRng(((e,t)=>{const o=document.createRange();return o.setStart(e.container(),e.offset()),o.setEnd(t.container(),t.offset()),o})(o,n)),zb(e),XS(a,r,Yl.fromRangeStart(e.selection.getRng())).map(tE).bind(eO(e,t)).each(H)}),e.nodeChanged()},oO=(e,t,o,n)=>{const r=((e,t)=>{const o=uu(t,e);return o||e})(e.getBody(),n.container()),a=R(Tb,e),s=XS(a,r,n);return s.bind(e=>o?e.fold(A(P.some(tE(e))),P.none,A(P.some(eE(e))),P.none):e.fold(P.none,A(P.some(eE(e))),P.none,A(P.some(tE(e))))).map(eO(e,t)).getOrThunk(()=>{const i=Zu(o,r,n),l=i.bind(e=>XS(a,r,e));return Ze(s,l,()=>Db(a,r,n).bind(t=>(e=>Ze(qu(e),Gu(e),(t,o)=>{const n=Mb(!0,t),r=Mb(!1,o);return Wu(e,n).forall(e=>e.isEqual(r))}).getOr(!0))(t)?P.some(()=>{Eb(e,o,mo.fromDom(t))}):P.none())).getOrThunk(()=>l.bind(()=>i.map(r=>()=>{o?tO(e,t,n,r):tO(e,t,r,n)})))})},nO=(e,t,o)=>{if(e.selection.isCollapsed()&&Ad(e)){const n=Yl.fromRangeStart(e.selection.getRng());return oO(e,t,o,n)}return P.none()},rO=(e,t)=>{const o=mo.fromDom(e.getBody()),n=mo.fromDom(e.selection.getStart()),r=zf(n,o);return te(r,t).fold(A(r),e=>r.slice(0,e))},aO=e=>1===Wo(e),sO=e=>rO(e,t=>e.schema.isBlock(_o(t))||(e=>Wo(e)>1)(t)),iO=(e,t)=>{const o=R(Ev,e);return ne(t,e=>o(e)?[e.dom]:[])},lO=e=>{const t=(e=>rO(e,t=>e.schema.isBlock(_o(t))))(e);return iO(e,t)},cO=(e,t)=>{const o=Y(sO(e),aO);return me(o).bind(n=>{const r=Yl.fromRangeStart(e.selection.getRng());return Fb(t,r,n.dom)&&!Kg(n)?P.some(()=>((e,t,o,n)=>{const r=iO(t,n);if(0===r.length)Eb(t,e,o);else{const e=Sv(o.dom,r);t.selection.setRng(e.toRange())}})(t,e,n,o)):P.none()})},dO=(e,t)=>{const o=e.selection.getStart(),n=((e,t)=>{const o=t.parentElement;return ma(t)&&!x(o)&&e.dom.isEmpty(o)})(e,o)||(r=o,Kg(mo.fromDom(r)))?Sv(o,t):((e,t)=>{const{caretContainer:o,caretPosition:n}=kv(t);return e.insertNode(o.dom),n})(e.selection.getRng(),t);var r;e.selection.setRng(n.toRange())},mO=e=>aa(e.startContainer),uO=e=>(e=>{const t=e.startContainer.parentNode,o=e.endContainer.parentNode;return!x(t)&&!x(o)&&t.isEqualNode(o)})(e)&&(e=>{const t=e.endContainer;return e.endOffset===(aa(t)?t.length:t.childNodes.length)})(e),gO=e=>{const t=e.selection.getRng();return(e=>0===e.startOffset&&mO(e))(t)&&((e,t)=>{const o=t.startContainer.parentElement;return!x(o)&&Ev(e,mo.fromDom(o))})(e,t)&&(e=>uO(e)||(e=>!e.endContainer.isEqualNode(e.commonAncestorContainer))(e))(t)},pO=e=>{if(gO(e)){const t=lO(e);return P.some(()=>{zb(e),((e,t)=>{const o=se(t,lO(e));o.length>0&&dO(e,o)})(e,t)})}return P.none()},hO=(e,t)=>e.selection.isCollapsed()?cO(e,t):pO(e),fO=e=>{return t=mo.fromDom(e.selection.getStart()),o=e.schema,_r(t,e=>Yu(e.dom),e=>o.isBlock(_o(e)));var t,o},bO=e=>((e=>{const t=e.selection.getRng();return t.collapsed&&(mO(t)||e.dom.isEmpty(t.startContainer))&&!fO(e)})(e)&&dO(e,[]),!0),xO=(e,t,o)=>_(o)?P.some(()=>{e._selectionOverrides.hideFakeCaret(),Eb(e,t,mo.fromDom(o))}):P.none(),vO=(e,t)=>e.selection.isCollapsed()?((e,t)=>{const o=t?Tf:Af,n=_u(t?1:-1,e.getBody(),e.selection.getRng());return o(n)?xO(e,t,n.getNode(!t)):P.from(Mb(t,n)).filter(e=>o(e)&&Su(n,e)).bind(o=>xO(e,t,o.getNode(!t)))})(e,t):((e,t)=>{const o=e.selection.getNode();return va(o)?xO(e,t,o):P.none()})(e,t),yO=e=>rt(null!=e?e:"").getOr(0),wO=(e,t)=>(e||"table"===_o(t)?"margin":"padding")+("rtl"===Hn(t,"direction")?"-right":"-left"),_O=e=>{const t=kO(e);return!e.mode.isReadOnly()&&(t.length>1||((e,t)=>re(t,t=>{const o=wO(gd(e),t),n=In(t,o).map(yO).getOr(0);return"false"!==e.dom.getContentEditable(t.dom)&&n>0}))(e,t))},CO=e=>Vi(e)||Zi(e),kO=e=>Y(Tn(e.selection.getSelectedBlocks()),e=>!CO(e)&&!(e=>Bo(e).exists(CO))(e)&&or(e,e=>pa(e.dom)||ha(e.dom)).exists(e=>pa(e.dom))),SO=(e,t)=>{var o,n;if(e.mode.isReadOnly())return;const{dom:r}=e,a=pd(e),s=null!==(n=null===(o=/[a-z%]+$/i.exec(a))||void 0===o?void 0:o[0])&&void 0!==n?n:"px",i=yO(a),l=gd(e);q(kO(e),e=>{((e,t,o,n,r,a)=>{const s=wO(o,mo.fromDom(a)),i=yO(e.getStyle(a,s));if("outdent"===t){const t=Math.max(0,i-n);e.setStyle(a,s,t?t+r:"")}else{const t=i+n+r;e.setStyle(a,s,t)}})(r,t,l,i,s,e.dom)})},EO=e=>SO(e,"outdent"),OO=e=>{if(e.selection.isCollapsed()&&_O(e)){const t=e.dom,o=e.selection.getRng(),n=Yl.fromRangeStart(o),r=t.getParent(o.startContainer,t.isBlock);if(null!==r&&Ff(mo.fromDom(r),n,e.schema))return P.some(()=>EO(e))}return P.none()},TO=(e,t,o)=>ge([OO,kS,gS,(e,o)=>nO(e,t,o),oS,vx,DS,vO,sS,hO,AS],t=>t(e,o)).filter(t=>e.selection.isEditable()),AO=(e,t)=>{e.addCommand("delete",()=>{((e,t)=>{TO(e,t,!1).fold(()=>{e.selection.isEditable()&&(zb(e),Pb(e))},H)})(e,t)}),e.addCommand("forwardDelete",()=>{((e,t)=>{TO(e,t,!0).fold(()=>{e.selection.isEditable()&&Hb(e)},H)})(e,t)})},DO=e=>void 0===e.touches||1!==e.touches.length?P.none():P.some(e.touches[0]),MO=e=>{const t=$e(),o=Ae(!1),n=st(t=>{e.dispatch("longpress",{...t,type:"longpress"}),o.set(!0)},400);e.on("touchstart",e=>{DO(e).each(r=>{n.cancel();const a={x:r.clientX,y:r.clientY,target:e.target};n.throttle(e),o.set(!1),t.set(a)})},!0),e.on("touchmove",r=>{n.cancel(),DO(r).each(n=>{t.on(r=>{((e,t)=>{const o=Math.abs(e.clientX-t.x),n=Math.abs(e.clientY-t.y);return o>5||n>5})(n,r)&&(t.clear(),o.set(!1),e.dispatch("longpresscancel"))})})},!0),e.on("touchend touchcancel",r=>{n.cancel(),"touchcancel"!==r.type&&t.get().filter(e=>e.target.isEqualNode(r.target)).each(()=>{o.get()?r.preventDefault():e.dispatch("tap",{...r,type:"tap"})})},!0)},RO=(e,t)=>Ee(e,t.nodeName),NO=(e,t)=>!!aa(t)||!!Yr(t)&&!(RO(e.getBlockElements(),t)||dg(t)||Ga(e,t)||Ba(t)),BO=(e,t)=>{if(aa(t)){if(0===t.data.length)return!0;if(/^\s+$/.test(t.data))return!t.nextSibling||RO(e,t.nextSibling)||Ba(t.nextSibling)}return!1},zO=e=>e.dom.create(qc(e),Gc(e)),HO=e=>{const t=e.dom,o=e.selection,n=e.schema,r=n.getBlockElements(),a=o.getStart(),s=e.getBody();let i,l,c=null;const d=qc(e);if(!a||!Yr(a))return;const m=s.nodeName.toLowerCase();if(!n.isValidChild(m,d.toLowerCase())||((e,t,o)=>W(Bf(mo.fromDom(o),mo.fromDom(t)),t=>RO(e,t.dom)))(r,s,a))return;if(s.firstChild===s.lastChild&&ma(s.firstChild))return i=zO(e),i.appendChild(qi().dom),s.replaceChild(i,s.firstChild),e.selection.setCursorLocation(i,0),void e.nodeChanged();let u=s.firstChild;for(;u;)if(Yr(u)&&ja(n,u),NO(n,u)){if(BO(r,u)){l=u,u=u.nextSibling,t.remove(l);continue}if(!i){if(!c&&e.hasFocus()&&(c=OS(e.selection.getRng(),()=>document.createElement("span"))),!u.parentNode){u=null;break}i=zO(e),s.insertBefore(i,u)}l=u,u=u.nextSibling,i.appendChild(l)}else i=null,u=u.nextSibling;c&&(e.selection.setRng(TS(c)),e.nodeChanged())},LO=(e,t,o)=>{const n=mo.fromDom(zO(e)),r=qi();dn(n,r),o(t,n);const a=document.createRange();return a.setStartBefore(r.dom),a.setEndBefore(r.dom),a},IO=e=>t=>-1!==(" "+t.attr("class")+" ").indexOf(e),PO=(e,t,o)=>function(n){const r=arguments,a=r[r.length-2],s=a>0?t.charAt(a-1):"";if('"'===s)return n;if(">"===s){const e=t.lastIndexOf("<",a);if(-1!==e){if(-1!==t.substring(e,a).indexOf('contenteditable="false"'))return n}}return'<span class="'+o+'" data-mce-content="'+e.dom.encode(r[0])+'">'+e.dom.encode("string"==typeof r[1]?r[1]:r[0])+"</span>"},FO=(e,t)=>re(e,e=>{const o=t.match(e);return null!==o&&o[0].length===t.length}),VO=e=>{const t="contenteditable",o=" "+lo.trim(vm(e))+" ",n=" "+lo.trim(xm(e))+" ",r=IO(o),a=IO(n),s=ym(e);s.length>0&&e.on("BeforeSetContent",t=>{((e,t,o)=>{let n=t.length,r=o.content;if("raw"!==o.format){for(;n--;)r=r.replace(t[n],PO(e,r,xm(e)));o.content=r}})(e,s,t)}),e.parser.addAttributeFilter("class",e=>{let o=e.length;for(;o--;){const n=e[o];r(n)?n.attr(t,"true"):a(n)&&n.attr(t,"false")}}),e.serializer.addAttributeFilter(t,e=>{let o=e.length;for(;o--;){const n=e[o];if(!r(n)&&!a(n))continue;const i=n.attr("data-mce-content");s.length>0&&i?FO(s,i)?(n.name="#text",n.type=3,n.raw=!0,n.value=i):n.remove():n.attr(t,null)}})},ZO=(e,t)=>{t.hasAttribute("data-mce-caret")&&(ll(t),e.selection.setRng(e.selection.getRng()),e.selection.scrollIntoView(t))},UO=(e,t)=>{const o=(e=>sr(mo.fromDom(e.getBody()),"*[data-mce-caret]").map(e=>e.dom).getOrNull())(e);if(o)return"compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void ZO(e,o)):void(nl(o)&&(ZO(e,o),e.undoManager.add()))},jO=ha,WO=(e,t,o)=>{const n=Hu(e.getBody()),r=R(ku,1===t?n.next:n.prev);if(o.collapsed){const n=e.dom.getParent(o.startContainer,"PRE");if(!n)return;if(!r(Yl.fromRangeStart(o))){const o=mo.fromDom((e=>{const t=e.dom.create(qc(e));return t.innerHTML='<br data-mce-bogus="1">',t})(e));1===t?ln(mo.fromDom(n),o):sn(mo.fromDom(n),o),e.selection.select(o.dom,!0),e.selection.collapse()}}},$O=(e,t)=>{const o=t?1:-1,n=e.selection.getRng();return((e,t,o)=>PE(t,e,o,Rf,Nf,jO))(o,e,n).orThunk(()=>(WO(e,o,n),P.none()))},qO=(e,t)=>{const o=t?1:-1,n=e.selection.getRng();return((e,t,o)=>FE(t,e,o,e=>Rf(e)||Df(e),e=>Nf(e)||Mf(e),jO))(o,e,n).orThunk(()=>(WO(e,o,n),P.none()))},GO=(e,t)=>$O(e,((e,t)=>{const o=t?e.getEnd(!0):e.getStart(!0);return Ab(o)?!t:t})(e.selection,t)).exists(t=>(LE(e,t),!0)),KO=(e,t)=>qO(e,t).exists(t=>(LE(e,t),!0)),YO=(e,t)=>ZE(e,t,t?Nf:Rf),XO=(e,t)=>pS(e,!t).map(o=>{const n=o.toRange(),r=e.selection.getRng();return t?n.setStart(r.startContainer,r.startOffset):n.setEnd(r.endContainer,r.endOffset),n}).exists(t=>(LE(e,t),!0)),JO=e=>j(["figcaption"],_o(e)),QO=(e,t)=>{const o=mo.fromDom(e.getBody()),n=Yl.fromRangeStart(e.selection.getRng());return((e,t,o)=>{const n=R(vo,t);return or(mo.fromDom(e.container()),e=>o.isBlock(_o(e)),n).filter(JO)})(n,o,e.schema).exists(()=>{if(((e,t,o)=>t?wE(e.dom,o):yE(e.dom,o))(o,t,n)){const n=LO(e,o,t?dn:cn);return e.selection.setRng(n),!0}return!1})},eT=(e,t)=>!!e.selection.isCollapsed()&&QO(e,t),tT=(e,t)=>t?P.from(e.dom.getParent(e.selection.getNode(),"details")).map(t=>((e,t)=>{const o=e.selection.getRng(),n=Yl.fromRangeStart(o);return!(e.getBody().lastChild!==t||!wE(t,n)||(e.execCommand("InsertNewBlockAfter"),0))})(e,t)).getOr(!1):P.from(e.dom.getParent(e.selection.getNode(),"summary")).bind(t=>P.from(e.dom.getParent(t,"details")).map(o=>((e,t,o)=>{const n=e.selection.getRng(),r=Yl.fromRangeStart(n);return!(e.getBody().firstChild!==t||!yE(o,r)||(e.execCommand("InsertNewBlockBefore"),0))})(e,o,t))).getOr(!1),oT=(e,t)=>tT(e,t),nT={shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0},rT=(e,t)=>t.keyCode===e.keyCode&&t.shiftKey===e.shiftKey&&t.altKey===e.altKey&&t.ctrlKey===e.ctrlKey&&t.metaKey===e.metaKey,aT=(e,t)=>ne((e=>$(e,e=>({...nT,...e})))(e),e=>rT(e,t)?[e]:[]),sT=(e,t)=>ne((e=>$(e,e=>({...nT,...e})))(e),e=>rT(e,t)?[e]:[]),iT=(e,...t)=>()=>e.apply(null,t),lT=(e,t)=>ee(aT(e,t),e=>e.action()),cT=(e,t)=>ge(sT(e,t),e=>e.action()),dT=(e,t)=>{const o=t?1:-1,n=e.selection.getRng();return PE(e,o,n,Tf,Af,va).exists(t=>(LE(e,t),!0))},mT=(e,t)=>{const o=t?1:-1,n=e.selection.getRng();return FE(e,o,n,Tf,Af,va).exists(t=>(LE(e,t),!0))},uT=(e,t)=>ZE(e,t,t?Af:Tf),gT=(e,t,o)=>ne(Vo(e),e=>bo(e,t)?o(e)?[e]:[]:gT(e,t,o)),pT=(e,t)=>((e,t,o=L)=>o(t)?P.none():j(e,_o(t))?P.some(t):ar(t,e.join(","),e=>bo(e,"table")||o(e)))(["td","th"],e,t),hT=e=>gT(e,"th,td",I),fT=(e,t)=>ir(e,"table",t),bT=Te([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),xT={...bT,none:e=>bT.none(e)},vT=(e,t,o,n,r=I)=>{const a=1===n;if(!a&&o<=0)return xT.first(e[0]);if(a&&o>=e.length-1)return xT.last(e[e.length-1]);{const a=o+n,s=e[a];return r(s)?xT.middle(t,s):vT(e,t,a,n,r)}},yT=(e,t)=>fT(e,t).bind(t=>{const o=hT(t);return te(o,t=>vo(e,t)).map(e=>({index:e,all:o}))}),wT=He("image"),_T=He("event"),CT=e=>t=>{t[_T]=e},kT=CT(0),ST=CT(2),ET=CT(1),OT=(TT=0,e=>{const t=e;return P.from(t[_T]).exists(e=>e===TT)});var TT;const AT=He("mode"),DT=e=>t=>{t[AT]=e},MT=(e,t)=>DT(t)(e),RT=DT(0),NT=DT(2),BT=DT(1),zT=e=>t=>{const o=t;return P.from(o[AT]).exists(t=>t===e)},HT=zT(0),LT=zT(1),IT=["none","copy","link","move"],PT=["none","copy","copyLink","copyMove","link","linkMove","move","all","uninitialized"],FT=()=>{const e=new window.DataTransfer;let t="move",o="all";const n={get dropEffect(){return t},set dropEffect(e){j(IT,e)&&(t=e)},get effectAllowed(){return o},set effectAllowed(e){OT(n)&&j(PT,e)&&(o=e)},get items(){return((e,t)=>({...t,get length(){return t.length},add:(o,n)=>{if(HT(e)){if(!p(o))return t.add(o);if(!y(n))return t.add(o,n)}return null},remove:o=>{HT(e)&&t.remove(o)},clear:()=>{HT(e)&&t.clear()}}))(n,e.items)},get files(){return LT(n)?Object.freeze({length:0,item:e=>null}):e.files},get types(){return e.types},setDragImage:(t,o,r)=>{var a;HT(n)&&(a={image:t,x:o,y:r},n[wT]=a,e.setDragImage(t,o,r))},getData:t=>LT(n)?"":e.getData(t),setData:(t,o)=>{HT(n)&&e.setData(t,o)},clearData:t=>{HT(n)&&e.clearData(t)}};return RT(n),n},VT=e=>{const t=FT(),o=(e=>{const t=e;return P.from(t[AT])})(e);return NT(e),kT(t),t.dropEffect=e.dropEffect,t.effectAllowed=e.effectAllowed,(e=>{const t=e;return P.from(t[wT])})(e).each(e=>t.setDragImage(e.image,e.x,e.y)),q(e.types,o=>{"Files"!==o&&t.setData(o,e.getData(o))}),q(e.files,e=>t.items.add(e)),(e=>{const t=e;return P.from(t[_T])})(e).each(e=>{((e,t)=>{CT(t)(e)})(t,e)}),o.each(o=>{MT(e,o),MT(t,o)}),t},ZT=(e,t)=>e.setData("text/html",t),UT=(e,t,o,n,r)=>{const a=wr(mo.fromDom(o),"td,th,caption").map(e=>e.dom),s=Y(((e,t)=>ne(t,t=>{const o=((e,t)=>({left:e.left-t,top:e.top-t,right:e.right+2*t,bottom:e.bottom+2*t,width:e.width+t,height:e.height+t}))(ml(t.getBoundingClientRect()),-1);return[{x:o.left,y:e(o),cell:t},{x:o.right,y:e(o),cell:t}]}))(e,a),e=>t(e,r));return((e,t,o)=>J(e,(e,n)=>e.fold(()=>P.some(n),e=>{const r=Math.sqrt(Math.abs(e.x-t)+Math.abs(e.y-o)),a=Math.sqrt(Math.abs(n.x-t)+Math.abs(n.y-o));return P.some(a<r?n:e)}),P.none()))(s,n,r).map(e=>e.cell)},jT=R(UT,e=>e.bottom,(e,t)=>e.y<t),WT=R(UT,e=>e.top,(e,t)=>e.y>t),$T=(e,t)=>de(t.getClientRects()).bind(t=>jT(e,t.left,t.top)).bind(e=>{return hE(Gu(o=e).map(e=>fE(o,e).positions.concat(e)).getOr([]),t);var o}),qT=(e,t)=>me(t.getClientRects()).bind(t=>WT(e,t.left,t.top)).bind(e=>{return hE(qu(o=e).map(e=>[e].concat(bE(o,e).positions)).getOr([]),t);var o}),GT=(e,t,o)=>{const n=e(t,o);return(e=>e.breakType===lE.Wrap&&0===e.positions.length)(n)||!ma(o.getNode())&&(e=>e.breakType===lE.Br&&1===e.positions.length)(n)?!((e,t,o)=>o.breakAt.exists(o=>e(t,o).breakAt.isSome()))(e,t,n):n.breakAt.isNone()},KT=R(GT,fE),YT=R(GT,bE),XT=(e,t,o,n)=>{const r=e.selection.getRng(),a=t?1:-1;return!(!Ym()||!((e,t,o)=>{const n=Yl.fromRangeStart(t);return ju(!e,o).exists(e=>e.isEqual(n))})(t,r,o))&&(iS(a,e,o,!t,!1).each(t=>{LE(e,t)}),!0)},JT=(e,t)=>{const o=t.getNode(e);return oa(o)?P.some(o):P.none()},QT=(e,t,o)=>{const n=JT(!!t,o),r=!1===t;n.fold(()=>LE(e,o.toRange()),n=>ju(r,e.getBody()).filter(e=>e.isEqual(o)).fold(()=>LE(e,o.toRange()),o=>((e,t,o)=>{t.undoManager.transact(()=>{const n=e?ln:sn,r=LO(t,mo.fromDom(o),n);LE(t,r)})})(t,e,n)))},eA=(e,t,o,n)=>{const r=e.selection.getRng(),a=Yl.fromRangeStart(r),s=e.getBody();if(!t&&KT(n,a)){const n=((e,t,o)=>$T(t,o).orThunk(()=>de(o.getClientRects()).bind(o=>pE(xE(e,Yl.before(t)),o.left))).getOr(Yl.before(t)))(s,o,a);return QT(e,t,n),!0}if(t&&YT(n,a)){const n=((e,t,o)=>qT(t,o).orThunk(()=>de(o.getClientRects()).bind(o=>pE(vE(e,Yl.after(t)),o.left))).getOr(Yl.after(t)))(s,o,a);return QT(e,t,n),!0}return!1},tA=(e,t,o)=>P.from(e.dom.getParent(e.selection.getNode(),"td,th")).bind(n=>P.from(e.dom.getParent(n,"table")).map(r=>o(e,t,r,n))).getOr(!1),oA=(e,t)=>tA(e,t,XT),nA=(e,t)=>tA(e,t,eA),rA=(e,t,o)=>o.fold(P.none,P.none,(e,t)=>{return(o=t,rr(o,Ar)).map(e=>(e=>{const t=Br.exact(e,0,e,0);return Pr(t)})(e));var o},o=>e.mode.isReadOnly()||!aA(o)?P.none():(e.execCommand("mceTableInsertRowAfter"),sA(e,t,o))),aA=e=>or(e,Do("table")).exists(br),sA=(e,t,o)=>rA(e,t,((e,t,o)=>yT(e,o).fold(()=>xT.none(e),o=>vT(o.all,e,o.index,1,t)))(o,lA)),iA=(e,t,o)=>rA(e,t,((e,t,o)=>yT(e,o).fold(()=>xT.none(),o=>vT(o.all,e,o.index,-1,t)))(o,lA)),lA=e=>br(e)||kr(e,cA),cA=e=>So(e)&&br(e),dA=(e,t)=>{const o=["table","li","dl"],n=mo.fromDom(e.getBody()),r=e=>{const t=_o(e);return vo(e,n)||j(o,t)},a=e.selection.getRng(),s=mo.fromDom(t?a.endContainer:a.startContainer);return pT(s,r).map(o=>{fT(o,r).each(t=>{e.model.table.clearSelectedCells(t.dom)}),e.selection.collapse(!t);return(t?sA:iA)(e,r,o).each(t=>{e.selection.setRng(t)}),!0}).getOr(!1)},mA=(e,t)=>{e.on("keydown",o=>{o.isDefaultPrevented()||((e,t,o)=>{const n=ro.os.isMacOS()||ro.os.isiOS();lT([{keyCode:Qp.RIGHT,action:iT(GO,e,!0)},{keyCode:Qp.LEFT,action:iT(GO,e,!1)},{keyCode:Qp.UP,action:iT(KO,e,!1)},{keyCode:Qp.DOWN,action:iT(KO,e,!0)},...n?[{keyCode:Qp.UP,action:iT(XO,e,!1),metaKey:!0,shiftKey:!0},{keyCode:Qp.DOWN,action:iT(XO,e,!0),metaKey:!0,shiftKey:!0}]:[],{keyCode:Qp.RIGHT,action:iT(oA,e,!0)},{keyCode:Qp.LEFT,action:iT(oA,e,!1)},{keyCode:Qp.UP,action:iT(nA,e,!1)},{keyCode:Qp.DOWN,action:iT(nA,e,!0)},{keyCode:Qp.UP,action:iT(nA,e,!1)},{keyCode:Qp.UP,action:iT(oT,e,!1)},{keyCode:Qp.DOWN,action:iT(oT,e,!0)},{keyCode:Qp.RIGHT,action:iT(dT,e,!0)},{keyCode:Qp.LEFT,action:iT(dT,e,!1)},{keyCode:Qp.UP,action:iT(mT,e,!1)},{keyCode:Qp.DOWN,action:iT(mT,e,!0)},{keyCode:Qp.RIGHT,action:iT(GE,e,t,!0)},{keyCode:Qp.LEFT,action:iT(GE,e,t,!1)},{keyCode:Qp.RIGHT,ctrlKey:!n,altKey:n,action:iT(XE,e,t)},{keyCode:Qp.LEFT,ctrlKey:!n,altKey:n,action:iT(JE,e,t)},{keyCode:Qp.UP,action:iT(eT,e,!1)},{keyCode:Qp.DOWN,action:iT(eT,e,!0)}],o).each(e=>{o.preventDefault()})})(e,t,o)})},uA=(e,t)=>({container:e,offset:t}),gA=fi.DOM,pA=e=>t=>e===t?-1:0,hA=(e,t,o)=>{if(aa(e)&&t>=0)return P.some(uA(e,t));{const n=Li(gA);return P.from(n.backwards(e,t,pA(e),o)).map(e=>uA(e.container,e.container.data.length))}},fA=(e,t,o)=>{if(!aa(e))return P.none();const n=e.data;if(t>=0&&t<=n.length)return P.some(uA(e,t));{const n=Li(gA);return P.from(n.backwards(e,t,pA(e),o)).bind(e=>{const n=e.container.data;return fA(e.container,t+n.length,o)})}},bA=(e,t,o)=>{if(!aa(e))return P.none();const n=e.data;if(t<=n.length)return P.some(uA(e,t));{const r=Li(gA);return P.from(r.forwards(e,t,pA(e),o)).bind(e=>bA(e.container,t-n.length,o))}},xA=(e,t,o,n,r)=>{const a=Li(e,(e=>t=>e.isBlock(t)||j(["BR","IMG","HR","INPUT"],t.nodeName)||"false"===e.getContentEditable(t))(e));return P.from(a.backwards(t,o,n,r))},vA=e=>""!==e&&-1!=="  \ufeff\f\n\r\t\v".indexOf(e),yA=(e,t)=>e.substring(t.length),wA=(e,t,o,n=!1)=>{if(!(r=t).collapsed||!aa(r.startContainer))return P.none();var r;const a={text:"",offset:0},s=e.getParent(t.startContainer,e.isBlock)||e.getRoot();return xA(e,t.startContainer,t.startOffset,(e,t,r)=>(a.text=r+a.text,a.offset+=t,((e,t,o,n=!1)=>{let r;const a=o.charAt(0);for(r=t-1;r>=0;r--){const s=e.charAt(r);if(!n&&vA(s))return P.none();if(a===s&&Ke(e,o,r,t))break}return P.some(r)})(a.text,a.offset,o,n).getOr(t)),s).bind(e=>{const n=t.cloneRange();if(n.setStart(e.container,e.offset),n.setEnd(t.endContainer,t.endOffset),n.collapsed)return P.none();const r=(e=>Xi(e.toString().replace(/\u00A0/g," ")))(n);return 0!==r.lastIndexOf(o)?P.none():P.some({text:yA(r,o),range:n,trigger:o})})},_A=e=>{if((e=>3===e.nodeType)(e))return uA(e,e.data.length);{const t=e.childNodes;return t.length>0?_A(t[t.length-1]):uA(e,t.length)}},CA=(e,t)=>{const o=e.childNodes;return o.length>0&&t<o.length?CA(o[t],0):o.length>0&&(e=>1===e.nodeType)(e)&&o.length===t?_A(o[o.length-1]):uA(e,t)},kA=e=>t=>{const o=CA(t.startContainer,t.startOffset);return!((e,t)=>{var o;const n=null!==(o=e.getParent(t.container,e.isBlock))&&void 0!==o?o:e.getRoot();return xA(e,t.container,t.offset,(e,t)=>0===t?-1:t,n).filter(e=>{const t=e.container.data.charAt(e.offset-1);return!vA(t)}).isSome()})(e,o)},SA=(e,t)=>{const o=t(),n=e.selection.getRng();return((e,t,o)=>ge(o.triggers,o=>wA(e,t,o)))(e.dom,n,o).bind(o=>EA(e,t,o))},EA=(e,t,o,n={})=>{var r;const a=t(),s=null!==(r=e.selection.getRng().startContainer.nodeValue)&&void 0!==r?r:"",i=Y(a.lookupByTrigger(o.trigger),t=>o.text.length>=t.minChars&&t.matches.getOrThunk(()=>kA(e.dom))(o.range,s,o.text));if(0===i.length)return P.none();const l=Promise.all($(i,e=>e.fetch(o.text,e.maxResults,n).then(t=>({matchText:o.text,items:t,columns:e.columns,onAction:e.onAction,highlightOn:e.highlightOn}))));return P.some({lookupData:l,context:o})};var OA;!function(e){e[e.Error=0]="Error",e[e.Value=1]="Value"}(OA||(OA={}));const TA=(e,t,o)=>e.stype===OA.Error?t(e.serror):o(e.svalue),AA=e=>({stype:OA.Value,svalue:e}),DA=e=>({stype:OA.Error,serror:e}),MA=e=>TA(e,Re.error,Re.value),RA=AA,NA=e=>{const t=[],o=[];return q(e,e=>{TA(e,e=>o.push(e),e=>t.push(e))}),{values:t,errors:o}},BA=DA,zA=(e,t)=>e.stype===OA.Error?t(e.serror):e,HA=(e,t)=>e.stype===OA.Value?{stype:OA.Value,svalue:t(e.svalue)}:e,LA=(e,t)=>e.stype===OA.Error?{stype:OA.Error,serror:t(e.serror)}:e,IA=TA,PA=e=>h(e)&&he(e).length>100?" removed due to size":JSON.stringify(e,null,2),FA=(e,t)=>BA([{path:e,getErrorInfo:t}]),VA=e=>({extract:(t,o)=>zA(e(o),e=>((e,t)=>FA(e,A(t)))(t,e)),toString:A("val")}),ZA=VA(RA),UA=A(ZA),jA=(e,t)=>VA(o=>{const n=typeof o;return e(o)?RA(o):BA(`Expected type: ${t} but got: ${n}`)}),WA=jA(k,"number"),$A=jA(p,"string"),qA=jA(v,"boolean"),GA=jA(C,"function"),KA=e=>{if(Object(e)!==e)return!0;switch({}.toString.call(e).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(e).every(t=>KA(e[t]));default:return!1}};VA(e=>KA(e)?RA(e):BA("Expected value to be acceptable for sending via postMessage"));const YA=e=>({tag:"defaultedThunk",process:A(e)}),XA=(e,t,o)=>{switch(e.tag){case"field":return t(e.key,e.newKey,e.presence,e.prop);case"custom":return o(e.newKey,e.instantiator)}},JA=e=>O(BA,oe)(e),QA=e=>{const t=NA(e);return t.errors.length>0?JA(t.errors):RA(t.values)},eD=(e,t,o,n)=>Se(t,o).fold(()=>((e,t,o)=>FA(e,()=>'Could not find valid *required* value for "'+t+'" in '+PA(o)))(e,o,t),n),tD=(e,t,o,n)=>n(Se(e,t).getOrThunk(()=>o(e))),oD=(e,t,o,n,r)=>{const a=e=>r.extract(t.concat([n]),e),s=e=>e.fold(()=>RA(P.none()),e=>{const o=r.extract(t.concat([n]),e);return HA(o,P.some)});switch(e.tag){case"required":return eD(t,o,n,a);case"defaultedThunk":return tD(o,n,e.process,a);case"option":return((e,t,o)=>o(Se(e,t)))(o,n,s);case"defaultedOptionThunk":return((e,t,o,n)=>n(Se(e,t).map(t=>!0===t?o(e):t)))(o,n,e.process,s);case"mergeWithThunk":return tD(o,n,A({}),t=>{const n=Ie(e.process(o),t);return a(n)})}},nD=e=>({extract:(t,o)=>((e,t,o)=>{const n={},r=[];for(const a of o)XA(a,(o,a,s,i)=>{const l=oD(s,e,t,o,i);IA(l,e=>{r.push(...e)},e=>{n[a]=e})},(e,o)=>{n[e]=o(t)});return r.length>0?BA(r):RA(n)})(t,o,e),toString:()=>{const t=$(e,e=>XA(e,(e,t,o,n)=>e+" -> "+n.toString(),(e,t)=>"state("+e+")"));return"obj{\n"+t.join("\n")+"}"}}),rD=(e,t,o)=>MA(((e,t,o)=>{const n=t.extract([e],o);return LA(n,e=>({input:o,errors:e}))})(e,t,o)),aD=e=>"Errors: \n"+(e=>{const t=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:A("... (only showing first ten failures)")}]):e;return $(t,e=>"Failed path: ("+e.path.join(" > ")+")\n"+e.getErrorInfo())})(e.errors).join("\n")+"\n\nInput object: "+PA(e.input),sD=(e,t,o,n)=>({tag:"field",key:e,newKey:t,presence:o,prop:n}),iD=(e,t)=>sD(e,e,{tag:"required",process:{}},t),lD=e=>iD(e,$A),cD=e=>iD(e,GA),dD=(e,t)=>sD(e,e,{tag:"option",process:{}},t),mD=e=>dD(e,$A),uD=e=>dD(e,GA),gD=(e,t)=>sD(e,e,YA(t),UA()),pD=(e,t,o)=>sD(e,e,YA(t),o),hD=(e,t)=>pD(e,t,WA),fD=(e,t)=>pD(e,t,qA),bD=(e,t)=>pD(e,t,GA),xD=lD("type");lD("name"),lD("label"),lD("text"),lD("title"),lD("icon"),lD("url");const vD=lD("value"),yD=cD("fetch");cD("getSubmenuItems");const wD=cD("onAction");cD("onItemAction"),bD("onSetup",()=>E),mD("name");const _D=mD("text");mD("role");const CD=mD("icon");mD("url"),mD("tooltip"),mD("label"),mD("shortcut"),uD("select");const kD=fD("active",!1);fD("borderless",!1);const SD=fD("enabled",!0);fD("primary",!1);const ED=gD("meta",{});bD("onAction",E);nD([(e=>((e,t)=>pD(e,t,$A))("type",e))("autocompleteitem"),kD,SD,ED,vD,_D,CD]);const OD=nD([xD,lD("trigger"),hD("minChars",1),(TD=1,gD("columns",TD)),hD("maxResults",10),uD("matches"),yD,wD,((e,t,o)=>{return pD(e,t,(n=o,{extract:(e,t)=>{const o=$(t,(t,o)=>n.extract(e.concat(["["+o+"]"]),t));return QA(o)},toString:()=>"array("+n.toString()+")"}));var n})("highlightOn",[],$A)]);var TD;const AD=e=>{const t=e.ui.registry.getAll().popups,o=xe(t,e=>{return(t=e,rD("Autocompleter",OD,t)).fold(e=>{throw new Error(aD(e))},D);var t}),n=mt(Ce(o,e=>e.trigger)),r=ke(o);return{dataset:o,triggers:n,lookupByTrigger:e=>Y(r,t=>t.trigger===e)}},DD=e=>{const t=$e(),o=Ae(!1),n=t.isSet,r=()=>{n()&&((e=>{e.dispatch("AutocompleterEnd")})(e),o.set(!1),t.clear())},a=it(()=>AD(e)),s=s=>{(o=>t.get().map(t=>wA(e.dom,e.selection.getRng(),t.trigger,!0).bind(t=>EA(e,a,t,o))).getOrThunk(()=>SA(e,a)))(s).fold(r,r=>{(e=>{n()||t.set({trigger:e.trigger,matchLength:e.text.length})})(r.context),r.lookupData.then(n=>{t.get().map(a=>{const s=r.context;a.trigger===s.trigger&&(t.set({...a,matchLength:s.text.length}),o.get()?(Mc(e,{range:s.range}),((e,t)=>{e.dispatch("AutocompleterUpdate",t)})(e,{lookupData:n})):(o.set(!0),Mc(e,{range:s.range}),((e,t)=>{e.dispatch("AutocompleterStart",t)})(e,{lookupData:n})))})})})},i=()=>t.get().bind(({trigger:t})=>{const n=e.selection.getRng();return wA(e.dom,n,t,o.get()).filter(({range:e})=>((e,t)=>{const o=e.compareBoundaryPoints(window.Range.START_TO_START,t),n=e.compareBoundaryPoints(window.Range.END_TO_END,t);return o>=0&&n<=0})(n,e)).map(({range:e})=>e)});e.addCommand("mceAutocompleterReload",(e,t)=>{const o=h(t)?t.fetchOptions:{};s(o)}),e.addCommand("mceAutocompleterClose",r),e.addCommand("mceAutocompleterRefreshActiveRange",()=>{i().each(t=>{Mc(e,{range:t})})}),e.editorCommands.addQueryStateHandler("mceAutoCompleterInRange",()=>i().isSome()),((e,t)=>{const o=st(t.load,50);e.on("input",t=>{("insertCompositionText"!==t.inputType||e.composing)&&o.throttle()}),e.on("keydown",e=>{const n=e.which;8===n?o.throttle():27===n?(o.cancel(),t.cancelIfNecessary()):38!==n&&40!==n||o.cancel()},!0),e.on("remove",o.cancel)})(e,{cancelIfNecessary:r,load:s})},MD=Gt().browser.isSafari(),RD=e=>Gi(mo.fromDom(e)),ND=(e,t)=>{var o;return 0===e.startOffset&&e.endOffset===(null===(o=t.textContent)||void 0===o?void 0:o.length)},BD=(e,t)=>P.from(e.getParent(t.container(),"details")),zD=(e,t)=>BD(e,t).isSome(),HD=(e,t)=>t.startSummary.exists(t=>((e,t)=>qu(t).exists(t=>t.isEqual(e)))(e,t)),LD=(e,t)=>t.startSummary.exists(t=>((e,t)=>Gu(t).exists(o=>ma(o.getNode())&&$u(t,o).exists(t=>t.isEqual(e))||o.isEqual(e)))(e,t)),ID=(e,t)=>{const o=t.getNode();y(o)||e.selection.setCursorLocation(o,t.offset())},PD=(e,t,o)=>{const n=e.dom.getParent(t.container(),"details");if(n&&!n.open){const t=e.dom.select("summary",n)[0];if(t){(o?qu(t):Gu(t)).each(t=>ID(e,t))}}else ID(e,t)},FD=(e,t,o)=>{const{dom:n,selection:r}=e,a=e.getBody();if("character"===o){const o=Yl.fromRangeStart(r.getRng()),s=n.getParent(o.container(),n.isBlock),i=BD(n,o),l=s&&n.isEmpty(s),c=x(null==s?void 0:s.previousSibling),d=x(null==s?void 0:s.nextSibling);if(l){if(t?d:c){if(Zu(!t,a,o).exists(e=>zD(n,e)&&!Ve(i,BD(n,e))))return!0}}return Zu(t,a,o).fold(L,o=>{const r=BD(n,o);if(zD(n,o)&&!Ve(i,r)){if(t||PD(e,o,!1),s&&l){if(t&&c)return!0;if(!t&&d)return!0;PD(e,o,t),e.dom.remove(s)}return!0}return!1})}return!1},VD=(e,t,o,n)=>{const r=e.selection.getRng(),a=Yl.fromRangeStart(r),s=e.getBody();return"selection"===n?((e,t)=>{const o=t.startSummary.exists(t=>t.contains(e.startContainer)),n=t.startSummary.exists(t=>t.contains(e.endContainer)),r=t.startDetails.forall(e=>t.endDetails.forall(t=>e!==t));return(o||n)&&!(o&&n)||r})(r,t):o?LD(a,t)||((e,t,o)=>o.startDetails.exists(o=>Wu(e,t).forall(e=>!o.contains(e.container()))))(s,a,t):HD(a,t)||((e,t)=>t.startDetails.exists(o=>$u(o,e).forall(o=>t.startSummary.exists(t=>!t.contains(e.container())&&t.contains(o.container())))))(a,t)},ZD=(e,t,o)=>((e,t)=>{const o=P.from(e.getParent(t.startContainer,"details")),n=P.from(e.getParent(t.endContainer,"details"));if(o.isSome()||n.isSome()){const t=o.bind(t=>P.from(e.select("summary",t)[0]));return P.some({startSummary:t,startDetails:o,endDetails:n})}return P.none()})(e.dom,e.selection.getRng()).fold(()=>FD(e,t,o),n=>VD(e,n,t,o)||FD(e,t,o)),UD=(e,t,o)=>{const n=e.selection,r=n.getNode(),a=n.getRng(),s=Yl.fromRangeStart(a);return!!_a(r)&&("selection"===o&&ND(a,r)||Fb(t,s,r)?RD(r):e.undoManager.transact(()=>{const a=n.getSel();let{anchorNode:s,anchorOffset:i,focusNode:l,focusOffset:c}=null!=a?a:{};const d=()=>{_(s)&&_(i)&&_(l)&&_(c)&&(null==a||a.setBaseAndExtent(s,i,l,c))},m=(e,t)=>{q(e.childNodes,e=>{Og(e)&&t.appendChild(e)})},u=e.dom.create("span",{"data-mce-bogus":"1"});m(r,u),r.appendChild(u),d(),"word"!==o&&"line"!==o||null==a||a.modify("extend",t?"right":"left",o),!n.isCollapsed()&&ND(n.getRng(),u)?RD(r):(e.execCommand(t?"ForwardDelete":"Delete"),s=null==a?void 0:a.anchorNode,i=null==a?void 0:a.anchorOffset,l=null==a?void 0:a.focusNode,c=null==a?void 0:a.focusOffset,m(u,r),d()),e.dom.remove(u)}),!0)},jD=(e,t,o)=>ZD(e,t,o)||MD&&UD(e,t,o)?P.some(E):P.none(),WD=e=>(t,o,n={})=>{const r=t.getBody(),a={bubbles:!0,composed:!0,data:null,isComposing:!1,detail:0,view:null,target:r,currentTarget:r,eventPhase:Event.AT_TARGET,originalTarget:r,explicitOriginalTarget:r,isTrusted:!1,srcElement:r,cancelable:!1,preventDefault:E,inputType:o},s=Qs(new InputEvent(e));return t.dispatch(e,{...s,...a,...n})},$D=WD("input"),qD=WD("beforeinput"),GD=Gt(),KD=GD.os,YD=KD.isMacOS()||KD.isiOS(),XD=GD.browser.isFirefox(),JD=(e,t)=>{let o=!1;e.on("keydown",n=>{o=n.keyCode===Qp.BACKSPACE,n.isDefaultPrevented()||((e,t,o)=>{const n=o.keyCode===Qp.BACKSPACE?"deleteContentBackward":"deleteContentForward",r=e.selection.isCollapsed(),a=r?"character":"selection",s=e=>r?e?"word":"line":"selection";cT([{keyCode:Qp.BACKSPACE,action:iT(OO,e)},{keyCode:Qp.BACKSPACE,action:iT(kS,e,!1)},{keyCode:Qp.DELETE,action:iT(kS,e,!0)},{keyCode:Qp.BACKSPACE,action:iT(gS,e,!1)},{keyCode:Qp.DELETE,action:iT(gS,e,!0)},{keyCode:Qp.BACKSPACE,action:iT(nO,e,t,!1)},{keyCode:Qp.DELETE,action:iT(nO,e,t,!0)},{keyCode:Qp.BACKSPACE,action:iT(vx,e,!1)},{keyCode:Qp.DELETE,action:iT(vx,e,!0)},{keyCode:Qp.BACKSPACE,action:iT(jD,e,!1,a)},{keyCode:Qp.DELETE,action:iT(jD,e,!0,a)},...YD?[{keyCode:Qp.BACKSPACE,altKey:!0,action:iT(jD,e,!1,s(!0))},{keyCode:Qp.DELETE,altKey:!0,action:iT(jD,e,!0,s(!0))},{keyCode:Qp.BACKSPACE,metaKey:!0,action:iT(jD,e,!1,s(!1))}]:[{keyCode:Qp.BACKSPACE,ctrlKey:!0,action:iT(jD,e,!1,s(!0))},{keyCode:Qp.DELETE,ctrlKey:!0,action:iT(jD,e,!0,s(!0))}],{keyCode:Qp.BACKSPACE,action:iT(DS,e,!1)},{keyCode:Qp.DELETE,action:iT(DS,e,!0)},{keyCode:Qp.BACKSPACE,action:iT(vO,e,!1)},{keyCode:Qp.DELETE,action:iT(vO,e,!0)},{keyCode:Qp.BACKSPACE,action:iT(sS,e,!1)},{keyCode:Qp.DELETE,action:iT(sS,e,!0)},{keyCode:Qp.BACKSPACE,action:iT(oS,e,!1)},{keyCode:Qp.DELETE,action:iT(oS,e,!0)},{keyCode:Qp.BACKSPACE,action:iT(hO,e,!1)},{keyCode:Qp.DELETE,action:iT(hO,e,!0)},{keyCode:Qp.BACKSPACE,action:iT(AS,e,!1)},{keyCode:Qp.DELETE,action:iT(AS,e,!0)}],o).filter(t=>e.selection.isEditable()).each(t=>{o.preventDefault(),qD(e,n).isDefaultPrevented()||(t(),$D(e,n))})})(e,t,n)}),e.on("keyup",t=>{t.isDefaultPrevented()||((e,t,o)=>{lT([{keyCode:Qp.BACKSPACE,action:iT(CS,e)},{keyCode:Qp.DELETE,action:iT(CS,e)},...YD?[{keyCode:Qp.BACKSPACE,altKey:!0,action:iT(bO,e)},{keyCode:Qp.DELETE,altKey:!0,action:iT(bO,e)},...o?[{keyCode:XD?224:91,action:iT(bO,e)}]:[]]:[{keyCode:Qp.BACKSPACE,ctrlKey:!0,action:iT(bO,e)},{keyCode:Qp.DELETE,ctrlKey:!0,action:iT(bO,e)}]],t)})(e,t,o),o=!1})},QD=(e,t)=>{const o=e.dom,n=e.schema.getMoveCaretBeforeOnEnterElements();if(!t)return;if(/^(LI|DT|DD)$/.test(t.nodeName)){const e=(e=>{for(;e;){if(Yr(e)||aa(e)&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}return null})(t.firstChild);e&&/^(UL|OL|DL)$/.test(e.nodeName)&&t.insertBefore(o.doc.createTextNode(ct),t.firstChild)}const r=o.createRng();if(t.normalize(),t.hasChildNodes()){const e=new Ur(t,t);let o,a=t;for(;o=e.current();){if(aa(o)){r.setStart(o,0),r.setEnd(o,0);break}if(n[o.nodeName.toLowerCase()]){r.setStartBefore(o),r.setEndBefore(o);break}a=o,o=e.next()}o||(r.setStart(a,0),r.setEnd(a,0))}else ma(t)?t.nextSibling&&o.isBlock(t.nextSibling)?(r.setStartBefore(t),r.setEndBefore(t)):(r.setStartAfter(t),r.setEndAfter(t)):(r.setStart(t,0),r.setEnd(t,0));e.selection.setRng(r),Nh(e,r)},eM=(e,t)=>{const o=e.getRoot();let n,r=t;for(;r!==o&&r&&"false"!==e.getContentEditable(r);){if("true"===e.getContentEditable(r)){n=r;break}r=r.parentNode}return r!==o?n:o},tM=e=>P.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock)),oM=e=>{e.innerHTML='<br data-mce-bogus="1">'},nM=(e,t)=>{if(qc(e).toLowerCase()===t.tagName.toLowerCase()){((e,t,o)=>{const n=e.dom;P.from(o.style).map(n.parseStyle).each(e=>{const o={...Pn(mo.fromDom(t)),...e};n.setStyles(t,o)});const r=P.from(o.class).map(e=>e.split(/\s+/)),a=P.from(t.className).map(e=>Y(e.split(/\s+/),e=>""!==e));Ze(r,a,(e,o)=>{const r=Y(o,t=>!j(e,t)),a=[...e,...r];n.setAttrib(t,"class",a.join(" "))});const s=["style","class"],i=_e(o,(e,t)=>!j(s,t));n.setAttribs(t,i)})(e,t,Gc(e))}},rM=(e,t,o,n,r=!0,a,s)=>{const i=e.dom,l=e.schema,c=qc(e),d=o?o.nodeName.toUpperCase():"";let m=t;const u=l.getTextInlineElements();let g;g=a||"TABLE"===d||"HR"===d?i.create(a||c,s||{}):o.cloneNode(!1);let p=g;if(r){do{if(u[m.nodeName]){if(Yu(m)||dg(m))continue;const e=m.cloneNode(!1);i.setAttrib(e,"id",""),g.hasChildNodes()?(e.appendChild(g.firstChild),g.appendChild(e)):(p=e,g.appendChild(e))}}while((m=m.parentNode)&&m!==n)}else i.setAttrib(g,"style",null),i.setAttrib(g,"class",null);return nM(e,g),oM(p),g},aM=(e,t,o)=>!t&&o.nodeName.toLowerCase()===qc(e)&&e.dom.isEmpty(o)&&((e,t,o)=>{let n=t;for(;n&&n!==e&&x(n.nextSibling);){const e=n.parentElement;if(!e||!o(e))return wa(e);n=e}return!1})(e.getBody(),o,t=>Ee(e.schema.getTextBlockElements(),t.nodeName.toLowerCase())),sM=(e,t,o)=>{var n,r,a;const s=t(qc(e)),i=((e,t)=>e.dom.getParent(t,wa))(e,o);i&&(e.dom.insertAfter(s,i),QD(e,s),(null!==(a=null===(r=null===(n=o.parentElement)||void 0===n?void 0:n.childNodes)||void 0===r?void 0:r.length)&&void 0!==a?a:0)>1&&e.dom.remove(o))},iM=(e,t)=>{const o=null==e?void 0:e.parentNode;return _(o)&&o.nodeName===t},lM=e=>_(e)&&/^(OL|UL|LI)$/.test(e.nodeName),cM=e=>_(e)&&/^(LI|DT|DD)$/.test(e.nodeName),dM=e=>{const t=e.parentNode;return cM(t)?t:e},mM=(e,t,o)=>{let n=e[o?"firstChild":"lastChild"];for(;n&&!Yr(n);)n=n[o?"nextSibling":"previousSibling"];return n===t},uM=e=>J(Ce(Pn(mo.fromDom(e)),(e,t)=>`${t}: ${e};`),(e,t)=>e+t,""),gM=(e,t,o,n,r)=>{const a=e.dom,s=e.selection.getRng(),i=o.parentNode;if(o===e.getBody()||!i)return;var l;lM(l=o)&&lM(l.parentNode)&&(r="LI");const c=cM(n)?uM(n):void 0;let d=cM(n)&&c?t(r,{style:uM(n)}):t(r);if(mM(o,n,!0)&&mM(o,n,!1))if(iM(o,"LI")){const e=dM(o);a.insertAfter(d,e),(e=>{var t;return(null===(t=e.parentNode)||void 0===t?void 0:t.firstChild)===e})(o)?a.remove(e):a.remove(o)}else a.replace(d,o);else if(mM(o,n,!0))iM(o,"LI")?(a.insertAfter(d,dM(o)),d.appendChild(a.doc.createTextNode(" ")),d.appendChild(o)):i.insertBefore(d,o),a.remove(n);else if(mM(o,n,!1))a.insertAfter(d,dM(o)),a.remove(n);else{o=dM(o);const e=s.cloneRange();e.setStartAfter(n),e.setEndAfter(o);const t=e.extractContents();if("LI"===r&&((e,t)=>e.firstChild&&e.firstChild.nodeName===t)(t,"LI")){const e=Y($(d.children,mo.fromDom),N(Do("br")));d=t.firstChild,a.insertAfter(t,o),q(e,e=>cn(mo.fromDom(d),e)),c&&d.setAttribute("style",c)}else a.insertAfter(t,o),a.insertAfter(d,o);a.remove(n)}QD(e,d)},pM=(e,t)=>t&&"A"===t.nodeName&&e.isEmpty(t),hM=(e,t)=>e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t,fM=(e,t)=>_(t)&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&e.isEditable(t.parentNode)&&"false"!==e.getContentEditable(t),bM=(e,t,o)=>aa(t)?e?1===o&&t.data.charAt(o-1)===Ki?0:o:o===t.data.length-1&&t.data.charAt(o)===Ki?t.data.length:o:o,xM={insert:(e,t)=>{let o,n,r,a,s=!1;const i=e.dom,l=e.schema.getNonEmptyElements(),c=e.selection.getRng(),d=qc(e),m=mo.fromDom(c.startContainer),u=Zo(m,c.startOffset),g=u.exists(e=>So(e)&&!br(e)),h=c.collapsed&&g,f=(t,n)=>rM(e,o,k,C,Jc(e),t,n),b=e=>{const t=bM(e,o,n);if(aa(o)&&(e?t>0:t<o.data.length))return!1;if((o.parentNode===k||o===k)&&s&&!e)return!0;if(e&&Yr(o)&&o===k.firstChild)return!0;if(hM(o,"TABLE")||hM(o,"HR"))return((e,t)=>e.nodeName===t||e.nextSibling&&e.nextSibling.nodeName===t)(o,"BR")?!e:s&&!e||!s&&e;const r=new Ur(o,k);let a;for(aa(o)&&(e&&0===t?r.prev():e||t!==o.data.length||r.next());a=r.current();){if(Yr(a)){if(!a.getAttribute("data-mce-bogus")){const e=a.nodeName.toLowerCase();if(l[e]&&"br"!==e)return!1}}else if(aa(a)&&!Wr(a.data))return!1;e?r.prev():r.next()}return!0},x=()=>{let t;return t=/^(H[1-6]|PRE|FIGURE)$/.test(r)&&"HGROUP"!==S?f(d):f(),((e,t)=>{const o=Qc(e);return!w(t)&&(p(o)?j(lo.explode(o),t.nodeName.toLowerCase()):o)})(e,a)&&fM(i,a)&&i.isEmpty(k,void 0,{includeZwsp:!0})?t=i.split(a,k):i.insertAfter(t,k),QD(e,t),t};gh(i,c).each(e=>{c.setStart(e.startContainer,e.startOffset),c.setEnd(e.endContainer,e.endOffset)}),o=c.startContainer,n=c.startOffset;const v=!(!t||!t.shiftKey),y=!(!t||!t.ctrlKey);Yr(o)&&o.hasChildNodes()&&!h&&(s=n>o.childNodes.length-1,o=o.childNodes[Math.min(n,o.childNodes.length-1)]||o,n=s&&aa(o)?o.data.length:0);const C=eM(i,o);if(!C||((e,t)=>{const o=e.dom.getParent(t,"ol,ul,dl");return null!==o&&"false"===e.dom.getContentEditableParent(o)})(e,o))return;v||(o=((e,t,o,n,r)=>{var a,s;const i=e.dom,l=null!==(a=eM(i,n))&&void 0!==a?a:i.getRoot();let c=i.getParent(n,i.isBlock);if(!c||!fM(i,c)){if(c=c||l,!c.hasChildNodes()){const n=i.create(t);return nM(e,n),c.appendChild(n),o.setStart(n,0),o.setEnd(n,0),n}let a,d=n;for(;d&&d.parentNode!==c;)d=d.parentNode;for(;d&&!i.isBlock(d);)a=d,d=d.previousSibling;const m=null===(s=null==a?void 0:a.parentElement)||void 0===s?void 0:s.nodeName;if(a&&m&&e.schema.isValidChild(m,t.toLowerCase())){const s=a.parentNode,l=i.create(t);for(nM(e,l),s.insertBefore(l,a),d=a;d&&!i.isBlock(d);){const e=d.nextSibling;l.appendChild(d),d=e}o.setStart(n,r),o.setEnd(n,r)}}return n})(e,d,c,o,n));let k=i.getParent(o,i.isBlock)||i.getRoot();a=_(null==k?void 0:k.parentNode)?i.getParent(k.parentNode,i.isBlock):null,r=k?k.nodeName.toUpperCase():"";const S=a?a.nodeName.toUpperCase():"";if("LI"===S&&!y){k=a,a=a.parentNode,r=S}if(Yr(a)&&aM(e,v,k))return sM(e,f,k);if(/^(LI|DT|DD)$/.test(r)&&Yr(a)&&i.isEmpty(k))return void gM(e,f,a,k,d);if(!(h||k!==e.getBody()&&fM(i,k)))return;const E=k.parentNode;let O;if(h)O=f(d),u.fold(()=>{dn(m,mo.fromDom(O))},e=>{sn(e,mo.fromDom(O))}),e.selection.setCursorLocation(O,0);else if(el(k))O=ll(k),i.isEmpty(k)&&oM(k),nM(e,O),QD(e,O);else if(b(!1))O=x();else if(b(!0)&&E){const t=Yl.fromRangeStart(c),o=Mf(t),n=mo.fromDom(k),r=qf(n,t,e.schema)?Gf(n,t,e.schema).bind(e=>P.from(e.getNode())):P.none();O=E.insertBefore(f(),k);const a=hM(k,"HR")||o?O:r.getOr(k);QD(e,a)}else{const t=(e=>{const t=e.cloneRange();return t.setStart(e.startContainer,bM(!0,e.startContainer,e.startOffset)),t.setEnd(e.endContainer,bM(!1,e.endContainer,e.endOffset)),t})(c).cloneRange();t.setEndAfter(k);const o=t.extractContents();(e=>{q(yr(mo.fromDom(e),Oo),e=>{const t=e.dom;t.nodeValue=Xi(t.data)})})(o),(e=>{let t=e;do{aa(t)&&(t.data=t.data.replace(/^[\r\n]+/,"")),t=t.firstChild}while(t)})(o),O=o.firstChild,i.insertAfter(o,k),((e,t,o)=>{var n;const r=[];if(!o)return;let a=o;for(;a=a.firstChild;){if(e.isBlock(a))return;Yr(a)&&!t[a.nodeName.toLowerCase()]&&r.push(a)}let s=r.length;for(;s--;)a=r[s],(!a.hasChildNodes()||a.firstChild===a.lastChild&&""===(null===(n=a.firstChild)||void 0===n?void 0:n.nodeValue)||pM(e,a))&&e.remove(a)})(i,l,O),((e,t)=>{t.normalize();const o=t.lastChild;(!o||Yr(o)&&/^(left|right)$/gi.test(e.getStyle(o,"float",!0)))&&e.add(t,"br")})(i,k),i.isEmpty(k)&&oM(k),O.normalize(),i.isEmpty(O)?(i.remove(O),x()):(nM(e,O),QD(e,O))}i.setAttrib(O,"id",""),e.dispatch("NewBlock",{newBlock:O})},fakeEventName:"insertParagraph"},vM=(e,t,o)=>{const n=e.dom.createRng();o?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),e.selection.setRng(n),Nh(e,n)},yM=(e,t)=>{const o=e.selection,n=e.dom,r=o.getRng();let a,s=!1;gh(n,r).each(e=>{r.setStart(e.startContainer,e.startOffset),r.setEnd(e.endContainer,e.endOffset)});let i=r.startOffset,l=r.startContainer;if(Yr(l)&&l.hasChildNodes()){const e=i>l.childNodes.length-1;l=l.childNodes[Math.min(i,l.childNodes.length-1)]||l,i=e&&aa(l)?l.data.length:0}let c=n.getParent(l,n.isBlock);const d=c&&c.parentNode?n.getParent(c.parentNode,n.isBlock):null,m=d?d.nodeName.toUpperCase():"",u=!(!t||!t.ctrlKey);"LI"!==m||u||(c=d),aa(l)&&i>=l.data.length&&(((e,t,o)=>{const n=new Ur(t,o);let r;const a=e.getNonEmptyElements();for(;r=n.next();)if(a[r.nodeName.toLowerCase()]||aa(r)&&r.length>0)return!0;return!1})(e.schema,l,c||n.getRoot())||(a=n.create("br"),r.insertNode(a),r.setStartAfter(a),r.setEndAfter(a),s=!0)),a=n.create("br"),Jl(n,r,a),vM(e,a,s),e.undoManager.add()},wM=(e,t)=>{const o=mo.fromTag("br");sn(mo.fromDom(t),o),e.undoManager.add()},_M=(e,t)=>{CM(e.getBody(),t)||ln(mo.fromDom(t),mo.fromTag("br"));const o=mo.fromTag("br");ln(mo.fromDom(t),o),vM(e,o.dom,!1),e.undoManager.add()},CM=(e,t)=>{return o=Yl.after(t),!!ma(o.getNode())||Wu(e,Yl.after(t)).map(e=>ma(e.getNode())).getOr(!1);var o},kM=e=>e&&"A"===e.nodeName&&"href"in e,SM=e=>e.fold(L,kM,kM,L),EM=(e,t)=>{t.fold(E,R(wM,e),R(_M,e),E)},OM={insert:(e,t)=>{const o=(e=>{const t=R(Tb,e),o=Yl.fromRangeStart(e.selection.getRng());return XS(t,e.getBody(),o).filter(SM)})(e);o.isSome()?o.each(R(EM,e)):yM(e,t)},fakeEventName:"insertLineBreak"},TM=(e,t)=>tM(e).filter(e=>t.length>0&&bo(mo.fromDom(e),t)).isSome(),AM=Te([{br:[]},{block:[]},{none:[]}]),DM=(e,t)=>(e=>TM(e,Xc(e)))(e),MM=e=>(t,o)=>(e=>tM(e).filter(e=>Zi(mo.fromDom(e))).isSome())(t)===e,RM=(e,t)=>(o,n)=>{const r=(e=>tM(e).fold(A(""),e=>e.nodeName.toUpperCase()))(o)===e.toUpperCase();return r===t},NM=e=>{const t=eM(e.dom,e.selection.getStart());return w(t)},BM=e=>RM("pre",e),zM=e=>(t,o)=>$c(t)===e,HM=(e,t)=>(e=>TM(e,Yc(e)))(e),LM=(e,t)=>t,IM=e=>{const t=qc(e),o=eM(e.dom,e.selection.getStart());return _(o)&&e.schema.isValidChild(o.nodeName,t)},PM=e=>{const t=e.selection.getRng(),o=mo.fromDom(t.startContainer),n=Zo(o,t.startOffset).map(e=>So(e)&&!br(e));return t.collapsed&&n.getOr(!0)},FM=(e,t)=>(o,n)=>J(e,(e,t)=>e&&t(o,n),!0)?P.some(t):P.none(),VM=(e,t,o)=>{if(!t.mode.isReadOnly()){if(t.selection.isCollapsed()||(e=>{e.execCommand("delete")})(t),_(o)){if(qD(t,e.fakeEventName).isDefaultPrevented())return}e.insert(t,o),_(o)&&$D(t,e.fakeEventName)}},ZM=(e,t)=>{if(e.mode.isReadOnly())return;const o=()=>VM(OM,e,t),n=()=>VM(xM,e,t),r=((e,t)=>VS([FM([DM],AM.none()),FM([BM(!0),NM],AM.none()),FM([RM("summary",!0)],AM.br()),FM([BM(!0),zM(!1),LM],AM.br()),FM([BM(!0),zM(!1)],AM.block()),FM([BM(!0),zM(!0),LM],AM.block()),FM([BM(!0),zM(!0)],AM.br()),FM([MM(!0),LM],AM.br()),FM([MM(!0)],AM.block()),FM([HM],AM.br()),FM([LM],AM.br()),FM([IM],AM.block()),FM([PM],AM.block())],[e,!(!t||!t.shiftKey)]).getOr(AM.none()))(e,t);switch(Kc(e)){case"linebreak":r.fold(o,o,E);break;case"block":r.fold(n,n,E);break;case"invert":r.fold(n,o,E);break;default:r.fold(o,n,E)}},UM=Gt(),jM=UM.os.isiOS()&&UM.browser.isSafari(),WM=(e,t)=>{var o;t.isDefaultPrevented()||(t.preventDefault(),(o=e.undoManager).typing&&(o.typing=!1,o.add()),e.undoManager.transact(()=>{ZM(e,t)}))},$M=e=>{let t=P.none();e.on("keydown",o=>{o.keyCode===Qp.ENTER&&(jM&&(e=>{if(!e.collapsed)return!1;const t=e.startContainer;if(aa(t)){const o=/^[\uAC00-\uD7AF\u1100-\u11FF\u3130-\u318F\uA960-\uA97F\uD7B0-\uD7FF]$/,n=t.data.charAt(e.startOffset-1);return o.test(n)}return!1})(e.selection.getRng())?(e=>{t=P.some(e.selection.getBookmark()),e.undoManager.add()})(e):WM(e,o))}),e.on("keyup",o=>{o.keyCode===Qp.ENTER&&t.each(()=>((e,o)=>{e.undoManager.undo(),t.fold(E,t=>e.selection.moveToBookmark(t)),WM(e,o),t=P.none()})(e,o))})},qM=(e,t)=>{e.on("keydown",o=>{o.isDefaultPrevented()||((e,t,o)=>{const n=ro.os.isMacOS()||ro.os.isiOS();lT([{keyCode:Qp.END,action:iT(YO,e,!0)},{keyCode:Qp.HOME,action:iT(YO,e,!1)},...n?[]:[{keyCode:Qp.HOME,action:iT(XO,e,!1),ctrlKey:!0,shiftKey:!0},{keyCode:Qp.END,action:iT(XO,e,!0),ctrlKey:!0,shiftKey:!0}],{keyCode:Qp.END,action:iT(uT,e,!0)},{keyCode:Qp.HOME,action:iT(uT,e,!1)},{keyCode:Qp.END,action:iT(QE,e,!0,t)},{keyCode:Qp.HOME,action:iT(QE,e,!1,t)}],o).each(e=>{o.preventDefault()})})(e,t,o)})},GM=e=>{e.on("input",t=>{t.isComposing||(e=>{const t=mo.fromDom(e.getBody());e.selection.isCollapsed()&&ub(t,Yl.fromRangeStart(e.selection.getRng()),e.schema).each(t=>{e.selection.setRng(t.toRange())})})(e)})},KM=Gt(),YM=e=>e.stopImmediatePropagation(),XM=e=>e.keyCode===Qp.PAGE_UP||e.keyCode===Qp.PAGE_DOWN,JM=(e,t,o)=>{o&&!e.get()?t.on("NodeChange",YM,!0):!o&&e.get()&&t.off("NodeChange",YM),e.set(o)},QM=(e,t)=>{if(KM.os.isMacOS())return;const o=Ae(!1);e.on("keydown",t=>{XM(t)&&JM(o,e,!0)}),e.on("keyup",n=>{n.isDefaultPrevented()||((e,t,o)=>{lT([{keyCode:Qp.PAGE_UP,action:iT(QE,e,!1,t)},{keyCode:Qp.PAGE_DOWN,action:iT(QE,e,!0,t)}],o)})(e,t,n),XM(n)&&o.get()&&(JM(o,e,!1),e.nodeChanged())})},eR=(e,t)=>e===t||e.contains(t),tR=e=>{e.on("beforeinput",t=>{e.selection.isEditable()&&!W(t.getTargetRanges(),t=>!((e,t)=>!eR(e.getBody(),t.startContainer)||!eR(e.getBody(),t.endContainer)||Bh(e.dom,t))(e,t))||t.preventDefault()})},oR=(e,t)=>{const o=t.container(),n=t.offset();return aa(o)?(o.insertData(n,e),P.some(Yl(o,n+e.length))):Cu(t).map(o=>{const n=mo.fromText(e);return t.isAtEnd()?ln(o,n):sn(o,n),Yl(n.dom,e.length)})},nR=R(oR,ct),rR=R(oR," "),aR=e=>t=>{e.selection.setRng(t.toRange()),e.nodeChanged()},sR=e=>{const t=Yl.fromRangeStart(e.selection.getRng()),o=mo.fromDom(e.getBody());if(e.selection.isCollapsed()){const n=R(Tb,e),r=Yl.fromRangeStart(e.selection.getRng());return XS(n,e.getBody(),r).bind((e=>t=>t.fold(t=>$u(e.dom,Yl.before(t)),e=>qu(e),e=>Gu(e),t=>Wu(e.dom,Yl.after(t))))(o)).map(n=>()=>((e,t,o)=>n=>nb(e,n,o)?nR(t):rR(t))(o,t,e.schema)(n).each(aR(e)))}return P.none()},iR=e=>{return Ue(ro.browser.isFirefox()&&e.selection.isEditable()&&(t=e.dom,o=e.selection.getRng().startContainer,t.isEditable(t.getParent(o,"summary"))),()=>{const t=mo.fromDom(e.getBody());e.selection.isCollapsed()||e.getDoc().execCommand("Delete");((e,t,o)=>nb(e,t,o)?nR(t):rR(t))(t,Yl.fromRangeStart(e.selection.getRng()),e.schema).each(aR(e))});var t,o},lR=e=>{e.on("keydown",t=>{t.isDefaultPrevented()||((e,t)=>{cT([{keyCode:Qp.SPACEBAR,action:iT(sR,e)},{keyCode:Qp.SPACEBAR,action:iT(iR,e)}],t).each(o=>{t.preventDefault(),qD(e,"insertText",{data:" "}).isDefaultPrevented()||(o(),$D(e,"insertText",{data:" "}))})})(e,t)})},cR=e=>Em(e)?[{keyCode:Qp.TAB,action:iT(dA,e,!0)},{keyCode:Qp.TAB,shiftKey:!0,action:iT(dA,e,!1)}]:[],dR=e=>{e.on("keydown",t=>{t.isDefaultPrevented()||((e,t)=>{lT([...cR(e)],t).each(e=>{t.preventDefault()})})(e,t)})},mR=e=>{if(e.addShortcut("Meta+P","","mcePrint"),DD(e),eC(e))return Ae(null);{const t=YE(e);return tR(e),(e=>{e.on("keyup compositionstart",R(UO,e))})(e),mA(e,t),JD(e,t),$M(e),lR(e),GM(e),dR(e),qM(e,t),QM(e,t),t}};class uR{constructor(e){let t;this.lastPath=[],this.editor=e;const o=this;"onselectionchange"in e.getDoc()||e.on("NodeChange click mouseup keyup focus",o=>{const n=e.selection.getRng(),r={startContainer:n.startContainer,startOffset:n.startOffset,endContainer:n.endContainer,endOffset:n.endOffset};"nodechange"!==o.type&&sh(r,t)||e.dispatch("SelectionChange"),t=r}),e.on("contextmenu",()=>{Dp(e),e.dispatch("SelectionChange")}),e.on("SelectionChange",()=>{const t=e.selection.getStart(!0);t&&kg(e)&&!o.isSameElementPath(t)&&e.dom.isChildOf(t,e.getBody())&&e.nodeChanged({selectionChange:!0})}),e.on("mouseup",t=>{!t.isDefaultPrevented()&&kg(e)&&("IMG"===e.selection.getNode().nodeName?Np.setEditorTimeout(e,()=>{e.nodeChanged()}):e.nodeChanged())})}nodeChanged(e={}){const t=this.editor,o=t.selection;let n;if(t.initialized&&o&&!Vd(t)&&!Bm(t)){const r=t.getBody();n=o.getStart(!0)||r,n.ownerDocument===t.getDoc()&&t.dom.isChildOf(n,r)||(n=r);const a=[];t.dom.getParent(n,e=>e===r||(a.push(e),!1)),t.dispatch("NodeChange",{...e,element:n,parents:a})}}isSameElementPath(e){let t;const o=this.editor,n=ae(o.dom.getParents(e,I,o.getBody()));if(n.length===this.lastPath.length){for(t=n.length;t>=0&&n[t]===this.lastPath[t];t--);if(-1===t)return this.lastPath=n,!0}return this.lastPath=n,!1}}const gR="x-tinymce/html",pR=A(gR),hR="\x3c!-- "+gR+" --\x3e",fR=e=>hR+e,bR=e=>-1!==e.indexOf(hR),xR=(e,t,o)=>{const n=e.split(/\n\n/),r=((e,t)=>{let o="<"+e;const n=Ce(t,(e,t)=>t+'="'+ys.encodeAllRaw(e)+'"');return n.length&&(o+=" "+n.join(" ")),o+">"})(t,o),a="</"+t+">",s=$(n,e=>e.split(/\n/).join("<br />"));return 1===s.length?s[0]:$(s,e=>r+e+a).join("")},vR="%MCEPASTEBIN%",yR=e=>e.dom.get("mcepastebin"),wR=e=>_(e)&&"mcepastebin"===e.id,_R=e=>e===vR,CR=e=>{const t=Ae(null);return{create:()=>((e,t)=>{const{dom:o,selection:n}=e,r=e.getBody();t.set(n.getRng());const a=o.add(e.getBody(),"div",{id:"mcepastebin",class:"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},vR);ro.browser.isFirefox()&&o.setStyle(a,"left","rtl"===o.getStyle(r,"direction",!0)?65535:-65535),o.bind(a,"beforedeactivate focusin focusout",e=>{e.stopPropagation()}),a.focus(),n.select(a,!0)})(e,t),remove:()=>((e,t)=>{const o=e.dom;if(yR(e)){let n;const r=t.get();for(;n=yR(e);)o.remove(n),o.unbind(n);r&&e.selection.setRng(r)}t.set(null)})(e,t),getEl:()=>yR(e),getHtml:()=>(e=>{const t=e.dom,o=(e,o)=>{e.appendChild(o),t.remove(o,!0)},[n,...r]=Y(e.getBody().childNodes,wR);q(r,e=>{o(n,e)});const a=t.select("div[id=mcepastebin]",n);for(let e=a.length-1;e>=0;e--){const r=t.create("div");n.insertBefore(r,a[e]),o(r,a[e])}return n?n.innerHTML:""})(e),getLastRng:t.get}},kR=(e,t)=>(lo.each(t,t=>{e=g(t,RegExp)?e.replace(t,""):e.replace(t[0],t[1])}),e),SR=e=>e=kR(e,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,(e,t,o)=>t||o?ct:" "],/<br class="Apple-interchange-newline">/g,/<br>$/i]),ER=(e,t)=>({content:e,cancelled:t}),OR=(e,t,o)=>{const n=((e,t,o)=>e.dispatch("PastePreProcess",{content:t,internal:o}))(e,t,o),r=((e,t)=>{const o=p_({sanitize:Cm(e),sandbox_iframes:Am(e),sandbox_iframes_exclusions:Dm(e),convert_unsafe_embeds:Mm(e)},e.schema);o.addNodeFilter("meta",e=>{lo.each(e,e=>{e.remove()})});const n=o.parse(t,{forced_root_block:!1,isRootContent:!0});return mf({validate:!0},e.schema).serialize(n)})(e,n.content);return e.hasEventListeners("PastePostProcess")&&!n.isDefaultPrevented()?((e,t,o)=>{const n=e.dom.create("div",{style:"display:none"},t),r=((e,t,o)=>e.dispatch("PastePostProcess",{node:t,internal:o}))(e,n,o);return ER(r.node.innerHTML,r.isDefaultPrevented())})(e,r,o):ER(r,n.isDefaultPrevented())},TR=(e,t)=>(e.insertContent(t,{merge:mm(e),paste:!0}),!0),AR=e=>/^https?:\/\/[\w\-\/+=.,!;:&%@^~(){}?#]+$/i.test(e),DR=(e,t,o)=>!(e.selection.isCollapsed()||!AR(t))&&((e,t,o)=>(e.undoManager.extra(()=>{o(e,t)},()=>{e.execCommand("mceInsertLink",!1,t)}),!0))(e,t,o),MR=(e,t,o)=>!!((e,t)=>AR(t)&&W(Sm(e),e=>Xe(t.toLowerCase(),`.${e.toLowerCase()}`)))(e,t)&&((e,t,o)=>(e.undoManager.extra(()=>{o(e,t)},()=>{e.insertContent('<img src="'+t+'">')}),!0))(e,t,o),RR=(e,t,o)=>{o||!um(e)?TR(e,t):((e,t)=>{lo.each([DR,MR,TR],o=>!o(e,t,TR))})(e,t)},NR=(e=>{let t=0;return()=>e+t++})("mceclip"),BR=e=>{const t=FT();return ZT(t,e),NT(t),t},zR=(e,t,o,n,r)=>{const a=((e,t,o)=>OR(e,t,o))(e,t,o);if(!a.cancelled){const t=a.content,o=()=>RR(e,t,n);if(r){qD(e,"insertFromPaste",{dataTransfer:BR(t)}).isDefaultPrevented()||(o(),$D(e,"insertFromPaste"))}else o()}},HR=(e,t,o,n)=>{const r=o||bR(t);zR(e,(e=>e.replace(hR,""))(t),r,!1,n)},LR=(e,t,o)=>{const n=e.dom.encode(t).replace(/\r\n/g,"\n"),r=qr(n,pm(e)),a=xR(r,qc(e),Gc(e));zR(e,a,!1,!0,o)},IR=e=>{const t={};if(e&&e.types)for(let o=0;o<e.types.length;o++){const n=e.types[o];try{t[n]=e.getData(n)}catch(e){t[n]=""}}return t},PR=(e,t)=>t in e&&e[t].length>0,FR=e=>PR(e,"text/html")||PR(e,"text/plain"),VR=(e,t,o,n)=>{const r=NR(),a=td(e)&&_(o.name),s=a?((e,t)=>{const o=t.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i);return _(o)?e.dom.encode(o[1]):void 0})(e,o.name):r,i=a?o.name:void 0,l=t.create(r,o,n,s,i);return t.add(l),l},ZR=e=>{const t=Sm(e);return e=>Ye(e.type,"image/")&&W(t,t=>(e=>{const t=e.toLowerCase(),o={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"};return lo.hasOwn(o,t)?"image/"+o[t]:"image/"+t})(t)===e.type)},UR=(e,t,o)=>{const n="paste"===t.type?t.clipboardData:t.dataTransfer;var r;if(am(e)&&n){const a=((e,t)=>{const o=t.items?ne(ue(t.items),e=>"file"===e.kind?[e.getAsFile()]:[]):[],n=t.files?ue(t.files):[];return Y(o.length>0?o:n,ZR(e))})(e,n);if(a.length>0)return t.preventDefault(),(r=a,Promise.all($(r,e=>Ay(e).then(t=>({file:e,uri:t}))))).then(t=>{o&&e.selection.setRng(o),q(t,t=>{((e,t)=>{Ey(t.uri).each(({data:o,type:n,base64Encoded:r})=>{const a=r?o:btoa(o),s=t.file,i=e.editorUpload.blobCache,l=i.getByData(a,n),c=null!=l?l:VR(e,i,s,a);HR(e,`<img src="${c.blobUri()}">`,!1,!0)})})(e,t)})}),!0}return!1},jR=(e,t,o,n,r)=>{let a=SR(o);const s=PR(t,pR())||bR(o),i=!s&&(e=>!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(e))(a),l=AR(a);(_R(a)||!a.length||i&&!l)&&(n=!0),(n||l)&&(a=PR(t,"text/plain")&&i?t["text/plain"]:(e=>{const t=Ps(),o=p_({},t);let n="";const r=t.getVoidElements(),a=lo.makeMap("script noscript style textarea video audio iframe object"," "),s=t.getBlockElements(),i=e=>{const o=e.name,l=e;if("br"!==o){if("wbr"!==o)if(r[o]&&(n+=" "),a[o])n+=" ";else{if(3===e.type&&(n+=e.value),!(e.name in t.getVoidElements())){let t=e.firstChild;if(t)do{i(t)}while(t=t.next)}s[o]&&l.next&&(n+="\n","p"===o&&(n+="\n"))}}else n+="\n"};return e=kR(e,[/<!\[[^\]]+\]>/g]),i(o.parse(e)),n})(a)),_R(a)||(n?LR(e,a,r):HR(e,a,s,r))},WR=(e,t,o)=>{let n;e.on("keydown",e=>{(e=>Qp.metaKeyPressed(e)&&86===e.keyCode||e.shiftKey&&45===e.keyCode)(e)&&!e.isDefaultPrevented()&&(n=e.shiftKey&&86===e.keyCode)}),e.on("paste",r=>{if(r.isDefaultPrevented()||(e=>{var t,o;return ro.os.isAndroid()&&0===(null===(o=null===(t=e.clipboardData)||void 0===t?void 0:t.items)||void 0===o?void 0:o.length)})(r))return;const a="text"===o.get()||n;n=!1;const s=IR(r.clipboardData);!FR(s)&&UR(e,r,t.getLastRng()||e.selection.getRng())||(PR(s,"text/html")?(r.preventDefault(),jR(e,s,s["text/html"],a,!0)):PR(s,"text/plain")&&PR(s,"text/uri-list")?(r.preventDefault(),jR(e,s,s["text/plain"],a,!0)):(t.create(),Np.setEditorTimeout(e,()=>{const o=t.getHtml();t.remove(),jR(e,s,o,a,!1)},0)))})},$R=(e,t,o)=>{WR(e,t,o),(e=>{const t=e=>Ye(e,"webkit-fake-url"),o=e=>Ye(e,"data:");e.parser.addNodeFilter("img",(n,r,a)=>{if(!am(e)&&(e=>{var t;return!0===(null===(t=e.data)||void 0===t?void 0:t.paste)})(a))for(const r of n){const n=r.attr("src");p(n)&&!r.attr("data-mce-object")&&n!==ro.transparentSrc&&(t(n)||!hm(e)&&o(n))&&r.remove()}})})(e)},qR=(e,t)=>{e.addCommand("mceTogglePlainTextPaste",()=>{((e,t)=>{"text"===t.get()?(t.set("html"),Rc(e,!1)):(t.set("text"),Rc(e,!0)),e.focus()})(e,t)}),e.addCommand("mceInsertClipboardContent",(t,o)=>{o.html&&HR(e,o.html,o.internal,!1),o.text&&LR(e,o.text,!1)})},GR=(e,t,o,n)=>{((e,t,o)=>{if(!e)return!1;try{return e.clearData(),e.setData("text/html",t),e.setData("text/plain",o),e.setData(pR(),t),!0}catch(e){return!1}})(e.clipboardData,t.html,t.text)?(e.preventDefault(),n()):o(t.html,n)},KR=e=>(t,o)=>{const{dom:n,selection:r}=e,a=n.create("div",{contenteditable:"false","data-mce-bogus":"all"}),s=n.create("div",{contenteditable:"true"},t);n.setStyles(a,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),a.appendChild(s),n.add(e.getBody(),a);const i=r.getRng();s.focus();const l=n.createRng();l.selectNodeContents(s),r.setRng(l),Np.setEditorTimeout(e,()=>{r.setRng(i),n.remove(a),o()},0)},YR=e=>({html:fR(e.selection.getContent({contextual:!0})),text:e.selection.getContent({format:"text"})}),XR=e=>!e.selection.isCollapsed()||(e=>!!e.dom.getParent(e.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",e.getBody()))(e),JR=e=>{e.on("cut",(e=>t=>{!t.isDefaultPrevented()&&XR(e)&&e.selection.isEditable()&&GR(t,YR(e),KR(e),()=>{if(ro.browser.isChromium()||ro.browser.isFirefox()){const t=e.selection.getRng();Np.setEditorTimeout(e,()=>{e.selection.setRng(t),e.execCommand("Delete")},0)}else e.execCommand("Delete")})})(e)),e.on("copy",(e=>t=>{!t.isDefaultPrevented()&&XR(e)&&GR(t,YR(e),KR(e),E)})(e))},QR=(e,t)=>{var o,n;return fh.getCaretRangeFromPoint(null!==(o=t.clientX)&&void 0!==o?o:0,null!==(n=t.clientY)&&void 0!==n?n:0,e.getDoc())},eN=(e,t)=>{e.focus(),t&&e.selection.setRng(t)},tN=(e,t)=>{rm(e)&&e.on("dragend dragover draggesture dragdrop drop drag",e=>{e.preventDefault(),e.stopPropagation()}),am(e)||e.on("drop",e=>{const t=e.dataTransfer;t&&(e=>W(e.files,e=>/^image\//.test(e.type)))(t)&&e.preventDefault()}),e.on("drop",o=>{if(o.isDefaultPrevented())return;const n=QR(e,o);if(w(n))return;const r=IR(o.dataTransfer),a=PR(r,pR());if((!FR(r)||(e=>{const t=e["text/plain"];return!!t&&0===t.indexOf("file://")})(r))&&UR(e,o,n))return;const s=r[pR()],i=s||r["text/html"]||r["text/plain"],l=((e,t,o,n)=>{const r=e.getParent(o,e=>Ga(t,e));if(!x(e.getParent(o,"summary")))return!0;if(r&&Ee(n,"text/html")){const e=(new DOMParser).parseFromString(n["text/html"],"text/html").body;return!x(e.querySelector(r.nodeName.toLowerCase()))}return!1})(e.dom,e.schema,n.startContainer,r),c=t.get();c&&!l||i&&(o.preventDefault(),Np.setEditorTimeout(e,()=>{e.undoManager.transact(()=>{(s||c&&l)&&e.execCommand("Delete"),eN(e,n);const t=SR(i);r["text/html"]?HR(e,t,a,!0):LR(e,t,!0)})}))}),e.on("dragstart",e=>{t.set(!0)}),e.on("dragover dragend",o=>{am(e)&&!t.get()&&(o.preventDefault(),eN(e,QR(e,o))),"dragend"===o.type&&t.set(!1)}),(e=>{e.on("input",t=>{const o=e=>x(e.querySelector("summary"));if("deleteByDrag"===t.inputType){const t=Y(e.dom.select("details"),o);q(t,t=>{ma(t.firstChild)&&t.firstChild.remove();const o=e.dom.create("summary");o.appendChild(qi().dom),t.prepend(o)})}})})(e)},oN=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,nN=e=>lo.trim(e).replace(oN,Ks).toLowerCase(),rN=(e,t,o)=>{const n=cm(e);if(o||"all"===n||!dm(e))return t;const r=n?n.split(/[, ]/):[];if(r&&"none"!==n){const o=e.dom,n=e.selection.getNode();t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,(e,t,a,s)=>{const i=o.parseStyle(o.decode(a)),l={};for(let e=0;e<r.length;e++){const t=i[r[e]];let a=t,s=o.getStyle(n,r[e],!0);/color/.test(r[e])&&(a=nN(a),s=nN(s)),s!==a&&(l[r[e]]=t)}const c=o.serializeStyle(l,"span");return c?t+' style="'+c+'"'+s:t+s})}else t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return t=t.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,(e,t,o,n)=>t+' style="'+o+'"'+n),t},aN=e=>{const t=Ae(!1),o=Ae(gm(e)?"text":"html"),n=CR(e);(e=>{(ro.browser.isChromium()||ro.browser.isSafari())&&((e,t)=>{e.on("PastePreProcess",o=>{o.content=t(e,o.content,o.internal)})})(e,rN)})(e),qR(e,o),(e=>{const t=t=>o=>{t(e,o)},o=sm(e);C(o)&&e.on("PastePreProcess",t(o));const n=im(e);C(n)&&e.on("PastePostProcess",t(n))})(e),e.addQueryStateHandler("mceTogglePlainTextPaste",()=>"text"===o.get()),e.on("PreInit",()=>{JR(e),tN(e,t),$R(e,n,o)})},sN=e=>{(e=>{e.on("click",t=>{e.dom.getParent(t.target,"details")&&t.preventDefault()})})(e),(e=>{e.parser.addNodeFilter("details",t=>{const o=Om(e);q(t,e=>{"expanded"===o?e.attr("open","open"):"collapsed"===o&&e.attr("open",null)})}),e.serializer.addNodeFilter("details",t=>{const o=Tm(e);q(t,e=>{"expanded"===o?e.attr("open","open"):"collapsed"===o&&e.attr("open",null)})})})(e)},iN=ma,lN=aa,cN=e=>ha(e.dom),dN=e=>t=>vo(mo.fromDom(e),t),mN=(e,t,o)=>or(mo.fromDom(e),e=>(e=>pa(e.dom))(e)||o.isBlock(_o(e)),dN(t)).getOr(mo.fromDom(t)).dom,uN=(e,t)=>or(mo.fromDom(e),cN,dN(t)),gN=(e,t,o)=>{const n=new Ur(e,t),r=o?n.next.bind(n):n.prev.bind(n);let a=e;for(let t=o?e:r();t&&!iN(t);t=r())Al(t)&&(a=t);return a},pN=e=>{const t=((e,t,o)=>{const n=Yl.fromRangeStart(e).getNode(),r=mN(n,t,o),a=gN(n,r,!1),s=gN(n,r,!0),i=document.createRange();return uN(a,r).fold(()=>{lN(a)?i.setStart(a,0):i.setStartBefore(a)},e=>i.setStartBefore(e.dom)),uN(s,r).fold(()=>{lN(s)?i.setEnd(s,s.data.length):i.setEndAfter(s)},e=>i.setEndAfter(e.dom)),i})(e.selection.getRng(),e.getBody(),e.schema);e.selection.setRng(Hx(t))};var hN;!function(e){e.Before="before",e.After="after"}(hN||(hN={}));const fN=(e,t)=>Math.abs(e.left-t),bN=(e,t)=>Math.abs(e.right-t),xN=(e,t)=>{const o=((e,t)=>Math.max(0,Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top)))(e,t)/Math.min(e.height,t.height);return((e,t)=>e.top<t.bottom&&e.bottom>t.top)(e,t)&&o>.5},vN=(e,t)=>(e=>J(e,(e,t)=>e.fold(()=>P.some(t),e=>{const o=Math.min(t.left,e.left),n=Math.min(t.top,e.top),r=Math.max(t.right,e.right),a=Math.max(t.bottom,e.bottom);return P.some({top:n,right:r,bottom:a,left:o,width:r-o,height:a-n})}),P.none()))(Y(e,e=>{return(o=t)>=(n=e).top&&o<=n.bottom;var o,n})).fold(()=>[[],e],t=>{const{pass:o,fail:n}=K(e,e=>xN(e,t));return[o,n]}),yN=(e,t,o)=>t>e.left&&t<e.right?0:Math.min(Math.abs(e.left-t),Math.abs(e.right-t)),wN=(e,t,o,n)=>{const r=e=>Al(e.node)?P.some(e):Yr(e.node)?wN(ue(e.node.childNodes),t,o,!1):P.none(),a=(e,a)=>{const s=le(e,(e,n)=>a(e,t,o)-a(n,t,o));return ge(s,r).map(e=>n&&!aa(e.node)&&s.length>1?((e,n,a)=>r(n).filter(n=>Math.abs(a(e,t,o)-a(n,t,o))<2&&aa(n.node)))(e,s[1],a).getOr(e):e)},[s,i]=vN(AE(e),o),{pass:l,fail:c}=K(i,e=>e.top<o);return a(s,yN).orThunk(()=>a(c,fl)).orThunk(()=>a(l,fl))},_N=(e,t,o)=>{const n=mo.fromDom(e),r=Ro(n),a=mo.fromPoint(r,t,o).filter(e=>yo(n,e)).getOr(n);return((e,t,o,n)=>{const r=(t,a)=>{const s=Y(t.dom.childNodes,N(e=>Yr(e)&&e.classList.contains("mce-drag-container")));return a.fold(()=>wN(s,o,n,!0),e=>{const t=Y(s,t=>t!==e.dom);return wN(t,o,n,!0)}).orThunk(()=>(vo(t,e)?P.none():zo(t)).bind(e=>r(e,P.some(t))))};return r(t,P.none())})(n,a,t,o)},CN=(e,t,o)=>_N(e,t,o).filter(e=>Jm(e.node)).map(e=>((e,t)=>({node:e.node,position:fN(e,t)<bN(e,t)?hN.Before:hN.After}))(e,t)),kN=e=>{var t,o;const n=e.getBoundingClientRect(),r=e.ownerDocument,a=r.documentElement,s=r.defaultView;return{top:n.top+(null!==(t=null==s?void 0:s.scrollY)&&void 0!==t?t:0)-a.clientTop,left:n.left+(null!==(o=null==s?void 0:s.scrollX)&&void 0!==o?o:0)-a.clientLeft}},SN=(e,t)=>{return o=(e=>e.inline?kN(e.getBody()):{left:0,top:0})(e),n=(e=>{const t=e.getBody();return e.inline?{left:t.scrollLeft,top:t.scrollTop}:{left:0,top:0}})(e),r=((e,t)=>{if(t.target.ownerDocument!==e.getDoc()){const o=kN(e.getContentAreaContainer()),n=(e=>{const t=e.getBody(),o=e.getDoc().documentElement,n={left:t.scrollLeft,top:t.scrollTop},r={left:t.scrollLeft||o.scrollLeft,top:t.scrollTop||o.scrollTop};return e.inline?n:r})(e);return{left:t.pageX-o.left+n.left,top:t.pageY-o.top+n.top}}return{left:t.pageX,top:t.pageY}})(e,t),{pageX:r.left-o.left+n.left,pageY:r.top-o.top+n.top};var o,n,r},EN=e=>({target:e,srcElement:e}),ON=(e,t,o,n)=>{const r=((e,t)=>{const o=VT(e);return"dragstart"===t?(kT(o),RT(o)):"drop"===t?(ST(o),NT(o)):(ET(o),BT(o)),o})(o,e);return y(n)?((e,t,o)=>{const n=B("Function not supported on simulated event.");return{bubbles:!0,cancelBubble:!1,cancelable:!0,composed:!1,currentTarget:null,defaultPrevented:!1,eventPhase:0,isTrusted:!0,returnValue:!1,timeStamp:0,type:e,composedPath:n,initEvent:n,preventDefault:E,stopImmediatePropagation:E,stopPropagation:E,AT_TARGET:window.Event.AT_TARGET,BUBBLING_PHASE:window.Event.BUBBLING_PHASE,CAPTURING_PHASE:window.Event.CAPTURING_PHASE,NONE:window.Event.NONE,altKey:!1,button:0,buttons:0,clientX:0,clientY:0,ctrlKey:!1,layerX:0,layerY:0,metaKey:!1,movementX:0,movementY:0,offsetX:0,offsetY:0,pageX:0,pageY:0,relatedTarget:null,screenX:0,screenY:0,shiftKey:!1,x:0,y:0,detail:0,view:null,which:0,initUIEvent:n,initMouseEvent:n,getModifierState:n,dataTransfer:o,...EN(t)}})(e,t,r):((e,t,o,n)=>({...t,dataTransfer:n,type:e,...EN(o)}))(e,n,t,r)},TN=ha,AN=((...e)=>t=>{for(let o=0;o<e.length;o++)if(e[o](t))return!0;return!1})(TN,pa),DN=(e,t,o,n)=>{const r=e.dom,a=t.cloneNode(!0);r.setStyles(a,{width:o,height:n}),r.setAttrib(a,"data-mce-selected",null);const s=r.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return r.setStyles(s,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:o,height:n}),r.setStyles(a,{margin:0,boxSizing:"border-box"}),s.appendChild(a),s},MN=(e,t)=>o=>()=>{const n="left"===e?o.scrollX:o.scrollY;o.scroll({[e]:n+t,behavior:"smooth"})},RN=MN("left",-32),NN=MN("left",32),BN=MN("top",-32),zN=MN("top",32),HN=e=>{e&&e.parentNode&&e.parentNode.removeChild(e)},LN=(e,t)=>o=>{if((e=>0===e.button)(o)){const n=ee(t.dom.getParents(o.target),AN).getOr(null);if(_(n)&&((e,t,o)=>TN(o)&&o!==t&&e.isEditable(o.parentElement))(t.dom,t.getBody(),n)){const r=t.dom.getPos(n),a=t.getBody(),s=t.getDoc().documentElement;e.set({element:n,dataTransfer:FT(),dragging:!1,screenX:o.screenX,screenY:o.screenY,maxX:(t.inline?a.scrollWidth:s.offsetWidth)-2,maxY:(t.inline?a.scrollHeight:s.offsetHeight)-2,relX:o.pageX-r.x,relY:o.pageY-r.y,width:n.offsetWidth,height:n.offsetHeight,ghost:DN(t,n,n.offsetWidth,n.offsetHeight),intervalId:We(100)})}}},IN=(e,t,o,n,r)=>{"dragstart"===t&&ZT(n,e.dom.getOuterHTML(o));const a=ON(t,o,n,r);return e.dispatch(t,a)},PN=(e,t)=>{const o=at((e,o)=>((e,t,o)=>{e._selectionOverrides.hideFakeCaret(),CN(e.getBody(),t,o).fold(()=>e.selection.placeCaretAt(t,o),n=>{const r=e._selectionOverrides.showCaret(1,n.node,n.position===hN.Before,!1);r?e.selection.setRng(r):e.selection.placeCaretAt(t,o)})})(t,e,o),0);t.on("remove",o.cancel);const n=e;return r=>e.on(e=>{const a=Math.max(Math.abs(r.screenX-e.screenX),Math.abs(r.screenY-e.screenY));if(!e.dragging&&a>10){const o=IN(t,"dragstart",e.element,e.dataTransfer,r);if(_(o.dataTransfer)&&(e.dataTransfer=o.dataTransfer),o.isDefaultPrevented())return;e.dragging=!0,t.focus()}if(e.dragging){const a=r.currentTarget===t.getDoc().documentElement,l=((e,t)=>({pageX:t.pageX-e.relX,pageY:t.pageY+5}))(e,SN(t,r));s=e.ghost,i=t.getBody(),s.parentNode!==i&&i.appendChild(s),((e,t,o,n,r,a,s,i,l,c,d,m)=>{let u=0,g=0;e.style.left=t.pageX+"px",e.style.top=t.pageY+"px",t.pageX+o>r&&(u=t.pageX+o-r),t.pageY+n>a&&(g=t.pageY+n-a),e.style.width=o-u+"px",e.style.height=n-g+"px";const p=l.clientHeight,h=l.clientWidth,f=s+l.getBoundingClientRect().top,b=i+l.getBoundingClientRect().left;d.on(e=>{e.intervalId.clear(),e.dragging&&m&&(s+8>=p?e.intervalId.set(zN(c)):s-8<=0?e.intervalId.set(BN(c)):i+8>=h?e.intervalId.set(NN(c)):i-8<=0?e.intervalId.set(RN(c)):f+16>=window.innerHeight?e.intervalId.set(zN(window)):f-16<=0?e.intervalId.set(BN(window)):b+16>=window.innerWidth?e.intervalId.set(NN(window)):b-16<=0&&e.intervalId.set(RN(window)))})})(e.ghost,l,e.width,e.height,e.maxX,e.maxY,r.clientY,r.clientX,t.getContentAreaContainer(),t.getWin(),n,a),o.throttle(r.clientX,r.clientY)}var s,i})},FN=(e,t)=>o=>{e.on(e=>{var n;if(e.intervalId.clear(),e.dragging){if(((e,t,o)=>!w(t)&&t!==o&&!e.dom.isChildOf(t,o)&&e.dom.isEditable(t))(t,(e=>{const t=e.getSel();if(_(t)){const e=t.getRangeAt(0).startContainer;return aa(e)?e.parentNode:e}return null})(t.selection),e.element)){const r=null!==(n=t.getDoc().elementFromPoint(o.clientX,o.clientY))&&void 0!==n?n:t.getBody();IN(t,"drop",r,e.dataTransfer,o).isDefaultPrevented()||t.undoManager.transact(()=>{((e,t)=>{const o=e.getParent(t.parentNode,e.isBlock);HN(t),o&&o!==e.getRoot()&&e.isEmpty(o)&&Gi(mo.fromDom(o))})(t.dom,e.element),(e=>{const t=e.getData("text/html");return""===t?P.none():P.some(t)})(e.dataTransfer).each(e=>t.insertContent(e)),t._selectionOverrides.hideFakeCaret()})}IN(t,"dragend",t.getBody(),e.dataTransfer,o)}}),ZN(e)},VN=(e,t,o)=>{e.on(e=>{e.intervalId.clear(),e.dragging&&o.fold(()=>IN(t,"dragend",e.element,e.dataTransfer),o=>IN(t,"dragend",e.element,e.dataTransfer,o))}),ZN(e)},ZN=e=>{e.on(e=>{e.intervalId.clear(),HN(e.ghost)}),e.clear()},UN=e=>{const t=$e(),o=fi.DOM,n=document,r=LN(t,e),a=PN(t,e),s=FN(t,e),i=((e,t)=>o=>VN(e,t,P.some(o)))(t,e);e.on("mousedown",r),e.on("mousemove",a),e.on("mouseup",s),o.bind(n,"mousemove",a),o.bind(n,"mouseup",i),e.on("remove",()=>{o.unbind(n,"mousemove",a),o.unbind(n,"mouseup",i)}),e.on("keydown",o=>{o.keyCode===Qp.ESC&&VN(t,e,P.none())})},jN=e=>{UN(e),qd(e)&&(e=>{const t=t=>{if(!t.isDefaultPrevented()){const o=t.dataTransfer;o&&(j(o.types,"Files")||o.files.length>0)&&(t.preventDefault(),"drop"===t.type&&JC(e,"Dropped file type is not supported"))}},o=o=>{Vp(e,o.target)&&t(o)},n=()=>{const n=fi.DOM,r=e.dom,a=document,s=e.inline?e.getBody():e.getDoc(),i=["drop","dragover"];q(i,e=>{n.bind(a,e,o),r.bind(s,e,t)}),e.on("remove",()=>{q(i,e=>{n.unbind(a,e,o),r.unbind(s,e,t)})})};e.on("init",()=>{Np.setEditorTimeout(e,n,0)})})(e)},WN=ha,$N=(e,t)=>yx(e.getBody(),t),qN=e=>{const t=e.selection,o=e.dom,n=e.getBody(),r=Km(e,n,o.isBlock,()=>Kp(e)),a="sel-"+o.uniqueId(),s="data-mce-selected";let i;const l=e=>e!==n&&(WN(e)||va(e))&&o.isChildOf(e,n)&&o.isEditable(e.parentNode),c=(o,n,a,s=!0)=>e.dispatch("ShowCaret",{target:n,direction:o,before:a}).isDefaultPrevented()?null:(s&&t.scrollIntoView(n,-1===o),r.show(a,n)),d=()=>{e.on("click",t=>{o.isEditable(t.target)||(t.preventDefault(),e.focus())}),e.on("blur NewBlock",f),e.on("ResizeWindow FullscreenStateChanged",r.reposition),e.on("tap",t=>{const o=t.target,n=$N(e,o);WN(n)?(t.preventDefault(),lS(e,n).each(h)):l(o)&&lS(e,o).each(h)},!0),e.on("mousedown",r=>{const a=r.target;if(a!==n&&"HTML"!==a.nodeName&&!o.isChildOf(a,n))return;if(!WC(e,r.clientX,r.clientY))return;f(),b();const s=$N(e,a);WN(s)?(r.preventDefault(),lS(e,s).each(h)):CN(n,r.clientX,r.clientY).each(o=>{r.preventDefault();(e=>{e&&t.setRng(e)})(c(1,o.node,o.position===hN.Before,!1)),Xr(s)?s.focus():e.getBody().focus()})}),e.on("keypress",e=>{Qp.modifierPressed(e)||WN(t.getNode())&&e.preventDefault()}),e.on("GetSelectionRange",e=>{let t=e.range;if(i){if(!i.parentNode)return void(i=null);t=t.cloneRange(),t.selectNode(i),e.range=t}}),e.on("focusin",t=>{if(r.isShowing()&&e.getBody().contains(t.target)&&t.target!==e.getBody()&&!e.dom.isEditable(t.target.parentNode)){r.hide(),t.target.contains(e.selection.getNode())||(e.selection.select(t.target,!0),e.selection.collapse(!0));const o=h(e.selection.getRng(),!0);o&&e.selection.setRng(o)}}),e.on("SetSelectionRange",e=>{e.range=g(e.range);const t=h(e.range,e.forward);t&&(e.range=t)});e.on("AfterSetSelectionRange",e=>{const t=e.range,n=t.startContainer.parentElement;var r;u(t)||Yr(r=n)&&"mcepastebin"===r.id||b(),(e=>_(e)&&o.hasClass(e,"mce-offscreen-selection"))(n)||f()}),jN(e),(e=>{const t=at(()=>{if(!e.removed&&e.getBody().contains(document.activeElement)){const t=e.selection.getRng();if(t.collapsed){const o=cS(e,t,!1);e.selection.setRng(o)}}},0);e.on("focus",()=>{t.throttle()}),e.on("blur",()=>{t.cancel()})})(e),(e=>{e.on("init",()=>{e.on("focusin",t=>{const o=t.target;if(va(o)){const t=yx(e.getBody(),o),n=ha(t)?t:o;e.selection.getNode()!==n&&lS(e,n).each(t=>e.selection.setRng(t))}})})})(e)},m=e=>ol(e)||sl(e)||il(e),u=e=>m(e.startContainer)||m(e.endContainer),g=t=>{const n=e.schema.getVoidElements(),r=o.createRng(),a=t.startContainer,s=t.startOffset,i=t.endContainer,l=t.endOffset;return Ee(n,a.nodeName.toLowerCase())?0===s?r.setStartBefore(a):r.setStartAfter(a):r.setStart(a,s),Ee(n,i.nodeName.toLowerCase())?0===l?r.setEndBefore(i):r.setEndAfter(i):r.setEnd(i,l),r},p=n=>{const r=n.cloneNode(!0),l=e.dispatch("ObjectSelected",{target:n,targetClone:r});if(l.isDefaultPrevented())return null;const c=((n,r)=>{const s=mo.fromDom(e.getBody()),i=e.getDoc(),l=sr(s,"#"+a).getOrThunk(()=>{const e=mo.fromHtml('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>',i);return pn(e,"id",a),dn(s,e),e}),c=o.createRng();wn(l),un(l,[mo.fromText(ct,i),mo.fromDom(r),mo.fromText(ct,i)]),c.setStart(l.dom.firstChild,1),c.setEnd(l.dom.lastChild,0),zn(l,{top:o.getPos(n,e.getBody()).y+"px"}),nn(l);const d=t.getSel();return d&&(d.removeAllRanges(),d.addRange(c)),c})(n,l.targetClone),d=mo.fromDom(n);return q(wr(mo.fromDom(e.getBody()),`*[${s}]`),e=>{vo(d,e)||vn(e,s)}),o.getAttrib(n,s)||n.setAttribute(s,"1"),i=n,b(),c},h=(e,t)=>{if(!e)return null;if(e.collapsed){if(!u(e)){const r=t?1:-1,a=_u(r,n,e),s=a.getNode(!t);if(_(s)){if(Jm(s))return c(r,s,!!t&&!a.isAtEnd(),!1);if(tl(s)&&ha(s.nextSibling)){const e=o.createRng();return e.setStart(s,0),e.setEnd(s,0),e}}const i=a.getNode(t);if(_(i)){if(Jm(i))return c(r,i,!t&&!a.isAtEnd(),!1);if(tl(i)&&ha(i.previousSibling)){const e=o.createRng();return e.setStart(i,1),e.setEnd(i,1),e}}}return null}let r=e.startContainer,a=e.startOffset;const s=e.endOffset;if(aa(r)&&0===a&&WN(r.parentNode)&&(r=r.parentNode,a=o.nodeIndex(r),r=r.parentNode),!Yr(r))return null;if(s===a+1&&r===e.endContainer){const e=r.childNodes[a];if(l(e))return p(e)}return null},f=()=>{i&&i.removeAttribute(s),sr(mo.fromDom(e.getBody()),"#"+a).each(_n),i=null},b=()=>{r.hide()};return eC(e)||d(),{showCaret:c,showBlockCaretContainer:e=>{e.hasAttribute("data-mce-caret")&&(ll(e),t.scrollIntoView(e))},hideFakeCaret:b,destroy:()=>{r.destroy(),i=null}}},GN=(e,t)=>{let o=t;for(let t=e.previousSibling;aa(t);t=t.previousSibling)o+=t.data.length;return o},KN=(e,t,o,n,r)=>{if(aa(o)&&(n<0||n>o.data.length))return[];const a=r&&aa(o)?[GN(o,n)]:[n];let s=o;for(;s!==t&&s.parentNode;)a.push(e.nodeIndex(s,r)),s=s.parentNode;return s===t?a.reverse():[]},YN=(e,t,o,n,r,a,s=!1)=>({start:KN(e,t,o,n,s),end:KN(e,t,r,a,s)}),XN=(e,t)=>{const o=t.slice(),n=o.pop();if(k(n)){return J(o,(e,t)=>e.bind(e=>P.from(e.childNodes[t])),P.some(e)).bind(e=>aa(e)&&(n<0||n>e.data.length)?P.none():P.some({node:e,offset:n}))}return P.none()},JN=(e,t)=>XN(e,t.start).bind(({node:o,offset:n})=>XN(e,t.end).map(({node:e,offset:t})=>{const r=document.createRange();return r.setStart(o,n),r.setEnd(e,t),r})),QN=(e,t,o)=>{if(t&&e.isEmpty(t)&&!o(t)){const n=t.parentNode;e.remove(t,aa(t.firstChild)&&Wr(t.firstChild.data)),QN(e,n,o)}},eB=(e,t,o,n=!0)=>{const r=t.startContainer.parentNode,a=t.endContainer.parentNode;t.deleteContents(),n&&!o(t.startContainer)&&(aa(t.startContainer)&&0===t.startContainer.data.length&&e.remove(t.startContainer),aa(t.endContainer)&&0===t.endContainer.data.length&&e.remove(t.endContainer),QN(e,r,o),r!==a&&QN(e,a,o))},tB=(e,t)=>P.from(e.dom.getParent(t.startContainer,e.dom.isBlock)),oB=(e,t,o)=>{const n=e.dynamicPatternsLookup({text:o,block:t});return{...e,blockPatterns:_c(n).concat(e.blockPatterns),inlinePatterns:Cc(n).concat(e.inlinePatterns)}},nB=(e,t,o,n)=>{const r=e.createRng();return r.setStart(t,0),r.setEnd(o,n),r.toString()},rB=(e,t)=>e.create("span",{"data-mce-type":"bookmark",id:t}),aB=(e,t)=>{const o=e.createRng();return o.setStartAfter(t.start),o.setEndBefore(t.end),o},sB=(e,t,o)=>{const n=JN(e.getRoot(),o).getOrDie("Unable to resolve path range"),r=n.startContainer,a=n.endContainer,s=0===n.endOffset?a:a.splitText(n.endOffset),i=0===n.startOffset?r:r.splitText(n.startOffset),l=i.parentNode;return{prefix:t,end:s.parentNode.insertBefore(rB(e,t+"-end"),s),start:l.insertBefore(rB(e,t+"-start"),i)}},iB=(e,t,o)=>{QN(e,e.get(t.prefix+"-end"),o),QN(e,e.get(t.prefix+"-start"),o)},lB=e=>0===e.start.length,cB=(e,t,o,n)=>{const r=t.start;var a;return xA(e,n.container,n.offset,(a=r,(e,t)=>{const o=e.data.substring(0,t),n=o.lastIndexOf(a.charAt(a.length-1)),r=o.lastIndexOf(a);return-1!==r?r+a.length:-1!==n?n+1:-1}),o).bind(n=>{var a,s;const i=null!==(s=null===(a=o.textContent)||void 0===a?void 0:a.indexOf(r))&&void 0!==s?s:-1;if(-1!==i&&n.offset>=i+r.length){const t=e.createRng();return t.setStart(n.container,n.offset-r.length),t.setEnd(n.container,n.offset),P.some(t)}{const a=n.offset-r.length;return fA(n.container,a,o).map(t=>{const o=e.createRng();return o.setStart(t.container,t.offset),o.setEnd(n.container,n.offset),o}).filter(e=>e.toString()===r).orThunk(()=>cB(e,t,o,uA(n.container,0)))}})},dB=(e,t,o,n)=>{const r=e.dom,a=r.getRoot(),s=o.pattern,i=o.position.container,l=o.position.offset;return fA(i,l-o.pattern.end.length,t).bind(c=>{const d=YN(r,a,c.container,c.offset,i,l,n);if(lB(s))return P.some({matches:[{pattern:s,startRng:d,endRng:d}],position:c});{const i=mB(e,o.remainingPatterns,c.container,c.offset,t,n),l=i.getOr({matches:[],position:c}),m=l.position,u=((e,t,o,n,r,a=!1)=>{if(0===t.start.length&&!a){const t=e.createRng();return t.setStart(o,n),t.setEnd(o,n),P.some(t)}return hA(o,n,r).bind(o=>cB(e,t,r,o).bind(e=>{var t;if(a){if(e.endContainer===o.container&&e.endOffset===o.offset)return P.none();if(0===o.offset&&(null===(t=e.endContainer.textContent)||void 0===t?void 0:t.length)===e.endOffset)return P.none()}return P.some(e)}))})(r,s,m.container,m.offset,t,i.isNone());return u.map(e=>{const t=((e,t,o,n=!1)=>YN(e,t,o.startContainer,o.startOffset,o.endContainer,o.endOffset,n))(r,a,e,n);return{matches:l.matches.concat([{pattern:s,startRng:t,endRng:d}]),position:uA(e.startContainer,e.startOffset)}})}})},mB=(e,t,o,n,r,a)=>{const s=e.dom;return hA(o,n,s.getRoot()).bind(i=>{const l=nB(s,r,o,n);for(let s=0;s<t.length;s++){const c=t[s];if(!Xe(l,c.end))continue;const d=t.slice();d.splice(s,1);const m=dB(e,r,{pattern:c,remainingPatterns:d,position:i},a);if(m.isNone()&&n>0)return mB(e,t,o,n-1,r,a);if(m.isSome())return m}return P.none()})},uB=(e,t,o)=>{e.selection.setRng(o),"inline-format"===t.type?q(t.format,t=>{e.formatter.apply(t)}):e.execCommand(t.cmd,!1,t.value)},gB=(e,t,o,n,r,a)=>{var s;return((e,t)=>{const o=re(e,e=>W(t,t=>e.pattern.start===t.pattern.start&&e.pattern.end===t.pattern.end));return e.length===t.length?o?e:t:e.length>t.length?e:t})(mB(e,r.inlinePatterns,o,n,t,a).fold(()=>[],e=>e.matches),mB(e,(s=r.inlinePatterns,le(s,(e,t)=>t.end.length-e.end.length)),o,n,t,a).fold(()=>[],e=>e.matches))},pB=(e,t)=>{if(0===t.length)return;const o=e.dom,n=e.selection.getBookmark(),r=((e,t)=>{const o=He("mce_textpattern"),n=X(t,(t,n)=>{const r=sB(e,o+`_end${t.length}`,n.endRng);return t.concat([{...n,endMarker:r}])},[]);return X(n,(t,r)=>{const a=n.length-t.length-1,s=lB(r.pattern)?r.endMarker:sB(e,o+`_start${a}`,r.startRng);return t.concat([{...r,startMarker:s}])},[])})(o,t);q(r,t=>{const n=o.getParent(t.startMarker.start,o.isBlock),r=e=>e===n;lB(t.pattern)?((e,t,o,n)=>{const r=aB(e.dom,o);eB(e.dom,r,n),uB(e,t,r)})(e,t.pattern,t.endMarker,r):((e,t,o,n,r)=>{const a=e.dom,s=aB(a,n),i=aB(a,o);eB(a,i,r),eB(a,s,r);const l={prefix:o.prefix,start:o.end,end:n.start},c=aB(a,l);uB(e,t,c)})(e,t.pattern,t.startMarker,t.endMarker,r),iB(o,t.endMarker,r),iB(o,t.startMarker,r)}),e.selection.moveToBookmark(n)},hB=(e,t,o)=>((e,t,o)=>{if(aa(e)&&t>=e.length)return P.some(uA(e,t));{const n=Li(gA);return P.from(n.forwards(e,t,pA(e),o)).map(e=>uA(e.container,0))}})(t,0,t).map(n=>{const r=n.container;return bA(r,o.start.length,t).each(o=>{const n=e.createRng();n.setStart(r,0),n.setEnd(o.container,o.offset),eB(e,n,e=>e===t)}),r}),fB=e=>(t,o)=>{const n=t.dom,r=o.pattern,a=JN(n.getRoot(),o.range).getOrDie("Unable to resolve path range");return tB(t,a).each(o=>{"block-format"===r.type?((e,t)=>{const o=t.get(e);return b(o)&&de(o).exists(e=>Ee(e,"block"))})(r.format,t.formatter)&&t.undoManager.transact(()=>{e(t.dom,o,r),t.formatter.apply(r.format)}):"block-command"===r.type&&t.undoManager.transact(()=>{e(t.dom,o,r),t.execCommand(r.cmd,!1,r.value)})}),!0},bB=e=>(t,o)=>{const n=(e=>le(e,(e,t)=>t.start.length-e.start.length))(t),r=o.replace(ct," ");return ee(n,t=>e(t,o,r))},xB=(e,t)=>(o,n,r,a,s)=>{var i;void 0===s&&(s=null!==(i=n.textContent)&&void 0!==i?i:"");const l=o.dom,c=qc(o);return l.is(n,c)?e(r.blockPatterns,s).map(e=>t&&lo.trim(s).length===e.start.length?[]:[{pattern:e,range:YN(l,l.getRoot(),n,0,n,0,a)}]).getOr([]):[]},vB=fB((e,t,o)=>{hB(e,t,o).each(e=>{const t=mo.fromDom(e),o=Xn(t);/^\s[^\s]/.test(o)&&Jn(t,o.slice(1))})}),yB=bB((e,t,o)=>0===t.indexOf(e.start)||0===o.indexOf(e.start)),wB=xB(yB,!0),_B=fB(hB),CB=bB((e,t,o)=>t===e.start||o===e.start),kB=xB(CB,!1),SB=(e,t)=>((e,t)=>{const o=e.selection.getRng();return tB(e,o).map(n=>{var r;const a=Math.max(0,o.startOffset),s=oB(t,n,null!==(r=n.textContent)&&void 0!==r?r:"");return{inlineMatches:gB(e,n,o.startContainer,a,s,!0),blockMatches:wB(e,n,s,!0)}}).filter(({inlineMatches:e,blockMatches:t})=>t.length>0||e.length>0)})(e,t).fold(L,({inlineMatches:t,blockMatches:o})=>(e.undoManager.add(),e.undoManager.extra(()=>{e.execCommand("mceInsertNewLine")},()=>{(e=>{e.insertContent(Ki,{preserve_zwsp:!0})})(e),pB(e,t),((e,t)=>{if(0===t.length)return;const o=e.selection.getBookmark();q(t,t=>vB(e,t)),e.selection.moveToBookmark(o)})(e,o);const n=e.selection.getRng(),r=hA(n.startContainer,n.startOffset,e.dom.getRoot());e.execCommand("mceInsertNewLine"),r.each(t=>{const o=t.container;o.data.charAt(t.offset-1)===lt&&(o.deleteData(t.offset-1,1),QN(e.dom,o.parentNode,t=>t===e.dom.getRoot()))})}),!0)),EB=(e,t)=>((e,t)=>{const o=e.selection.getRng();return tB(e,o).map(n=>{const r=Math.max(0,o.startOffset),a=nB(e.dom,n,o.startContainer,r),s=oB(t,n,a);return kB(e,n,s,!1,a)}).filter(e=>e.length>0)})(e,t).fold(L,t=>(e.undoManager.transact(()=>{((e,t)=>{q(t,t=>_B(e,t))})(e,t)}),!0)),OB=(e,t,o)=>{for(let n=0;n<e.length;n++)if(o(e[n],t))return!0;return!1},TB=e=>{const t=[",",".",";",":","!","?"],o=[32],n=()=>{return t=fm(e).filter(t=>"inline-command"!==t.type&&"block-command"!==t.type||e.queryCommandSupported(t.cmd)),o=bm(e),{inlinePatterns:Cc(t),blockPatterns:_c(t),dynamicPatternsLookup:o};var t,o},r=()=>(e=>e.options.isSet("text_patterns_lookup"))(e);e.on("keydown",t=>{if(13===t.keyCode&&!Qp.modifierPressed(t)&&e.selection.isCollapsed()&&e.selection.isEditable()){const o=kc(n(),"enter");(o.inlinePatterns.length>0||o.blockPatterns.length>0||r())&&SB(e,o)&&t.preventDefault()}},!0),e.on("keydown",t=>{if(32===t.keyCode&&e.selection.isCollapsed()&&e.selection.isEditable()){const o=kc(n(),"space");(o.blockPatterns.length>0||r())&&EB(e,o)&&t.preventDefault()}},!0);const a=()=>{if(e.selection.isCollapsed()&&e.selection.isEditable()){const t=kc(n(),"space");(t.inlinePatterns.length>0||r())&&((e,t)=>{const o=e.selection.getRng();tB(e,o).map(n=>{const r=Math.max(0,o.startOffset-1),a=nB(e.dom,n,o.startContainer,r),s=oB(t,n,a),i=gB(e,n,o.startContainer,r,s,!1);i.length>0&&e.undoManager.transact(()=>{pB(e,i)})})})(e,t)}};e.on("keyup",e=>{OB(o,e,(e,t)=>e===t.keyCode&&!Qp.modifierPressed(t))&&a()}),e.on("keypress",o=>{OB(t,o,(e,t)=>e.charCodeAt(0)===t.charCode)&&Np.setEditorTimeout(e,a)})},AB=e=>{const t=lo.each,o=Qp.BACKSPACE,n=Qp.DELETE,r=e.dom,a=e.selection,s=e.parser,i=ro.browser,l=i.isFirefox(),c=i.isChromium()||i.isSafari(),d=ro.deviceType.isiPhone()||ro.deviceType.isiPad(),m=ro.os.isMacOS()||ro.os.isiOS(),u=(t,o)=>{try{e.getDoc().execCommand(t,!1,String(o))}catch(e){}},g=e=>e.isDefaultPrevented(),p=()=>{const t=e=>{const t=r.create("body"),o=e.cloneContents();return t.appendChild(o),a.serializer.serialize(t,{format:"html"})};e.on("keydown",a=>{const s=a.keyCode;if(!g(a)&&(s===n||s===o)&&e.selection.isEditable()){const o=e.selection.isCollapsed(),n=e.getBody();if(o&&!Aa(e.schema,n))return;if(!o&&!(o=>{const n=t(o),a=r.createRng();return a.selectNode(e.getBody()),n===t(a)})(e.selection.getRng()))return;a.preventDefault(),e.setContent(""),n.firstChild&&r.isBlock(n.firstChild)?e.selection.setCursorLocation(n.firstChild,0):e.selection.setCursorLocation(n,0),e.nodeChanged()}})},h=()=>{e.shortcuts.add("meta+a",null,"SelectAll")},f=()=>{e.inline||r.bind(e.getDoc(),"mousedown mouseup",t=>{let o;if(t.target===e.getDoc().documentElement)if(o=a.getRng(),e.getBody().focus(),"mousedown"===t.type){if(ol(o.startContainer))return;a.placeCaretAt(t.clientX,t.clientY)}else a.setRng(o)})},b=()=>{Range.prototype.getClientRects||e.on("mousedown",t=>{if(!g(t)&&"HTML"===t.target.nodeName){const t=e.getBody();t.blur(),Np.setEditorTimeout(e,()=>{t.focus()})}})},x=()=>{const t=Yd(e);e.on("click",o=>{const n=o.target;/^(IMG|HR)$/.test(n.nodeName)&&r.isEditable(n)&&(o.preventDefault(),e.selection.select(n),e.nodeChanged()),"A"===n.nodeName&&r.hasClass(n,t)&&0===n.childNodes.length&&r.isEditable(n.parentNode)&&(o.preventDefault(),a.select(n))})},v=()=>{e.on("mousedown",t=>{Ze(P.from(t.clientX),P.from(t.clientY),(o,n)=>{const r=e.getDoc().caretPositionFromPoint(o,n),a=(null==r?void 0:r.offsetNode.childNodes[r.offset-(r.offset>0?1:0)])||(null==r?void 0:r.offsetNode);if(a&&("IMG"===(s=a).nodeName&&e.dom.isEditable(s))){const o=a.getBoundingClientRect();t.preventDefault(),e.hasFocus()||e.focus(),e.selection.select(a),t.clientX<o.left||t.clientY<o.top?e.selection.collapse(!0):(t.clientX>o.right||t.clientY>o.bottom)&&e.selection.collapse(!1)}var s})})},y=()=>{e.on("keydown",e=>{if(!g(e)&&e.keyCode===o&&a.isCollapsed()&&0===a.getRng().startOffset){const t=a.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}return!0})},w=()=>{const t=()=>{u("StyleWithCSS",!1),u("enableInlineTableEditing",!1),yd(e)||u("enableObjectResizing",!1)};Zd(e)||e.on("BeforeExecCommand mousedown",t)},_=()=>{e.on("SetContent ExecCommand",e=>{"setcontent"!==e.type&&"mceInsertLink"!==e.command||t(r.select("a:not([data-mce-block])"),e=>{var t;let o=e.parentNode;const n=r.getRoot();if((null==o?void 0:o.lastChild)===e){for(;o&&!r.isBlock(o);){if((null===(t=o.parentNode)||void 0===t?void 0:t.lastChild)!==o||o===n)return;o=o.parentNode}r.add(o,"br",{"data-mce-bogus":1})}})})},C=()=>{e.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},k=()=>{e.inline||e.on("keydown",()=>{document.activeElement===document.body&&e.getWin().focus()})},S=()=>{e.inline||(e.contentStyles.push("body {min-height: 150px}"),e.on("click",t=>{let o;"HTML"===t.target.nodeName&&(o=e.selection.getRng(),e.getBody().focus(),e.selection.setRng(o),e.selection.normalize(),e.nodeChanged())}))},O=()=>{m&&e.on("keydown",t=>{if(Qp.metaKeyPressed(t)&&!t.shiftKey&&(37===t.keyCode||39===t.keyCode)){t.preventDefault();e.selection.getSel().modify("move",37===t.keyCode?"backward":"forward","lineboundary")}})},T=()=>{e.on("click",e=>{let t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)}),e.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")},A=()=>{e.on("init",()=>{e.dom.bind(e.getBody(),"submit",e=>{e.preventDefault()})})},D=E,M=()=>{e.on("keydown",t=>{if(g(t)||t.keyCode!==Qp.BACKSPACE)return;let o=a.getRng();const n=o.startContainer,s=o.startOffset,i=r.getRoot();let l=n;if(o.collapsed&&0===s){for(;l.parentNode&&l.parentNode.firstChild===l&&l.parentNode!==i;)l=l.parentNode;"BLOCKQUOTE"===l.nodeName&&(e.formatter.toggle("blockquote",void 0,l),o=r.createRng(),o.setStart(n,0),o.setEnd(n,0),a.setRng(o))}}),p(),ro.windowsPhone||e.on("keyup focusin mouseup",t=>{Qp.modifierPressed(t)||(e=>{const t=e.getBody(),o=e.selection.getRng();return o.startContainer===o.endContainer&&o.startContainer===t&&0===o.startOffset&&o.endOffset===t.childNodes.length})(e)||a.normalize()},!0),c&&(f(),x(),e.on("init",()=>{u("DefaultParagraphSeparator",qc(e))}),A(),y(),s.addNodeFilter("br",e=>{let t=e.length;for(;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()}),d?(k(),S(),T()):h()),l&&(v(),e.on("keydown",t=>{if(!g(t)&&t.keyCode===o){if(!e.getBody().getElementsByTagName("hr").length)return;if(a.isCollapsed()&&0===a.getRng().startOffset){const e=a.getNode(),o=e.previousSibling;if("HR"===e.nodeName)return r.remove(e),void t.preventDefault();o&&o.nodeName&&"hr"===o.nodeName.toLowerCase()&&(r.remove(o),t.preventDefault())}}}),b(),(()=>{const o=()=>{const o=r.getAttribs(a.getStart().cloneNode(!1));return()=>{const n=a.getStart();n!==e.getBody()&&(r.setAttrib(n,"style",null),t(o,e=>{n.setAttributeNode(e.cloneNode(!0))}))}},n=()=>!a.isCollapsed()&&r.getParent(a.getStart(),r.isBlock)!==r.getParent(a.getEnd(),r.isBlock);e.on("keypress",t=>{let r;return!(!(g(t)||8!==t.keyCode&&46!==t.keyCode)&&n()&&(r=o(),e.getDoc().execCommand("delete",!1),r(),t.preventDefault(),1))}),r.bind(e.getDoc(),"cut",t=>{if(!g(t)&&n()){const t=o();Np.setEditorTimeout(e,()=>{t()})}})})(),w(),_(),C(),O(),y())};return eC(e)?(c&&(f(),x(),A(),h(),d&&(k(),S(),T())),l&&(b(),w(),C(),O())):M(),{refreshContentEditable:D,isHidden:()=>{if(!l||e.removed)return!1;const t=e.selection.getSel();return!t||!t.rangeCount||0===t.rangeCount}}},DB=fi.DOM,MB=e=>e.inline?e.getElement().nodeName.toLowerCase():void 0,RB=e=>_e(e,e=>!1===y(e)),NB=e=>{const t=e.options.get,o=e.editorUpload.blobCache;return RB({allow_conditional_comments:t("allow_conditional_comments"),allow_html_data_urls:t("allow_html_data_urls"),allow_svg_data_urls:t("allow_svg_data_urls"),allow_html_in_named_anchor:t("allow_html_in_named_anchor"),allow_script_urls:t("allow_script_urls"),allow_html_in_comments:t("allow_html_in_comments"),allow_mathml_annotation_encodings:t("allow_mathml_annotation_encodings"),allow_unsafe_link_target:t("allow_unsafe_link_target"),convert_unsafe_embeds:t("convert_unsafe_embeds"),convert_fonts_to_spans:t("convert_fonts_to_spans"),extended_mathml_attributes:t("extended_mathml_attributes"),extended_mathml_elements:t("extended_mathml_elements"),fix_list_elements:t("fix_list_elements"),font_size_legacy_values:t("font_size_legacy_values"),forced_root_block:t("forced_root_block"),forced_root_block_attrs:t("forced_root_block_attrs"),preserve_cdata:t("preserve_cdata"),inline_styles:t("inline_styles"),root_name:MB(e),sandbox_iframes:t("sandbox_iframes"),sandbox_iframes_exclusions:Dm(e),sanitize:t("xss_sanitization"),validate:!0,blob_cache:o,document:e.getDoc()})},BB=e=>{const t=e.options.get;return RB({custom_elements:t("custom_elements"),extended_valid_elements:t("extended_valid_elements"),invalid_elements:t("invalid_elements"),invalid_styles:t("invalid_styles"),schema:t("schema"),valid_children:t("valid_children"),valid_classes:t("valid_classes"),valid_elements:t("valid_elements"),valid_styles:t("valid_styles"),verify_html:t("verify_html"),padd_empty_block_inline_children:t("format_empty_lines")})},zB=e=>{e.bindPendingEventDelegates(),e.initialized=!0,(e=>{e.dispatch("Init")})(e),e.focus(!0),(e=>{const t=e.dom.getRoot();e.inline||kg(e)&&e.selection.getStart(!0)!==t||qu(t).each(t=>{const o=t.getNode(),n=oa(o)?qu(o).getOr(t):t;e.selection.setRng(n.toRange())})})(e),e.nodeChanged({initial:!0});const t=Qd(e);C(t)&&t.call(e,e),(e=>{const t=tm(e);t&&Np.setEditorTimeout(e,()=>{let o;o=!0===t?e:e.editorManager.get(t),o&&!o.destroyed&&(o.focus(),o.selection.scrollIntoView())},100)})(e),sk(e)&&lk(e,!0)},HB=e=>e.inline?e.ui.styleSheetLoader:e.dom.styleSheetLoader,LB=e=>{const t=HB(e),o=bd(e),n=e.contentCSS,r=()=>{t.unloadAll(n),e.inline||e.ui.styleSheetLoader.unloadAll(o)},a=()=>{e.removed?r():e.on("remove",r)};if(e.contentStyles.length>0){let t="";lo.each(e.contentStyles,e=>{t+=e+"\r\n"}),e.dom.addStyle(t)}const s=Promise.all(((e,t,o)=>{const{pass:n,fail:r}=K(t,e=>tinymce.Resource.has(gk(e))),a=n.map(t=>{const o=tinymce.Resource.get(gk(t));return p(o)?Promise.resolve(HB(e).loadRawCss(t,o)):Promise.resolve()}),s=[...a,HB(e).loadAll(r)];return e.inline?s:s.concat([e.ui.styleSheetLoader.loadAll(o)])})(e,n,o)).then(a).catch(a),i=fd(e);return i&&((e,t)=>{const o=mo.fromDom(e.getBody()),n=Go(qo(o)),r=mo.fromTag("style");pn(r,"type","text/css"),dn(r,mo.fromText(t)),dn(n,r),e.on("remove",()=>{_n(r)})})(e,i),s},IB=e=>{!0!==e.removed&&((e=>{eC(e)||e.load({initial:!0,format:"html"}),e.startContent=e.getContent({format:"raw"})})(e),zB(e))},PB=e=>{const t=e.getElement();let o=e.getDoc();e.inline&&(DB.addClass(t,"mce-content-body"),e.contentDocument=o=document,e.contentWindow=window,e.bodyElement=t,e.contentAreaContainer=t);const n=e.getBody();n.disabled=!0,e.readonly=Zd(e),e._editableRoot=Ud(e),!Bm(e)&&e.hasEditableRoot()&&(e.inline&&"static"===DB.getStyle(n,"position",!0)&&(n.style.position="relative"),n.contentEditable="true"),n.disabled=!1,e.editorUpload=kk(e),e.schema=Ps(BB(e)),e.dom=fi(o,{keep_values:!0,url_converter:e.convertURL,url_converter_scope:e,update_styles:!0,root_element:e.inline?e.getBody():null,collect:e.inline,schema:e.schema,contentCssCors:cd(e),referrerPolicy:dd(e),onSetAttrib:t=>{e.dispatch("SetAttrib",t)}}),e.parser=(e=>{const t=p_(NB(e),e.schema);return t.addAttributeFilter("src,href,style,tabindex",(t,o)=>{const n=e.dom,r="data-mce-"+o;let a=t.length;for(;a--;){const s=t[a];let i=s.attr(o);if(i&&!s.attr(r)){if(0===i.indexOf("data:")||0===i.indexOf("blob:"))continue;"style"===o?(i=n.serializeStyle(n.parseStyle(i),s.name),i.length||(i=null),s.attr(r,i),s.attr(o,i)):"tabindex"===o?(s.attr(r,i),s.attr(o,null)):s.attr(r,e.convertURL(i,o,s.name))}}}),t.addNodeFilter("script",e=>{let t=e.length;for(;t--;){const o=e[t],n=o.attr("type")||"no/type";0!==n.indexOf("mce-")&&o.attr("type","mce-"+n)}}),wm(e)&&t.addNodeFilter("#cdata",t=>{var o;let n=t.length;for(;n--;){const r=t[n];r.type=8,r.name="#comment",r.value="[CDATA["+e.dom.encode(null!==(o=r.value)&&void 0!==o?o:"")+"]]"}}),t.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",t=>{let o=t.length;const n=e.schema.getNonEmptyElements();for(;o--;){const e=t[o];e.isEmpty(n)&&0===e.getAll("br").length&&e.append(new jh("br",1))}}),t})(e),e.serializer=xC((e=>{const t=e.options.get;return{...NB(e),...BB(e),...RB({remove_trailing_brs:t("remove_trailing_brs"),pad_empty_with_br:t("pad_empty_with_br"),url_converter:t("url_converter"),url_converter_scope:t("url_converter_scope"),element_format:t("element_format"),entities:t("entities"),entity_encoding:t("entity_encoding"),indent:t("indent"),indent_after:t("indent_after"),indent_before:t("indent_before")})}})(e),e),e.selection=uC(e.dom,e.getWin(),e.serializer,e),e.annotator=yp(e),e.formatter=Hk(e),e.undoManager=Ik(e),e._nodeChangeDispatcher=new uR(e),e._selectionOverrides=qN(e),MO(e),sN(e),VO(e),eC(e)||((e=>{e.on("mousedown",t=>{t.detail>=3&&(t.preventDefault(),pN(e))})})(e),(e=>{TB(e)})(e));const r=mR(e);AO(e,r),(e=>{e.on("NodeChange",()=>HO(e))})(e),Uk(e),aN(e);const a=tC(e);(e=>{const t=e.getDoc(),o=e.getBody();(e=>{e.dispatch("PreInit")})(e),om(e)||(t.body.spellcheck=!1,DB.setAttrib(o,"spellcheck","false")),e.quirks=AB(e),(e=>{e.dispatch("PostRender")})(e);const n=xd(e);void 0!==n&&(o.dir=n);const r=nm(e);r&&e.on("BeforeSetContent",e=>{lo.each(r,t=>{e.content=e.content.replace(t,e=>"\x3c!--mce:protected "+escape(e)+"--\x3e")})}),e.on("SetContent",()=>{e.addVisual(e.getBody())}),e.on("compositionstart compositionend",t=>{e.composing="compositionstart"===t.type})})(e),(e=>{const t=Rm(e);var o;p(Nm(e))||!y(t)&&"INVALID"!=((e=>"gpl"===e.toLowerCase())(o=t)||(e=>e.length>=64&&e.length<=255)(o)?"VALID":"INVALID")||console.warn("TinyMCE is running in evaluation mode. Provide a valid license key or add license_key: 'gpl' to the init config to agree to the open source license terms. Read more at https://www.tiny.cloud/license-key/")})(e),a.fold(()=>{const t=(e=>{let t=!1;const o=setTimeout(()=>{t||e.setProgressState(!0)},500);return()=>{clearTimeout(o),t=!0,e.setProgressState(!1)}})(e);LB(e).then(()=>{IB(e),t()})},t=>{e.setProgressState(!0),LB(e).then(()=>{t().then(t=>{e.setProgressState(!1),IB(e),rC(e)},t=>{e.notificationManager.open({type:"error",text:String(t)}),IB(e),rC(e)})})})},FB=fi.DOM,VB=(e,t)=>{const o=ro.browser.isFirefox()?Xd(e):"Rich Text Area",n=e.translate(o),r=bn(mo.fromDom(e.getElement()),"tabindex").bind(rt),a=((e,t,o,n)=>{const r=mo.fromTag("iframe");return n.each(e=>pn(r,"tabindex",e)),hn(r,o),hn(r,{id:e+"_ifr",frameBorder:"0",allowTransparency:"true",title:t}),ur(r,"tox-edit-area__iframe"),r})(e.id,n,Fc(e),r).dom;a.onload=()=>{a.onload=null,e.dispatch("load")},e.contentAreaContainer=t.iframeContainer,e.iframeElement=a,e.iframeHTML=(e=>{let t=Vc(e)+"<html><head>";Zc(e)!==e.documentBaseUrl&&(t+='<base href="'+e.documentBaseURI.getURI()+'" />'),t+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';const o=Uc(e),n=jc(e),r=e.translate(Xd(e));return Wc(e)&&(t+='<meta http-equiv="Content-Security-Policy" content="'+Wc(e)+'" />'),t+=`</head><body id="${o}" class="mce-content-body ${n}" data-id="${e.id}" aria-label="${r}"><br></body></html>`,t})(e),FB.add(t.iframeContainer,a)},ZB=e=>{const t=e.iframeElement,o=()=>{e.contentDocument=t.contentDocument,PB(e)};if(km(e)||ro.browser.isFirefox()){const t=e.getDoc();t.open(),t.write(e.iframeHTML),t.close(),o()}else{const r=(n=mo.fromDom(t),Qo(n,"load",tn,()=>{r.unbind(),o()}));t.srcdoc=e.iframeHTML}var n},UB=fi.DOM,jB=(e,t,o)=>{const n=GC.get(o),r=GC.urls[o]||e.documentBaseUrl.replace(/\/$/,"");if(o=lo.trim(o),n&&-1===lo.inArray(t,o)){if(e.plugins[o])return;try{const a=n(e,r)||{};e.plugins[o]=a,C(a.init)&&(a.init(e,r),t.push(o))}catch(t){((e,t,o)=>{const n=_i.translate(["Failed to initialize plugin: {0}",t]);Ec(e,"PluginLoadError",{message:n}),tk(n,o),JC(e,n)})(e,o,t)}}},WB=(e,t)=>({editorContainer:e,iframeContainer:t,api:{}}),$B=e=>{const t=e.getElement();return e.inline?WB(null):(e=>{const t=UB.create("div");return UB.insertAfter(t,e),WB(t,t)})(t)},qB=e=>{const t=e.getElement();return e.orgDisplay=t.style.display,p(Sd(e))?(e=>{const t=e.theme.renderUI;return t?t():$B(e)})(e):C(Sd(e))?(e=>{const t=e.getElement(),o=Sd(e)(e,t);return o.editorContainer.nodeType&&(o.editorContainer.id=o.editorContainer.id||e.id+"_parent"),o.iframeContainer&&o.iframeContainer.nodeType&&(o.iframeContainer.id=o.iframeContainer.id||e.id+"_iframecontainer"),o.height=o.iframeHeight?o.iframeHeight:t.offsetHeight,o})(e):$B(e)},GB=async e=>{e.dispatch("ScriptsLoaded"),(e=>{const t=lo.trim(nd(e)),o=e.ui.registry.getAll().icons,n={...LC.get("default").icons,...LC.get(t).icons};be(n,(t,n)=>{Ee(o,n)||e.ui.registry.addIcon(n,t)})})(e),(e=>{const t=Sd(e);if(p(t)){const o=KC.get(t);e.theme=o(e,KC.urls[t])||{},C(e.theme.init)&&e.theme.init(e,KC.urls[t]||e.documentBaseUrl.replace(/\/$/,""))}else e.theme={}})(e),(e=>{const t=Od(e),o=IC.get(t);e.model=o(e,IC.urls[t])})(e),(e=>{const t=[];q(Wd(e),o=>{jB(e,t,(e=>e.replace(/^\-/,""))(o))})})(e);const t=await qB(e);((e,t)=>{const o={show:P.from(t.show).getOr(E),hide:P.from(t.hide).getOr(E),isEnabled:P.from(t.isEnabled).getOr(I),setEnabled:o=>{o&&("readonly"===e.mode.get()||sk(e))||P.from(t.setEnabled).each(e=>e(o))}};e.ui={...e.ui,...o}})(e,P.from(t.api).getOr({})),e.editorContainer=t.editorContainer,hk(e),e.inline?PB(e):((e,t)=>{VB(e,t),t.editorContainer&&(t.editorContainer.style.display=e.orgDisplay,e.hidden=FB.isHidden(t.editorContainer)),e.getElement().style.display="none",FB.setAttrib(e.id,"aria-hidden","true"),e.getElement().style.visibility=e.orgVisibility,ZB(e)})(e,{editorContainer:t.editorContainer,iframeContainer:t.iframeContainer})},KB=fi.DOM,YB=e=>"-"===e.charAt(0),XB=(e,t)=>{const o=md(t),n=ud(t);if(!_i.hasCode(o)&&"en"!==o){const r=ot(n)?n:`${t.editorManager.baseURL}/langs/${o}.js`;e.add(r).catch(()=>{((e,t,o)=>{QC(e,"LanguageLoadError",ek("language",t,o))})(t,r,o)})}},JB=(e,t)=>{const o=Sd(e);if(p(o)&&!YB(o)&&!Ee(KC.urls,o)){const n=Ed(e),r=n?e.documentBaseURI.toAbsolute(n):`themes/${o}/theme${t}.js`;KC.load(o,r).catch(()=>{((e,t,o)=>{QC(e,"ThemeLoadError",ek("theme",t,o))})(e,r,o)})}},QB=(e,t)=>{const o=Od(e);if("plugin"!==o&&!Ee(IC.urls,o)){const n=Td(e),r=p(n)?e.documentBaseURI.toAbsolute(n):`models/${o}/model${t}.js`;IC.load(o,r).catch(()=>{((e,t,o)=>{QC(e,"ModelLoadError",ek("model",t,o))})(e,r,o)})}},ez=(e,t,o)=>P.from(t).filter(e=>ot(e)&&!LC.has(e)).map(t=>({url:`${e.editorManager.baseURL}/icons/${t}/icons${o}.js`,name:P.some(t)})),tz=(e,t,o)=>{const n=ez(t,"default",o),r=(e=>P.from(rd(e)).filter(ot).map(e=>({url:e,name:P.none()})))(t).orThunk(()=>ez(t,nd(t),""));q((e=>{const t=[],o=e=>{t.push(e)};for(let t=0;t<e.length;t++)e[t].each(o);return t})([n,r]),o=>{e.add(o.url).catch(()=>{((e,t,o)=>{QC(e,"IconsLoadError",ek("icons",t,o))})(t,o.url,o.name.getOrUndefined())})})},oz=(e,t)=>{const o=(t,o)=>{GC.load(t,o).catch(()=>{((e,t,o)=>{QC(e,"PluginLoadError",ek("plugin",t,o))})(e,o,t)})};be($d(e),(t,n)=>{o(n,t),e.options.set("plugins",Wd(e).concat(n))}),q(Wd(e),e=>{!(e=lo.trim(e))||GC.urls[e]||YB(e)||o(e,`plugins/${e}/plugin${t}.js`)})},nz=(e,t)=>{const o=xi.ScriptLoader,n=()=>{!e.removed&&(e=>{const t=Sd(e);return!p(t)||_(KC.get(t))})(e)&&(e=>{const t=Od(e);return _(IC.get(t))})(e)&&GB(e)};JB(e,t),QB(e,t),XB(o,e),tz(o,e,t),oz(e,t),o.loadQueue().then(n,n)},rz=e=>{const t=e.id;_i.setCode(md(e));const o=()=>{KB.unbind(window,"ready",o),e.render()};if(!si.Event.domLoaded)return void KB.bind(window,"ready",o);if(!e.getElement())return;const n=mo.fromDom(e.getElement()),r=yn(n);e.on("remove",()=>{G(n.dom.attributes,e=>vn(n,e.name)),hn(n,r)}),e.ui.styleSheetLoader=((e,t)=>os.forElement(e,{contentCssCors:jd(t),referrerPolicy:dd(t)}))(n,e),zd(e)?e.inline=!0:(e.orgVisibility=e.getElement().style.visibility,e.getElement().style.visibility="hidden");const a=e.getElement().form||KB.getParent(t,"form");a&&(e.formElement=a,Hd(e)&&!ra(e.getElement())&&(KB.insertAfter(KB.create("input",{type:"hidden",name:t}),t),e.hasHiddenInput=!0),e.formEventDelegate=t=>{e.dispatch(t.type,t)},KB.bind(a,"submit reset",e.formEventDelegate),e.on("reset",()=>{e.resetContent()}),!Ld(e)||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=()=>(e.editorManager.triggerSave(),e.setDirty(!1),a._mceOldSubmit(a)))),e.windowManager=YC(e),e.notificationManager=qC(e),(e=>"xml"===e.options.get("encoding"))(e)&&e.on("GetContent",e=>{e.save&&(e.content=KB.encode(e.content))}),Id(e)&&e.on("submit",()=>{e.initialized&&e.save()}),Pd(e)&&(e._beforeUnload=()=>{!e.initialized||e.destroyed||e.isHidden()||e.save({format:"raw",no_events:!0,set_dirty:!1})},e.editorManager.on("BeforeUnload",e._beforeUnload)),e.editorManager.add(e),nz(e,e.suffix)},az=Gt().deviceType,sz=az.isPhone(),iz=az.isTablet(),lz=e=>{if(w(e))return[];{const t=b(e)?e:e.split(/[ ,]/),o=$(t,Qe);return Y(o,ot)}},cz=(e,t)=>{const o=((e,t)=>{const o={},n={};return we(e,t,ye(o),ye(n)),{t:o,f:n}})(t,(t,o)=>j(e,o));return n=o.t,r=o.f,{sections:A(n),options:A(r)};var n,r},dz=(e,t)=>Ee(e.sections(),t),mz=(e,t)=>({...{table_grid:!1,object_resizing:!1,resize:!1,toolbar_mode:Se(e,"toolbar_mode").getOr("scrolling"),toolbar_sticky:!1},...t?{menubar:!1}:{}}),uz=(e,t)=>{var o;const n=null!==(o=t.external_plugins)&&void 0!==o?o:{};return e&&e.external_plugins?lo.extend({},e.external_plugins,n):n},gz=(e,t,o,n)=>{const r=lz(o.forced_plugins),a=lz(n.plugins),s=((e,t)=>dz(e,t)?e.sections()[t]:{})(t,"mobile"),i=((e,t,o,n)=>e&&dz(t,"mobile")?n:o)(e,t,a,s.plugins?lz(s.plugins):a),l=((e,t)=>[...lz(e),...lz(t)])(r,i);return lo.extend(n,{forced_plugins:r,plugins:l})},pz=(e,t,o,n,r)=>{var a;const s=e?{mobile:mz(null!==(a=r.mobile)&&void 0!==a?a:{},t)}:{},i=cz(["mobile"],Ie(s,r)),l=lo.extend(o,n,i.options(),((e,t)=>e&&dz(t,"mobile"))(e,i)?((e,t,o={})=>{const n=e.sections(),r=Se(n,t).getOr({});return lo.extend({},o,r)})(i,"mobile"):{},{external_plugins:uz(n,i.options())});return gz(e,i,n,l)},hz=(e,t)=>((e,t)=>nC(e).editor.addVisual(t))(e,t),fz=e=>{const t=t=>()=>{q("left,center,right,justify".split(","),o=>{t!==o&&e.formatter.remove("align"+o)}),"none"!==t&&((t,o)=>{e.formatter.toggle(t,o),e.nodeChanged()})("align"+t)};e.editorCommands.addCommands({JustifyLeft:t("left"),JustifyCenter:t("center"),JustifyRight:t("right"),JustifyFull:t("justify"),JustifyNone:t("none")})},bz=e=>{fz(e),(e=>{const t=t=>()=>{const o=e.selection,n=o.isCollapsed()?[e.dom.getParent(o.getNode(),e.dom.isBlock)]:o.getSelectedBlocks();return W(n,o=>_(e.formatter.matchNode(o,t)))};e.editorCommands.addCommands({JustifyLeft:t("alignleft"),JustifyCenter:t("aligncenter"),JustifyRight:t("alignright"),JustifyFull:t("alignjustify")},"state")})(e)},xz=(e,t)=>{const o=e.selection,n=e.dom;return/^ | $/.test(t)?((e,t,o,n)=>{const r=mo.fromDom(e.getRoot());return o=rb(r,Yl.fromRangeStart(t),n)?o.replace(/^ /,"&nbsp;"):o.replace(/^&nbsp;/," "),ab(r,Yl.fromRangeEnd(t),n)?o.replace(/(&nbsp;| )(<br( \/)>)?$/,"&nbsp;"):o.replace(/&nbsp;(<br( \/)?>)?$/," ")})(n,o.getRng(),t,e.schema):t},vz=(e,t)=>{if(e.selection.isEditable()){const{content:o,details:n}=(e=>{if("string"!=typeof e){const t=lo.extend({paste:e.paste,data:{paste:e.paste}},e);return{content:e.content,details:t}}return{content:e,details:{}}})(t);v_(e,{...n,content:xz(e,o),format:"html",set:!1,selection:!0}).each(t=>{const o=((e,t,o)=>oC(e).editor.insertContent(t,o))(e,t.content,n);y_(e,o,t),e.addVisual()})}},yz={"font-size":"size","font-family":"face"},wz=Do("font"),_z=(e,t,o)=>Er(mo.fromDom(o),t=>(t=>In(t,e).orThunk(()=>wz(t)?Se(yz,e).bind(e=>bn(t,e)):P.none()))(t),e=>vo(mo.fromDom(t),e)),Cz=e=>(t,o)=>P.from(o).map(mo.fromDom).filter(Eo).bind(o=>_z(e,t,o.dom).or(((e,t)=>P.from(fi.DOM.getStyle(t,e,!0)))(e,o.dom))).getOr(""),kz=Cz("font-size"),Sz=O(e=>e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,","),Cz("font-family")),Ez=e=>qu(e.getBody()).bind(e=>{const t=e.container();return P.from(aa(t)?t.parentNode:t)}),Oz=(e,t)=>(e=>P.from(e.selection.getRng()).bind(t=>{const o=e.getBody();return t.startContainer===o&&0===t.startOffset?P.none():P.from(e.selection.getStart(!0))}))(e).orThunk(R(Ez,e)).map(mo.fromDom).filter(Eo).bind(t),Tz=(e,t)=>Oz(e,T(P.some,t)),Az=(e,t)=>{if(/^[0-9.]+$/.test(t)){const o=parseInt(t,10);if(o>=1&&o<=7){const n=(e=>lo.explode(e.options.get("font_size_style_values")))(e),r=(e=>lo.explode(e.options.get("font_size_classes")))(e);return r.length>0?r[o-1]||t:n[o-1]||t}return t}return t},Dz=e=>{const t=e.split(/\s*,\s*/);return $(t,e=>-1===e.indexOf(" ")||Ye(e,'"')||Ye(e,"'")?e:`'${e}'`).join(",")},Mz=e=>{const t=(t,o)=>{e.formatter.toggle(t,o),e.nodeChanged()};e.editorCommands.addCommands({"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":e=>{t(e)},"ForeColor,HiliteColor":(e,o,n)=>{t(e,{value:n})},BackColor:(e,o,n)=>{t("hilitecolor",{value:n})},FontName:(t,o,n)=>{((e,t)=>{const o=Az(e,t);e.formatter.toggle("fontname",{value:Dz(o)}),e.nodeChanged()})(e,n)},FontSize:(t,o,n)=>{((e,t)=>{e.formatter.toggle("fontsize",{value:Az(e,t)}),e.nodeChanged()})(e,n)},LineHeight:(t,o,n)=>{((e,t)=>{e.formatter.toggle("lineheight",{value:String(t)}),e.nodeChanged()})(e,n)},Lang:(e,o,n)=>{var r;t(e,{value:n.code,customValue:null!==(r=n.customCode)&&void 0!==r?r:null})},RemoveFormat:t=>{e.formatter.remove(t)},mceBlockQuote:()=>{t("blockquote")},FormatBlock:(e,o,n)=>{t(p(n)?n:"p")},mceToggleFormat:(e,o,n)=>{t(n)}})},Rz=e=>{const t=t=>e.formatter.match(t);e.editorCommands.addCommands({"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":e=>t(e),mceBlockQuote:()=>t("blockquote")},"state"),e.editorCommands.addQueryValueHandler("FontName",()=>(e=>Tz(e,t=>Sz(e.getBody(),t.dom)).getOr(""))(e)),e.editorCommands.addQueryValueHandler("FontSize",()=>(e=>Tz(e,t=>kz(e.getBody(),t.dom)).getOr(""))(e)),e.editorCommands.addQueryValueHandler("LineHeight",()=>(e=>Tz(e,t=>{const o=mo.fromDom(e.getBody()),n=Er(t,e=>In(e,"line-height"),R(vo,o));return n.getOrThunk(()=>{const e=parseFloat(Hn(t,"line-height")),o=parseFloat(Hn(t,"font-size"));return String(e/o)})}).getOr(""))(e))},Nz=e=>{e.editorCommands.addCommands({Indent:()=>{(e=>{SO(e,"indent")})(e)},Outdent:()=>{EO(e)}}),e.editorCommands.addCommands({Outdent:()=>_O(e)},"state")},Bz=(e,t)=>{if(e.mode.isReadOnly())return;const o=e.dom,n=e.selection.getRng(),r=t?e.selection.getStart():e.selection.getEnd(),a=t?n.startContainer:n.endContainer,s=eM(o,a);if(!s||!s.isContentEditable)return;const i=t?sn:ln,l=qc(e);((e,t,o,n)=>{const r=e.dom,a=e=>r.isBlock(e)&&e.parentElement===o,s=a(t)?t:r.getParent(n,a,o);return P.from(s).map(mo.fromDom)})(e,r,s,a).each(t=>{const o=rM(e,a,t.dom,s,!1,l);i(t,mo.fromDom(o)),e.selection.setCursorLocation(o,0),e.dispatch("NewBlock",{newBlock:o}),$D(e,"insertParagraph")})},zz=e=>{e.editorCommands.addCommands({InsertNewBlockBefore:()=>{(e=>{Bz(e,!0)})(e)},InsertNewBlockAfter:()=>{(e=>{Bz(e,!1)})(e)}})},Hz=e=>{bz(e),(e=>{e.editorCommands.addCommands({"Cut,Copy,Paste":t=>{const o=e.getDoc();let n;try{o.execCommand(t)}catch(e){n=!0}if("paste"!==t||o.queryCommandEnabled(t)||(n=!0),n||!o.queryCommandSupported(t)){let t=e.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");(ro.os.isMacOS()||ro.os.isiOS())&&(t=t.replace(/Ctrl\+/g,"⌘+")),e.notificationManager.open({text:t,type:"error"})}}})})(e),(e=>{e.editorCommands.addCommands({mceAddUndoLevel:()=>{e.undoManager.add()},mceEndUndoLevel:()=>{e.undoManager.add()},Undo:()=>{e.undoManager.undo()},Redo:()=>{e.undoManager.redo()}})})(e),(e=>{e.editorCommands.addCommands({mceSelectNodeDepth:(t,o,n)=>{let r=0;e.dom.getParent(e.selection.getNode(),t=>!Yr(t)||r++!==n||(e.selection.select(t),!1),e.getBody())},mceSelectNode:(t,o,n)=>{e.selection.select(n)},selectAll:()=>{const t=e.dom.getParent(e.selection.getStart(),pa);if(t){const o=e.dom.createRng();o.selectNodeContents(t),e.selection.setRng(o)}}})})(e),(e=>{e.editorCommands.addCommands({mceCleanup:()=>{const t=e.selection.getBookmark();e.setContent(e.getContent()),e.selection.moveToBookmark(t)},insertImage:(t,o,n)=>{vz(e,e.dom.createHTML("img",{src:n}))},insertHorizontalRule:()=>{e.execCommand("mceInsertContent",!1,"<hr>")},insertText:(t,o,n)=>{vz(e,e.dom.encode(n))},insertHTML:(t,o,n)=>{vz(e,n)},mceInsertContent:(t,o,n)=>{vz(e,n)},mceSetContent:(t,o,n)=>{e.setContent(n)},mceReplaceContent:(t,o,n)=>{e.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,e.selection.getContent({format:"text"})))},mceNewDocument:()=>{e.setContent(lm(e))}})})(e),(e=>{const t=(t,o,n)=>{if(e.mode.isReadOnly())return;const r=p(n)?{href:n}:n,a=e.dom.getParent(e.selection.getNode(),"a");h(r)&&p(r.href)&&(r.href=r.href.replace(/ /g,"%20"),a&&r.href||e.formatter.remove("link"),r.href&&e.formatter.apply("link",r,a))};e.editorCommands.addCommands({unlink:()=>{if(e.selection.isEditable()){if(e.selection.isCollapsed()){const t=e.dom.getParent(e.selection.getStart(),"a");return void(t&&e.dom.remove(t,!0))}e.formatter.remove("link")}},mceInsertLink:t,createLink:t})})(e),Nz(e),zz(e),(e=>{e.editorCommands.addCommands({insertParagraph:()=>{VM(xM,e)},mceInsertNewLine:(t,o,n)=>{ZM(e,n)},InsertLineBreak:(t,o,n)=>{VM(OM,e)}})})(e),(e=>{Mz(e),Rz(e)})(e),(e=>{e.editorCommands.addCommands({mceRemoveNode:(t,o,n)=>{const r=null!=n?n:e.selection.getNode();if(r!==e.getBody()){const t=e.selection.getBookmark();e.dom.remove(r,!0),e.selection.moveToBookmark(t)}},mcePrint:()=>{e.getWin().print()},mceFocus:(t,o,n)=>{Jp(e,!0===n)},mceToggleVisualAid:()=>{e.hasVisual=!e.hasVisual,e.addVisual()}})})(e)},Lz=["toggleview"],Iz=e=>j(Lz,e.toLowerCase());class Pz{constructor(e){this.commands={state:{},exec:{},value:{}},this.editor=e}execCommand(e,t=!1,o,n){const r=this.editor,a=e.toLowerCase(),s=null==n?void 0:n.skip_focus;if(r.removed)return!1;"mcefocus"!==a&&(/^(mceAddUndoLevel|mceEndUndoLevel)$/i.test(a)||s?(e=>{Mp(e).each(t=>e.selection.setRng(t))})(r):r.focus());if(r.dispatch("BeforeExecCommand",{command:e,ui:t,value:o}).isDefaultPrevented())return!1;const i=this.commands.exec[a];return!!C(i)&&(i(a,t,o),r.dispatch("ExecCommand",{command:e,ui:t,value:o}),!0)}queryCommandState(e){if(!Iz(e)&&this.editor.quirks.isHidden()||this.editor.removed)return!1;const t=e.toLowerCase(),o=this.commands.state[t];return!!C(o)&&o(t)}queryCommandValue(e){if(!Iz(e)&&this.editor.quirks.isHidden()||this.editor.removed)return"";const t=e.toLowerCase(),o=this.commands.value[t];return C(o)?o(t):""}addCommands(e,t="exec"){const o=this.commands;be(e,(e,n)=>{q(n.toLowerCase().split(","),n=>{o[t][n]=e})})}addCommand(e,t,o){const n=e.toLowerCase();this.commands.exec[n]=(e,n,r)=>t.call(null!=o?o:this.editor,n,r)}queryCommandSupported(e){const t=e.toLowerCase();return!!this.commands.exec[t]}addQueryStateHandler(e,t,o){this.commands.state[e.toLowerCase()]=()=>t.call(null!=o?o:this.editor)}addQueryValueHandler(e,t,o){this.commands.value[e.toLowerCase()]=()=>t.call(null!=o?o:this.editor)}}const Fz=lo.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," ");class Vz{static isNative(e){return!!Fz[e.toLowerCase()]}constructor(e){this.bindings={},this.settings=e||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||L}fire(e,t){return this.dispatch(e,t)}dispatch(e,t){const o=e.toLowerCase(),n=ei(o,null!=t?t:{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(n);const r=this.bindings[o];if(r)for(let e=0,t=r.length;e<t;e++){const t=r[e];if(!t.removed){if(t.once&&this.off(o,t.func),n.isImmediatePropagationStopped())return n;if(!1===t.func.call(this.scope,n))return n.preventDefault(),n}}return n}on(e,t,o,n){if(!1===t&&(t=L),t){const r={func:t,removed:!1};n&&lo.extend(r,n);const a=e.toLowerCase().split(" ");let s=a.length;for(;s--;){const e=a[s];let t=this.bindings[e];t||(t=[],this.toggleEvent(e,!0)),t=o?[r,...t]:[...t,r],this.bindings[e]=t}}return this}off(e,t){if(e){const o=e.toLowerCase().split(" ");let n=o.length;for(;n--;){const r=o[n];let a=this.bindings[r];if(!r)return be(this.bindings,(e,t)=>{this.toggleEvent(t,!1),delete this.bindings[t]}),this;if(a){if(t){const e=K(a,e=>e.func===t);a=e.fail,this.bindings[r]=a,q(e.pass,e=>{e.removed=!0})}else a.length=0;a.length||(this.toggleEvent(e,!1),delete this.bindings[r])}}}else be(this.bindings,(e,t)=>{this.toggleEvent(t,!1)}),this.bindings={};return this}once(e,t,o){return this.on(e,t,o,{once:!0})}has(e){e=e.toLowerCase();const t=this.bindings[e];return!(!t||0===t.length)}}const Zz=e=>(e._eventDispatcher||(e._eventDispatcher=new Vz({scope:e,toggleEvent:(t,o)=>{Vz.isNative(t)&&e.toggleNativeEvent&&e.toggleNativeEvent(t,o)}})),e._eventDispatcher),Uz={fire(e,t,o){return console.warn('The "fire" event api has been deprecated and will be removed in TinyMCE 9. Use "dispatch" instead.',(new Error).stack),this.dispatch(e,t,o)},dispatch(e,t,o){const n=this;if(n.removed&&"remove"!==e&&"detach"!==e)return ei(e.toLowerCase(),null!=t?t:{},n);const r=Zz(n).dispatch(e,t);if(!1!==o&&n.parent){let t=n.parent();for(;t&&!r.isPropagationStopped();)t.dispatch(e,r,!1),t=t.parent?t.parent():void 0}return r},on(e,t,o){return Zz(this).on(e,t,o)},off(e,t){return Zz(this).off(e,t)},once(e,t){return Zz(this).once(e,t)},hasEventListeners(e){return Zz(this).has(e)}},jz=fi.DOM;let Wz;const $z=(e,t)=>{if("selectionchange"===t)return e.getDoc();if(!e.inline&&/^(?:mouse|touch|click|contextmenu|drop|dragover|dragend)/.test(t))return e.getDoc().documentElement;const o=Cd(e);return o?(e.eventRoot||(e.eventRoot=jz.select(o)[0]),e.eventRoot):e.getBody()},qz=(e,t,o)=>{(e=>!e.hidden&&!sk(e))(e)?e.dispatch(t,o):sk(e)&&mk(e,o)},Gz=(e,t)=>{if(e.delegates||(e.delegates={}),e.delegates[t]||e.removed)return;const o=$z(e,t);if(Cd(e)){if(Wz||(Wz={},e.editorManager.on("removeEditor",()=>{e.editorManager.activeEditor||Wz&&(be(Wz,(t,o)=>{e.dom.unbind($z(e,o))}),Wz=null)})),Wz[t])return;const n=o=>{const n=o.target,r=e.editorManager.get();let a=r.length;for(;a--;){const e=r[a].getBody();(e===n||jz.isChildOf(n,e))&&qz(r[a],t,o)}};Wz[t]=n,jz.bind(o,t,n)}else{const n=o=>{qz(e,t,o)};jz.bind(o,t,n),e.delegates[t]=n}},Kz={...Uz,bindPendingEventDelegates(){const e=this;lo.each(e._pendingNativeEvents,t=>{Gz(e,t)})},toggleNativeEvent(e,t){const o=this;"focus"!==e&&"blur"!==e&&(o.removed||(t?o.initialized?Gz(o,e):o._pendingNativeEvents?o._pendingNativeEvents.push(e):o._pendingNativeEvents=[e]:o.initialized&&o.delegates&&(o.dom.unbind($z(o,e),e,o.delegates[e]),delete o.delegates[e])))},unbindAllNativeEvents(){const e=this,t=e.getBody(),o=e.dom;e.delegates&&(be(e.delegates,(t,o)=>{e.dom.unbind($z(e,o),o,t)}),delete e.delegates),!e.inline&&t&&o&&(t.onload=null,o.unbind(e.getWin()),o.unbind(e.getDoc())),o&&(o.unbind(t),o.unbind(e.getContainer()))}},Yz=e=>p(e)?{value:e.split(/[ ,]/),valid:!0}:S(e,p)?{value:e,valid:!0}:{valid:!1,message:"The value must be a string[] or a comma/space separated string."},Xz=(e,t)=>e+(nt(t.message)?"":`. ${t.message}`),Jz=e=>e.valid,Qz=(e,t,o="")=>{const n=t(e);return v(n)?n?{value:e,valid:!0}:{valid:!1,message:o}:n},eH=(e,t,o=t)=>{const n={},r={},a=(e,t,o)=>{const n=Qz(t,o);return Jz(n)?(r[e]=n.value,!0):(console.warn(Xz(`Invalid value passed for the ${e} option`,n)),!1)},s=e=>Ee(n,e);return{register:(e,o)=>{const s=(e=>p(e.processor))(o)?(e=>{const t=(()=>{switch(e){case"array":return b;case"boolean":return v;case"function":return C;case"number":return k;case"object":return h;case"string":return p;case"string[]":return Yz;case"object[]":return e=>S(e,h);case"regexp":return e=>g(e,RegExp);default:return I}})();return o=>Qz(o,t,`The value must be a ${e}.`)})(o.processor):o.processor,i=((e,t,o)=>{if(!y(t)){const n=Qz(t,o);if(Jz(n))return n.value;console.error(Xz(`Invalid default value passed for the "${e}" option`,n))}})(e,o.default,s);n[e]={...o,default:i,processor:s};Se(r,e).orThunk(()=>Se(t,e)).each(t=>a(e,t,s))},isRegistered:s,get:e=>Se(r,e).orThunk(()=>Se(n,e).map(e=>e.default)).getOrUndefined(),set:(e,t)=>{if(s(e)){const o=n[e];return o.immutable?(console.error(`"${e}" is an immutable option and cannot be updated`),!1):a(e,t,o.processor)}return console.warn(`"${e}" is not a registered option. Ensure the option has been registered before setting a value.`),!1},unset:e=>{const t=s(e);return t&&delete r[e],t},isSet:e=>Ee(r,e),debug:()=>{try{console.log(JSON.parse(JSON.stringify(o,(e,t)=>v(t)||k(t)||p(t)||x(t)||b(t)||f(t)?t:Object.prototype.toString.call(t))))}catch(e){console.error(e)}}}},tH=e=>e.readonly,oH=e=>{const t=t=>{tH(e)&&(e=>W(e,e=>"characterData"===e.type||"childList"===e.type))(t)&&(e=>{const t=e.undoManager.add();_(t)&&(e.undoManager.undo(),e.undoManager.reset())})(e)},o=new MutationObserver(t);e.on("beforeinput paste cut dragend dragover draggesture dragdrop drop drag",t=>{tH(e)&&t.preventDefault()}),e.on("BeforeExecCommand",t=>{"Undo"!==t.command&&"Redo"!==t.command||!tH(e)||t.preventDefault()}),e.on("compositionstart",()=>{tH(e)&&o.observe(e.getBody(),{characterData:!0,childList:!0,subtree:!0})}),e.on("compositionend",()=>{if(tH(e)){const e=o.takeRecords();t(e)}o.disconnect()})},nH=["design","readonly"],rH=(e,t,o,n)=>{const r=o[t.get()],a=o[n];try{a.activate()}catch(e){return void console.error(`problem while activating editor mode ${n}:`,e)}r.deactivate(),r.editorReadOnly!==a.editorReadOnly&&((e,t)=>{const o=mo.fromDom(e.getBody());t?(e.readonly=!0,e.hasEditableRoot()&&((e,t)=>{e.dom.contentEditable=t?"true":"false"})(o,!0),rk(e)):(e.readonly=!1,ak(e))})(e,a.editorReadOnly),t.set(n),((e,t)=>{e.dispatch("SwitchMode",{mode:t})})(e,n)},aH=e=>{const t=Ae("design"),o=Ae({design:{activate:E,deactivate:E,editorReadOnly:!1},readonly:{activate:E,deactivate:E,editorReadOnly:!0}});return oH(e),uk(e),{isReadOnly:()=>tH(e),set:n=>((e,t,o,n)=>{if(!(n===o.get()||e.initialized&&sk(e))){if(!Ee(t,n))throw new Error(`Editor mode '${n}' is invalid`);e.initialized?rH(e,o,t,n):e.on("init",()=>rH(e,o,t,n))}})(e,o.get(),t,n),get:()=>t.get(),register:(e,t)=>{o.set(((e,t,o)=>{if(j(nH,t))throw new Error(`Cannot override default mode ${t}`);return{...e,[t]:{...o,deactivate:()=>{try{o.deactivate()}catch(e){console.error(`problem while deactivating editor mode ${t}:`,e)}}}}})(o.get(),e,t))}}},sH=lo.each,iH=lo.explode,lH={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},cH=lo.makeMap("alt,ctrl,shift,meta,access"),dH=e=>{const t={},o=ro.os.isMacOS()||ro.os.isiOS();sH(iH(e.toLowerCase(),"+"),e=>{(e=>e in cH)(e)?t[e]=!0:/^[0-9]{2,}$/.test(e)?t.keyCode=parseInt(e,10):(t.charCode=e.charCodeAt(0),t.keyCode=lH[e]||e.toUpperCase().charCodeAt(0))});const n=[t.keyCode];let r;for(r in cH)t[r]?n.push(r):t[r]=!1;return t.id=n.join(","),t.access&&(t.alt=!0,o?t.ctrl=!0:t.shift=!0),t.meta&&(o?t.meta=!0:(t.ctrl=!0,t.meta=!1)),t};class mH{constructor(e){this.shortcuts={},this.pendingPatterns=[],this.editor=e;const t=this;e.on("keyup keypress keydown",e=>{!t.hasModifier(e)&&!t.isFunctionKey(e)||e.isDefaultPrevented()||(sH(t.shortcuts,o=>{t.matchShortcut(e,o)&&(t.pendingPatterns=o.subpatterns.slice(0),"keydown"===e.type&&t.executeShortcutAction(o))}),t.matchShortcut(e,t.pendingPatterns[0])&&(1===t.pendingPatterns.length&&"keydown"===e.type&&t.executeShortcutAction(t.pendingPatterns[0]),t.pendingPatterns.shift()))})}add(e,t,o,n){const r=this,a=r.normalizeCommandFunc(o);return sH(iH(lo.trim(e)),e=>{const o=r.createShortcut(e,t,a,n);r.shortcuts[o.id]=o}),!0}remove(e){const t=this.createShortcut(e);return!!this.shortcuts[t.id]&&(delete this.shortcuts[t.id],!0)}normalizeCommandFunc(e){const t=this,o=e;return"string"==typeof o?()=>{t.editor.execCommand(o,!1,null)}:lo.isArray(o)?()=>{t.editor.execCommand(o[0],o[1],o[2])}:o}createShortcut(e,t,o,n){const r=lo.map(iH(e,">"),dH);return r[r.length-1]=lo.extend(r[r.length-1],{func:o,scope:n||this.editor}),lo.extend(r[0],{desc:this.editor.translate(t),subpatterns:r.slice(1)})}hasModifier(e){return e.altKey||e.ctrlKey||e.metaKey}isFunctionKey(e){return"keydown"===e.type&&e.keyCode>=112&&e.keyCode<=123}matchShortcut(e,t){return!!t&&(t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&(t.alt===e.altKey&&t.shift===e.shiftKey&&(!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0))))}executeShortcutAction(e){return e.func?e.func.call(e.scope):null}}const uH=()=>{const e=(()=>{const e={},t={},o={},n={},r={},a={},s={},i={},l={},c=(e,t)=>(o,n)=>{e[o.toLowerCase()]={...n,type:t}};return{addButton:c(e,"button"),addGroupToolbarButton:c(e,"grouptoolbarbutton"),addToggleButton:c(e,"togglebutton"),addMenuButton:c(e,"menubutton"),addSplitButton:c(e,"splitbutton"),addMenuItem:c(t,"menuitem"),addNestedMenuItem:c(t,"nestedmenuitem"),addToggleMenuItem:c(t,"togglemenuitem"),addAutocompleter:c(o,"autocompleter"),addContextMenu:c(r,"contextmenu"),addContextToolbar:c(a,"contexttoolbar"),addContextForm:((e,t)=>(o,n)=>{e[o.toLowerCase()]={type:t,...n}})(a,"contextform"),addSidebar:c(i,"sidebar"),addView:c(l,"views"),addIcon:(e,t)=>n[e.toLowerCase()]=t,addContext:(e,t)=>s[e.toLowerCase()]=t,getAll:()=>({buttons:e,menuItems:t,icons:n,popups:o,contextMenus:r,contextToolbars:a,sidebars:i,views:l,contexts:s})}})();return{addAutocompleter:e.addAutocompleter,addButton:e.addButton,addContextForm:e.addContextForm,addContextMenu:e.addContextMenu,addContextToolbar:e.addContextToolbar,addIcon:e.addIcon,addMenuButton:e.addMenuButton,addMenuItem:e.addMenuItem,addNestedMenuItem:e.addNestedMenuItem,addSidebar:e.addSidebar,addSplitButton:e.addSplitButton,addToggleButton:e.addToggleButton,addGroupToolbarButton:e.addGroupToolbarButton,addToggleMenuItem:e.addToggleMenuItem,addView:e.addView,addContext:e.addContext,getAll:e.getAll}},gH=fi.DOM,pH=lo.extend,hH=lo.each;class fH{constructor(e,t,o){this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.composing=!1,this.destroyed=!1,this.hasHiddenInput=!1,this.iframeElement=null,this.initialized=!1,this.readonly=!1,this.removed=!1,this.startContent="",this._pendingNativeEvents=[],this._skinLoaded=!1,this._editableRoot=!0,this.editorManager=o,this.documentBaseUrl=o.documentBaseURL,pH(this,Kz);const n=this;this.id=e,this.hidden=!1;const r=((e,t)=>{const o=Pe(t);return pz(sz||iz,sz,o,e,o)})(o.defaultOptions,t);this.options=eH(0,r,t),(e=>{const t=e.options.register;t("id",{processor:"string",default:e.id}),t("selector",{processor:"string"}),t("target",{processor:"object"}),t("suffix",{processor:"string"}),t("cache_suffix",{processor:"string"}),t("base_url",{processor:"string"}),t("referrer_policy",{processor:"string",default:""}),t("language_load",{processor:"boolean",default:!0}),t("inline",{processor:"boolean",default:!1}),t("iframe_attrs",{processor:"object",default:{}}),t("doctype",{processor:"string",default:"<!DOCTYPE html>"}),t("document_base_url",{processor:"string",default:e.documentBaseUrl}),t("body_id",{processor:Pc(e,"tinymce"),default:"tinymce"}),t("body_class",{processor:Pc(e),default:""}),t("content_security_policy",{processor:"string",default:""}),t("br_in_pre",{processor:"boolean",default:!0}),t("forced_root_block",{processor:e=>{const t=p(e)&&ot(e);return t?{value:e,valid:t}:{valid:!1,message:"Must be a non-empty string."}},default:"p"}),t("forced_root_block_attrs",{processor:"object",default:{}}),t("newline_behavior",{processor:e=>{const t=j(["block","linebreak","invert","default"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be one of: block, linebreak, invert or default."}},default:"default"}),t("br_newline_selector",{processor:"string",default:".mce-toc h2,figcaption,caption"}),t("no_newline_selector",{processor:"string",default:""}),t("keep_styles",{processor:"boolean",default:!0}),t("end_container_on_empty_block",{processor:e=>v(e)||p(e)?{valid:!0,value:e}:{valid:!1,message:"Must be boolean or a string"},default:"blockquote"}),t("font_size_style_values",{processor:"string",default:"xx-small,x-small,small,medium,large,x-large,xx-large"}),t("font_size_legacy_values",{processor:"string",default:"xx-small,small,medium,large,x-large,xx-large,300%"}),t("font_size_classes",{processor:"string",default:""}),t("automatic_uploads",{processor:"boolean",default:!0}),t("images_reuse_filename",{processor:"boolean",default:!1}),t("images_replace_blob_uris",{processor:"boolean",default:!0}),t("icons",{processor:"string",default:""}),t("icons_url",{processor:"string",default:""}),t("images_upload_url",{processor:"string",default:""}),t("images_upload_base_path",{processor:"string",default:""}),t("images_upload_credentials",{processor:"boolean",default:!1}),t("images_upload_handler",{processor:"function"}),t("language",{processor:"string",default:"en"}),t("language_url",{processor:"string",default:""}),t("entity_encoding",{processor:"string",default:"named"}),t("indent",{processor:"boolean",default:!0}),t("indent_before",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,details,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist"}),t("indent_after",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,details,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist"}),t("indent_use_margin",{processor:"boolean",default:!1}),t("indentation",{processor:"string",default:"40px"}),t("content_css",{processor:e=>{const t=!1===e||p(e)||S(e,p);return t?p(e)?{value:$(e.split(","),Qe),valid:t}:b(e)?{value:e,valid:t}:!1===e?{value:[],valid:t}:{value:e,valid:t}:{valid:!1,message:"Must be false, a string or an array of strings."}},default:zd(e)?[]:["default"]}),t("content_style",{processor:"string"}),t("content_css_cors",{processor:"boolean",default:!1}),t("font_css",{processor:e=>{const t=p(e)||S(e,p);return t?{value:b(e)?e:$(e.split(","),Qe),valid:t}:{valid:!1,message:"Must be a string or an array of strings."}},default:[]}),t("extended_mathml_attributes",{processor:"string[]"}),t("extended_mathml_elements",{processor:"string[]"}),t("inline_boundaries",{processor:"boolean",default:!0}),t("inline_boundaries_selector",{processor:"string",default:"a[href],code,span.mce-annotation"}),t("object_resizing",{processor:e=>{const t=v(e)||p(e);return t?!1===e||Nc.isiPhone()||Nc.isiPad()?{value:"",valid:t}:{value:!0===e?"table,img,figure.image,div,video,iframe":e,valid:t}:{valid:!1,message:"Must be boolean or a string"}},default:!Bc}),t("resize_img_proportional",{processor:"boolean",default:!0}),t("event_root",{processor:"string"}),t("service_message",{processor:"string"}),t("onboarding",{processor:"boolean",default:!0}),t("tiny_cloud_entry_url",{processor:"string"}),t("theme",{processor:e=>!1===e||p(e)||C(e),default:"silver"}),t("theme_url",{processor:"string"}),t("formats",{processor:"object"}),t("format_empty_lines",{processor:"boolean",default:!1}),t("format_noneditable_selector",{processor:"string",default:""}),t("preview_styles",{processor:e=>{const t=!1===e||p(e);return t?{value:!1===e?"":e,valid:t}:{valid:!1,message:"Must be false or a string"}},default:"font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"}),t("custom_ui_selector",{processor:"string",default:""}),t("hidden_input",{processor:"boolean",default:!0}),t("submit_patch",{processor:"boolean",default:!0}),t("encoding",{processor:"string"}),t("add_form_submit_trigger",{processor:"boolean",default:!0}),t("add_unload_trigger",{processor:"boolean",default:!0}),t("custom_undo_redo_levels",{processor:"number",default:0}),t("disable_nodechange",{processor:"boolean",default:!1}),t("disabled",{processor:t=>v(t)?(e.initialized&&Bm(e)!==t&&Promise.resolve().then(()=>{((e,t)=>{e.dispatch("DisabledStateChange",{state:t})})(e,t)}),{valid:!0,value:t}):{valid:!1,message:"The value must be a boolean."},default:!1}),t("readonly",{processor:"boolean",default:!1}),t("editable_root",{processor:"boolean",default:!0}),t("plugins",{processor:"string[]",default:[]}),t("external_plugins",{processor:"object"}),t("forced_plugins",{processor:"string[]"}),t("model",{processor:"string",default:e.hasPlugin("rtc")?"plugin":"dom"}),t("model_url",{processor:"string"}),t("block_unsupported_drop",{processor:"boolean",default:!0}),t("visual",{processor:"boolean",default:!0}),t("visual_table_class",{processor:"string",default:"mce-item-table"}),t("visual_anchor_class",{processor:"string",default:"mce-item-anchor"}),t("iframe_aria_text",{processor:"string",default:"Rich Text Area".concat(e.hasPlugin("help")?". Press ALT-0 for help.":"")}),t("setup",{processor:"function"}),t("init_instance_callback",{processor:"function"}),t("url_converter",{processor:"function",default:e.convertURL}),t("url_converter_scope",{processor:"object",default:e}),t("urlconverter_callback",{processor:"function"}),t("allow_conditional_comments",{processor:"boolean",default:!1}),t("allow_html_data_urls",{processor:"boolean",default:!1}),t("allow_svg_data_urls",{processor:"boolean"}),t("allow_html_in_named_anchor",{processor:"boolean",default:!1}),t("allow_html_in_comments",{processor:"boolean",default:!0}),t("allow_script_urls",{processor:"boolean",default:!1}),t("allow_unsafe_link_target",{processor:"boolean",default:!1}),t("allow_mathml_annotation_encodings",{processor:e=>{const t=S(e,p);return t?{value:e,valid:t}:{valid:!1,message:"Must be an array of strings."}},default:[]}),t("convert_fonts_to_spans",{processor:"boolean",default:!0,deprecated:!0}),t("fix_list_elements",{processor:"boolean",default:!1}),t("preserve_cdata",{processor:"boolean",default:!1}),t("remove_trailing_brs",{processor:"boolean",default:!0}),t("pad_empty_with_br",{processor:"boolean",default:!1}),t("inline_styles",{processor:"boolean",default:!0,deprecated:!0}),t("element_format",{processor:"string",default:"html"}),t("entities",{processor:"string"}),t("schema",{processor:"string",default:"html5"}),t("convert_urls",{processor:"boolean",default:!0}),t("relative_urls",{processor:"boolean",default:!0}),t("remove_script_host",{processor:"boolean",default:!0}),t("custom_elements",{processor:Ic}),t("extended_valid_elements",{processor:"string"}),t("invalid_elements",{processor:"string"}),t("invalid_styles",{processor:Ic}),t("valid_children",{processor:"string"}),t("valid_classes",{processor:Ic}),t("valid_elements",{processor:"string"}),t("valid_styles",{processor:Ic}),t("verify_html",{processor:"boolean",default:!0}),t("auto_focus",{processor:e=>p(e)||!0===e}),t("browser_spellcheck",{processor:"boolean",default:!1}),t("protect",{processor:"array"}),t("images_file_types",{processor:"string",default:"jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp"}),t("deprecation_warnings",{processor:"boolean",default:!0}),t("a11y_advanced_options",{processor:"boolean",default:!1}),t("api_key",{processor:"string"}),t("license_key",{processor:"string"}),t("paste_block_drop",{processor:"boolean",default:!1}),t("paste_data_images",{processor:"boolean",default:!0}),t("paste_preprocess",{processor:"function"}),t("paste_postprocess",{processor:"function"}),t("paste_webkit_styles",{processor:"string",default:"none"}),t("paste_remove_styles_if_webkit",{processor:"boolean",default:!0}),t("paste_merge_formats",{processor:"boolean",default:!0}),t("smart_paste",{processor:"boolean",default:!0}),t("paste_as_text",{processor:"boolean",default:!1}),t("paste_tab_spaces",{processor:"number",default:4}),t("text_patterns",{processor:e=>S(e,h)||!1===e?{value:Sc(!1===e?[]:e),valid:!0}:{valid:!1,message:"Must be an array of objects or false."},default:[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1",trigger:"space"},{start:"##",format:"h2",trigger:"space"},{start:"###",format:"h3",trigger:"space"},{start:"####",format:"h4",trigger:"space"},{start:"#####",format:"h5",trigger:"space"},{start:"######",format:"h6",trigger:"space"},{start:"1.",cmd:"InsertOrderedList",trigger:"space"},{start:"*",cmd:"InsertUnorderedList",trigger:"space"},{start:"-",cmd:"InsertUnorderedList",trigger:"space"},{start:">",cmd:"mceBlockQuote",trigger:"space"},{start:"---",cmd:"InsertHorizontalRule",trigger:"space"}]}),t("text_patterns_lookup",{processor:e=>{return C(e)?{value:(t=e,e=>{const o=t(e);return Sc(o)}),valid:!0}:{valid:!1,message:"Must be a single function"};var t},default:e=>[]}),t("noneditable_class",{processor:"string",default:"mceNonEditable"}),t("editable_class",{processor:"string",default:"mceEditable"}),t("noneditable_regexp",{processor:e=>S(e,Hc)?{value:e,valid:!0}:Hc(e)?{value:[e],valid:!0}:{valid:!1,message:"Must be a RegExp or an array of RegExp."},default:[]}),t("table_tab_navigation",{processor:"boolean",default:!0}),t("highlight_on_focus",{processor:"boolean",default:!0}),t("xss_sanitization",{processor:"boolean",default:!0}),t("details_initial_state",{processor:e=>{const t=j(["inherited","collapsed","expanded"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be one of: inherited, collapsed, or expanded."}},default:"inherited"}),t("details_serialized_state",{processor:e=>{const t=j(["inherited","collapsed","expanded"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be one of: inherited, collapsed, or expanded."}},default:"inherited"}),t("init_content_sync",{processor:"boolean",default:!1}),t("newdocument_content",{processor:"string",default:""}),t("sandbox_iframes",{processor:"boolean",default:!0}),t("sandbox_iframes_exclusions",{processor:"string[]",default:["youtube.com","youtu.be","vimeo.com","player.vimeo.com","dailymotion.com","embed.music.apple.com","open.spotify.com","giphy.com","dai.ly","codepen.io"]}),t("convert_unsafe_embeds",{processor:"boolean",default:!0}),e.on("ScriptsLoaded",()=>{t("directionality",{processor:"string",default:_i.isRtl()?"rtl":void 0}),t("placeholder",{processor:"string",default:zc.getAttrib(e.getElement(),"placeholder")})})})(n);const a=this.options.get;a("deprecation_warnings")&&RC(t,r);const s=a("suffix");s&&(o.suffix=s),this.suffix=o.suffix;const i=a("base_url");i&&o._setBaseUrl(i),this.baseUri=o.baseURI;const l=dd(n);l&&(xi.ScriptLoader._setReferrerPolicy(l),fi.DOM.styleSheetLoader._setReferrerPolicy(l));const c=jd(n);_(c)&&fi.DOM.styleSheetLoader._setContentCssCors(c),Ci.languageLoad=a("language_load"),Ci.baseURL=o.baseURL,this.setDirty(!1),this.documentBaseURI=new Xw(Zc(n),{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=zd(n),this.hasVisual=Gd(n),this.shortcuts=new mH(this),this.editorCommands=new Pz(this),Hz(this);const d=a("cache_suffix");d&&(ro.cacheSuffix=d.replace(/^[\?\&]+/,"")),this.ui={registry:uH(),styleSheetLoader:void 0,show:E,hide:E,setEnabled:E,isEnabled:I},this.mode=aH(n),o.dispatch("SetupEditor",{editor:this});const m=Jd(n);C(m)&&m.call(n,n)}render(){rz(this)}focus(e){this.execCommand("mceFocus",!1,e)}hasFocus(){return Kp(this)}translate(e){return _i.translate(e)}getParam(e,t,o){const n=this.options;return n.isRegistered(e)||(_(o)?n.register(e,{processor:o,default:t}):n.register(e,{processor:I,default:t})),n.isSet(e)||y(t)?n.get(e):t}hasPlugin(e,t){return!!j(Wd(this),e)&&(!t||void 0!==GC.get(e))}nodeChanged(e){this._nodeChangeDispatcher.nodeChanged(e)}addCommand(e,t,o){this.editorCommands.addCommand(e,t,o)}addQueryStateHandler(e,t,o){this.editorCommands.addQueryStateHandler(e,t,o)}addQueryValueHandler(e,t,o){this.editorCommands.addQueryValueHandler(e,t,o)}addShortcut(e,t,o,n){this.shortcuts.add(e,t,o,n)}execCommand(e,t,o,n){return this.editorCommands.execCommand(e,t,o,n)}queryCommandState(e){return this.editorCommands.queryCommandState(e)}queryCommandValue(e){return this.editorCommands.queryCommandValue(e)}queryCommandSupported(e){return this.editorCommands.queryCommandSupported(e)}show(){const e=this;e.hidden&&(e.hidden=!1,e.inline?e.getBody().contentEditable="true":(gH.show(e.getContainer()),gH.hide(e.id)),e.load(),e.dispatch("show"))}hide(){const e=this;e.hidden||(e.save(),e.inline?(e.getBody().contentEditable="false",e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(gH.hide(e.getContainer()),gH.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.dispatch("hide"))}isHidden(){return this.hidden}setProgressState(e,t){this.dispatch("ProgressState",{state:e,time:t})}load(e={}){const t=this,o=t.getElement();if(t.removed)return"";if(o){const n={...e,load:!0},r=ra(o)?o.value:o.innerHTML,a=t.setContent(r,n);return n.no_events||t.dispatch("LoadContent",{...n,element:o}),a}return""}save(e={}){const t=this;let o=t.getElement();if(!o||!t.initialized||t.removed)return"";const n={...e,save:!0,element:o};let r=t.getContent(n);const a={...n,content:r};if(a.no_events||t.dispatch("SaveContent",a),"raw"===a.format&&t.dispatch("RawSaveContent",a),r=a.content,ra(o))o.value=r;else{!e.is_removing&&t.inline||(o.innerHTML=r);const n=gH.getParent(t.id,"form");n&&hH(n.elements,e=>e.name!==t.id||(e.value=r,!1))}return a.element=n.element=o=null,!1!==a.set_dirty&&t.setDirty(!1),r}setContent(e,t){return yC(this,e,t)}getContent(e){return vC(this,e)}insertContent(e,t){t&&(e=pH({content:e},t)),this.execCommand("mceInsertContent",!1,e)}resetContent(e){void 0===e?yC(this,this.startContent,{format:"raw"}):yC(this,e),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()}isDirty(){return!this.isNotDirty}setDirty(e){const t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.dispatch("dirty")}getContainer(){const e=this;return e.container||(e.container=e.editorContainer||gH.get(e.id+"_parent")),e.container}getContentAreaContainer(){return this.contentAreaContainer}getElement(){return this.targetElm||(this.targetElm=gH.get(this.id)),this.targetElm}getWin(){const e=this;if(!e.contentWindow){const t=e.iframeElement;t&&(e.contentWindow=t.contentWindow)}return e.contentWindow}getDoc(){const e=this;if(!e.contentDocument){const t=e.getWin();t&&(e.contentDocument=t.document)}return e.contentDocument}getBody(){var e,t;const o=this.getDoc();return null!==(t=null!==(e=this.bodyElement)&&void 0!==e?e:null==o?void 0:o.body)&&void 0!==t?t:null}convertURL(e,t,o){const n=this,r=n.options.get,a=em(n);if(C(a))return a.call(n,e,o,!0,t);if(!r("convert_urls")||"link"===o||h(o)&&"LINK"===o.nodeName||0===e.indexOf("file:")||0===e.length)return e;const s=new Xw(e);return"http"!==s.protocol&&"https"!==s.protocol&&""!==s.protocol?e:r("relative_urls")?n.documentBaseURI.toRelative(e):e=n.documentBaseURI.toAbsolute(e,r("remove_script_host"))}addVisual(e){hz(this,e)}setEditableRoot(e){((e,t)=>{e._editableRoot!==t&&(e._editableRoot=t,sk(e)||(e.getBody().contentEditable=String(e.hasEditableRoot()),e.nodeChanged()),((e,t)=>{e.dispatch("EditableRootStateChange",{state:t})})(e,t))})(this,e)}hasEditableRoot(){return this._editableRoot}remove(){zC(this)}destroy(e){HC(this,e)}uploadImages(){return this.editorUpload.uploadImages()}_scanForImages(){return this.editorUpload.scanForImages()}}const bH=fi.DOM,xH=lo.each;let vH,yH=!1,wH=[];const _H=e=>{const t=e.type;xH(EH.get(),o=>{switch(t){case"scroll":o.dispatch("ScrollWindow",e);break;case"resize":o.dispatch("ResizeWindow",e)}})},CH=e=>{if(e!==yH){const t=fi.DOM;e?(t.bind(window,"resize",_H),t.bind(window,"scroll",_H)):(t.unbind(window,"resize",_H),t.unbind(window,"scroll",_H)),yH=e}},kH=e=>{const t=wH;return wH=Y(wH,t=>e!==t),EH.activeEditor===e&&(EH.activeEditor=wH.length>0?wH[0]:null),EH.focusedEditor===e&&(EH.focusedEditor=null),t.length!==wH.length},SH="CSS1Compat"!==document.compatMode,EH={...Uz,baseURI:null,baseURL:null,defaultOptions:{},documentBaseURL:null,suffix:null,majorVersion:"7",minorVersion:"9.2",releaseDate:"2026-02-11",i18n:_i,activeEditor:null,focusedEditor:null,setup(){const e=this;let t="",o="",n=Xw.getDocumentBaseUrl(document.location);/^[^:]+:\/\/\/?[^\/]+\//.test(n)&&(n=n.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/"));const r=window.tinymce||window.tinyMCEPreInit;if(r)t=r.base||r.baseURL,o=r.suffix;else{const e=document.getElementsByTagName("script");for(let n=0;n<e.length;n++){const r=e[n].src||"";if(""===r)continue;const a=r.substring(r.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(r)){-1!==a.indexOf(".min")&&(o=".min"),t=r.substring(0,r.lastIndexOf("/"));break}}if(!t&&document.currentScript){const e=document.currentScript.src;-1!==e.indexOf(".min")&&(o=".min"),t=e.substring(0,e.lastIndexOf("/"))}}var a;e.baseURL=new Xw(n).toAbsolute(t),e.documentBaseURL=n,e.baseURI=new Xw(e.baseURL),e.suffix=o,(a=e).on("AddEditor",R(Up,a)),a.on("RemoveEditor",R(jp,a))},overrideDefaults(e){const t=e.base_url;t&&this._setBaseUrl(t);const o=e.suffix;o&&(this.suffix=o),this.defaultOptions=e;const n=e.plugin_base_urls;void 0!==n&&be(n,(e,t)=>{Ci.PluginManager.urls[t]=e})},init(e){const t=this;let o;const n=lo.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," ");let r=e=>{o=e};const a=()=>{let o=0;const s=[];let i;bH.unbind(window,"ready",a),(o=>{const n=e[o];if(n)n.apply(t,[])})("onpageload"),i=pe((e=>ro.browser.isIE()||ro.browser.isEdge()?(tk("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tiny.cloud/docs/tinymce/7/support/#supportedwebbrowsers"),[]):SH?(tk("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[]):p(e.selector)?bH.select(e.selector):_(e.target)?[e.target]:[])(e)),lo.each(i,e=>{var o;(o=t.get(e.id))&&o.initialized&&!(o.getContainer()||o.getBody()).parentNode&&(kH(o),o.unbindAllNativeEvents(),o.destroy(!0),o.removed=!0)}),i=lo.grep(i,e=>!t.get(e.id)),0===i.length?r([]):xH(i,a=>{((e,t)=>e.inline&&t.tagName.toLowerCase()in n)(e,a)?tk("Could not initialize inline editor on invalid inline target element",a):((e,n,a)=>{const l=new fH(e,n,t);s.push(l),l.on("init",()=>{++o===i.length&&r(s)}),l.targetElm=l.targetElm||a,l.render()})((e=>{let t=e.id;return t||(t=Se(e,"name").filter(e=>!bH.get(e)).getOrThunk(bH.uniqueId),e.setAttribute("id",t)),t})(a),e,a)})};return bH.bind(window,"ready",a),new Promise(e=>{o?e(o):r=t=>{e(t)}})},get(e){return 0===arguments.length?wH.slice(0):p(e)?ee(wH,t=>t.id===e).getOr(null):k(e)&&wH[e]?wH[e]:null},add(e){const t=this,o=t.get(e.id);return o===e||(null===o&&wH.push(e),CH(!0),t.activeEditor=e,t.dispatch("AddEditor",{editor:e}),vH||(vH=e=>{const o=t.dispatch("BeforeUnload");if(o.returnValue)return e.preventDefault(),e.returnValue=o.returnValue,o.returnValue},window.addEventListener("beforeunload",vH))),e},createEditor(e,t){return this.add(new fH(e,t,this))},remove(e){const t=this;let o;if(e){if(!p(e))return o=e,x(t.get(o.id))?null:(kH(o)&&t.dispatch("RemoveEditor",{editor:o}),0===wH.length&&window.removeEventListener("beforeunload",vH),o.remove(),CH(wH.length>0),o);xH(bH.select(e),e=>{o=t.get(e.id),o&&t.remove(o)})}else for(let e=wH.length-1;e>=0;e--)t.remove(wH[e])},execCommand(e,t,o){var n;const r=this,a=h(o)?null!==(n=o.id)&&void 0!==n?n:o.index:o;switch(e){case"mceAddEditor":if(!r.get(a)){const e=o.options;new fH(a,e,r).render()}return!0;case"mceRemoveEditor":{const e=r.get(a);return e&&e.remove(),!0}case"mceToggleEditor":{const e=r.get(a);return e?(e.isHidden()?e.show():e.hide(),!0):(r.execCommand("mceAddEditor",!1,o),!0)}}return!!r.activeEditor&&r.activeEditor.execCommand(e,t,o)},triggerSave:()=>{xH(wH,e=>{e.save()})},addI18n:(e,t)=>{_i.add(e,t)},translate:e=>_i.translate(e),setActive(e){const t=this.activeEditor;this.activeEditor!==e&&(t&&t.dispatch("deactivate",{relatedTarget:e}),e.dispatch("activate",{relatedTarget:t})),this.activeEditor=e},_setBaseUrl(e){this.baseURL=new Xw(this.documentBaseURL).toAbsolute(e.replace(/\/+$/,"")),this.baseURI=new Xw(this.baseURL)}};EH.setup();const OH=(()=>{const e=$e();return{FakeClipboardItem:e=>({items:e,types:he(e),getType:t=>Se(e,t).getOrUndefined()}),write:t=>{e.set(t)},read:()=>e.get().getOrUndefined(),clear:e.clear}})(),TH=Math.min,AH=Math.max,DH=Math.round,MH=(e,t,o)=>{let n=t.x,r=t.y;const a=e.w,s=e.h,i=t.w,l=t.h,c=(o||"").split("");return"b"===c[0]&&(r+=l),"r"===c[1]&&(n+=i),"c"===c[0]&&(r+=DH(l/2)),"c"===c[1]&&(n+=DH(i/2)),"b"===c[3]&&(r-=s),"r"===c[4]&&(n-=a),"c"===c[3]&&(r-=DH(s/2)),"c"===c[4]&&(n-=DH(a/2)),RH(n,r,a,s)},RH=(e,t,o,n)=>({x:e,y:t,w:o,h:n}),NH={inflate:(e,t,o)=>RH(e.x-t,e.y-o,e.w+2*t,e.h+2*o),relativePosition:MH,findBestRelativePosition:(e,t,o,n)=>{for(let r=0;r<n.length;r++){const a=MH(e,t,n[r]);if(a.x>=o.x&&a.x+a.w<=o.w+o.x&&a.y>=o.y&&a.y+a.h<=o.h+o.y)return n[r]}return null},intersect:(e,t)=>{const o=AH(e.x,t.x),n=AH(e.y,t.y),r=TH(e.x+e.w,t.x+t.w),a=TH(e.y+e.h,t.y+t.h);return r-o<0||a-n<0?null:RH(o,n,r-o,a-n)},clamp:(e,t,o)=>{let n=e.x,r=e.y,a=e.x+e.w,s=e.y+e.h;const i=t.x+t.w,l=t.y+t.h,c=AH(0,t.x-n),d=AH(0,t.y-r),m=AH(0,a-i),u=AH(0,s-l);return n+=c,r+=d,o&&(a+=c,s+=d,n-=m,r-=u),a-=m,s-=u,RH(n,r,a-n,s-r)},create:RH,fromClientRect:e=>RH(e.left,e.top,e.width,e.height)},BH=(()=>{const e={},t={},o={};return{load:(o,n)=>{const r=`Script at URL "${n}" failed to load`,a=`Script at URL "${n}" did not call \`tinymce.Resource.add('${o}', data)\` within 1 second`;if(void 0!==e[o])return e[o];{const s=new Promise((e,s)=>{const i=((e,t,o=1e3)=>{let n=!1,r=null;const a=e=>(...t)=>{n||(n=!0,null!==r&&(window.clearTimeout(r),r=null),e.apply(null,t))},s=a(e),i=a(t);return{start:(...e)=>{n||null!==r||(r=window.setTimeout(()=>i.apply(null,e),o))},resolve:s,reject:i}})(e,s);t[o]=i.resolve,xi.ScriptLoader.loadScript(n).then(()=>i.start(a),()=>i.reject(r))});return e[o]=s,s}},add:(n,r)=>{void 0!==t[n]&&(t[n](r),delete t[n]),e[n]=Promise.resolve(r),o[n]=r},has:e=>e in o,get:e=>o[e],unload:t=>{delete e[t],delete o[t]}}})();let zH;try{const e="__storage_test__";zH=window.localStorage,zH.setItem(e,e),zH.removeItem(e)}catch(e){zH=(()=>{let e={},t=[];const o={getItem:t=>e[t]||null,setItem:(o,n)=>{t.push(o),e[o]=String(n)},key:e=>t[e],removeItem:o=>{t=t.filter(e=>e===o),delete e[o]},clear:()=>{t=[],e={}},length:0};return Object.defineProperty(o,"length",{get:()=>t.length,configurable:!1,enumerable:!1}),o})()}const HH={geom:{Rect:NH},util:{Delay:Np,Tools:lo,VK:Qp,URI:Xw,EventDispatcher:Vz,Observable:Uz,I18n:_i,LocalStorage:zH,ImageUploader:e=>{const t=bk(),o=_k(e,t);return{upload:(t,n=!0)=>o.upload(t,n?wk(e):void 0)}}},dom:{EventUtils:si,TreeWalker:Ur,TextSeeker:Li,DOMUtils:fi,ScriptLoader:xi,RangeUtils:fh,Serializer:xC,StyleSheetLoader:ts,ControlSelection:rh,BookmarkManager:wp,Selection:uC,Event:si.Event},html:{Styles:Ys,Entities:ys,Node:jh,Schema:Ps,DomParser:p_,Writer:df,Serializer:mf},Env:ro,AddOnManager:Ci,Annotator:yp,Formatter:Hk,UndoManager:Ik,EditorCommands:Pz,WindowManager:YC,NotificationManager:qC,EditorObservable:Kz,Shortcuts:mH,Editor:fH,FocusManager:Rp,EditorManager:EH,DOM:fi.DOM,ScriptLoader:xi.ScriptLoader,PluginManager:GC,ThemeManager:KC,ModelManager:IC,IconManager:LC,Resource:BH,FakeClipboard:OH,trim:lo.trim,isArray:lo.isArray,is:lo.is,toArray:lo.toArray,makeMap:lo.makeMap,each:lo.each,map:lo.map,grep:lo.grep,inArray:lo.inArray,extend:lo.extend,walk:lo.walk,resolve:lo.resolve,explode:lo.explode,_addCacheSuffix:lo._addCacheSuffix},LH=lo.extend(EH,HH);(e=>{window.tinymce=e,window.tinyMCE=e})(LH),(t=>{try{e.exports=t}catch(e){}})(LH)}()},41253:(e,t,o)=>{o(73586)},42382:()=>{tinymce.Resource.add("ui/oxide/skin.css",'.tox{box-shadow:none;box-sizing:content-box;color:#222f3e;cursor:auto;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;font-style:normal;font-weight:400;line-height:normal;-webkit-tap-highlight-color:transparent;-webkit-text-decoration:none;text-decoration:none;text-shadow:none;text-transform:none;vertical-align:initial;white-space:normal}.tox :not(svg):not(rect){box-sizing:inherit;color:inherit;cursor:inherit;direction:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;line-height:inherit;-webkit-tap-highlight-color:inherit;text-align:inherit;text-decoration:inherit;text-shadow:inherit;text-transform:inherit;vertical-align:inherit;white-space:inherit}.tox :not(svg):not(rect){background:0 0;border:0;box-shadow:none;float:none;height:auto;margin:0;max-width:none;outline:0;padding:0;position:static;width:auto}.tox:not([dir=rtl]){direction:ltr;text-align:left}.tox[dir=rtl]{direction:rtl;text-align:right}.tox-tinymce{border:2px solid #eee;border-radius:10px;box-shadow:none;box-sizing:border-box;display:flex;flex-direction:column;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;overflow:hidden;position:relative;visibility:inherit!important}.tox.tox-tinymce-inline{border:none;box-shadow:none;overflow:initial}.tox.tox-tinymce-inline .tox-editor-container{overflow:initial}.tox.tox-tinymce-inline .tox-editor-header{background-color:#fff;border:2px solid #eee;border-radius:10px;box-shadow:none;overflow:hidden}.tox-tinymce-aux{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;z-index:1300}.tox-tinymce :focus,.tox-tinymce-aux :focus{outline:0}button::-moz-focus-inner{border:0}.tox[dir=rtl] .tox-icon--flip svg{transform:rotateY(180deg)}@keyframes tox-rotation{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.tox .accessibility-issue__header{align-items:center;display:flex;margin-bottom:4px}.tox #accessibility-issue__subheader{font-size:16px;color:#222f3e}.tox .accessbility-sr-only{position:absolute;clip:rect(1px,1px,1px,1px);clip-path:inset(0 0 99.9% 99.9%);overflow:hidden;height:1px;width:1px;padding:0;border:0}.tox .accessibility-issue__description{align-items:stretch;border-radius:6px;justify-content:space-between}.tox .accessibility-issue__description>div{padding-bottom:4px}.tox .accessibility-issue__description>div>div{align-items:center;display:flex;margin-bottom:4px}.tox .accessibility-issue__description>div>div .tox-icon svg{display:block}.tox #accessibility-issue__contentID{margin-top:8px;margin-bottom:8px}.tox #accessibility-issue__contentID span:first-child{font-weight:700}.tox #accessibility-issue__document{padding-bottom:8px}.tox .accessibility-issue__repair{margin-top:8px}.tox .accessibility-issue__repair .tox-form__group .tox-form__group--error{color:#c00}.tox .tox-dialog__body-content .accessibility-issue--info .accessibility-issue__description{background-color:#e6f0fd;color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--info .tox-form__group h2{font-size:14px;color:#006ce7}.tox .tox-dialog__body-content .accessibility-issue--info .tox-icon.accessibility-issue__icon svg{fill:#006ce7}.tox .tox-dialog__body-content .accessibility-issue--info a.tox-button--naked.tox-button--icon{background-color:#006ce7;color:#fff}.tox .tox-dialog__body-content .accessibility-issue--info a.tox-button--naked.tox-button--icon:focus,.tox .tox-dialog__body-content .accessibility-issue--info a.tox-button--naked.tox-button--icon:hover{background-color:#0060ce}.tox .tox-dialog__body-content .accessibility-issue--info a.tox-button--naked.tox-button--icon:active{background-color:#0054b4}.tox .tox-dialog__body-content .accessibility-issue--warn .accessibility-issue__description{background-color:#fffae6;color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--warn .tox-form__group h2{font-size:14px;color:#7a6e25}.tox .tox-dialog__body-content .accessibility-issue--warn .tox-icon.accessibility-issue__icon svg{fill:#7a6e25}.tox .tox-dialog__body-content .accessibility-issue--warn a.tox-button--naked.tox-button--icon{background-color:#ffe89d;color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--warn a.tox-button--naked.tox-button--icon:focus,.tox .tox-dialog__body-content .accessibility-issue--warn a.tox-button--naked.tox-button--icon:hover{background-color:#f2d574;color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--warn a.tox-button--naked.tox-button--icon:active{background-color:#e8c657;color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--error .accessibility-issue__description{background-color:#fae6e6;color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--error .tox-form__group h2{font-size:14px;color:#c00}.tox .tox-dialog__body-content .accessibility-issue--error .tox-icon.accessibility-issue__icon svg{fill:#c00}.tox .tox-dialog__body-content .accessibility-issue--error a.tox-button--naked.tox-button--icon{background-color:#f2bfbf;color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--error a.tox-button--naked.tox-button--icon:focus,.tox .tox-dialog__body-content .accessibility-issue--error a.tox-button--naked.tox-button--icon:hover{background-color:#e9a4a4;color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--error a.tox-button--naked.tox-button--icon:active{background-color:#ee9494;color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--success .accessibility-issue__description{background-color:rgba(120,171,70,.1);color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--success .accessibility-issue__description>:last-child{display:none}.tox .tox-dialog__body-content .accessibility-issue--success .tox-form__group h2{color:#527530}.tox .tox-dialog__body-content .accessibility-issue--success .tox-icon.accessibility-issue__icon svg{fill:#527530}.tox .tox-dialog__body-content .accessibility-issue__header .tox-form__group h1,.tox .tox-dialog__body-content .tox-form__group .accessibility-issue__description h2{margin-top:0}.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__header .tox-button{margin-left:4px}.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__header>:nth-last-child(2){margin-left:auto}.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__description{padding:8px}.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__header .tox-button{margin-right:4px}.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__header>:nth-last-child(2){margin-right:auto}.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__description{padding:4px 8px 4px 4px}.tox .mce-codemirror{background:#fff;bottom:0;font-size:13px;left:0;position:absolute;right:0;top:0;z-index:1}.tox .mce-codemirror.tox-inline-codemirror{margin:8px;position:absolute}.tox .tox-advtemplate .tox-form__grid{flex:1}.tox .tox-advtemplate .tox-form__grid>div:first-child{display:flex;flex-direction:column;width:30%}.tox .tox-advtemplate .tox-form__grid>div:first-child>div:nth-child(2){flex-basis:0;flex-grow:1;overflow:auto}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox .tox-advtemplate .tox-form__grid>div:first-child{width:100%}}.tox .tox-advtemplate iframe{border-color:#eee;border-radius:10px;border-style:solid;border-width:1px;margin:0 10px}.tox .tox-anchorbar{display:flex;flex:0 0 auto}.tox .tox-bottom-anchorbar{display:flex;flex:0 0 auto}.tox .tox-bar{display:flex;flex:0 0 auto}.tox .tox-button{background-color:#006ce7;background-image:none;background-position:0 0;background-repeat:repeat;border-color:#006ce7;border-radius:6px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:14px;font-style:normal;font-weight:700;letter-spacing:normal;line-height:24px;margin:0;outline:0;padding:4px 16px;position:relative;text-align:center;-webkit-text-decoration:none;text-decoration:none;text-transform:none;white-space:nowrap}.tox .tox-button::before{border-radius:6px;bottom:-1px;box-shadow:inset 0 0 0 1px #fff,0 0 0 2px #006ce7;content:\'\';left:-1px;opacity:0;pointer-events:none;position:absolute;right:-1px;top:-1px}.tox .tox-button[disabled]{background-color:#006ce7;background-image:none;border-color:#006ce7;box-shadow:none;color:rgba(255,255,255,.5);cursor:not-allowed}.tox .tox-button:focus:not(:disabled){background-color:#0060ce;background-image:none;border-color:#0060ce;box-shadow:none;color:#fff}.tox .tox-button:focus:not(:disabled)::before{opacity:1}.tox .tox-button:hover:not(:disabled){background-color:#0060ce;background-image:none;border-color:#0060ce;box-shadow:none;color:#fff}.tox .tox-button:active:not(:disabled){background-color:#0054b4;background-image:none;border-color:#0054b4;box-shadow:none;color:#fff}.tox .tox-button.tox-button--enabled{background-color:#0054b4;background-image:none;border-color:#0054b4;box-shadow:none;color:#fff}.tox .tox-button.tox-button--enabled[disabled]{background-color:#0054b4;background-image:none;border-color:#0054b4;box-shadow:none;color:rgba(255,255,255,.5);cursor:not-allowed}.tox .tox-button.tox-button--enabled:focus:not(:disabled){background-color:#00489b;background-image:none;border-color:#00489b;box-shadow:none;color:#fff}.tox .tox-button.tox-button--enabled:hover:not(:disabled){background-color:#00489b;background-image:none;border-color:#00489b;box-shadow:none;color:#fff}.tox .tox-button.tox-button--enabled:active:not(:disabled){background-color:#003c81;background-image:none;border-color:#003c81;box-shadow:none;color:#fff}.tox .tox-button--icon-and-text,.tox .tox-button.tox-button--icon-and-text,.tox .tox-button.tox-button--secondary.tox-button--icon-and-text{display:flex;padding:5px 4px}.tox .tox-button--icon-and-text .tox-icon svg,.tox .tox-button.tox-button--icon-and-text .tox-icon svg,.tox .tox-button.tox-button--secondary.tox-button--icon-and-text .tox-icon svg{display:block;fill:currentColor}.tox .tox-button--secondary{background-color:#f0f0f0;background-image:none;background-position:0 0;background-repeat:repeat;border-color:#f0f0f0;border-radius:6px;border-style:solid;border-width:1px;box-shadow:none;color:#222f3e;font-size:14px;font-style:normal;font-weight:700;letter-spacing:normal;outline:0;padding:4px 16px;-webkit-text-decoration:none;text-decoration:none;text-transform:none}.tox .tox-button--secondary[disabled]{background-color:#f0f0f0;background-image:none;border-color:#f0f0f0;box-shadow:none;color:rgba(34,47,62,.5)}.tox .tox-button--secondary:focus:not(:disabled){background-color:#e3e3e3;background-image:none;border-color:#e3e3e3;box-shadow:none;color:#222f3e}.tox .tox-button--secondary:hover:not(:disabled){background-color:#e3e3e3;background-image:none;border-color:#e3e3e3;box-shadow:none;color:#222f3e}.tox .tox-button--secondary:active:not(:disabled){background-color:#d6d6d6;background-image:none;border-color:#d6d6d6;box-shadow:none;color:#222f3e}.tox .tox-button--secondary.tox-button--enabled{background-color:#a8c8ed;background-image:none;border-color:#a8c8ed;box-shadow:none;color:#222f3e}.tox .tox-button--secondary.tox-button--enabled[disabled]{background-color:#a8c8ed;background-image:none;border-color:#a8c8ed;box-shadow:none;color:rgba(34,47,62,.5)}.tox .tox-button--secondary.tox-button--enabled:focus:not(:disabled){background-color:#93bbe9;background-image:none;border-color:#93bbe9;box-shadow:none;color:#222f3e}.tox .tox-button--secondary.tox-button--enabled:hover:not(:disabled){background-color:#93bbe9;background-image:none;border-color:#93bbe9;box-shadow:none;color:#222f3e}.tox .tox-button--secondary.tox-button--enabled:active:not(:disabled){background-color:#7daee4;background-image:none;border-color:#7daee4;box-shadow:none;color:#222f3e}.tox .tox-button--icon,.tox .tox-button.tox-button--icon,.tox .tox-button.tox-button--secondary.tox-button--icon{padding:4px}.tox .tox-button--icon .tox-icon svg,.tox .tox-button.tox-button--icon .tox-icon svg,.tox .tox-button.tox-button--secondary.tox-button--icon .tox-icon svg{display:block;fill:currentColor}.tox-context-form__group .tox-button--icon,.tox-context-form__group .tox-button.tox-button--icon{margin:6px 1px 5px 0;padding:0}.tox .tox-button-link{background:0;border:none;box-sizing:border-box;cursor:pointer;display:inline-block;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0;white-space:nowrap}.tox .tox-button-link--sm{font-size:14px}.tox .tox-button--naked{background-color:transparent;border-color:transparent;box-shadow:unset;color:#222f3e}.tox .tox-button--naked[disabled]{background-color:rgba(34,47,62,.12);border-color:transparent;box-shadow:unset;color:rgba(34,47,62,.5)}.tox .tox-button--naked:hover:not(:disabled){background-color:rgba(34,47,62,.12);border-color:transparent;box-shadow:unset;color:#222f3e}.tox .tox-button--naked:focus:not(:disabled){background-color:rgba(34,47,62,.12);border-color:transparent;box-shadow:unset;color:#222f3e}.tox .tox-button--naked:active:not(:disabled){background-color:rgba(34,47,62,.18);border-color:transparent;box-shadow:unset;color:#222f3e}.tox .tox-button--naked .tox-icon svg{fill:currentColor}.tox .tox-button--naked.tox-button--icon:hover:not(:disabled){color:#222f3e}.tox .tox-checkbox{align-items:center;border-radius:6px;cursor:pointer;display:flex;height:36px;min-width:36px}.tox .tox-checkbox__input{height:1px;overflow:hidden;position:absolute;top:auto;width:1px}.tox .tox-checkbox__icons{align-items:center;border-radius:6px;box-shadow:0 0 0 2px transparent;box-sizing:content-box;display:flex;height:24px;justify-content:center;padding:calc(4px - 1px);width:24px}.tox .tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:block;fill:rgba(34,47,62,0.3)}@media (forced-colors:active){.tox .tox-checkbox__icons .tox-checkbox-icon__unchecked svg{fill:currentColor!important}}.tox .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{display:none;fill:#006ce7}.tox .tox-checkbox__icons .tox-checkbox-icon__checked svg{display:none;fill:#006ce7}.tox .tox-checkbox--disabled{color:rgba(34,47,62,.5);cursor:not-allowed}.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__checked svg{fill:rgba(34,47,62,0.5)}.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__unchecked svg{fill:rgba(34,47,62,0.5)}.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{fill:rgba(34,47,62,0.5)}.tox input.tox-checkbox__input:checked+.tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:none}.tox input.tox-checkbox__input:checked+.tox-checkbox__icons .tox-checkbox-icon__checked svg{display:block}.tox input.tox-checkbox__input:indeterminate+.tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:none}.tox input.tox-checkbox__input:indeterminate+.tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{display:block}.tox input.tox-checkbox__input:focus+.tox-checkbox__icons{border-radius:6px;box-shadow:inset 0 0 0 1px #006ce7;padding:calc(4px - 1px)}.tox:not([dir=rtl]) .tox-checkbox__label{margin-left:4px}.tox:not([dir=rtl]) .tox-checkbox__input{left:-10000px}.tox:not([dir=rtl]) .tox-bar .tox-checkbox{margin-left:4px}.tox[dir=rtl] .tox-checkbox__label{margin-right:4px}.tox[dir=rtl] .tox-checkbox__input{right:-10000px}.tox[dir=rtl] .tox-bar .tox-checkbox{margin-right:4px}.tox .tox-collection--toolbar .tox-collection__group{display:flex;padding:0}.tox .tox-collection--grid .tox-collection__group{display:flex;flex-wrap:wrap;max-height:208px;overflow-x:hidden;overflow-y:auto;padding:0}.tox .tox-collection--list .tox-collection__group{border-bottom-width:0;border-color:#e3e3e3;border-left-width:0;border-right-width:0;border-style:solid;border-top-width:1px;padding:4px 0}.tox .tox-collection--list .tox-collection__group:first-child{border-top-width:0}.tox .tox-collection__group-heading{background-color:#fcfcfc;color:rgba(34,47,62,.7);cursor:default;font-size:12px;font-style:normal;font-weight:400;margin-bottom:4px;margin-top:-4px;padding:4px 8px;text-transform:none;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.tox .tox-collection__item{align-items:center;border-radius:3px;color:#222f3e;display:flex;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.tox .tox-image-selector-menu .tox-collection__item,.tox .tox-image-selector-menu .tox-collection__item-image-selector{flex-direction:column}.tox .tox-image-selector-menu .tox-collection__item .tox-collection__item-checkmark,.tox .tox-image-selector-menu .tox-collection__item .tox-collection__item-icon,.tox .tox-image-selector-menu .tox-collection__item .tox-collection__item-image,.tox .tox-image-selector-menu .tox-collection__item-image-selector .tox-collection__item-checkmark,.tox .tox-image-selector-menu .tox-collection__item-image-selector .tox-collection__item-icon,.tox .tox-image-selector-menu .tox-collection__item-image-selector .tox-collection__item-image{flex-grow:1}.tox .tox-image-selector-menu .tox-collection__item label,.tox .tox-image-selector-menu .tox-collection__item-image-selector label{width:48px;white-space:nowrap;overflow:hidden;font-size:12px;color:#222f3e;text-align:center;align-self:flex-end}.tox .tox-image-selector-menu .tox-collection__item-checkmark{height:24px;width:24px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.tox .tox-image-selector-menu .tox-collection__item-checkmark svg path{fill:#006ce7;stroke:#006ce7}.tox .tox-image-selector-menu .tox-image-selector__row .tox-collection__item-image-selector.tox-collection__item--active:not(.tox-collection__item--state-disabled){background-color:#fff}.tox .tox-image-selector-menu .tox-image-selector__row .tox-collection__item-image-selector.tox-collection__item--enabled:not(.tox-collection__item--state-disabled){z-index:2;background-color:#fff;opacity:.8;background-clip:content-box}.tox .tox-collection--list .tox-collection__item{padding:4px 8px}.tox .tox-collection--toolbar .tox-collection__item{border-radius:3px;padding:4px}.tox .tox-collection--grid .tox-collection__item{border-radius:3px;padding:4px}.tox .tox-collection--list .tox-collection__item--enabled:not(.tox-collection__item--state-disabled){background-color:#fff;color:#222f3e}.tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled){background-color:#006ce7;color:#fff}@media (forced-colors:active){.tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled){border:solid 1px}}.tox .tox-collection--grid .tox-collection__item--enabled:not(.tox-collection__item--state-disabled){background-color:#a6ccf7;color:#222f3e}.tox .tox-collection--grid .tox-collection__item--active:not(.tox-collection__item--state-disabled){background-color:#f0f0f0;color:#222f3e;position:relative;z-index:1}.tox .tox-collection--grid .tox-collection__item--active:not(.tox-collection__item--state-disabled):focus::after{border-radius:3px;bottom:0;box-shadow:0 0 0 2px #006ce7 inset;content:\'\';left:0;position:absolute;right:0;top:0}@media (forced-colors:active){.tox .tox-collection--grid .tox-collection__item--active:not(.tox-collection__item--state-disabled):focus::after{border:2px solid highlight}}.tox .tox-collection--toolbar .tox-collection__item--enabled:not(.tox-collection__item--state-disabled){background-color:#a6ccf7;color:#222f3e}@media (forced-colors:active){.tox .tox-collection--toolbar .tox-collection__item--enabled:not(.tox-collection__item--state-disabled){border-radius:3px;outline:solid 1px}}.tox .tox-collection--toolbar .tox-collection__item--active:not(.tox-collection__item--state-disabled){color:#222f3e;background-color:#fff;position:relative}.tox .tox-collection--toolbar .tox-collection__item--active:not(.tox-collection__item--state-disabled):hover{background-color:#f0f0f0;color:#222f3e}.tox .tox-collection--toolbar .tox-collection__item--active:not(.tox-collection__item--state-disabled):focus{background-color:#f0f0f0;color:#222f3e}.tox .tox-collection--toolbar .tox-collection__item--active:not(.tox-collection__item--state-disabled):focus::after{border-radius:3px;bottom:0;box-shadow:0 0 0 2px #006ce7;content:\'\';left:0;position:absolute;right:0;top:0}@media (forced-colors:active){.tox .tox-collection--toolbar .tox-collection__item--active:not(.tox-collection__item--state-disabled):focus::after{border:2px solid highlight}}@media (forced-colors:active){.tox .tox-collection--toolbar .tox-collection__item--active:not(.tox-collection__item--state-disabled):hover{border-radius:3px;outline:solid 1px}}.tox .tox-collection__item-image{border:1px solid #eee;border-radius:6px;display:flex;flex-direction:column;justify-content:center;margin-bottom:4px;position:relative}.tox .tox-collection__item-checkmark,.tox .tox-collection__item-icon{align-items:center;display:flex;height:24px;justify-content:center;width:24px}.tox .tox-collection__item-checkmark svg,.tox .tox-collection__item-icon svg{fill:currentColor}.tox .tox-collection--toolbar-lg .tox-collection__item-icon{height:48px;width:48px}.tox .tox-collection__item-label{color:currentColor;display:inline-block;flex:1;font-size:14px;font-style:normal;font-weight:400;line-height:24px;max-width:100%;text-transform:none;word-break:break-all}.tox .tox-collection__item-accessory{color:currentColor;display:inline-block;font-size:14px;height:24px;line-height:24px;text-transform:none}.tox .tox-collection__item-caret{align-items:center;display:flex;min-height:24px}.tox .tox-collection__item-caret::after{content:\'\';font-size:0;min-height:inherit}.tox .tox-collection__item-caret svg{fill:currentColor}.tox .tox-collection__item--state-disabled{background-color:transparent;color:rgba(34,47,62,.5);cursor:not-allowed}.tox .tox-collection__item--state-disabled .tox-collection__item-caret svg{fill:rgba(34,47,62,0.5)}.tox .tox-collection--list .tox-collection__item:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg{display:none}.tox .tox-collection--list .tox-collection__item:not(.tox-collection__item--enabled) .tox-collection__item-accessory+.tox-collection__item-checkmark{display:none}.tox .tox-collection--horizontal{background-color:#fff;border:1px solid #e3e3e3;border-radius:6px;box-shadow:0 0 2px 0 rgba(34,47,62,.2),0 4px 8px 0 rgba(34,47,62,.15);display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:nowrap;margin-bottom:0;overflow-x:auto;padding:0}.tox .tox-collection--horizontal .tox-collection__group{align-items:center;display:flex;flex-wrap:nowrap;margin:0;padding:0 4px}.tox .tox-collection--horizontal .tox-collection__item{height:28px;margin:6px 1px 5px 0;padding:0 4px}.tox .tox-collection--horizontal .tox-collection__item-label{white-space:nowrap}.tox .tox-collection--horizontal .tox-collection__item-caret{margin-left:4px}.tox .tox-collection__item-container{display:flex}.tox .tox-collection__item-container--row{align-items:center;flex:1 1 auto;flex-direction:row}.tox .tox-collection__item-container--row.tox-collection__item-container--align-left{margin-right:auto}.tox .tox-collection__item-container--row.tox-collection__item-container--align-right{justify-content:flex-end;margin-left:auto}.tox .tox-collection__item-container--row.tox-collection__item-container--valign-top{align-items:flex-start;margin-bottom:auto}.tox .tox-collection__item-container--row.tox-collection__item-container--valign-middle{align-items:center}.tox .tox-collection__item-container--row.tox-collection__item-container--valign-bottom{align-items:flex-end;margin-top:auto}.tox .tox-collection__item-container--column{align-self:center;flex:1 1 auto;flex-direction:column}.tox .tox-collection__item-container--column.tox-collection__item-container--align-left{align-items:flex-start}.tox .tox-collection__item-container--column.tox-collection__item-container--align-right{align-items:flex-end}.tox .tox-collection__item-container--column.tox-collection__item-container--valign-top{align-self:flex-start}.tox .tox-collection__item-container--column.tox-collection__item-container--valign-middle{align-self:center}.tox .tox-collection__item-container--column.tox-collection__item-container--valign-bottom{align-self:flex-end}.tox:not([dir=rtl]) .tox-collection--horizontal .tox-collection__group:not(:last-of-type){border-right:1px solid transparent}.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item>:not(:first-child){margin-left:8px}.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item>.tox-collection__item-label:first-child{margin-left:4px}.tox:not([dir=rtl]) .tox-collection__item-accessory{margin-left:16px;text-align:right}.tox:not([dir=rtl]) .tox-collection .tox-collection__item-caret{margin-left:16px}.tox[dir=rtl] .tox-collection--horizontal .tox-collection__group:not(:last-of-type){border-left:1px solid transparent}.tox[dir=rtl] .tox-collection--list .tox-collection__item>:not(:first-child){margin-right:8px}.tox[dir=rtl] .tox-collection--list .tox-collection__item>.tox-collection__item-label:first-child{margin-right:4px}.tox[dir=rtl] .tox-collection__item-accessory{margin-right:16px;text-align:left}.tox[dir=rtl] .tox-collection .tox-collection__item-caret{margin-right:16px;transform:rotateY(180deg)}.tox[dir=rtl] .tox-collection--horizontal .tox-collection__item-caret{margin-right:4px}@media (forced-colors:active){.tox .tox-hue-slider,.tox .tox-rgb-form .tox-rgba-preview{background-color:currentColor!important;border:1px solid highlight!important;forced-color-adjust:none}}.tox .tox-color-picker-container{display:flex;flex-direction:row;height:225px;margin:0}.tox .tox-sv-palette{box-sizing:border-box;display:flex;height:100%}.tox .tox-sv-palette-spectrum{height:100%}.tox .tox-sv-palette,.tox .tox-sv-palette-spectrum{width:225px}.tox .tox-sv-palette-thumb{background:0 0;border:1px solid #000;border-radius:50%;box-sizing:content-box;height:12px;position:absolute;width:12px}.tox .tox-sv-palette-inner-thumb{border:1px solid #fff;border-radius:50%;height:10px;position:absolute;width:10px}.tox .tox-hue-slider{box-sizing:border-box;height:100%;width:25px}.tox .tox-hue-slider-spectrum{background:linear-gradient(to bottom,red,#ff0080,#f0f,#8000ff,#00f,#0080ff,#0ff,#00ff80,#0f0,#80ff00,#ff0,#ff8000,red);height:100%;width:100%}.tox .tox-hue-slider,.tox .tox-hue-slider-spectrum{width:20px}.tox .tox-hue-slider-spectrum:focus,.tox .tox-sv-palette-spectrum:focus{outline:#08f solid}.tox .tox-hue-slider-thumb{background:#fff;border:1px solid #000;box-sizing:content-box;height:4px;width:100%}.tox .tox-rgb-form{display:flex;flex-direction:column;justify-content:space-between}.tox .tox-rgb-form div{align-items:center;display:flex;justify-content:space-between;margin-bottom:5px;width:inherit}.tox .tox-rgb-form input{min-width:6em}.tox .tox-rgb-form input.tox-invalid{border:1px solid red!important;box-shadow:0 0 0 1px red}.tox .tox-rgb-container{position:relative}.tox .tox-rgb-form .tox-invalid-icon{align-content:center;align-items:center;display:none;height:100%;position:absolute;right:0;top:0}.tox .tox-rgb-form .tox-invalid-icon .tox-control-wrap__status-icon-invalid{margin:0}.tox .tox-rgb-warning-note{background-color:#f5cccc;border:1px solid #f0b3b3;border-radius:3px;color:#77181f;padding:3px}.tox input.tox-invalid+.tox-invalid-icon{display:flex}.tox .tox-rgb-form .tox-rgba-preview{border:1px solid #000;flex-grow:2;margin-bottom:0}.tox:not([dir=rtl]) .tox-sv-palette{margin-right:15px}.tox:not([dir=rtl]) .tox-hue-slider{margin-right:15px}.tox:not([dir=rtl]) .tox-hue-slider-thumb{margin-left:-1px}.tox:not([dir=rtl]) .tox-rgb-form label{margin-right:.5em}.tox[dir=rtl] .tox-sv-palette{margin-left:15px}.tox[dir=rtl] .tox-hue-slider{margin-left:15px}.tox[dir=rtl] .tox-hue-slider-thumb{margin-right:-1px}.tox[dir=rtl] .tox-rgb-form label{margin-left:.5em}.tox .tox-toolbar .tox-swatches,.tox .tox-toolbar__overflow .tox-swatches,.tox .tox-toolbar__primary .tox-swatches{margin:5px 0 6px 11px}.tox .tox-collection--list .tox-collection__group .tox-swatches-menu{border:0;margin:-4px -4px}.tox .tox-swatches__row{display:flex}@media (forced-colors:active){.tox .tox-swatches__row{forced-color-adjust:none}}.tox .tox-swatch{height:30px;transition:transform .15s,box-shadow .15s;width:30px}.tox .tox-swatch:focus,.tox .tox-swatch:hover{box-shadow:0 0 0 1px rgba(127,127,127,.3) inset;transform:scale(.8)}.tox .tox-swatch--remove{align-items:center;display:flex;justify-content:center}.tox .tox-swatch--remove svg path{stroke:#e74c3c}.tox .tox-swatches__picker-btn{align-items:center;background-color:transparent;border:0;cursor:pointer;display:flex;height:30px;justify-content:center;outline:0;padding:0;width:30px}.tox .tox-swatches__picker-btn svg{fill:#222f3e;height:24px;width:24px}.tox .tox-swatches__picker-btn:hover{background:#f0f0f0}.tox div.tox-swatch:not(.tox-swatch--remove) svg{display:none;fill:#222f3e;height:24px;margin:calc((30px - 24px)/ 2) calc((30px - 24px)/ 2);width:24px}.tox div.tox-swatch:not(.tox-swatch--remove) svg path{fill:#fff;paint-order:stroke;stroke:#222f3e;stroke-width:2px}.tox div.tox-swatch:not(.tox-swatch--remove).tox-collection__item--enabled svg{display:block}.tox:not([dir=rtl]) .tox-swatches__picker-btn{margin-left:auto}.tox[dir=rtl] .tox-swatches__picker-btn{margin-right:auto}.tox .tox-conversations{display:flex;flex-direction:column;position:relative;height:100%;min-width:300px;max-width:300px;width:300px}.tox .tox-conversations__header{align-items:center;display:flex;justify-content:space-between;box-shadow:0 4px 8px 0 rgba(34,47,62,.1);padding:8px 12px;background:#fff;z-index:1}.tox .tox-conversations__title{font-size:20px;font-weight:400;padding:8px 0 8px 0;color:#222f3e;line-height:28px}.tox .tox-comment{background:#fff;border:1px solid #fff;border-radius:6px;padding:8px;padding-bottom:16px;position:relative}.tox .tox-comment:hover{box-shadow:0 4px 8px 0 rgba(34,47,62,.1)}.tox .tox-comment.tox-comment--selected{background-color:#fff2c9;border:1px solid #ffcf30;box-shadow:0 4px 8px 0 rgba(34,47,62,.1)}.tox .tox-comment.tox-comment--selected:focus{border:2px solid #006ce7;margin:-1px}.tox .tox-comment.tox-comment--selected:focus:not(:first-child){margin-top:7px}.tox .tox-comment.tox-comment--selected .tox-comment__single{margin-bottom:12px}.tox .tox-comment.tox-comment--selected .tox-comment__single:focus{position:relative}.tox .tox-comment.tox-comment--selected .tox-comment__single:focus::after{top:-9px;pointer-events:none;position:absolute;content:"";display:block;bottom:-9px;left:-9px;right:-9px;border-radius:6px;border:2px solid #006ce7}.tox .tox-comment.tox-comment--selected .tox-comment__single:focus:last-of-type:has(textarea):after{bottom:calc((12px + 16px + 1px) * -1)}.tox .tox-comment__header{align-items:center;color:#222f3e;display:flex;justify-content:space-between}.tox .tox-comment__date{color:#222f3e;font-size:12px;line-height:18px}.tox .tox-comment__body{color:#222f3e;font-size:16px;font-style:normal;font-weight:400;line-height:1.3;margin-top:8px;position:relative;text-transform:initial;transition:max-height .5s cubic-bezier(0, 1, 0, 1);white-space:pre-wrap}.tox .tox-comment__body.tox-comment__body--expanded{max-height:100em;transition:max-height 1s ease-in-out}.tox .tox-comment__body.tox-comment__body--pending{transition:max-height 0s}.tox .tox-comment__body p{margin:0}.tox .tox-comment__body textarea{resize:none;white-space:normal;width:100%;font-size:16px}.tox .tox-comment__loading-text{align-items:center;color:#222f3e;display:flex;flex-direction:column;position:relative}.tox .tox-comment__loading-text>div{padding-bottom:16px}.tox .tox-comment__overlaytext{bottom:0;flex-direction:column;font-size:14px;left:0;padding:1em;position:absolute;right:0;top:0;z-index:10}.tox .tox-comment__overlaytext p{background-color:#fff;box-shadow:0 0 8px 8px #fff;color:#222f3e;text-align:center}.tox .tox-comment__overlaytext div:nth-of-type(2){font-size:.8em}.tox .tox-comment__expander{padding-top:8px}.tox .tox-comment__expander p{color:rgba(34,47,62,.7);font-size:14px;font-style:normal}.tox .tox-comment__expander p:focus{font-weight:700}.tox .tox-comment__buttonspacing{padding-top:16px;text-align:center}.tox .tox-tbtn.tox-comment__mention-btn{display:flex;width:34px;height:34px;padding:5px;justify-content:center;align-items:center;margin:0;background-color:transparent}.tox .tox-comment-thread{background:#fff;position:relative;border-radius:6px;background-color:transparent}.tox .tox-comment-thread>:not(:first-child){margin-top:8px}.tox .tox-comment-thread__overlay::after{background:#fff;bottom:0;content:"";display:flex;left:0;opacity:.9;position:absolute;right:0;top:0;z-index:5}.tox .tox-comment__reply{display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end;margin-top:8px}.tox .tox-comment__reply>:first-child{margin-bottom:8px;width:100%}.tox .tox-comment__edit{display:flex;flex-wrap:wrap;justify-content:flex-end;margin-top:8px}.tox .tox-comment__gradient::after{background:linear-gradient(rgba(255,255,255,0),#fff);bottom:0;content:"";display:block;height:5em;margin-top:-40px;position:absolute;width:100%}.tox .tox-comment__overlay{background:#fff;bottom:0;display:flex;flex-direction:column;flex-grow:1;left:0;opacity:.9;position:absolute;right:0;text-align:center;top:0;z-index:5}.tox .tox-comment__busy-spinner{align-items:center;background-color:#fff;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:20}.tox .tox-comment__scroll{display:flex;flex-direction:column;flex-shrink:1;overflow:auto;padding:12px;scroll-behavior:smooth}.tox .tox-comment__scroll:has(textarea:focus){scroll-behavior:auto}.tox .tox-comment--disappearing{transition:opacity .5s ease}.tox .tox-comment[data-transitioning-destination=deleting]{opacity:0}.tox .tox-skeleton .tox-skeleton__line{height:16px;width:100%;background:linear-gradient(to right,rgba(240,240,240,.5) 8%,rgba(240,240,240,.7) 18%,rgba(240,240,240,.5) 33%);animation:wave 2s infinite ease-out}.tox .tox-skeleton .tox-skeleton__circle{height:36px;width:36px;margin-right:8px;border-radius:100%;background:linear-gradient(to right,rgba(240,240,240,.5) 8%,rgba(240,240,240,.7) 18%,rgba(240,240,240,.5) 33%);animation:wave 2s infinite ease-out}@keyframes wave{0%{background-position:-268px 0}100%{background-position:268px 0}}.tox .tox-ring-loader{width:10px;height:10px;border:1px solid #fff;border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;animation:tox-rotation 1s linear infinite}.tox:not([dir=rtl]) .tox-comment__edit{margin-left:8px}.tox:not([dir=rtl]) .tox-comment__buttonspacing>:last-child,.tox:not([dir=rtl]) .tox-comment__edit>:last-child,.tox:not([dir=rtl]) .tox-comment__reply>:last-child{margin-left:8px}.tox[dir=rtl] .tox-comment__edit{margin-right:8px}.tox[dir=rtl] .tox-comment__buttonspacing>:last-child,.tox[dir=rtl] .tox-comment__edit>:last-child,.tox[dir=rtl] .tox-comment__reply>:last-child{margin-right:8px}.tox .tox-user{align-items:center;display:flex}.tox .tox-user__avatar svg{fill:rgba(34,47,62,0.7)}.tox .tox-user__avatar img{border-radius:50%;height:36px;object-fit:cover;vertical-align:middle;width:36px}.tox .tox-user__name{color:#222f3e;font-size:14px;font-style:normal;font-weight:700;line-height:18px;text-transform:none}.tox:not([dir=rtl]) .tox-user__avatar img,.tox:not([dir=rtl]) .tox-user__avatar svg{margin-right:8px}.tox:not([dir=rtl]) .tox-user__avatar+.tox-user__name{margin-left:8px}.tox[dir=rtl] .tox-user__avatar img,.tox[dir=rtl] .tox-user__avatar svg{margin-left:8px}.tox[dir=rtl] .tox-user__avatar+.tox-user__name{margin-right:8px}.tox .tox-dialog-wrap{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:1100}.tox .tox-dialog-wrap__backdrop{background-color:rgba(255,255,255,.75);bottom:0;left:0;position:absolute;right:0;top:0;z-index:1}.tox .tox-dialog-wrap__backdrop--opaque{background-color:#fff}.tox .tox-dialog{background-color:#fff;border-color:#eee;border-radius:10px;border-style:solid;border-width:0;box-shadow:0 16px 16px -10px rgba(34,47,62,.15),0 0 40px 1px rgba(34,47,62,.15);display:flex;flex-direction:column;max-height:100%;max-width:480px;overflow:hidden;position:relative;width:95vw;z-index:2}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox .tox-dialog{align-self:flex-start;margin:8px auto;max-height:calc(100vh - 8px * 2);width:calc(100vw - 16px)}}.tox .tox-dialog-inline{z-index:1100}.tox .tox-dialog__header{align-items:center;background-color:#fff;border-bottom:none;color:#222f3e;display:flex;font-size:16px;justify-content:space-between;padding:8px 16px 0 16px;position:relative}.tox .tox-dialog__header .tox-button{z-index:1}.tox .tox-dialog__draghandle{cursor:grab;height:100%;left:0;position:absolute;top:0;width:100%}.tox .tox-dialog__draghandle:active{cursor:grabbing}.tox .tox-dialog__dismiss{margin-left:auto}.tox .tox-dialog__title{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:20px;font-style:normal;font-weight:400;line-height:1.3;margin:0;text-transform:none}.tox .tox-dialog__body{color:#222f3e;display:flex;flex:1;font-size:16px;font-style:normal;font-weight:400;line-height:1.3;min-width:0;text-align:left;text-transform:none}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox .tox-dialog__body{flex-direction:column}}.tox .tox-dialog__body-nav{align-items:flex-start;display:flex;flex-direction:column;flex-shrink:0;padding:16px 16px}@media only screen and (min-width:768px){.tox .tox-dialog__body-nav{max-width:11em}}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox .tox-dialog__body-nav{flex-direction:row;-webkit-overflow-scrolling:touch;overflow-x:auto;padding-bottom:0}}.tox .tox-dialog__body-nav-item{border-bottom:2px solid transparent;color:rgba(34,47,62,.7);display:inline-block;flex-shrink:0;font-size:14px;line-height:1.3;margin-bottom:8px;max-width:13em;-webkit-text-decoration:none;text-decoration:none}.tox .tox-dialog__body-nav-item:focus{background-color:rgba(0,108,231,.1)}.tox .tox-dialog__body-nav-item--active{border-bottom:2px solid #144782;color:#144782}@media (forced-colors:active){.tox .tox-dialog__body-nav-item--active{border-bottom:2px solid highlight;color:highlight}}.tox .tox-dialog__body-content{box-sizing:border-box;display:flex;flex:1;flex-direction:column;max-height:min(650px,calc(100vh - 110px));overflow:auto;-webkit-overflow-scrolling:touch;padding:16px 16px}.tox .tox-dialog__body-content>*{margin-bottom:0;margin-top:16px}.tox .tox-dialog__body-content>:first-child{margin-top:0}.tox .tox-dialog__body-content>:last-child{margin-bottom:0}.tox .tox-dialog__body-content>:only-child{margin-bottom:0;margin-top:0}.tox .tox-dialog__body-content a{color:#144782;cursor:pointer;-webkit-text-decoration:underline;text-decoration:underline}.tox .tox-dialog__body-content a:focus,.tox .tox-dialog__body-content a:hover{color:#071729;-webkit-text-decoration:underline;text-decoration:underline}.tox .tox-dialog__body-content a:focus-visible{border-radius:1px;outline:2px solid #144782;outline-offset:2px}.tox .tox-dialog__body-content a:active{color:#000;-webkit-text-decoration:underline;text-decoration:underline}.tox .tox-dialog__body-content svg{fill:#222f3e}.tox .tox-dialog__body-content strong{font-weight:700}.tox .tox-dialog__body-content ul{list-style-type:disc}.tox .tox-dialog__body-content dd,.tox .tox-dialog__body-content ol,.tox .tox-dialog__body-content ul{padding-inline-start:2.5rem}.tox .tox-dialog__body-content dl,.tox .tox-dialog__body-content ol,.tox .tox-dialog__body-content ul{margin-bottom:16px}.tox .tox-dialog__body-content dd,.tox .tox-dialog__body-content dl,.tox .tox-dialog__body-content dt,.tox .tox-dialog__body-content ol,.tox .tox-dialog__body-content ul{display:block;margin-inline-end:0;margin-inline-start:0}.tox .tox-dialog__body-content .tox-form__group h1{color:#222f3e;font-size:20px;font-style:normal;font-weight:700;letter-spacing:normal;margin-bottom:16px;margin-top:2rem;text-transform:none}.tox .tox-dialog__body-content .tox-form__group h2{color:#222f3e;font-size:16px;font-style:normal;font-weight:700;letter-spacing:normal;margin-bottom:16px;margin-top:2rem;text-transform:none}.tox .tox-dialog__body-content .tox-form__group p{margin-bottom:16px}.tox .tox-dialog__body-content .tox-form__group h1:first-child,.tox .tox-dialog__body-content .tox-form__group h2:first-child,.tox .tox-dialog__body-content .tox-form__group p:first-child{margin-top:0}.tox .tox-dialog__body-content .tox-form__group h1:last-child,.tox .tox-dialog__body-content .tox-form__group h2:last-child,.tox .tox-dialog__body-content .tox-form__group p:last-child{margin-bottom:0}.tox .tox-dialog__body-content .tox-form__group h1:only-child,.tox .tox-dialog__body-content .tox-form__group h2:only-child,.tox .tox-dialog__body-content .tox-form__group p:only-child{margin-bottom:0;margin-top:0}.tox .tox-dialog__body-content .tox-form__group .tox-label.tox-label--center{text-align:center}.tox .tox-dialog__body-content .tox-form__group .tox-label.tox-label--end{text-align:end}.tox .tox-dialog--width-lg{height:650px;max-width:1200px}.tox .tox-dialog--fullscreen{height:100%;max-width:100%}.tox .tox-dialog--fullscreen .tox-dialog__body-content{max-height:100%}.tox .tox-dialog--width-md{max-width:800px}.tox .tox-dialog--width-md .tox-dialog__body-content{overflow:auto}.tox .tox-dialog__body-content--centered{text-align:center}.tox .tox-dialog__footer{align-items:center;background-color:#fff;border-top:none;display:flex;justify-content:space-between;padding:8px 16px}.tox .tox-dialog__footer-end,.tox .tox-dialog__footer-start{display:flex}.tox .tox-dialog__busy-spinner{align-items:center;background-color:rgba(255,255,255,.75);bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:3}.tox .tox-dialog__table{border-collapse:collapse;width:100%}.tox .tox-dialog__table thead th{font-weight:700;padding-bottom:8px}.tox .tox-dialog__table thead th:first-child{padding-right:8px}.tox .tox-dialog__table tbody tr{border-bottom:1px solid #626262}.tox .tox-dialog__table tbody tr:last-child{border-bottom:none}.tox .tox-dialog__table td{padding-bottom:8px;padding-top:8px}.tox .tox-dialog__table td:first-child{padding-right:8px}.tox .tox-dialog__iframe{min-height:200px}.tox .tox-dialog__iframe.tox-dialog__iframe--opaque{background:#fff}.tox .tox-navobj-bordered{position:relative}.tox .tox-navobj-bordered::before{border:1px solid #eee;border-radius:6px;content:\'\';inset:0;opacity:1;pointer-events:none;position:absolute;z-index:1}.tox .tox-navobj-bordered iframe{border-radius:6px}.tox .tox-navobj-bordered-focus.tox-navobj-bordered::before{border-color:#006ce7;box-shadow:0 0 0 1px #006ce7;outline:0}.tox .tox-dialog__popups{position:absolute;width:100%;z-index:1100}.tox .tox-dialog__body-iframe{display:flex;flex:1;flex-direction:column}.tox .tox-dialog__body-iframe .tox-navobj{display:flex;flex:1}.tox .tox-dialog__body-iframe .tox-navobj :nth-child(2){flex:1;height:100%}.tox .tox-dialog-dock-fadeout{opacity:0;visibility:hidden}.tox .tox-dialog-dock-fadein{opacity:1;visibility:visible}.tox .tox-dialog-dock-transition{transition:visibility 0s linear .3s,opacity .3s ease}.tox .tox-dialog-dock-transition.tox-dialog-dock-fadein{transition-delay:0s}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav{margin-right:0}}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav-item:not(:first-child){margin-left:8px}}.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-end>*,.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-start>*{margin-left:8px}.tox[dir=rtl] .tox-dialog__body{text-align:right}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav{margin-left:0}}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav-item:not(:first-child){margin-right:8px}}.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-end>*,.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-start>*{margin-right:8px}body.tox-dialog__disable-scroll{overflow:hidden}.tox .tox-dropzone-container{display:flex;flex:1}.tox .tox-dropzone{align-items:center;background:#fff;border:2px dashed #eee;box-sizing:border-box;display:flex;flex-direction:column;flex-grow:1;justify-content:center;min-height:100px;padding:10px}.tox .tox-dropzone p{color:rgba(34,47,62,.7);margin:0 0 16px 0}.tox .tox-edit-area{display:flex;flex:1;overflow:hidden;position:relative}.tox .tox-edit-area::before{border:2px solid #006ce7;border-radius:4px;content:\'\';inset:0;opacity:0;pointer-events:none;position:absolute;transition:opacity .15s;z-index:1}@media (forced-colors:active){.tox .tox-edit-area::before{border:2px solid highlight}}.tox .tox-edit-area__iframe{background-color:#fff;border:0;box-sizing:border-box;flex:1;height:100%;position:absolute;width:100%}.tox.tox-edit-focus .tox-edit-area::before{opacity:1}.tox.tox-inline-edit-area{border:1px dotted #eee}.tox .tox-editor-container{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.tox .tox-editor-header{display:grid;grid-template-columns:1fr min-content;z-index:2}.tox:not(.tox-tinymce-inline) .tox-editor-header{background-color:#fff;border-bottom:none;box-shadow:0 2px 2px -2px rgba(34,47,62,.1),0 8px 8px -4px rgba(34,47,62,.07);padding:4px 0}.tox:not(.tox-tinymce-inline) .tox-editor-header:not(.tox-editor-dock-transition){transition:box-shadow .5s}.tox:not(.tox-tinymce-inline).tox-tinymce--toolbar-bottom .tox-editor-header{border-top:1px solid #e3e3e3;box-shadow:none}.tox:not(.tox-tinymce-inline).tox-tinymce--toolbar-sticky-on .tox-editor-header{background-color:#fff;box-shadow:0 2px 2px -2px rgba(34,47,62,.2),0 8px 8px -4px rgba(34,47,62,.15);padding:4px 0}.tox:not(.tox-tinymce-inline).tox-tinymce--toolbar-sticky-on.tox-tinymce--toolbar-bottom .tox-editor-header{box-shadow:0 2px 2px -2px rgba(34,47,62,.2),0 8px 8px -4px rgba(34,47,62,.15)}.tox.tox:not(.tox-tinymce-inline) .tox-editor-header.tox-editor-header--empty{background:0 0;border:none;box-shadow:none;padding:0}.tox-editor-dock-fadeout{opacity:0;visibility:hidden}.tox-editor-dock-fadein{opacity:1;visibility:visible}.tox-editor-dock-transition{transition:visibility 0s linear .25s,opacity .25s ease}.tox-editor-dock-transition.tox-editor-dock-fadein{transition-delay:0s}.tox .tox-control-wrap{flex:1;position:relative}.tox .tox-control-wrap:not(.tox-control-wrap--status-invalid) .tox-control-wrap__status-icon-invalid,.tox .tox-control-wrap:not(.tox-control-wrap--status-unknown) .tox-control-wrap__status-icon-unknown,.tox .tox-control-wrap:not(.tox-control-wrap--status-valid) .tox-control-wrap__status-icon-valid{display:none}.tox .tox-control-wrap svg{display:block}.tox .tox-control-wrap__status-icon-wrap{position:absolute;top:50%;transform:translateY(-50%)}.tox .tox-control-wrap__status-icon-invalid svg{fill:#c00}.tox .tox-control-wrap__status-icon-unknown svg{fill:orange}.tox .tox-control-wrap__status-icon-valid svg{fill:green}.tox:not([dir=rtl]) .tox-control-wrap--status-invalid .tox-textfield,.tox:not([dir=rtl]) .tox-control-wrap--status-unknown .tox-textfield,.tox:not([dir=rtl]) .tox-control-wrap--status-valid .tox-textfield{padding-right:32px}.tox:not([dir=rtl]) .tox-control-wrap__status-icon-wrap{right:4px}.tox[dir=rtl] .tox-control-wrap--status-invalid .tox-textfield,.tox[dir=rtl] .tox-control-wrap--status-unknown .tox-textfield,.tox[dir=rtl] .tox-control-wrap--status-valid .tox-textfield{padding-left:32px}.tox[dir=rtl] .tox-control-wrap__status-icon-wrap{left:4px}.tox .tox-custom-preview{border-color:#eee;border-radius:6px;border-style:solid;border-width:1px;flex:1;padding:8px}.tox .tox-autocompleter{max-width:25em}.tox .tox-autocompleter .tox-menu{box-sizing:border-box;max-width:25em}.tox .tox-autocompleter .tox-autocompleter-highlight{font-weight:700}.tox .tox-color-input{display:flex;position:relative;z-index:1}.tox .tox-color-input .tox-textfield{z-index:-1}.tox .tox-color-input span{border-color:rgba(34 47 3.1%);border-radius:6px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;height:24px;position:absolute;top:6px;width:24px}@media (forced-colors:active){.tox .tox-color-input span{border-color:currentColor;border-width:2px!important;forced-color-adjust:none}}.tox .tox-color-input span:focus:not([aria-disabled=true]),.tox .tox-color-input span:hover:not([aria-disabled=true]){border-color:#006ce7;cursor:pointer}.tox .tox-color-input span::before{background-image:linear-gradient(45deg,rgba(0,0,0,.25) 25%,transparent 25%),linear-gradient(-45deg,rgba(0,0,0,.25) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,rgba(0,0,0,.25) 75%),linear-gradient(-45deg,transparent 75%,rgba(0,0,0,.25) 75%);background-position:0 0,0 6px,6px -6px,-6px 0;background-size:12px 12px;border:1px solid #fff;border-radius:6px;box-sizing:border-box;content:\'\';height:24px;left:-1px;position:absolute;top:-1px;width:24px;z-index:-1}@media (forced-colors:active){.tox .tox-color-input span::before{border:none}}.tox .tox-color-input span[aria-disabled=true]{cursor:not-allowed}.tox:not([dir=rtl]) .tox-color-input .tox-textfield{padding-left:36px}.tox:not([dir=rtl]) .tox-color-input span{left:6px}.tox[dir=rtl] .tox-color-input .tox-textfield{padding-right:36px}.tox[dir=rtl] .tox-color-input span{right:6px}.tox .tox-label,.tox .tox-toolbar-label{color:rgba(34,47,62,.7);display:block;font-size:14px;font-style:normal;font-weight:400;line-height:1.3;padding:0 8px 0 0;text-transform:none;white-space:nowrap}.tox .tox-toolbar-label{padding:0 8px}.tox[dir=rtl] .tox-label{padding:0 0 0 8px}.tox .tox-form{display:flex;flex:1;flex-direction:column}.tox .tox-form__group{box-sizing:border-box;margin-bottom:4px}.tox .tox-form-group--maximize{flex:1}.tox .tox-form__group--error{color:#c00}.tox .tox-form__group--collection{display:flex}.tox .tox-form__grid{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between}.tox .tox-form__grid--2col>.tox-form__group{width:calc(50% - (8px / 2))}.tox .tox-form__grid--3col>.tox-form__group{width:calc(100% / 3 - (8px / 2))}.tox .tox-form__grid--4col>.tox-form__group{width:calc(25% - (8px / 2))}.tox .tox-form__controls-h-stack{align-items:center;display:flex}.tox .tox-form__group--inline{align-items:center;display:flex}.tox .tox-form__group--stretched{display:flex;flex:1;flex-direction:column}.tox .tox-form__group--stretched .tox-textarea{flex:1}.tox .tox-form__group--stretched .tox-navobj{display:flex;flex:1}.tox .tox-form__group--stretched .tox-navobj :nth-child(2){flex:1;height:100%}.tox:not([dir=rtl]) .tox-form__controls-h-stack>:not(:first-child){margin-left:4px}.tox[dir=rtl] .tox-form__controls-h-stack>:not(:first-child){margin-right:4px}.tox .tox-lock.tox-locked .tox-lock-icon__unlock,.tox .tox-lock:not(.tox-locked) .tox-lock-icon__lock{display:none}.tox .tox-context-form__group .tox-button--icon.tox-lock-context-form-size-input{margin-left:8px;margin-right:8px}.tox .tox-listboxfield .tox-listbox--select,.tox .tox-textarea,.tox .tox-textarea-wrap .tox-textarea:focus,.tox .tox-textfield,.tox .tox-toolbar-textfield{appearance:none;background-color:#fff;border-color:#eee;border-radius:6px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;color:#222f3e;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;line-height:24px;margin:0;min-height:34px;outline:0;padding:5px 5.5px;resize:none;width:100%}.tox .tox-textarea[disabled],.tox .tox-textfield[disabled],.tox .tox-toolbar-textfield[disabled]{background-color:#f2f2f2;color:rgba(34,47,62,.85);cursor:not-allowed}.tox .tox-custom-editor:focus-within,.tox .tox-focusable-wrapper:focus,.tox .tox-listboxfield .tox-listbox--select:focus,.tox .tox-textarea-wrap:focus-within,.tox .tox-textarea:focus,.tox .tox-textfield:focus,.tox .tox-toolbar-textfield:focus{background-color:#fff;border-color:#006ce7;box-shadow:0 0 0 1px #006ce7;outline:0}.tox .tox-toolbar-textfield{max-width:250px;min-height:unset;height:28px;margin:5px 0 6px 0}.tox .tox-naked-btn{background-color:transparent;border:0;border-color:transparent;box-shadow:unset;color:#006ce7;cursor:pointer;display:block;margin:0;padding:0}.tox .tox-naked-btn svg{display:block;fill:#222f3e}.tox .tox-textfield-size{width:80px}.tox:not([dir=rtl]) .tox-toolbar-textfield+*{margin-left:4px}.tox[dir=rtl] .tox-toolbar-textfield+*{margin-right:4px}.tox .tox-listboxfield{cursor:pointer;position:relative}.tox .tox-listboxfield .tox-listbox--select[disabled]{background-color:#f2f2f2;color:rgba(34,47,62,.85);cursor:not-allowed}.tox .tox-listbox__select-label{cursor:default;flex:1;margin:0 4px}.tox .tox-listbox__select-chevron{align-items:center;display:flex;justify-content:center;width:16px}.tox .tox-listbox__select-chevron svg{fill:#222f3e}@media (forced-colors:active){.tox .tox-listbox__select-chevron svg{fill:currentColor!important}}.tox .tox-listboxfield .tox-listbox--select{align-items:center;display:flex}.tox:not([dir=rtl]) .tox-listboxfield svg{right:8px}.tox[dir=rtl] .tox-listboxfield svg{left:8px}.tox .tox-selectfield{cursor:pointer;position:relative}.tox .tox-selectfield select{appearance:none;background-color:#fff;border-color:#eee;border-radius:6px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;color:#222f3e;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;line-height:24px;margin:0;min-height:34px;outline:0;padding:5px 5.5px;resize:none;width:100%}.tox .tox-selectfield select[disabled]{background-color:#f2f2f2;color:rgba(34,47,62,.85);cursor:not-allowed}.tox .tox-selectfield select::-ms-expand{display:none}.tox .tox-selectfield select:focus{background-color:#fff;border-color:#006ce7;box-shadow:0 0 0 1px #006ce7;outline:0}.tox .tox-selectfield svg{pointer-events:none;position:absolute;top:50%;transform:translateY(-50%)}.tox .tox-selectfield select option:checked{background-color:revert;color:revert}.tox:not([dir=rtl]) .tox-selectfield select[size="0"],.tox:not([dir=rtl]) .tox-selectfield select[size="1"]{padding-right:24px}.tox:not([dir=rtl]) .tox-selectfield svg{right:8px}.tox[dir=rtl] .tox-selectfield select[size="0"],.tox[dir=rtl] .tox-selectfield select[size="1"]{padding-left:24px}.tox[dir=rtl] .tox-selectfield svg{left:8px}.tox .tox-textarea-wrap{border-color:#eee;border-radius:6px;border-style:solid;border-width:1px;display:flex;flex:1;overflow:hidden}.tox .tox-textarea{appearance:textarea;white-space:pre-wrap}.tox .tox-textarea-wrap .tox-textarea{border:none}.tox .tox-textarea-wrap .tox-textarea:focus{border:none}.tox-fullscreen{border:0;height:100%;margin:0;overflow:hidden;overscroll-behavior:none;padding:0;touch-action:pinch-zoom;width:100%}.tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle{display:none}.tox-shadowhost.tox-fullscreen,.tox.tox-tinymce.tox-fullscreen{left:0;position:fixed;top:0;z-index:1200}.tox.tox-tinymce.tox-fullscreen{background-color:transparent}.tox-fullscreen .tox.tox-tinymce-aux,.tox-fullscreen~.tox.tox-tinymce-aux{z-index:1201}.tox .tox-help__more-link{list-style:none;margin-top:1em}.tox .tox-imagepreview{background-color:#666;height:380px;overflow:hidden;position:relative;width:100%}.tox .tox-imagepreview.tox-imagepreview__loaded{overflow:auto}.tox .tox-imagepreview__container{display:flex;left:100vw;position:absolute;top:100vw}.tox .tox-imagepreview__image{background:url(data:image/gif;base64,R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==)}.tox .tox-image-tools .tox-spacer{flex:1}.tox .tox-image-tools .tox-bar{align-items:center;display:flex;height:60px;justify-content:center}.tox .tox-image-tools .tox-imagepreview,.tox .tox-image-tools .tox-imagepreview+.tox-bar{margin-top:8px}.tox .tox-image-tools .tox-croprect-block{background:#000;opacity:.5;position:absolute;zoom:1}.tox .tox-image-tools .tox-croprect-handle{border:2px solid #fff;height:20px;left:0;position:absolute;top:0;width:20px}.tox .tox-image-tools .tox-croprect-handle-move{border:0;cursor:move;position:absolute}.tox .tox-image-tools .tox-croprect-handle-nw{border-width:2px 0 0 2px;cursor:nw-resize;left:100px;margin:-2px 0 0 -2px;top:100px}.tox .tox-image-tools .tox-croprect-handle-ne{border-width:2px 2px 0 0;cursor:ne-resize;left:200px;margin:-2px 0 0 -20px;top:100px}.tox .tox-image-tools .tox-croprect-handle-sw{border-width:0 0 2px 2px;cursor:sw-resize;left:100px;margin:-20px 2px 0 -2px;top:200px}.tox .tox-image-tools .tox-croprect-handle-se{border-width:0 2px 2px 0;cursor:se-resize;left:200px;margin:-20px 0 0 -20px;top:200px}.tox .tox-image-selector-loading-spinner-wrapper{display:flex;justify-content:center;align-items:center}.tox .tox-image-selector-loading-spinner{position:absolute;width:min(24px,30%);aspect-ratio:1;border-radius:50%;border:3px solid #006ce7;border-bottom-color:transparent;animation:tox-rotation 1s linear infinite}.tox .tox-toolbar .tox-image-selector,.tox .tox-toolbar__overflow .tox-image-selector,.tox .tox-toolbar__primary .tox-image-selector{margin:5px 0 6px 11px}.tox .tox-image-selector-menu{border:0;border-radius:3px;margin:-4px -4px;padding:4px}.tox .tox-image-selector-menu .tox-collection--list .tox-collection__group{border:0;padding:0;margin:-4px -4px}.tox .tox-image-selector-menu .tox-collection__item{max-width:48px}.tox .tox-image-selector-menu .tox-collection__item-icon{border:1px solid #eee;border-radius:3px;margin-bottom:4px;width:100%}.tox .tox-image-selector-menu .tox-collection__item-icon svg path{stroke:#c00}.tox .tox-image-selector__row{display:flex}.tox .tox-image-selector--remove{align-items:center;display:flex;justify-content:center}.tox .tox-image-selector--remove svg path{stroke:#c00}.tox .tox-image-selector-image-wrapper{width:46px;height:46px;display:flex;align-items:center;justify-content:center}.tox .tox-image-selector-image-img{max-width:100%;max-height:100%}.tox .tox-image-selector__picker-btn{align-items:center;background-color:transparent;border:0;cursor:pointer;display:flex;height:30px;justify-content:center;outline:0;padding:0;width:30px}.tox .tox-image-selector__picker-btn svg{fill:#222f3e;height:24px;width:24px}.tox .tox-image-selector__picker-btn:hover{background:#f0f0f0}.tox .tox-insert-table-picker{background-color:#fff;display:flex;flex-wrap:wrap;width:170px}.tox .tox-insert-table-picker>div{border-color:#eee;border-style:solid;border-width:0 1px 1px 0;box-sizing:border-box;height:17px;width:17px}.tox .tox-collection--list .tox-collection__group .tox-insert-table-picker{margin:-4px -4px}.tox .tox-insert-table-picker .tox-insert-table-picker__selected{background-color:#006ce7;border-color:#eee}@media (forced-colors:active){.tox .tox-insert-table-picker .tox-insert-table-picker__selected{border-color:Highlight;filter:contrast(50%)}}.tox .tox-insert-table-picker__label{color:rgba(34,47,62,.7);display:block;font-size:14px;padding:4px;text-align:center;width:100%}.tox:not([dir=rtl]) .tox-insert-table-picker>div:nth-child(10n){border-right:0}.tox[dir=rtl] .tox-insert-table-picker>div:nth-child(10n+1){border-right:0}.tox-mentions__card-common{z-index:1200}.tox.tox-mentions__card{background:#fff;border:1px solid #eee;display:flex;padding:4px 8px}.tox.tox-mentions__card .tox-mentions__container{display:flex;flex-direction:column;align-self:center;margin:0 4px}.tox .tox-mentions__avatar{width:42px;height:42px;border-radius:50%;margin-right:4px}.tox .tox-mentions__username{font-size:14px;line-height:21px}.tox .tox-mentions__description{font-size:12px;line-height:21px;color:rgba(34,47,62,.7)}.tox .tox-collection__item--active .tox-mentions__description{color:inherit}.tox .tox-menu{background-color:#fff;border:1px solid transparent;border-radius:6px;box-shadow:0 0 2px 0 rgba(34,47,62,.2),0 4px 8px 0 rgba(34,47,62,.15);display:inline-block;overflow:hidden;vertical-align:top;z-index:1150}.tox .tox-menu.tox-collection.tox-collection--list{padding:0 4px}.tox .tox-menu.tox-collection.tox-collection--toolbar{padding:8px}.tox .tox-menu.tox-collection.tox-collection--grid{padding:8px}@media only screen and (min-width:768px){.tox .tox-menu .tox-collection__item-label{overflow-wrap:break-word;word-break:normal}.tox .tox-dialog__popups .tox-menu .tox-collection__item-label{word-break:break-all}}.tox .tox-menu__label blockquote,.tox .tox-menu__label code,.tox .tox-menu__label h1,.tox .tox-menu__label h2,.tox .tox-menu__label h3,.tox .tox-menu__label h4,.tox .tox-menu__label h5,.tox .tox-menu__label h6,.tox .tox-menu__label p{margin:0}.tox .tox-menubar{background:repeating-linear-gradient(transparent 0 1px,transparent 1px 39px) center top 39px/100% calc(100% - 39px) no-repeat;background-color:#fff;display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:wrap;grid-column:1/-1;grid-row:1;padding:0 11px 0 12px}.tox .tox-promotion+.tox-menubar{grid-column:1}.tox .tox-promotion{background:repeating-linear-gradient(transparent 0 1px,transparent 1px 39px) center top 39px/100% calc(100% - 39px) no-repeat;background-color:#fff;grid-column:2;grid-row:1;padding-inline-end:8px;padding-inline-start:4px;padding-top:5px}.tox .tox-promotion-link{align-items:unsafe center;background-color:#e8f1f8;border-radius:5px;color:#086be6;cursor:pointer;display:flex;font-size:14px;height:26.6px;padding:4px 8px;white-space:nowrap}.tox .tox-promotion-link:hover{background-color:#b4d7ff}.tox .tox-promotion-link:focus{background-color:#d9edf7}.tox .tox-mbtn{align-items:center;background:#fff;border:0;border-radius:3px;box-shadow:none;color:#222f3e;display:flex;flex:0 0 auto;font-size:14px;font-style:normal;font-weight:400;height:28px;justify-content:center;margin:5px 1px 6px 0;outline:0;padding:0 4px;text-transform:none;width:auto}.tox .tox-mbtn[disabled]{background-color:#fff;border:0;box-shadow:none;color:rgba(34,47,62,.5);cursor:not-allowed}.tox .tox-mbtn:focus:not(:disabled){background:#fff;border:0;box-shadow:none;color:#222f3e;position:relative;z-index:1}.tox .tox-mbtn:focus:not(:disabled)::after{border-radius:3px;bottom:0;box-shadow:0 0 0 2px #006ce7;content:\'\';left:0;position:absolute;right:0;top:0}@media (forced-colors:active){.tox .tox-mbtn:focus:not(:disabled)::after{border:2px solid highlight}}.tox .tox-mbtn--active,.tox .tox-mbtn:not(:disabled).tox-mbtn--active:focus{background:#a6ccf7;border:0;box-shadow:none;color:#222f3e}.tox .tox-mbtn:hover:not(:disabled):not(.tox-mbtn--active){background:#f0f0f0;border:0;box-shadow:none;color:#222f3e}.tox .tox-mbtn__select-label{cursor:default;font-weight:400;margin:0 4px}.tox .tox-mbtn[disabled] .tox-mbtn__select-label{cursor:not-allowed}.tox .tox-mbtn__select-chevron{align-items:center;display:flex;justify-content:center;width:16px;display:none}.tox .tox-notification{border-radius:6px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;display:grid;font-size:14px;font-weight:400;grid-template-columns:minmax(40px,1fr) auto minmax(40px,1fr);margin-left:auto;margin-right:auto;margin-top:4px;opacity:0;padding:4px;transition:transform .1s ease-in,opacity 150ms ease-in;width:max-content}.tox .tox-notification a{cursor:pointer;-webkit-text-decoration:underline;text-decoration:underline}.tox .tox-notification p{font-size:14px;font-weight:400}.tox .tox-notification:focus{border-color:#006ce7;box-shadow:0 0 0 1px #006ce7}.tox .tox-notification--in{opacity:1}.tox .tox-notification--success{background-color:#e4eeda;border-color:#d7e6c8;color:#222f3e}.tox .tox-notification--success p{color:#222f3e}.tox .tox-notification--success a{color:#517342}.tox .tox-notification--success a:focus,.tox .tox-notification--success a:hover{color:#24321d;-webkit-text-decoration:underline;text-decoration:underline}.tox .tox-notification--success a:focus-visible{border-radius:1px;outline:2px solid #517342;outline-offset:2px}.tox .tox-notification--success a:active{color:#0d120a;-webkit-text-decoration:underline;text-decoration:underline}.tox .tox-notification--success svg{fill:#222f3e}.tox .tox-notification--error{background-color:#f5cccc;border-color:#f0b3b3;color:#222f3e}.tox .tox-notification--error p{color:#222f3e}.tox .tox-notification--error a{color:#77181f}.tox .tox-notification--error a:focus,.tox .tox-notification--error a:hover{color:#220709;-webkit-text-decoration:underline;text-decoration:underline}.tox .tox-notification--error a:focus-visible{border-radius:1px;outline:2px solid #77181f;outline-offset:2px}.tox .tox-notification--error a:active{color:#000;-webkit-text-decoration:underline;text-decoration:underline}.tox .tox-notification--error svg{fill:#222f3e}.tox .tox-notification--warn,.tox .tox-notification--warning{background-color:#fff5cc;border-color:#fff0b3;color:#222f3e}.tox .tox-notification--warn p,.tox .tox-notification--warning p{color:#222f3e}.tox .tox-notification--warn a,.tox .tox-notification--warning a{color:#7a6e25}.tox .tox-notification--warn a:focus,.tox .tox-notification--warn a:hover,.tox .tox-notification--warning a:focus,.tox .tox-notification--warning a:hover{color:#2c280d;-webkit-text-decoration:underline;text-decoration:underline}.tox .tox-notification--warn a:focus-visible,.tox .tox-notification--warning a:focus-visible{border-radius:1px;outline:2px solid #7a6e25;outline-offset:2px}.tox .tox-notification--warn a:active,.tox .tox-notification--warning a:active{color:#050502;-webkit-text-decoration:underline;text-decoration:underline}.tox .tox-notification--warn svg,.tox .tox-notification--warning svg{fill:#222f3e}.tox .tox-notification--info{background-color:#d6e7fb;border-color:#c1dbf9;color:#222f3e}.tox .tox-notification--info p{color:#222f3e}.tox .tox-notification--info a{color:#2a64a6}.tox .tox-notification--info a:focus,.tox .tox-notification--info a:hover{color:#163355;-webkit-text-decoration:underline;text-decoration:underline}.tox .tox-notification--info a:focus-visible{border-radius:1px;outline:2px solid #2a64a6;outline-offset:2px}.tox .tox-notification--info a:active{color:#0b1a2c;-webkit-text-decoration:underline;text-decoration:underline}.tox .tox-notification--info svg{fill:#222f3e}.tox .tox-notification__body{align-self:center;color:#222f3e;font-size:14px;grid-column-end:3;grid-column-start:2;grid-row-end:2;grid-row-start:1;text-align:center;white-space:normal;word-break:break-all;word-break:break-word}.tox .tox-notification__body>*{margin:0}.tox .tox-notification__body>*+*{margin-top:1rem}.tox .tox-notification__icon{align-self:center;grid-column-end:2;grid-column-start:1;grid-row-end:2;grid-row-start:1;justify-self:end}.tox .tox-notification__icon svg{display:block}.tox .tox-notification__dismiss{align-self:start;grid-column-end:4;grid-column-start:3;grid-row-end:2;grid-row-start:1;justify-self:end}.tox .tox-notification .tox-progress-bar{grid-column-end:4;grid-column-start:1;grid-row-end:3;grid-row-start:2;justify-self:center}.tox .tox-notification-container-dock-fadeout{opacity:0;visibility:hidden}.tox .tox-notification-container-dock-fadein{opacity:1;visibility:visible}.tox .tox-notification-container-dock-transition{transition:visibility 0s linear .3s,opacity .3s ease}.tox .tox-notification-container-dock-transition.tox-notification-container-dock-fadein{transition-delay:0s}.tox .tox-onboarding-overlay{height:100%;background-color:#f0f0f0;position:absolute;top:0;left:0;right:0;z-index:1;overflow:auto;display:grid;justify-content:center;align-items:center}.tox .tox-onboarding-dialog{max-width:512px;background-color:#fff;display:flex;flex-direction:column;box-shadow:0 16px 16px -10px rgba(34,47,62,.15),0 0 40px 1px rgba(34,47,62,.15);border-radius:12px;margin:8px}.tox .tox-onboarding-dialog .tox-onboarding-header{color:#222f3e;display:flex;justify-content:center;align-items:center;font-size:20px;margin:24px 0 8px}.tox .tox-onboarding-dialog .tox-onboarding-step{display:grid;grid-template-columns:min-content 1fr min-content;align-items:center;margin:0 24px}.tox .tox-onboarding-dialog .tox-onboarding-step:not(:last-child){border-bottom:1px solid #e3e3e3}.tox .tox-onboarding-dialog .tox-onboarding-step--number{width:24px;aspect-ratio:1;border-radius:50%;border:1px solid #00ad0e;display:flex;justify-content:center;align-items:center;font-size:12px;font-weight:700;color:#00ad0e}.tox .tox-onboarding-dialog .tox-onboarding-step--body{padding:24px 0 24px 16px}.tox .tox-onboarding-dialog .tox-onboarding-step--body-header{color:#222f3e;font-size:14px;font-weight:700;margin-bottom:4px}.tox .tox-onboarding-dialog .tox-onboarding-step--body-details{color:rgba(34,47,62,.7);font-size:14px}.tox .tox-onboarding-dialog .tox-onboarding-step--action{padding-left:24px}.tox .tox-onboarding-dialog .tox-onboarding-footer{background-color:#f0f0f0;display:flex;justify-content:space-between;align-items:center;padding:16px 24px;border-bottom-left-radius:12px;border-bottom-right-radius:12px}.tox .tox-onboarding-dialog .tox-onboarding-footer p{display:flex;align-items:center;justify-content:center;gap:4px;font-size:14px;color:rgba(34,47,62,.7)}.tox .tox-onboarding-dialog svg{width:24px;fill:rgba(34,47,62,0.7)}.tox .tox-promotion-dialog .tox-promotion-dialog-plugin{display:grid;align-items:center;grid-template-columns:min-content 1fr min-content;border-bottom:1px solid #e3e3e3;padding:24px 0;margin:0 16px}.tox .tox-promotion-dialog .tox-promotion-dialog-plugin--body{margin:0 16px}.tox .tox-promotion-dialog .tox-promotion-dialog-plugin--body .tox-promotion-dialog-plugin-header{color:#222f3e;font-size:14px;font-weight:700;margin-bottom:4px}.tox .tox-promotion-dialog .tox-promotion-dialog-plugin--body .tox-promotion-dialog-plugin-details{color:rgba(34,47,62,.7);font-size:14px}.tox .tox-promotion-dialog .tox-promotion-dialog-plugin--icon{display:grid;place-content:center;width:56px;height:56px;line-height:24px;font-size:24px;border-radius:12px;background:linear-gradient(180deg,#fff 24%,#f0f0f0 100%);box-shadow:0 1px 1px 0 #222f3e12,0 3px 6px 0 #222f3e06;color:#006ce7}.tox .tox-promotion-dialog--subtitle{margin:16px;color:rgba(34,47,62,.7);font-size:14px}.tox .tox-promotion-dialog--explore{text-align:center;margin:16px;color:rgba(34,47,62,.7);font-size:14px}.tox .tox-promotion-dialog--explore a{color:#006ce7}.tox .tox-promotion-dialog--footer{background-color:#f0f0f0;color:rgba(34,47,62,.7);font-size:12px;text-align:center;padding:16px}.tox .tox-promotion-button{display:flex;align-items:center;height:26.6px;line-height:26.6px;font-size:14px;font-weight:700;background-color:#f1ebf9;color:#851aff;padding:8px 16px;cursor:pointer;white-space:nowrap;border-radius:5px}.tox .tox-promotion-button:focus{outline:1px solid #851AFF}.tox .tox-onboarding-dialog a,.tox .tox-promotion-dialog--footer a{color:rgba(34,47,62,.7);cursor:pointer;-webkit-text-decoration:underline;text-decoration:underline}.tox .tox-onboarding-dialog a:focus,.tox .tox-onboarding-dialog a:hover,.tox .tox-promotion-dialog--footer a:focus,.tox .tox-promotion-dialog--footer a:hover{color:#071729;-webkit-text-decoration:underline;text-decoration:underline}.tox .tox-onboarding-dialog a:focus-visible,.tox .tox-promotion-dialog--footer a:focus-visible{border-radius:1px;outline:2px solid #144782;outline-offset:2px}.tox .tox-onboarding-dialog a:active,.tox .tox-promotion-dialog--footer a:active{color:#000;-webkit-text-decoration:underline;text-decoration:underline}.tox .tox-pop{display:inline-block;position:relative}.tox .tox-pop--resizing{transition:width .1s ease}.tox .tox-pop--resizing .tox-toolbar,.tox .tox-pop--resizing .tox-toolbar__group{flex-wrap:nowrap}.tox .tox-pop--transition{transition:.15s ease;transition-property:left,right,top,bottom}.tox .tox-pop--transition::after,.tox .tox-pop--transition::before{transition:all .15s,visibility 0s,opacity 75ms ease 75ms}.tox .tox-pop__dialog{background-color:#fff;border:1px solid #eee;border-radius:6px;box-shadow:0 0 2px 0 rgba(34,47,62,.2),0 4px 8px 0 rgba(34,47,62,.15);min-width:0;overflow:hidden}.tox .tox-pop__dialog>:not(.tox-toolbar){margin:4px 4px 4px 8px}.tox .tox-pop__dialog .tox-toolbar{background-color:transparent;margin-bottom:-1px}.tox .tox-pop::after,.tox .tox-pop::before{border-style:solid;content:\'\';display:block;height:0;opacity:1;position:absolute;width:0}@media (forced-colors:active){.tox .tox-pop::after,.tox .tox-pop::before{content:none}}.tox .tox-pop.tox-pop--inset::after,.tox .tox-pop.tox-pop--inset::before{opacity:0;transition:all 0s .15s,visibility 0s,opacity 75ms ease}.tox .tox-pop.tox-pop--bottom::after,.tox .tox-pop.tox-pop--bottom::before{left:50%;top:100%}.tox .tox-pop.tox-pop--bottom::after{border-color:#fff transparent transparent transparent;border-width:8px;margin-left:-8px;margin-top:-1px}.tox .tox-pop.tox-pop--bottom::before{border-color:#eee transparent transparent transparent;border-width:9px;margin-left:-9px}.tox .tox-pop.tox-pop--top::after,.tox .tox-pop.tox-pop--top::before{left:50%;top:0;transform:translateY(-100%)}.tox .tox-pop.tox-pop--top::after{border-color:transparent transparent #fff transparent;border-width:8px;margin-left:-8px;margin-top:1px}.tox .tox-pop.tox-pop--top::before{border-color:transparent transparent #eee transparent;border-width:9px;margin-left:-9px}.tox .tox-pop.tox-pop--left::after,.tox .tox-pop.tox-pop--left::before{left:0;top:calc(50% - 1px);transform:translateY(-50%)}.tox .tox-pop.tox-pop--left::after{border-color:transparent #fff transparent transparent;border-width:8px;margin-left:-15px}.tox .tox-pop.tox-pop--left::before{border-color:transparent #eee transparent transparent;border-width:10px;margin-left:-19px}.tox .tox-pop.tox-pop--right::after,.tox .tox-pop.tox-pop--right::before{left:100%;top:calc(50% + 1px);transform:translateY(-50%)}.tox .tox-pop.tox-pop--right::after{border-color:transparent transparent transparent #fff;border-width:8px;margin-left:-1px}.tox .tox-pop.tox-pop--right::before{border-color:transparent transparent transparent #eee;border-width:10px;margin-left:-1px}.tox .tox-pop.tox-pop--align-left::after,.tox .tox-pop.tox-pop--align-left::before{left:20px}.tox .tox-pop.tox-pop--align-right::after,.tox .tox-pop.tox-pop--align-right::before{left:calc(100% - 20px)}.tox .tox-sidebar-wrap{display:flex;flex-direction:row;flex-grow:1;min-height:0}.tox .tox-sidebar{background-color:#f0f0f0;display:flex;flex-direction:row;justify-content:flex-end}.tox .tox-sidebar__slider{display:flex;overflow:hidden}.tox .tox-sidebar__pane-container{display:flex}.tox .tox-sidebar__pane{display:flex}.tox .tox-sidebar--sliding-closed{opacity:0}.tox .tox-sidebar--sliding-open{opacity:1}.tox .tox-sidebar--sliding-growing,.tox .tox-sidebar--sliding-shrinking{transition:width .5s ease,opacity .5s ease}.tox .tox-selector{background-color:#4099ff;border-color:#4099ff;border-style:solid;border-width:1px;box-sizing:border-box;display:inline-block;height:10px;position:absolute;width:10px}.tox.tox-platform-touch .tox-selector{height:12px;width:12px}.tox .tox-slider{align-items:center;display:flex;flex:1;height:24px;justify-content:center;position:relative}.tox .tox-slider__rail{background-color:transparent;border:1px solid #eee;border-radius:6px;height:10px;min-width:120px;width:100%}.tox .tox-slider__handle{background-color:#006ce7;border:2px solid #0054b4;border-radius:6px;box-shadow:none;height:24px;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:14px}.tox .tox-form__controls-h-stack>.tox-slider:not(:first-of-type){margin-inline-start:8px}.tox .tox-form__controls-h-stack>.tox-form__group+.tox-slider{margin-inline-start:32px}.tox .tox-form__controls-h-stack>.tox-slider+.tox-form__group{margin-inline-start:32px}.tox .tox-toolbar-slider{align-items:center;display:inline-flex;height:16px}.tox .tox-toolbar-slider__input{appearance:none;background:#eee;border-radius:16px;width:130px;height:2px}.tox .tox-toolbar-slider__input::-webkit-slider-runnable-track{background-color:transparent;height:16px}.tox .tox-toolbar-slider__input::-moz-range-track{background-color:transparent;height:16px}.tox .tox-toolbar-slider__input::-webkit-slider-thumb{-webkit-appearance:none;background-color:#006ce7;border-radius:16px;border:none;height:16px;width:16px}.tox .tox-toolbar-slider__input::-moz-range-thumb{appearance:none;background-color:#006ce7;border-radius:16px;border:none;height:16px;width:16px}.tox .tox-toolbar-slider__input:focus-visible{outline:0}.tox .tox-toolbar-slider__input:focus::-webkit-slider-thumb{background-color:#0060ce;box-shadow:inset 0 0 0 1px #fff,0 0 0 2px #006ce7}.tox .tox-toolbar-slider__input:focus::-moz-range-thumb{background-color:#0060ce;box-shadow:inset 0 0 0 1px #fff,0 0 0 2px #006ce7}.tox .tox-toolbar-slider__input:hover::-webkit-slider-thumb{background-color:#0060ce}.tox .tox-toolbar-slider__input:hover::-moz-range-thumb{background-color:#0060ce}.tox .tox-toolbar-slider__input:active::-webkit-slider-thumb{background-color:#0054b4}.tox .tox-toolbar-slider__input:active::-moz-range-thumb{background-color:#0054b4}.tox .tox-toolbar-slider__input[disabled]::-webkit-slider-thumb{background-color:rgba(255,255,255,.5)}.tox .tox-toolbar-slider__input[disabled]::-moz-range-thumb{background-color:rgba(255,255,255,.5)}.tox .tox-source-code{overflow:auto}.tox .tox-spinner{display:flex}.tox .tox-spinner>div{animation:tam-bouncing-dots 1.5s ease-in-out 0s infinite both;background-color:rgba(34,47,62,.7);border-radius:100%;height:8px;width:8px}.tox .tox-spinner>div:first-child{animation-delay:-.32s}.tox .tox-spinner>div:nth-child(2){animation-delay:-.16s}@keyframes tam-bouncing-dots{0%,100%,80%{transform:scale(0)}40%{transform:scale(1)}}.tox:not([dir=rtl]) .tox-spinner>div:not(:first-child){margin-left:4px}.tox[dir=rtl] .tox-spinner>div:not(:first-child){margin-right:4px}.tox .tox-statusbar{align-items:center;background-color:#fff;border-top:1px solid #e3e3e3;color:rgba(34,47,62,.7);display:flex;flex:0 0 auto;font-size:14px;font-weight:400;height:25px;overflow:hidden;padding:0 8px;position:relative;text-transform:none}.tox .tox-statusbar__path{display:flex;flex:1 1 auto;text-overflow:ellipsis;white-space:nowrap}.tox .tox-statusbar__right-container{display:flex;justify-content:flex-end;white-space:nowrap}.tox .tox-statusbar__help-text{text-align:center}.tox .tox-statusbar__text-container{align-items:flex-start;display:flex;flex:1 1 auto;height:16px;justify-content:space-between}@media only screen and (min-width:768px){.tox .tox-statusbar__text-container.tox-statusbar__text-container-3-cols>.tox-statusbar__help-text,.tox .tox-statusbar__text-container.tox-statusbar__text-container-3-cols>.tox-statusbar__path,.tox .tox-statusbar__text-container.tox-statusbar__text-container-3-cols>.tox-statusbar__right-container{flex:0 0 calc(100% / 3)}}.tox .tox-statusbar__text-container.tox-statusbar__text-container--flex-end{justify-content:flex-end}.tox .tox-statusbar__text-container.tox-statusbar__text-container--flex-start{justify-content:flex-start}.tox .tox-statusbar__text-container.tox-statusbar__text-container--space-around{justify-content:space-around}.tox .tox-statusbar__path>*{display:inline;white-space:nowrap}.tox .tox-statusbar__wordcount{flex:0 0 auto;margin-left:1ch}@media only screen and (max-width:767px){.tox .tox-statusbar__text-container .tox-statusbar__help-text{display:none}.tox .tox-statusbar__text-container .tox-statusbar__help-text:only-child{display:block}}.tox .tox-statusbar a,.tox .tox-statusbar__path-item,.tox .tox-statusbar__wordcount{color:rgba(34,47,62,.7);position:relative;-webkit-text-decoration:none;text-decoration:none}.tox .tox-statusbar a:focus:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar a:hover:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar__path-item:focus:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar__path-item:hover:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar__wordcount:focus:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar__wordcount:hover:not(:disabled):not([aria-disabled=true]){color:#222f3e;cursor:pointer}.tox .tox-statusbar a:focus-visible::after,.tox .tox-statusbar__path-item:focus-visible::after,.tox .tox-statusbar__wordcount:focus-visible::after{border-radius:3px;bottom:0;box-shadow:0 0 0 2px #006ce7;content:\'\';left:0;position:absolute;right:0;top:0}@media (forced-colors:active){.tox .tox-statusbar a:focus-visible::after,.tox .tox-statusbar__path-item:focus-visible::after,.tox .tox-statusbar__wordcount:focus-visible::after{border:2px solid highlight}}.tox .tox-statusbar__branding svg{fill:rgba(34,47,62,0.8);height:1em;margin-left:.3em;width:auto}@media (forced-colors:active){.tox .tox-statusbar__branding svg{fill:currentColor}}.tox .tox-statusbar__branding a{align-items:center;display:inline-flex}.tox .tox-statusbar__branding a:focus:not(:disabled):not([aria-disabled=true]) svg,.tox .tox-statusbar__branding a:hover:not(:disabled):not([aria-disabled=true]) svg{fill:#222f3e}.tox .tox-statusbar__resize-cursor-default{cursor:ns-resize}.tox .tox-statusbar__resize-cursor-both{cursor:nwse-resize}.tox .tox-statusbar__resize-handle{align-items:flex-end;align-self:stretch;display:flex;flex:0 0 auto;justify-content:flex-end;margin-bottom:3px;margin-left:4px;margin-right:calc(3px - 8px);margin-top:3px;padding-bottom:0;padding-left:0;padding-right:0;position:relative}.tox .tox-statusbar__resize-handle svg{display:block;fill:rgba(34,47,62,0.5)}.tox .tox-statusbar__resize-handle:focus svg,.tox .tox-statusbar__resize-handle:hover svg{fill:#222f3e}.tox .tox-statusbar__resize-handle:focus-visible{background-color:transparent;border-radius:1px 1px 5px 1px;box-shadow:0 0 0 2px transparent}.tox .tox-statusbar__resize-handle:focus-visible::after{border-radius:3px;bottom:0;box-shadow:0 0 0 2px #006ce7;content:\'\';left:0;position:absolute;right:0;top:0}@media (forced-colors:active){.tox .tox-statusbar__resize-handle:focus-visible::after{border:2px solid highlight}}.tox .tox-statusbar__resize-handle:only-child{margin-left:auto}.tox:not([dir=rtl]) .tox-statusbar__path>*{margin-right:4px}.tox:not([dir=rtl]) .tox-statusbar__branding{margin-left:2ch}.tox[dir=rtl] .tox-statusbar{flex-direction:row-reverse}.tox[dir=rtl] .tox-statusbar__path>*{margin-left:4px}.tox[dir=rtl] .tox-statusbar__branding svg{margin-left:0;margin-right:.3em}.tox .tox-throbber{z-index:1299}.tox .tox-throbber__busy-spinner{align-items:center;background-color:rgba(255,255,255,.6);bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.tox .tox-tbtn{align-items:center;background:#fff;border:0;border-radius:3px;box-shadow:none;color:#222f3e;display:flex;flex:0 0 auto;font-size:14px;font-style:normal;font-weight:400;height:28px;justify-content:center;margin:6px 1px 5px 0;outline:0;padding:0;text-transform:none;width:34px}@media (forced-colors:active){.tox .tox-tbtn.tox-tbtn:hover,.tox .tox-tbtn:hover{outline:1px dashed currentColor}.tox .tox-tbtn.tox-tbtn--active,.tox .tox-tbtn.tox-tbtn--enabled,.tox .tox-tbtn.tox-tbtn--enabled:focus,.tox .tox-tbtn.tox-tbtn--enabled:hover,.tox .tox-tbtn:focus:not(.tox-tbtn--disabled){outline:1px solid currentColor;position:relative}}.tox .tox-tbtn svg{display:block;fill:#222f3e}@media (forced-colors:active){.tox .tox-tbtn svg{fill:currentColor!important}.tox .tox-tbtn svg.tox-tbtn--enabled,.tox .tox-tbtn svg:focus:not(.tox-tbtn--disabled){fill:currentColor!important}.tox .tox-tbtn svg .tox-tbtn:disabled,.tox .tox-tbtn svg .tox-tbtn:disabled:hover,.tox .tox-tbtn svg.tox-tbtn--disabled,.tox .tox-tbtn svg.tox-tbtn--disabled:hover{filter:contrast(0%)}}.tox .tox-tbtn.tox-tbtn-more{padding-left:5px;padding-right:5px;width:inherit}.tox .tox-tbtn:focus{background:#fff;border:0;box-shadow:none;position:relative;z-index:1}.tox .tox-tbtn:focus::after{border-radius:3px;bottom:0;box-shadow:0 0 0 2px #006ce7;content:\'\';left:0;position:absolute;right:0;top:0}@media (forced-colors:active){.tox .tox-tbtn:focus::after{border:2px solid highlight}}.tox .tox-tbtn:hover{background:#f0f0f0;border:0;box-shadow:none;color:#222f3e}.tox .tox-tbtn:hover svg{fill:#222f3e}.tox .tox-tbtn:active{background:#a6ccf7;border:0;box-shadow:none;color:#222f3e}.tox .tox-tbtn:active svg{fill:#222f3e}.tox .tox-tbtn--disabled .tox-tbtn--enabled svg{fill:rgba(34,47,62,0.5)}.tox .tox-tbtn--disabled,.tox .tox-tbtn--disabled:hover,.tox .tox-tbtn:disabled,.tox .tox-tbtn:disabled:hover{background:#fff;border:0;box-shadow:none;color:rgba(34,47,62,.5);cursor:not-allowed}.tox .tox-tbtn--disabled svg,.tox .tox-tbtn--disabled:hover svg,.tox .tox-tbtn:disabled svg,.tox .tox-tbtn:disabled:hover svg{fill:rgba(34,47,62,0.5)}.tox .tox-tbtn--active,.tox .tox-tbtn--enabled,.tox .tox-tbtn--enabled:focus,.tox .tox-tbtn--enabled:hover{background:#a6ccf7;border:0;box-shadow:none;color:#222f3e;position:relative}.tox .tox-tbtn--active>*,.tox .tox-tbtn--enabled:focus>*,.tox .tox-tbtn--enabled:hover>*,.tox .tox-tbtn--enabled>*{transform:none}.tox .tox-tbtn--active svg,.tox .tox-tbtn--enabled svg,.tox .tox-tbtn--enabled:focus svg,.tox .tox-tbtn--enabled:hover svg{fill:#222f3e}.tox .tox-tbtn--active.tox-tbtn--disabled svg,.tox .tox-tbtn--enabled.tox-tbtn--disabled svg,.tox .tox-tbtn--enabled:focus.tox-tbtn--disabled svg,.tox .tox-tbtn--enabled:hover.tox-tbtn--disabled svg{fill:rgba(34,47,62,0.5)}.tox .tox-tbtn--enabled:focus::after{border-radius:3px;bottom:0;box-shadow:0 0 0 2px #006ce7;content:\'\';left:0;position:absolute;right:0;top:0}@media (forced-colors:active){.tox .tox-tbtn--enabled:focus::after{border:2px solid highlight}}.tox .tox-tbtn:focus:not(.tox-tbtn--disabled){color:#222f3e}.tox .tox-tbtn:focus:not(.tox-tbtn--disabled) svg{fill:#222f3e}.tox .tox-tbtn:active>*{transform:none}.tox .tox-tbtn--md{height:42px;width:51px}.tox .tox-tbtn--lg{flex-direction:column;height:56px;width:68px}.tox .tox-tbtn--return{align-self:stretch;height:unset;width:16px}.tox .tox-tbtn--labeled{padding:0 4px;width:unset}.tox .tox-tbtn__vlabel{display:block;font-size:10px;font-weight:400;letter-spacing:-.025em;margin-bottom:4px;white-space:nowrap}.tox .tox-label--context-toolbar{margin:6px 1px 5px 0;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.tox .tox-number-input{background:#f7f7f7;border-radius:3px;display:flex;margin:6px 1px 5px 0;position:relative;width:auto}.tox .tox-number-input:focus{background:#f7f7f7}.tox .tox-number-input:focus::after{border-radius:3px;bottom:0;box-shadow:0 0 0 2px #006ce7;content:\'\';left:0;position:absolute;right:0;top:0}@media (forced-colors:active){.tox .tox-number-input:focus::after{border:2px solid highlight}}.tox .tox-number-input .tox-input-wrapper{display:flex;pointer-events:none;position:relative;text-align:center}.tox .tox-number-input .tox-input-wrapper:focus{background-color:#f7f7f7;z-index:1}.tox .tox-number-input .tox-input-wrapper:focus::after{border-radius:3px;bottom:0;box-shadow:0 0 0 2px #006ce7;content:\'\';left:0;position:absolute;right:0;top:0}@media (forced-colors:active){.tox .tox-number-input .tox-input-wrapper:focus::after{border:2px solid highlight}}.tox .tox-number-input .tox-input-wrapper:has(input:focus)::after{border-radius:3px;bottom:0;box-shadow:0 0 0 2px #006ce7;content:\'\';left:0;position:absolute;right:0;top:0}@media (forced-colors:active){.tox .tox-number-input .tox-input-wrapper:has(input:focus)::after{border:2px solid highlight}}.tox .tox-number-input input{border-radius:3px;color:#222f3e;font-size:14px;margin:2px 0;pointer-events:all;position:relative;width:60px}.tox .tox-number-input input:hover{background:#f0f0f0;color:#222f3e}.tox .tox-number-input input:focus{background-color:#f7f7f7}.tox .tox-number-input input:disabled{background:#fff;border:0;box-shadow:none;color:rgba(34,47,62,.5);cursor:not-allowed}.tox .tox-number-input button{color:#222f3e;height:28px;position:relative;text-align:center;width:24px}@media (forced-colors:active){.tox .tox-number-input button:active,.tox .tox-number-input button:focus,.tox .tox-number-input button:hover{outline:1px solid currentColor!important}}.tox .tox-number-input button svg{display:block;fill:#222f3e;margin:0 auto;transform:scale(.67)}@media (forced-colors:active){.tox .tox-number-input button svg,.tox .tox-number-input button svg:active,.tox .tox-number-input button svg:hover{fill:currentColor!important}.tox .tox-number-input button svg:disabled{filter:contrast(0)}}.tox .tox-number-input button:focus{background:#f7f7f7;z-index:1}.tox .tox-number-input button:focus::after{border-radius:3px;bottom:0;box-shadow:0 0 0 2px #006ce7;content:\'\';left:0;position:absolute;right:0;top:0}@media (forced-colors:active){.tox .tox-number-input button:focus::after{border:2px solid highlight}}.tox .tox-number-input button:hover{background:#f0f0f0;border:0;box-shadow:none;color:#222f3e}.tox .tox-number-input button:hover svg{fill:#222f3e}.tox .tox-number-input button:active{background:#a6ccf7;border:0;box-shadow:none;color:#222f3e}.tox .tox-number-input button:active svg{fill:#222f3e}.tox .tox-number-input button:disabled{background:#fff;border:0;box-shadow:none;color:rgba(34,47,62,.5);cursor:not-allowed}.tox .tox-number-input button:disabled svg{fill:rgba(34,47,62,0.5)}.tox .tox-number-input button.minus{border-radius:3px 0 0 3px}.tox .tox-number-input button.plus{border-radius:0 3px 3px 0}.tox .tox-number-input:focus:not(:active)>.tox-input-wrapper,.tox .tox-number-input:focus:not(:active)>button{background:#f7f7f7}.tox .tox-tbtn--select{margin:6px 1px 5px 0;padding:0 4px;width:auto}.tox .tox-tbtn--bordered,.tox .tox-tbtn--bordered:focus,.tox .tox-tbtn--bordered:hover{border:1px solid #eee}.tox .tox-tbtn__select-label{cursor:default;font-weight:400;height:initial;margin:0 4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tox .tox-tbtn__select-chevron{align-items:center;display:flex;justify-content:center;width:16px}.tox .tox-tbtn__select-chevron svg{fill:rgba(34,47,62,0.5)}@media (forced-colors:active){.tox .tox-tbtn__select-chevron svg{fill:currentColor}}.tox .tox-tbtn--bespoke{background:#f7f7f7}.tox .tox-tbtn--bespoke:focus{background:#f7f7f7}.tox .tox-tbtn--bespoke+.tox-tbtn--bespoke{margin-inline-start:4px}.tox .tox-tbtn--bespoke .tox-tbtn__select-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:7em}.tox .tox-tbtn--disabled .tox-tbtn__select-label,.tox .tox-tbtn--select:disabled .tox-tbtn__select-label{cursor:not-allowed}.tox .tox-split-button{border:0;border-radius:3px;box-sizing:border-box;display:flex;margin:6px 1px 5px 0}.tox .tox-split-button:hover{box-shadow:0 0 0 1px #f0f0f0 inset}.tox .tox-split-button:focus{background:#fff;box-shadow:none;color:#222f3e;position:relative;z-index:1}.tox .tox-split-button:focus::after{pointer-events:none;border-radius:3px;bottom:0;box-shadow:0 0 0 2px #006ce7;content:\'\';left:0;position:absolute;right:0;top:0}@media (forced-colors:active){.tox .tox-split-button:focus::after{border:2px solid highlight}}.tox .tox-split-button>*{border-radius:0}.tox .tox-split-button>:first-child{border-bottom-left-radius:3px;border-top-left-radius:3px}.tox .tox-split-button>:nth-child(2){border-bottom-right-radius:3px;border-top-right-radius:3px}.tox .tox-split-button__chevron{width:16px}.tox .tox-split-button__chevron svg{fill:rgba(34,47,62,0.5)}@media (forced-colors:active){.tox .tox-split-button__chevron svg{fill:currentColor}}.tox .tox-split-button .tox-tbtn{margin:0}.tox .tox-split-button:focus .tox-tbtn{background-color:transparent}.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:focus,.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:hover,.tox .tox-split-button.tox-tbtn--disabled:focus,.tox .tox-split-button.tox-tbtn--disabled:hover{background:#fff;box-shadow:none;color:rgba(34,47,62,.5)}.tox.tox-platform-touch .tox-split-button .tox-tbtn--select{padding:0 0}.tox.tox-platform-touch .tox-split-button .tox-tbtn:not(.tox-tbtn--select):first-child{width:30px}.tox.tox-platform-touch .tox-split-button__chevron{width:20px}.tox .tox-split-button.tox-tbtn--disabled svg .tox-icon-highlight-bg-color__color,.tox .tox-split-button.tox-tbtn--disabled svg .tox-icon-text-color__color{opacity:.3}.tox .tox-toolbar-overlord{background-color:#fff}.tox .tox-toolbar,.tox .tox-toolbar__overflow,.tox .tox-toolbar__primary{background-attachment:local;background-color:#fff;background-image:repeating-linear-gradient(#e3e3e3 0 1px,transparent 1px 39px);background-position:center top 40px;background-repeat:no-repeat;background-size:calc(100% - 11px * 2) calc(100% - 41px);display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:wrap;padding:0 0;transform:perspective(1px)}.tox .tox-toolbar-overlord>.tox-toolbar,.tox .tox-toolbar-overlord>.tox-toolbar__overflow,.tox .tox-toolbar-overlord>.tox-toolbar__primary{background-position:center top 0;background-size:calc(100% - 11px * 2) calc(100% - 0px)}.tox .tox-toolbar__overflow.tox-toolbar__overflow--closed{height:0;opacity:0;padding-bottom:0;padding-top:0;visibility:hidden}.tox .tox-toolbar__overflow--growing{transition:height .3s ease,opacity .2s linear .1s}.tox .tox-toolbar__overflow--shrinking{transition:opacity .3s ease,height .2s linear .1s,visibility 0s linear .3s}.tox .tox-anchorbar,.tox .tox-toolbar-overlord{grid-column:1/-1}.tox .tox-menubar+.tox-toolbar,.tox .tox-menubar+.tox-toolbar-overlord{border-top:1px solid transparent;margin-top:-1px;padding-bottom:1px;padding-top:1px}@media (forced-colors:active){.tox .tox-menubar+.tox-toolbar,.tox .tox-menubar+.tox-toolbar-overlord{outline:1px solid currentColor}}.tox .tox-toolbar--scrolling{flex-wrap:nowrap;overflow-x:auto}.tox .tox-pop .tox-toolbar{border-width:0}.tox .tox-toolbar--no-divider{background-image:none}.tox .tox-toolbar-overlord .tox-toolbar:not(.tox-toolbar--scrolling):first-child,.tox .tox-toolbar-overlord .tox-toolbar__primary{background-position:center top 39px}.tox .tox-editor-header>.tox-toolbar--scrolling,.tox .tox-toolbar-overlord .tox-toolbar--scrolling:first-child{background-image:none}.tox .tox-focusable-wrapper{border:1px solid transparent;margin-right:2px;pointer-events:none}.tox .tox-focusable-wrapper .tox-textfield-size{pointer-events:all}.tox .tox-focusable-wrapper:focus{background-color:#f7f7f7;border-radius:6px;border-style:solid;border-width:1px}.tox.tox-tinymce-aux .tox-toolbar__overflow{background-color:#fff;background-position:center top 43px;background-size:calc(100% - 8px * 2) calc(100% - 51px);border:none;border-radius:6px;box-shadow:0 0 2px 0 rgba(34,47,62,.2),0 4px 8px 0 rgba(34,47,62,.15);overscroll-behavior:none;padding:4px 0}@media (forced-colors:active){.tox.tox-tinymce-aux .tox-toolbar__overflow{border:solid}}.tox-pop .tox-pop__dialog .tox-toolbar{background-position:center top 43px;background-size:calc(100% - 11px * 2) calc(100% - 51px);padding:4px 0}.tox-context-form__group{display:flex;align-items:center}.tox .tox-toolbar__group{align-items:center;display:flex;flex-wrap:wrap;margin:0 0;padding:0 11px 0 12px}.tox .tox-toolbar__group--pull-right{margin-left:auto}.tox .tox-toolbar--scrolling .tox-toolbar__group{flex-shrink:0;flex-wrap:nowrap}.tox:not([dir=rtl]) .tox-toolbar__group:not(:last-of-type){border-right:1px solid transparent}.tox[dir=rtl] .tox-toolbar__group:not(:last-of-type){border-left:1px solid transparent}.tox .tox-tooltip{display:inline-block;max-width:15em;padding:8px;pointer-events:none;position:relative;width:max-content;z-index:1150}.tox .tox-tooltip__body{background-color:#222f3e;border-radius:6px;box-shadow:none;color:#fff;font-size:12px;font-style:normal;font-weight:600;overflow-wrap:break-word;padding:4px 6px;text-transform:none}@media (forced-colors:active){.tox .tox-tooltip__body{outline:outset 1px}}.tox .tox-tooltip__arrow{position:absolute}.tox .tox-tooltip--down .tox-tooltip__arrow{border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #222f3e;bottom:0;left:50%;position:absolute;transform:translateX(-50%)}.tox .tox-tooltip--up .tox-tooltip__arrow{border-bottom:8px solid #222f3e;border-left:8px solid transparent;border-right:8px solid transparent;left:50%;position:absolute;top:0;transform:translateX(-50%)}.tox .tox-tooltip--right .tox-tooltip__arrow{border-bottom:8px solid transparent;border-left:8px solid #222f3e;border-top:8px solid transparent;position:absolute;right:0;top:50%;transform:translateY(-50%)}.tox .tox-tooltip--left .tox-tooltip__arrow{border-bottom:8px solid transparent;border-right:8px solid #222f3e;border-top:8px solid transparent;left:0;position:absolute;top:50%;transform:translateY(-50%)}.tox .tox-tree{display:flex;flex-direction:column}.tox .tox-tree .tox-trbtn{align-items:center;background:0 0;border:0;border-radius:4px;box-shadow:none;color:#222f3e;display:flex;flex:0 0 auto;font-size:14px;font-style:normal;font-weight:400;height:28px;margin-bottom:4px;margin-top:4px;outline:0;overflow:hidden;padding:0;padding-left:8px;text-transform:none}.tox .tox-tree .tox-trbtn .tox-tree__label{cursor:default;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tox .tox-tree .tox-trbtn svg{display:block;fill:#222f3e}.tox .tox-tree .tox-trbtn:focus{background:#f0f0f0;border:0;box-shadow:none}.tox .tox-tree .tox-trbtn:hover{background:#f0f0f0;border:0;box-shadow:none;color:#222f3e}.tox .tox-tree .tox-trbtn:hover svg{fill:#222f3e}.tox .tox-tree .tox-trbtn:active{background:#a6ccf7;border:0;box-shadow:none;color:#222f3e}.tox .tox-tree .tox-trbtn:active svg{fill:#222f3e}.tox .tox-tree .tox-trbtn--disabled,.tox .tox-tree .tox-trbtn--disabled:hover,.tox .tox-tree .tox-trbtn:disabled,.tox .tox-tree .tox-trbtn:disabled:hover{background:0 0;border:0;box-shadow:none;color:rgba(34,47,62,.5);cursor:not-allowed}.tox .tox-tree .tox-trbtn--disabled svg,.tox .tox-tree .tox-trbtn--disabled:hover svg,.tox .tox-tree .tox-trbtn:disabled svg,.tox .tox-tree .tox-trbtn:disabled:hover svg{fill:rgba(34,47,62,0.5)}.tox .tox-tree .tox-trbtn--enabled,.tox .tox-tree .tox-trbtn--enabled:hover{background:#a6ccf7;border:0;box-shadow:none;color:#222f3e}.tox .tox-tree .tox-trbtn--enabled:hover>*,.tox .tox-tree .tox-trbtn--enabled>*{transform:none}.tox .tox-tree .tox-trbtn--enabled svg,.tox .tox-tree .tox-trbtn--enabled:hover svg{fill:#222f3e}.tox .tox-tree .tox-trbtn:focus:not(.tox-trbtn--disabled){color:#222f3e}.tox .tox-tree .tox-trbtn:focus:not(.tox-trbtn--disabled) svg{fill:#222f3e}.tox .tox-tree .tox-trbtn:active>*{transform:none}.tox .tox-tree .tox-trbtn--return{align-self:stretch;height:unset;width:16px}.tox .tox-tree .tox-trbtn--labeled{padding:0 4px;width:unset}.tox .tox-tree .tox-trbtn__vlabel{display:block;font-size:10px;font-weight:400;letter-spacing:-.025em;margin-bottom:4px;white-space:nowrap}.tox .tox-tree .tox-tree--directory{display:flex;flex-direction:column}.tox .tox-tree .tox-tree--directory .tox-tree--directory__label{font-weight:700}.tox .tox-tree .tox-tree--directory .tox-tree--directory__label .tox-mbtn{margin-left:auto}.tox .tox-tree .tox-tree--directory .tox-tree--directory__label .tox-mbtn svg{fill:transparent}.tox .tox-tree .tox-tree--directory .tox-tree--directory__label .tox-mbtn.tox-mbtn--active svg,.tox .tox-tree .tox-tree--directory .tox-tree--directory__label .tox-mbtn:focus svg{fill:#222f3e}.tox .tox-tree .tox-tree--directory .tox-tree--directory__label:focus .tox-mbtn svg,.tox .tox-tree .tox-tree--directory .tox-tree--directory__label:hover .tox-mbtn svg{fill:#222f3e}.tox .tox-tree .tox-tree--directory .tox-tree--directory__label:hover:has(.tox-mbtn:hover){background-color:transparent;color:#222f3e}.tox .tox-tree .tox-tree--directory .tox-tree--directory__label:hover:has(.tox-mbtn:hover) .tox-chevron svg{fill:#222f3e}.tox .tox-tree .tox-tree--directory .tox-tree--directory__label .tox-chevron{margin-right:6px}.tox .tox-tree .tox-tree--directory .tox-tree--directory__label:has(+ .tox-tree--directory__children--growing) .tox-chevron,.tox .tox-tree .tox-tree--directory .tox-tree--directory__label:has(+ .tox-tree--directory__children--shrinking) .tox-chevron{transition:transform .5s ease-in-out}.tox .tox-tree .tox-tree--directory .tox-tree--directory__label:has(+ .tox-tree--directory__children--growing) .tox-chevron,.tox .tox-tree .tox-tree--directory .tox-tree--directory__label:has(+ .tox-tree--directory__children--open) .tox-chevron{transform:rotate(90deg)}.tox .tox-tree .tox-tree--leaf__label{font-weight:400}.tox .tox-tree .tox-tree--leaf__label .tox-mbtn{margin-left:auto}.tox .tox-tree .tox-tree--leaf__label .tox-mbtn svg{fill:transparent}.tox .tox-tree .tox-tree--leaf__label .tox-mbtn.tox-mbtn--active svg,.tox .tox-tree .tox-tree--leaf__label .tox-mbtn:focus svg{fill:#222f3e}.tox .tox-tree .tox-tree--leaf__label:hover .tox-mbtn svg{fill:#222f3e}.tox .tox-tree .tox-tree--leaf__label:hover:has(.tox-mbtn:hover){background-color:transparent;color:#222f3e}.tox .tox-tree .tox-tree--leaf__label:hover:has(.tox-mbtn:hover) .tox-chevron svg{fill:#222f3e}.tox .tox-tree .tox-icon-custom-state{flex-grow:1;display:flex;justify-content:flex-end}.tox .tox-tree .tox-tree--directory__children{overflow:hidden;padding-left:16px}.tox .tox-tree .tox-tree--directory__children.tox-tree--directory__children--growing,.tox .tox-tree .tox-tree--directory__children.tox-tree--directory__children--shrinking{transition:height .5s ease-in-out}.tox .tox-tree .tox-trbtn.tox-tree--leaf__label{display:flex;justify-content:space-between}.tox .tox-revisionhistory__pane{padding:0!important}.tox .tox-revisionhistory__container{display:flex;flex-direction:column;height:100%}.tox .tox-revisionhistory{background-color:#fff;border-top:1px solid #f0f0f0;display:flex;flex:1;height:100%;margin-top:8px;overflow-x:auto;overflow-y:hidden;position:relative;width:100%}.tox .tox-revisionhistory--align-right{margin-left:auto}.tox .tox-revisionhistory__iframe{flex:1}.tox .tox-revisionhistory__sidebar{display:flex;flex-direction:column;height:100%;min-width:248px;width:316px}.tox .tox-revisionhistory__sidebar .tox-revisionhistory__sidebar-title{background-color:#fff;box-shadow:0 4px 8px 0 rgba(34,47,62,.1);color:#222f3e;font-size:20px;font-weight:400;line-height:28px;padding:12px;z-index:1}.tox .tox-revisionhistory__sidebar .tox-revisionhistory__revisions{background-color:#f0f0f0;display:flex;flex:1;flex-direction:column;gap:12px;overflow-y:auto;padding:10px 12px}.tox .tox-revisionhistory__sidebar .tox-revisionhistory__revisions:focus{height:100%;position:relative;z-index:1}.tox .tox-revisionhistory__sidebar .tox-revisionhistory__revisions:focus::after{border-radius:3px;bottom:0;box-shadow:0 0 0 2px #006ce7;content:\'\';left:0;position:absolute;right:0;top:0;border-radius:6px;bottom:1px;left:1px;right:1px;top:1px}@media (forced-colors:active){.tox .tox-revisionhistory__sidebar .tox-revisionhistory__revisions:focus::after{border:2px solid highlight}}.tox .tox-revisionhistory__sidebar .tox-revisionhistory__revisions .tox-revisionhistory__card{background-color:#fff;border:1px solid #f0f0f0;border-radius:6px;color:#222f3e;cursor:pointer;display:flex;flex-direction:column;font-size:14px;gap:12px;padding:12px;width:100%}.tox .tox-revisionhistory__sidebar .tox-revisionhistory__revisions .tox-revisionhistory__card:hover{box-shadow:0 4px 8px 0 rgba(34,47,62,.1)}.tox .tox-revisionhistory__sidebar .tox-revisionhistory__revisions .tox-revisionhistory__card:focus{position:relative;z-index:1}.tox .tox-revisionhistory__sidebar .tox-revisionhistory__revisions .tox-revisionhistory__card:focus::after{border-radius:3px;bottom:0;box-shadow:0 0 0 2px #006ce7 #006ce7;content:\'\';left:0;position:absolute;right:0;top:0;border-radius:6px;box-shadow:0 0 0 2px #006ce7;box-shadow:0 0 0 2px #006ce7!important}@media (forced-colors:active){.tox .tox-revisionhistory__sidebar .tox-revisionhistory__revisions .tox-revisionhistory__card:focus::after{border:2px solid highlight}}.tox .tox-revisionhistory__sidebar .tox-revisionhistory__revisions .tox-revisionhistory__card.tox-revisionhistory__card--selected{background-color:#fff5cc;box-shadow:0 4px 8px 0 rgba(34,47,62,.1);position:relative}.tox .tox-revisionhistory__sidebar .tox-revisionhistory__revisions .tox-revisionhistory__card.tox-revisionhistory__card--selected::after{border-radius:3px;bottom:0;box-shadow:0 0 0 2px #006ce7 #e3b82a;content:\'\';left:0;position:absolute;right:0;top:0;border-radius:6px;box-shadow:0 0 0 2px #e3b82a}@media (forced-colors:active){.tox .tox-revisionhistory__sidebar .tox-revisionhistory__revisions .tox-revisionhistory__card.tox-revisionhistory__card--selected::after{border:2px solid highlight}}.tox .tox-revisionhistory__sidebar .tox-revisionhistory__revisions .tox-revisionhistory__card-date{display:flex;gap:12px;justify-content:space-between}.tox .tox-revisionhistory__sidebar .tox-revisionhistory__revisions .tox-revisionhistory__card-date-label{font-size:16px;line-height:24px}.tox .tox-revisionhistory__sidebar .tox-revisionhistory__revisions .tox-revisionhistory__card-label{font-size:12px;font-weight:600;line-height:24px;padding:0}.tox .tox-revisionhistory__sidebar .tox-revisionhistory__revisions .tox-revisionhistory__card-author{align-items:center;display:flex;flex:1 0 0;gap:8px;height:36px}.tox .tox-revisionhistory__sidebar .tox-revisionhistory__revisions .tox-revisionhistory__card-author-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:700;line-height:18px}.tox .tox-revisionhistory__sidebar .tox-revisionhistory__revisions .tox-revisionhistory__avatar{border-radius:50%;height:36px;object-fit:cover;vertical-align:middle;width:36px}.tox .tox-revisionhistory__sidebar .tox-revisionhistory__revisions .tox-revisionhistory__norevision{color:rgba(34,47,62,.7);font-size:16px;line-height:24px;padding:5px 5.5px}.tox .tox-revisionhistory__sidebar .tox-revisionhistory__revisions .tox-revisionhistory__card-check-icon{color:#222f3e;height:24px}[data-mce-name=uploadcare-enhance-filter] .color-swatch-remove-color path{fill:#c00;stroke:#c00}.tox .tox-view-wrap,.tox .tox-view-wrap__slot-container{background-color:#fff;display:flex;flex:1;flex-direction:column;height:100%}.tox .tox-view{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.tox .tox-view__header{align-items:center;display:flex;font-size:16px;justify-content:space-between;padding:10px 10px 2px 10px;position:relative}.tox .tox-view__label{color:#222f3e;font-weight:700;line-height:24px;padding:4px 16px;text-align:center;white-space:nowrap}.tox .tox-view__label--normal{font-size:16px}.tox .tox-view__label--large{font-size:20px}.tox .tox-view--mobile.tox-view__header,.tox .tox-view--mobile.tox-view__toolbar{padding:8px}.tox .tox-view--scrolling{flex-wrap:nowrap;overflow-x:auto}.tox .tox-view__toolbar{display:flex;flex-direction:row;gap:8px;justify-content:space-between;overflow-x:auto;padding:10px 10px 2px 10px}.tox .tox-view__toolbar__group{display:flex;flex-direction:row;gap:12px}.tox .tox-view__header-end,.tox .tox-view__header-start{display:flex}.tox .tox-view__pane{height:100%;padding:8px;position:relative;width:100%}.tox .tox-view__pane_panel{border:1px solid #eee;border-radius:6px}.tox:not([dir=rtl]) .tox-view__header .tox-view__header-end>*,.tox:not([dir=rtl]) .tox-view__header .tox-view__header-start>*{margin-left:8px}.tox[dir=rtl] .tox-view__header .tox-view__header-end>*,.tox[dir=rtl] .tox-view__header .tox-view__header-start>*{margin-right:8px}.tox .tox-well{border:1px solid #eee;border-radius:6px;padding:8px;width:100%}.tox .tox-well>:first-child{margin-top:0}.tox .tox-well>:last-child{margin-bottom:0}.tox .tox-well>:only-child{margin:0}.tox .tox-custom-editor{border:1px solid #eee;border-radius:6px;display:flex;flex:1;overflow:hidden;position:relative}.tox .tox-dialog-loading::before{background-color:rgba(0,0,0,.5);content:"";height:100%;position:absolute;width:100%;z-index:1000}.tox .tox-tab{cursor:pointer}.tox .tox-dialog__content-js{display:flex;flex:1}.tox .tox-dialog__body-content .tox-collection{display:flex;flex:1}')},73586:()=>{!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=r=e,n=(a=String).prototype,n.isPrototypeOf(o)||(null===(s=r.constructor)||void 0===s?void 0:s.name)===a.name)?"string":t;var o,n;var r,a,s})(t)===e,o=e=>t=>typeof t===e,n=t("string"),r=t("object"),a=t("array"),s=(i=null,e=>i===e);var i;const l=o("boolean"),c=e=>!(e=>null==e)(e),d=o("function"),m=(e,t)=>{if(a(e)){for(let o=0,n=e.length;o<n;++o)if(!t(e[o]))return!1;return!0}return!1},u=()=>{},g=(e,t)=>e===t;class p{constructor(e,t){this.tag=e,this.value=t}static some(e){return new p(!0,e)}static none(){return p.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?p.some(e(this.value)):p.none()}bind(e){return this.tag?e(this.value):p.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:p.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return c(e)?p.some(e):p.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}p.singletonNone=new p(!1);Array.prototype.slice;const h=Array.prototype.indexOf,f=Array.prototype.push,b=(e,t)=>((e,t)=>h.call(e,t))(e,t)>-1,x=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!a(e[o]))throw new Error("Arr.flatten item "+o+" was not an array, input: "+e);f.apply(t,e[o])}return t},v=(e,t)=>x(((e,t)=>{const o=e.length,n=new Array(o);for(let r=0;r<o;r++){const o=e[r];n[r]=t(o,r)}return n})(e,t));d(Array.from)&&Array.from;const y=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome())return n}return p.none()},w=Object.keys,_=Object.hasOwnProperty,C=(e,t,o,n)=>{((e,t)=>{const o=w(e);for(let n=0,r=o.length;n<r;n++){const r=o[n];t(e[r],r)}})(e,(e,r)=>{(t(e,r)?o:n)(e,r)})},k=(e,t)=>_.call(e,t),S=(e,t,o=g)=>e.exists(e=>o(e,t)),E=e=>{const t=[],o=e=>{t.push(e)};for(let t=0;t<e.length;t++)e[t].each(o);return t},O=(e,t)=>e?p.some(t):p.none(),T=()=>{const e=(e=>{const t=(e=>{let t=e;return{get:()=>t,set:e=>{t=e}}})(p.none()),o=()=>t.get().each(e);return{clear:()=>{o(),t.set(p.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{o(),t.set(p.some(e))}}})(u);return{...e,on:t=>e.get().each(t)}},A=(e,t)=>((e,t,o)=>""===t||e.length>=t.length&&e.substr(o,o+t.length)===t)(e,t,0),D=e=>t=>t.options.get(e),M=D("link_assume_external_targets"),R=D("link_context_toolbar"),N=D("link_list"),B=D("link_default_target"),z=D("link_default_protocol"),H=D("link_target_list"),L=D("link_rel_list"),I=D("link_class_list"),P=D("link_title"),F=D("allow_unsafe_link_target"),V=D("link_quicklink"),Z=D("link_attributes_postprocess");var U=tinymce.util.Tools.resolve("tinymce.util.URI"),j=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),W=tinymce.util.Tools.resolve("tinymce.util.Tools");const $=e=>c(e)&&"a"===e.nodeName.toLowerCase(),q=e=>$(e)&&!!Y(e),G=(e,t)=>{if(e.collapsed)return[];{const o=e.cloneContents(),n=o.firstChild,r=new j(n,o),a=[];let s=n;do{t(s)&&a.push(s)}while(s=r.next());return a}},K=e=>/^\w+:/i.test(e),Y=e=>{var t,o;return null!==(o=null!==(t=e.getAttribute("data-mce-href"))&&void 0!==t?t:e.getAttribute("href"))&&void 0!==o?o:""},X=(e,t)=>{const o=["noopener"],n=e?e.split(/\s+/):[],r=e=>e.filter(e=>-1===W.inArray(o,e)),a=t?(e=>(e=r(e)).length>0?e.concat(o):o)(n):r(n);return a.length>0?(e=>W.trim(e.sort().join(" ")))(a):""},J=(e,t)=>(t=t||te(e.selection.getRng())[0]||e.selection.getNode(),ae(t)?p.from(e.dom.select("a[href]",t)[0]):p.from(e.dom.getParent(t,"a[href]"))),Q=(e,t)=>J(e,t).isSome(),ee=(e,t)=>(e=>e.replace(/\uFEFF/g,""))(t.fold(()=>e.getContent({format:"text"}),e=>e.innerText||e.textContent||"")),te=e=>G(e,q),oe=e=>W.grep(e,q),ne=e=>oe(e).length>0,re=e=>{const t=e.schema.getTextInlineElements(),o=e=>1===e.nodeType&&!$(e)&&!k(t,e.nodeName.toLowerCase());if(J(e).exists(e=>e.hasAttribute("data-mce-block")))return!1;const n=e.selection.getRng();if(n.collapsed)return!0;return 0===G(n,o).length},ae=e=>c(e)&&"FIGURE"===e.nodeName&&/\bimage\b/i.test(e.className),se=(e,t)=>{const o={...t};if(0===L(e).length&&!F(e)){const e=X(o.rel,"_blank"===o.target);o.rel=e||null}return p.from(o.target).isNone()&&!1===H(e)&&(o.target=B(e)),o.href=((e,t)=>"http"!==t&&"https"!==t||K(e)?e:t+"://"+e)(o.href,M(e)),o},ie=(e,t,o)=>{const n=e.selection.getNode(),r=J(e,n),a=se(e,(e=>{return t=["title","rel","class","target"],o=(t,o)=>(e[o].each(e=>{t[o]=e.length>0?e:null}),t),n={href:e.href},((e,t)=>{for(let o=0,n=e.length;o<n;o++)t(e[o],o)})(t,(e,t)=>{n=o(n,e,t)}),n;var t,o,n})(o)),s=Z(e);c(s)&&s(a),e.undoManager.transact(()=>{o.href===t.href&&t.attach(),r.fold(()=>{((e,t,o,n)=>{const r=e.dom;ae(t)?ue(r,t,n):o.fold(()=>{e.execCommand("mceInsertLink",!1,n);const t=e.selection.getEnd(),o=r.createRng();o.setStartAfter(t),o.setEndAfter(t),e.selection.setRng(o)},t=>{e.insertContent(r.createHTML("a",n,r.encode(t)))})})(e,n,o.text,a)},t=>{e.focus(),((e,t,o,n)=>{o.each(e=>{k(t,"innerText")?t.innerText=e:t.textContent=e}),e.dom.setAttribs(t,n);const r=e.dom.createRng();r.setStartAfter(t),r.setEndAfter(t),e.selection.setRng(r)})(e,t,o.text,a)})})},le=e=>{const{class:t,href:o,rel:n,target:r,text:a,title:i}=e;return((e,t)=>{const o={};var n;return C(e,t,(n=o,(e,t)=>{n[t]=e}),u),o})({class:t.getOrNull(),href:o,rel:n.getOrNull(),target:r.getOrNull(),text:a.getOrNull(),title:i.getOrNull()},(e,t)=>!1===s(e))},ce=(e,t,o)=>{const n=((e,t)=>{const o=e.options.get,n={allow_html_data_urls:o("allow_html_data_urls"),allow_script_urls:o("allow_script_urls"),allow_svg_data_urls:o("allow_svg_data_urls")},r=t.href;return{...t,href:U.isDomSafe(r,"a",n)?r:""}})(e,o);e.hasPlugin("rtc",!0)?e.execCommand("createlink",!1,le(n)):ie(e,t,n)},de=e=>{e.hasPlugin("rtc",!0)?e.execCommand("unlink"):(e=>{e.undoManager.transact(()=>{const t=e.selection.getNode();ae(t)?me(e,t):(e=>{const t=e.dom,o=e.selection,n=o.getBookmark(),r=o.getRng().cloneRange(),a=t.getParent(r.startContainer,"a[href]",e.getBody()),s=t.getParent(r.endContainer,"a[href]",e.getBody());a&&r.setStartBefore(a),s&&r.setEndAfter(s),o.setRng(r),e.execCommand("unlink"),o.moveToBookmark(n)})(e),e.focus()})})(e)},me=(e,t)=>{var o;const n=e.dom.select("img",t)[0];if(n){const r=e.dom.getParents(n,"a[href]",t)[0];r&&(null===(o=r.parentNode)||void 0===o||o.insertBefore(n,r),e.dom.remove(r))}},ue=(e,t,o)=>{var n;const r=e.select("img",t)[0];if(r){const t=e.create("a",o);null===(n=r.parentNode)||void 0===n||n.insertBefore(t,r),t.appendChild(r)}},ge=e=>n(e.value)?e.value:"",pe=(e,t)=>{const o=[];return W.each(e,e=>{const r=(e=>n(e.text)?e.text:n(e.title)?e.title:"")(e);if(void 0!==e.menu){const n=pe(e.menu,t);o.push({text:r,items:n})}else{const n=t(e);o.push({text:r,value:n})}}),o},he=(e=ge)=>t=>p.from(t).map(t=>pe(t,e)),fe={sanitize:e=>he(ge)(e),sanitizeWith:he,createUi:(e,t)=>o=>({name:e,type:"listbox",label:t,items:o}),getValue:ge},be=e=>{return k(t=e,o="items")&&void 0!==t[o]&&null!==t[o];var t,o},xe=(e,t)=>y(t,t=>be(t)?xe(e,t.items):O(t.value===e,t)),ve=(e,t,o,n)=>{const r=n[t],a=e.length>0;return void 0!==r?xe(r,o).map(t=>({url:{value:t.value,meta:{text:a?e:t.text,attach:u}},text:a?e:t.text})):p.none()},ye=(e,t)=>{const o={text:e.text,title:e.title},n=e=>{const t=(n=e.url,O(o.text.length<=0,p.from(null===(r=n.meta)||void 0===r?void 0:r.text).getOr(n.value)));var n,r;const a=(e=>{var t;return O(o.title.length<=0,p.from(null===(t=e.meta)||void 0===t?void 0:t.title).getOr(""))})(e.url);return t.isSome()||a.isSome()?p.some({...t.map(e=>({text:e})).getOr({}),...a.map(e=>({title:e})).getOr({})}):p.none()},r=(e,n)=>{const r=(a=t,s=n,"link"===s?a.link:"anchor"===s?a.anchor:p.none()).getOr([]);var a,s;return ve(o.text,n,r,e)};return{onChange:(e,t)=>{const a=t.name;return"url"===a?n(e()):b(["anchor","link"],a)?r(e(),a):"text"===a||"title"===a?(o[a]=e()[a],p.none()):p.none()}}};var we=tinymce.util.Tools.resolve("tinymce.util.Delay");const _e=e=>{const t=e.href;return t.indexOf("@")>0&&-1===t.indexOf("/")&&-1===t.indexOf("mailto:")?p.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:e=>({...e,href:"mailto:"+t})}):p.none()},Ce=(e,t)=>o=>{const n=o.href;return 1===e&&!K(n)||0===e&&/^\s*www(\.|\d\.)/i.test(n)?p.some({message:`The URL you entered seems to be an external link. Do you want to add the required ${t}:// prefix?`,preprocess:e=>({...e,href:t+"://"+n})}):p.none()},ke=(e,t)=>y([_e,Ce(M(e),z(e))],e=>e(t)).fold(()=>Promise.resolve(t),o=>new Promise(n=>{((e,t,o)=>{const n=e.selection.getRng();we.setEditorTimeout(e,()=>{e.windowManager.confirm(t,t=>{e.selection.setRng(n),o(t)})})})(e,o.message,e=>{n(e?o.preprocess(t):t)})})),Se=e=>{const t=e.dom.select("a:not([href])"),o=v(t,e=>{const t=e.name||e.id;return t?[{text:t,value:"#"+t}]:[]});return o.length>0?p.some([{text:"None",value:""}].concat(o)):p.none()},Ee=e=>{const t=I(e);return t.length>0?fe.sanitize(t):p.none()},Oe=e=>{try{return p.some(JSON.parse(e))}catch(e){return p.none()}},Te=e=>{const t=t=>e.convertURL(t.value||t.url||"","href"),o=N(e);return new Promise(e=>{n(o)?fetch(o).then(e=>e.ok?e.text().then(Oe):Promise.reject()).then(e,()=>e(p.none())):d(o)?o(t=>e(p.some(t))):e(p.from(o))}).then(e=>e.bind(fe.sanitizeWith(t)).map(e=>{if(e.length>0){return[{text:"None",value:""}].concat(e)}return e}))},Ae=(e,t)=>{const o=L(e);if(o.length>0){const n=S(t,"_blank"),r=e=>X(fe.getValue(e),n);return(!1===F(e)?fe.sanitizeWith(r):fe.sanitize)(o)}return p.none()},De=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Me=e=>{const t=H(e);return a(t)?fe.sanitize(t).orThunk(()=>p.some(De)):!1===t?p.none():p.some(De)},Re=(e,t,o)=>{const n=e.getAttrib(t,o);return null!==n&&n.length>0?p.some(n):p.none()},Ne=(e,t)=>Te(e).then(o=>{const n=((e,t)=>{const o=e.dom,n=re(e)?p.some(ee(e.selection,t)):p.none(),r=t.bind(e=>p.from(o.getAttrib(e,"href"))),a=t.bind(e=>p.from(o.getAttrib(e,"target"))),s=t.bind(e=>Re(o,e,"rel")),i=t.bind(e=>Re(o,e,"class"));return{url:r,text:n,title:t.bind(e=>Re(o,e,"title")),target:a,rel:s,linkClass:i}})(e,t);return{anchor:n,catalogs:{targets:Me(e),rels:Ae(e,n.target),classes:Ee(e),anchor:Se(e),link:o},optNode:t,flags:{titleEnabled:P(e)}}}),Be=e=>{const t=(e=>{const t=J(e);return Ne(e,t)})(e);t.then(t=>{const o=((e,t)=>o=>{const n=o.getData();if(!n.url.value)return de(e),void o.close();const r=e=>p.from(n[e]).filter(o=>!S(t.anchor[e],o)),a={href:n.url.value,text:r("text"),target:r("target"),rel:r("rel"),class:r("linkClass"),title:r("title")},s={href:n.url.value,attach:void 0!==n.url.meta&&n.url.meta.attach?n.url.meta.attach:u};ke(e,a).then(t=>{ce(e,s,t)}),o.close()})(e,t);return((e,t,o)=>{const n=e.anchor.text.map(()=>({name:"text",type:"input",label:"Text to display"})).toArray(),r=e.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],a=((e,t)=>{const o=e.anchor,n=o.url.getOr("");return{url:{value:n,meta:{original:{value:n}}},text:o.text.getOr(""),title:o.title.getOr(""),anchor:n,link:n,rel:o.rel.getOr(""),target:o.target.or(t).getOr(""),linkClass:o.linkClass.getOr("")}})(e,p.from(B(o))),s=e.catalogs,i=ye(a,s);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:x([[{name:"url",type:"urlinput",filetype:"file",label:"URL",picker_text:"Browse links"}],n,r,E([s.anchor.map(fe.createUi("anchor","Anchors")),s.rels.map(fe.createUi("rel","Rel")),s.targets.map(fe.createUi("target","Open link in...")),s.link.map(fe.createUi("link","Link list")),s.classes.map(fe.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:a,onChange:(e,{name:t})=>{i.onChange(e.getData,{name:t}).each(t=>{e.setData(t)})},onSubmit:t}})(t,o,e)}).then(t=>{e.windowManager.open(t)})};var ze=tinymce.util.Tools.resolve("tinymce.util.VK");const He=e=>{const t=document.createElement("a");t.target="_blank",t.href=e,t.rel="noreferrer noopener";const o=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});document.dispatchEvent(o),((e,t)=>{document.body.appendChild(e),e.dispatchEvent(t),document.body.removeChild(e)})(t,o)},Le=(e,t)=>{if(t){const r=Y(t);if(/^#/.test(r)){const t=e.dom.select(`${r},[name="${o=r,n="#",A(o,n)?((e,t)=>e.substring(t))(o,n.length):o}"]`);t.length&&e.selection.scrollIntoView(t[0],!0)}else He(t.href)}var o,n},Ie=(e,t)=>{const o=oe(e.dom.getParents(t));return O(1===o.length,o[0])},Pe=e=>e.selection.isCollapsed()||(e=>{const t=e.selection.getRng(),o=t.startContainer;return q(o)&&t.startContainer===t.endContainer&&1===e.dom.select("img",o).length})(e)?Ie(e,e.selection.getStart()):(e=>{const t=te(e.selection.getRng());return O(t.length>0,t[0]).or(Ie(e,e.selection.getNode()))})(e),Fe=e=>()=>{e.execCommand("mceLink",!1,{dialog:!0})},Ve=(e,t)=>(e.on("NodeChange",t),()=>e.off("NodeChange",t)),Ze=e=>t=>{const o=()=>{t.setActive(!e.mode.isReadOnly()&&Q(e,e.selection.getNode())),t.setEnabled(e.selection.isEditable())};return o(),Ve(e,o)},Ue=e=>t=>{const o=()=>{t.setEnabled(e.selection.isEditable())};return o(),Ve(e,o)},je=e=>t=>{const o=t=>{return ne(t)||(o=e.selection.getRng(),te(o).length>0);var o},n=e.dom.getParents(e.selection.getStart()),r=n=>{t.setEnabled(o(n)&&e.selection.isEditable())};return r(n),Ve(e,e=>r(e.parents))},We=(e,t)=>{const o=t=>{const o=e.selection.getNode();return t.setEnabled(Q(e,o)&&e.selection.isEditable()),u};e.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Ze(e)},label:"Link",predicate:t=>R(e)&&Q(e,t),initValue:()=>J(e).fold((e=>()=>e)(""),Y),commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:t=>{const o=e.selection.getNode();return t.setActive(Q(e,o)),Ze(e)(t)},onAction:t=>{const o=t.getValue(),n=(t=>{const o=J(e),n=re(e);if(o.isNone()&&n){const n=ee(e.selection,o);return O(0===n.length,t)}return p.none()})(o);ce(e,{href:o,attach:u},{href:o,text:n,title:p.none(),rel:p.none(),target:p.from(B(e)),class:p.none()}),(e=>{e.selection.collapse(!1)})(e),t.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:o,onAction:t=>{de(e),t.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:o,onAction:e=>{t.gotoSelectedLink(),e.hide()}}]})},$e=e=>{const t=(e=>{const t=T(),o=()=>t.get().or(Pe(e));return e.on("contextmenu",o=>{Ie(e,o.target).each(t.set)}),e.on("SelectionChange",()=>{t.isSet()||Pe(e).each(t.set)}),e.on("click",o=>{t.clear();const n=oe(e.dom.getParents(o.target));1===n.length&&ze.metaKeyPressed(o)&&(o.preventDefault(),Le(e,n[0]))}),e.on("keydown",n=>{t.clear(),!n.isDefaultPrevented()&&13===n.keyCode&&(e=>!0===e.altKey&&!1===e.shiftKey&&!1===e.ctrlKey&&!1===e.metaKey)(n)&&o().each(t=>{n.preventDefault(),Le(e,t)})}),{gotoSelectedLink:()=>o().each(t=>Le(e,t))}})(e);((e,t)=>{e.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Meta+K",onAction:Fe(e),onSetup:Ze(e)}),e.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:t.gotoSelectedLink,onSetup:je(e)}),e.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:()=>de(e),onSetup:je(e)})})(e,t),((e,t)=>{e.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:t.gotoSelectedLink,onSetup:je(e)}),e.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:Fe(e),onSetup:Ue(e)}),e.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:()=>de(e),onSetup:je(e)})})(e,t),(e=>{e.ui.registry.addContextMenu("link",{update:t=>e.dom.isEditable(t)?ne(e.dom.getParents(t,"a"))?"link unlink openlink":"link":""})})(e),We(e,t)};e.add("link",e=>{(e=>{const t=e.options.register;t("link_assume_external_targets",{processor:e=>{const t=n(e)||l(e);return t?!0===e?{value:1,valid:t}:"http"===e||"https"===e?{value:e,valid:t}:{value:0,valid:t}:{valid:!1,message:"Must be a string or a boolean."}},default:!1}),t("link_context_toolbar",{processor:"boolean",default:!1}),t("link_list",{processor:e=>n(e)||d(e)||m(e,r)}),t("link_default_target",{processor:"string"}),t("link_default_protocol",{processor:"string",default:"https"}),t("link_target_list",{processor:e=>l(e)||m(e,r),default:!0}),t("link_rel_list",{processor:"object[]",default:[]}),t("link_class_list",{processor:"object[]",default:[]}),t("link_title",{processor:"boolean",default:!0}),t("allow_unsafe_link_target",{processor:"boolean",default:!1}),t("link_quicklink",{processor:"boolean",default:!1}),t("link_attributes_postprocess",{processor:"function"})})(e),(e=>{e.addCommand("mceLink",(t,o)=>{!0!==(null==o?void 0:o.dialog)&&V(e)?e.dispatch("contexttoolbar-show",{toolbarKey:"quicklink"}):Be(e)})})(e),$e(e),(e=>{e.addShortcut("Meta+K","",()=>{e.execCommand("mceLink")})})(e)})}()},75916:()=>{!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.ModelManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=r=e,n=(a=String).prototype,n.isPrototypeOf(o)||(null===(s=r.constructor)||void 0===s?void 0:s.name)===a.name)?"string":t;var o,n;var r,a,s})(t)===e,o=e=>t=>typeof t===e,n=e=>t=>e===t,r=t("string"),a=t("object"),s=t("array"),i=n(null),l=o("boolean"),c=n(void 0),d=e=>!(e=>null==e)(e),m=o("function"),u=o("number"),g=()=>{},p=e=>()=>e,h=e=>e,f=(e,t)=>e===t;function b(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const x=e=>t=>!e(t),v=e=>e(),y=p(!1),w=p(!0);class _{constructor(e,t){this.tag=e,this.value=t}static some(e){return new _(!0,e)}static none(){return _.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?_.some(e(this.value)):_.none()}bind(e){return this.tag?e(this.value):_.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:_.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return d(e)?_.some(e):_.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}_.singletonNone=new _(!1);const C=Array.prototype.slice,k=Array.prototype.indexOf,S=Array.prototype.push,E=(e,t)=>{return o=e,n=t,k.call(o,n)>-1;var o,n},O=(e,t)=>{for(let o=0,n=e.length;o<n;o++){if(t(e[o],o))return!0}return!1},T=(e,t)=>{const o=[];for(let n=0;n<e;n++)o.push(t(n));return o},A=(e,t)=>{const o=e.length,n=new Array(o);for(let r=0;r<o;r++){const o=e[r];n[r]=t(o,r)}return n},D=(e,t)=>{for(let o=0,n=e.length;o<n;o++){t(e[o],o)}},M=(e,t)=>{const o=[],n=[];for(let r=0,a=e.length;r<a;r++){const a=e[r];(t(a,r)?o:n).push(a)}return{pass:o,fail:n}},R=(e,t)=>{const o=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];t(r,n)&&o.push(r)}return o},N=(e,t,o)=>(((e,t)=>{for(let o=e.length-1;o>=0;o--)t(e[o],o)})(e,(e,n)=>{o=t(o,e,n)}),o),B=(e,t,o)=>(D(e,(e,n)=>{o=t(o,e,n)}),o),z=(e,t)=>((e,t,o)=>{for(let n=0,r=e.length;n<r;n++){const r=e[n];if(t(r,n))return _.some(r);if(o(r,n))break}return _.none()})(e,t,y),H=(e,t)=>{for(let o=0,n=e.length;o<n;o++){if(t(e[o],o))return _.some(o)}return _.none()},L=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!s(e[o]))throw new Error("Arr.flatten item "+o+" was not an array, input: "+e);S.apply(t,e[o])}return t},I=(e,t)=>L(A(e,t)),P=(e,t)=>{for(let o=0,n=e.length;o<n;++o){if(!0!==t(e[o],o))return!1}return!0},F=(e,t)=>{const o={};for(let n=0,r=e.length;n<r;n++){const r=e[n];o[String(r)]=t(r,n)}return o},V=(e,t)=>t>=0&&t<e.length?_.some(e[t]):_.none(),Z=e=>V(e,0),U=e=>V(e,e.length-1),j=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome())return n}return _.none()},W=Object.keys,$=Object.hasOwnProperty,q=(e,t)=>{const o=W(e);for(let n=0,r=o.length;n<r;n++){const r=o[n];t(e[r],r)}},G=(e,t)=>K(e,(e,o)=>({k:o,v:t(e,o)})),K=(e,t)=>{const o={};return q(e,(e,n)=>{const r=t(e,n);o[r.k]=r.v}),o},Y=(e,t)=>{const o={};return((e,t,o,n)=>{q(e,(e,r)=>{(t(e,r)?o:n)(e,r)})})(e,t,(e=>(t,o)=>{e[o]=t})(o),g),o},X=(e,t)=>{const o=[];return q(e,(e,n)=>{o.push(t(e,n))}),o},J=e=>X(e,h),Q=(e,t)=>$.call(e,t),ee=e=>{if(!s(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");const t=[],o={};return D(e,(n,r)=>{const a=W(n);if(1!==a.length)throw new Error("one and only one name per case");const i=a[0],l=n[i];if(void 0!==o[i])throw new Error("duplicate key detected:"+i);if("cata"===i)throw new Error("cannot have a case named cata (sorry)");if(!s(l))throw new Error("case arguments must be an array");t.push(i),o[i]=(...o)=>{const n=o.length;if(n!==l.length)throw new Error("Wrong number of arguments to case "+i+". Expected "+l.length+" ("+l+"), got "+n);return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[r].apply(null,o)},match:e=>{const n=W(e);if(t.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","));if(!P(t,e=>E(n,e)))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "));return e[i].apply(null,o)},log:e=>{console.log(e,{constructors:t,constructor:i,params:o})}}}}),o},te=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},oe=e=>e.slice(0).sort(),ne=(e,t,o)=>{if(0===t.length)throw new Error("You must specify at least one required field.");return((e,t)=>{if(!s(t))throw new Error("The "+e+" fields must be an array. Was: "+t+".");D(t,t=>{if(!r(t))throw new Error("The value "+t+" in the "+e+" fields was not a string.")})})("required",t),(e=>{const t=oe(e);z(t,(e,o)=>o<t.length-1&&e===t[o+1]).each(e=>{throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+t.join(", ")+"].")})})(t),n=>{const r=W(n);P(t,e=>E(r,e))||((e,t)=>{throw new Error("All required keys ("+oe(e).join(", ")+") were not specified. Specified keys were: "+oe(t).join(", ")+".")})(t,r),e(t,r);const a=R(t,e=>!o.validate(n[e],e));return a.length>0&&((e,t)=>{throw new Error("All values need to be of type: "+t+". Keys ("+oe(e).join(", ")+") were not.")})(a,o.label),n}},re=(e,t)=>{const o=R(t,t=>!E(e,t));o.length>0&&(e=>{throw new Error("Unsupported keys for object: "+oe(e).join(", "))})(o)},ae=e=>((e,t)=>ne(e,t,{validate:m,label:"function"}))(re,e),se=e=>{const t=t=>t(e),o=p(e),n=()=>r,r={tag:!0,inner:e,fold:(t,o)=>o(e),isValue:w,isError:y,map:t=>le.value(t(e)),mapError:n,bind:t,exists:t,forall:t,getOr:o,or:n,getOrThunk:o,orThunk:n,getOrDie:o,each:t=>{t(e)},toOptional:()=>_.some(e)};return r},ie=e=>{const t=()=>o,o={tag:!1,inner:e,fold:(t,o)=>t(e),isValue:y,isError:w,map:t,mapError:t=>le.error(t(e)),bind:t,exists:y,forall:w,getOr:h,or:h,getOrThunk:v,orThunk:v,getOrDie:(n=String(e),()=>{throw new Error(n)}),each:g,toOptional:_.none};var n;return o},le={value:se,error:ie,fromOption:(e,t)=>e.fold(()=>ie(t),se)},ce="undefined"!=typeof window?window:Function("return this;")(),de=e=>{const t=e.replace(/\./g,"-");return{resolve:e=>t+"-"+e}},me=(e,t,o=f)=>e.exists(e=>o(e,t)),ue=e=>{const t=[],o=e=>{t.push(e)};for(let t=0;t<e.length;t++)e[t].each(o);return t},ge=(e,t)=>e?_.some(t):_.none(),pe=(e,t)=>((e,t)=>{let o=null!=t?t:ce;for(let t=0;t<e.length&&null!=o;++t)o=o[e[t]];return o})(e.split("."),t),he=()=>{const e=(e=>{const t=te(_.none()),o=()=>t.get().each(e);return{clear:()=>{o(),t.set(_.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{o(),t.set(_.some(e))}}})(g);return{...e,on:t=>e.get().each(t)}},fe=(e,t,o)=>""===t||e.length>=t.length&&e.substr(o,o+t.length)===t,be=(e,t,o=0,n)=>{const r=e.indexOf(t,o);return-1!==r&&(!!c(n)||r+t.length<=n)},xe=(e,t)=>fe(e,t,0),ve=(e,t)=>fe(e,t,e.length-t.length),ye=(e=>t=>t.replace(e,""))(/^\s+|\s+$/g),we=e=>e.length>0,_e=e=>{let t,o=!1;return(...n)=>(o||(o=!0,t=e.apply(null,n)),t)},Ce=["tfoot","thead","tbody","colgroup"],ke=(e,t,o)=>({element:e,rowspan:t,colspan:o}),Se=(e,t,o)=>({element:e,cells:t,section:o}),Ee=(e,t,o)=>({element:e,isNew:t,isLocked:o}),Oe=(e,t,o,n)=>({element:e,cells:t,section:o,isNew:n}),Te=(e,t,o)=>{const n=e.cells,r=n.slice(0,t),a=n.slice(t),s=r.concat(o).concat(a);return Me(e,s)},Ae=(e,t,o)=>Te(e,t,[o]),De=(e,t,o)=>{e.cells[t]=o},Me=(e,t)=>Oe(e.element,t,e.section,e.isNew),Re=(e,t)=>e.cells[t],Ne=(e,t)=>Re(e,t).element,Be=e=>e.cells.length,ze=e=>{const t=M(e,e=>"colgroup"===e.section);return{rows:t.fail,cols:t.pass}},He=(e,t,o)=>{const n=A(e.cells,o);return Oe(t(e.element),n,e.section,!0)},Le=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},Ie={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return Le(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return Le(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return Le(o)},fromDom:Le,fromPoint:(e,t,o)=>_.from(e.dom.elementFromPoint(t,o)).map(Le)},Pe=(e,t)=>{const o=e.document.createRange();return o.selectNode(t.dom),o},Fe=(e,t)=>{const o=e.document.createRange();return Ve(o,t),o},Ve=(e,t)=>e.selectNodeContents(t.dom),Ze=(e,t,o)=>{const n=e.document.createRange();var r;return r=n,t.fold(e=>{r.setStartBefore(e.dom)},(e,t)=>{r.setStart(e.dom,t)},e=>{r.setStartAfter(e.dom)}),((e,t)=>{t.fold(t=>{e.setEndBefore(t.dom)},(t,o)=>{e.setEnd(t.dom,o)},t=>{e.setEndAfter(t.dom)})})(n,o),n},Ue=(e,t,o,n,r)=>{const a=e.document.createRange();return a.setStart(t.dom,o),a.setEnd(n.dom,r),a},je=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}),We=ee([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),$e=(e,t,o)=>t(Ie.fromDom(o.startContainer),o.startOffset,Ie.fromDom(o.endContainer),o.endOffset),qe=(e,t)=>{const o=((e,t)=>t.match({domRange:e=>({ltr:p(e),rtl:_.none}),relative:(t,o)=>({ltr:_e(()=>Ze(e,t,o)),rtl:_e(()=>_.some(Ze(e,o,t)))}),exact:(t,o,n,r)=>({ltr:_e(()=>Ue(e,t,o,n,r)),rtl:_e(()=>_.some(Ue(e,n,r,t,o)))})}))(e,t);return((e,t)=>{const o=t.ltr();if(o.collapsed)return t.rtl().filter(e=>!1===e.collapsed).map(e=>We.rtl(Ie.fromDom(e.endContainer),e.endOffset,Ie.fromDom(e.startContainer),e.startOffset)).getOrThunk(()=>$e(0,We.ltr,o));return $e(0,We.ltr,o)})(0,o)},Ge=(e,t)=>qe(e,t).match({ltr:(t,o,n,r)=>{const a=e.document.createRange();return a.setStart(t.dom,o),a.setEnd(n.dom,r),a},rtl:(t,o,n,r)=>{const a=e.document.createRange();return a.setStart(n.dom,r),a.setEnd(t.dom,o),a}});We.ltr,We.rtl;const Ke=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},Ye=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,Xe=(e,t)=>{const o=void 0===t?document:t.dom;return Ye(o)?_.none():_.from(o.querySelector(e)).map(Ie.fromDom)},Je=(e,t)=>e.dom===t.dom,Qe=(e,t)=>{const o=e.dom,n=t.dom;return o!==n&&o.contains(n)},et=Ke,tt=()=>ot(0,0),ot=(e,t)=>({major:e,minor:t}),nt={nu:ot,detect:(e,t)=>{const o=String(t).toLowerCase();return 0===e.length?tt():((e,t)=>{const o=((e,t)=>{for(let o=0;o<e.length;o++){const n=e[o];if(n.test(t))return n}})(e,t);if(!o)return{major:0,minor:0};const n=e=>Number(t.replace(o,"$"+e));return ot(n(1),n(2))})(e,o)},unknown:tt},rt=(e,t)=>{const o=String(t).toLowerCase();return z(e,e=>e.search(o))},at=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,st=e=>t=>be(t,e),it=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>be(e,"edge/")&&be(e,"chrome")&&be(e,"safari")&&be(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,at],search:e=>be(e,"chrome")&&!be(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>be(e,"msie")||be(e,"trident")},{name:"Opera",versionRegexes:[at,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:st("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:st("firefox")},{name:"Safari",versionRegexes:[at,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(be(e,"safari")||be(e,"mobile/"))&&be(e,"applewebkit")}],lt=[{name:"Windows",search:st("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>be(e,"iphone")||be(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:st("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:st("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:st("linux"),versionRegexes:[]},{name:"Solaris",search:st("sunos"),versionRegexes:[]},{name:"FreeBSD",search:st("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:st("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],ct={browsers:p(it),oses:p(lt)},dt="Edge",mt="Chromium",ut="Opera",gt="Firefox",pt="Safari",ht=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isEdge:n(dt),isChromium:n(mt),isIE:n("IE"),isOpera:n(ut),isFirefox:n(gt),isSafari:n(pt)}},ft={unknown:()=>ht({current:void 0,version:nt.unknown()}),nu:ht,edge:p(dt),chromium:p(mt),ie:p("IE"),opera:p(ut),firefox:p(gt),safari:p(pt)},bt="Windows",xt="Android",vt="Linux",yt="macOS",wt="Solaris",_t="FreeBSD",Ct="ChromeOS",kt=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isWindows:n(bt),isiOS:n("iOS"),isAndroid:n(xt),isMacOS:n(yt),isLinux:n(vt),isSolaris:n(wt),isFreeBSD:n(_t),isChromeOS:n(Ct)}},St={unknown:()=>kt({current:void 0,version:nt.unknown()}),nu:kt,windows:p(bt),ios:p("iOS"),android:p(xt),linux:p(vt),macos:p(yt),solaris:p(wt),freebsd:p(_t),chromeos:p(Ct)},Et=(e,t,o)=>{const n=ct.browsers(),r=ct.oses(),a=t.bind(e=>((e,t)=>j(t.brands,t=>{const o=t.brand.toLowerCase();return z(e,e=>{var t;return o===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())}).map(e=>({current:e.name,version:nt.nu(parseInt(t.version,10),0)}))}))(n,e)).orThunk(()=>((e,t)=>rt(e,t).map(e=>{const o=nt.detect(e.versionRegexes,t);return{current:e.name,version:o}}))(n,e)).fold(ft.unknown,ft.nu),s=((e,t)=>rt(e,t).map(e=>{const o=nt.detect(e.versionRegexes,t);return{current:e.name,version:o}}))(r,e).fold(St.unknown,St.nu),i=((e,t,o,n)=>{const r=e.isiOS()&&!0===/ipad/i.test(o),a=e.isiOS()&&!r,s=e.isiOS()||e.isAndroid(),i=s||n("(pointer:coarse)"),l=r||!a&&s&&n("(min-device-width:768px)"),c=a||s&&!l,d=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),m=!c&&!l&&!d;return{isiPad:p(r),isiPhone:p(a),isTablet:p(l),isPhone:p(c),isTouch:p(i),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:p(d),isDesktop:p(m)}})(s,a,e,o);return{browser:a,os:s,deviceType:i}},Ot=e=>window.matchMedia(e).matches;let Tt=_e(()=>Et(window.navigator.userAgent,_.from(window.navigator.userAgentData),Ot));const At=()=>Tt(),Dt=(e,t)=>{const o=((e,t)=>pe(e,t))(e,t);if(null==o)throw new Error(e+" not available on this browser");return o},Mt=Object.getPrototypeOf,Rt=e=>{const t=pe("ownerDocument.defaultView",e);return a(e)&&((e=>Dt("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(Mt(e).constructor.name))},Nt=e=>e.dom.nodeName.toLowerCase(),Bt=e=>e.dom.nodeType,zt=e=>t=>Bt(t)===e,Ht=e=>8===Bt(e)||"#comment"===Nt(e),Lt=e=>It(e)&&Rt(e.dom),It=zt(1),Pt=zt(3),Ft=zt(9),Vt=zt(11),Zt=e=>t=>It(t)&&Nt(t)===e,Ut=e=>Ie.fromDom(e.dom.ownerDocument),jt=e=>Ft(e)?e:Ut(e),Wt=e=>_.from(e.dom.parentNode).map(Ie.fromDom),$t=e=>_.from(e.dom.parentElement).map(Ie.fromDom),qt=(e,t)=>{const o=m(t)?t:y;let n=e.dom;const r=[];for(;null!==n.parentNode&&void 0!==n.parentNode;){const e=n.parentNode,t=Ie.fromDom(e);if(r.push(t),!0===o(t))break;n=e}return r},Gt=e=>_.from(e.dom.previousSibling).map(Ie.fromDom),Kt=e=>_.from(e.dom.nextSibling).map(Ie.fromDom),Yt=e=>A(e.dom.childNodes,Ie.fromDom),Xt=(e,t)=>{const o=e.dom.childNodes;return _.from(o[t]).map(Ie.fromDom)},Jt=(e,t,o,n)=>{const r=((e,t,o,n)=>{const r=Ut(e).dom.createRange();return r.setStart(e.dom,t),r.setEnd(o.dom,n),r})(e,t,o,n),a=Je(e,o)&&t===n;return r.collapsed&&!a},Qt=e=>Vt(e)&&d(e.dom.host),eo=e=>Ie.fromDom(e.dom.getRootNode()),to=e=>Ie.fromDom(e.dom.host),oo=e=>d(e.dom.shadowRoot),no=e=>{const t=Ie.fromDom((e=>{if(d(e.target)){const t=Ie.fromDom(e.target);if(It(t)&&oo(t)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return Z(t)}}return _.from(e.target)})(e).getOr(e.target)),o=()=>e.stopPropagation(),n=()=>e.preventDefault(),r=(a=n,s=o,(...e)=>a(s.apply(null,e)));var a,s;return((e,t,o,n,r,a,s)=>({target:e,x:t,y:o,stop:n,prevent:r,kill:a,raw:s}))(t,e.clientX,e.clientY,o,n,r,e)},ro=(e,t,o,n,r)=>{const a=((e,t)=>o=>{e(o)&&t(no(o))})(o,n);return e.dom.addEventListener(t,a,r),{unbind:b(ao,e,t,a,r)}},ao=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)},so=w,io=(e,t,o)=>((e,t,o,n)=>ro(e,t,o,n,!1))(e,t,so,o),lo=no,co=(e,t)=>{Wt(e).each(o=>{o.dom.insertBefore(t.dom,e.dom)})},mo=(e,t)=>{Kt(e).fold(()=>{Wt(e).each(e=>{go(e,t)})},e=>{co(e,t)})},uo=(e,t)=>{const o=(e=>Xt(e,0))(e);o.fold(()=>{go(e,t)},o=>{e.dom.insertBefore(t.dom,o.dom)})},go=(e,t)=>{e.dom.appendChild(t.dom)},po=(e,t)=>{co(e,t),go(t,e)},ho=(e,t)=>{D(t,(o,n)=>{const r=0===n?e:t[n-1];mo(r,o)})},fo=(e,t)=>{D(t,t=>{go(e,t)})},bo=(e,t,o)=>{if(!(r(o)||l(o)||u(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")},xo=(e,t,o)=>{bo(e.dom,t,o)},vo=(e,t)=>{const o=e.dom;q(t,(e,t)=>{bo(o,t,e)})},yo=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},wo=(e,t)=>_.from(yo(e,t)),_o=(e,t)=>{e.dom.removeAttribute(t)},Co=e=>B(e.dom.attributes,(e,t)=>(e[t.name]=t.value,e),{}),ko=e=>{e.dom.textContent="",D(Yt(e),e=>{So(e)})},So=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},Eo=e=>{const t=Yt(e);t.length>0&&ho(e,t),So(e)},Oo=(e,t)=>Ie.fromDom(e.dom.cloneNode(t)),To=e=>Oo(e,!1),Ao=e=>Oo(e,!0),Do=(e,t)=>{const o=Ie.fromTag(t),n=Co(e);return vo(o,n),o},Mo=e=>void 0!==e.style&&m(e.style.getPropertyValue),Ro=e=>{const t=Pt(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return(e=>{const t=eo(e);return Qt(t)?_.some(t):_.none()})(Ie.fromDom(t)).fold(()=>o.body.contains(t),(n=Ro,r=to,e=>n(r(e))));var n,r},No=(e,t,o)=>{if(!r(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);Mo(e)&&e.style.setProperty(t,o)},Bo=(e,t,o)=>{const n=e.dom;No(n,t,o)},zo=(e,t)=>{const o=e.dom;q(t,(e,t)=>{No(o,t,e)})},Ho=(e,t)=>{const o=e.dom,n=window.getComputedStyle(o).getPropertyValue(t);return""!==n||Ro(e)?n:Lo(o,t)},Lo=(e,t)=>Mo(e)?e.style.getPropertyValue(t):"",Io=(e,t)=>{const o=e.dom,n=Lo(o,t);return _.from(n).filter(e=>e.length>0)},Po=(e,t)=>{((e,t)=>{Mo(e)&&e.style.removeProperty(t)})(e.dom,t),me(wo(e,"style").map(ye),"")&&_o(e,"style")},Fo=(e,t)=>{const o=o=>{const n=t(o);if(n<=0||null===n){const t=Ho(o,e);return parseFloat(t)||0}return n},n=(e,t)=>B(t,(t,o)=>{const n=Ho(e,o),r=void 0===n?0:parseInt(n,10);return isNaN(r)?t:t+r},0);return{set:(t,o)=>{if(!u(o)&&!o.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+o);const n=t.dom;Mo(n)&&(n.style[e]=o+"px")},get:o,getOuter:o,aggregate:n,max:(e,t,o)=>{const r=n(e,o);return t>r?t-r:0}}},Vo=(e,t)=>(e=>{const t=parseFloat(e);return isNaN(t)?_.none():_.some(t)})(e).getOr(t),Zo=(e,t,o)=>Vo(Ho(e,t),o),Uo=(e,t)=>{const o=e.dom,n=o.getBoundingClientRect().width||o.offsetWidth;return"border-box"===t?n:((e,t,o,n)=>t-Zo(e,`padding-${o}`,0)-Zo(e,`padding-${n}`,0)-Zo(e,`border-${o}-width`,0)-Zo(e,`border-${n}-width`,0))(e,n,"left","right")},jo=Fo("height",e=>{const t=e.dom;return Ro(e)?t.getBoundingClientRect().height:t.offsetHeight}),Wo=e=>jo.get(e),$o=e=>jo.getOuter(e),qo=e=>Zo(e,"height",e.dom.offsetHeight),Go=Fo("width",e=>e.dom.offsetWidth);Fo("width",e=>{const t=e.dom;return Ro(e)?t.getBoundingClientRect().width:t.offsetWidth});const Ko=e=>Go.get(e),Yo=e=>Go.getOuter(e),Xo=e=>Uo(e,"content-box"),Jo=e=>Zo(e,"width",e.dom.offsetWidth),Qo=(e,t)=>({left:e,top:t,translate:(o,n)=>Qo(e+o,t+n)}),en=Qo,tn=(e,t)=>void 0!==e?e:void 0!==t?t:0,on=e=>{const t=e.dom.ownerDocument,o=t.body,n=t.defaultView,r=t.documentElement;if(o===e.dom)return en(o.offsetLeft,o.offsetTop);const a=tn(null==n?void 0:n.pageYOffset,r.scrollTop),s=tn(null==n?void 0:n.pageXOffset,r.scrollLeft),i=tn(r.clientTop,o.clientTop),l=tn(r.clientLeft,o.clientLeft);return nn(e).translate(s-l,a-i)},nn=e=>{const t=e.dom,o=t.ownerDocument.body;return o===t?en(o.offsetLeft,o.offsetTop):Ro(e)?(e=>{const t=e.getBoundingClientRect();return en(t.left,t.top)})(t):en(0,0)},rn=((e,t)=>{const o=t=>e(t)?_.from(t.dom.nodeValue):_.none();return{get:n=>{if(!e(n))throw new Error("Can only get "+t+" value of a "+t+" node");return o(n).getOr("")},getOption:o,set:(o,n)=>{if(!e(o))throw new Error("Can only set raw "+t+" value of a "+t+" node");o.dom.nodeValue=n}}})(Pt,"text"),an=e=>rn.get(e),sn=e=>rn.getOption(e),ln=(e,t)=>rn.set(e,t),cn=(e,t)=>o=>"rtl"===dn(o)?t:e,dn=e=>"rtl"===Ho(e,"direction")?"rtl":"ltr",mn=(e,t)=>{const o=yo(e,t);return void 0===o||""===o?[]:o.split(" ")};var un=(e,t,o,n,r)=>e(o,n)?_.some(o):m(r)&&r(o)?_.none():t(o,n,r);const gn=(e,t,o)=>{let n=e.dom;const r=m(o)?o:y;for(;n.parentNode;){n=n.parentNode;const e=Ie.fromDom(n);if(t(e))return _.some(e);if(r(e))break}return _.none()},pn=(e,t,o)=>un((e,t)=>t(e),gn,e,t,o),hn=(e,t,o)=>gn(e,e=>Ke(e,t),o),fn=(e,t)=>((e,t)=>z(e.dom.childNodes,e=>t(Ie.fromDom(e))).map(Ie.fromDom))(e,e=>Ke(e,t)),bn=(e,t)=>Xe(t,e),xn=(e,t,o)=>un((e,t)=>Ke(e,t),hn,e,t,o),vn=e=>void 0!==e.dom.classList,yn=(e,t)=>((e,t,o)=>{const n=mn(e,t).concat([o]);return xo(e,t,n.join(" ")),!0})(e,"class",t),wn=(e,t)=>{vn(e)?e.dom.classList.add(t):yn(e,t)},_n=(e,t)=>vn(e)&&e.dom.classList.contains(t),Cn=e=>xn(e,"[contenteditable]"),kn=(e,t=!1)=>Ro(e)?e.dom.isContentEditable:Cn(e).fold(p(t),e=>"true"===Sn(e)),Sn=e=>e.dom.contentEditable,En=(e,t)=>{let o=[];return D(Yt(e),e=>{t(e)&&(o=o.concat([e])),o=o.concat(En(e,t))}),o},On=(e,t,o)=>((e,t,o)=>R(qt(e,o),t))(e,e=>Ke(e,t),o),Tn=(e,t)=>((e,t)=>R(Yt(e),t))(e,e=>Ke(e,t)),An=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return Ye(o)?[]:A(o.querySelectorAll(e),Ie.fromDom)})(t,e),Dn=(e,t)=>H(e,b(Je,t)),Mn=e=>"img"===Nt(e)?1:sn(e).fold(()=>Yt(e).length,e=>e.length),Rn=["img","br"],Nn=e=>sn(e).filter(e=>0!==e.trim().length||e.indexOf(" ")>-1).isSome()||E(Rn,Nt(e))||(e=>Lt(e)&&"false"===yo(e,"contenteditable"))(e),Bn=e=>((e,t)=>{const o=e=>{for(let n=0;n<e.childNodes.length;n++){const r=Ie.fromDom(e.childNodes[n]);if(t(r))return _.some(r);const a=o(e.childNodes[n]);if(a.isSome())return a}return _.none()};return o(e.dom)})(e,Nn),zn=e=>Hn(e,Nn),Hn=(e,t)=>{const o=e=>{const n=Yt(e);for(let e=n.length-1;e>=0;e--){const r=n[e];if(t(r))return _.some(r);const a=o(r);if(a.isSome())return a}return _.none()};return o(e)},Ln=(e,t,o,n)=>({start:e,soffset:t,finish:o,foffset:n}),In=ee([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Pn=In.before,Fn=In.on,Vn=In.after,Zn={before:Pn,on:Fn,after:Vn,cata:(e,t,o,n)=>e.fold(t,o,n),getStart:e=>e.fold(h,h,h)},Un=ee([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),jn=Un.domRange,Wn=Un.relative,$n=Un.exact,qn=Ln,Gn={domRange:jn,relative:Wn,exact:$n,exactFromRange:e=>Un.exact(e.start,e.soffset,e.finish,e.foffset),getWin:e=>{const t=(e=>e.match({domRange:e=>Ie.fromDom(e.startContainer),relative:(e,t)=>Zn.getStart(e),exact:(e,t,o,n)=>e}))(e);return o=t,Ie.fromDom(jt(o).dom.defaultView);var o},range:qn},Kn=(e,t,o)=>e.caretPositionFromPoint?((e,t,o)=>{var n;return _.from(null===(n=e.caretPositionFromPoint)||void 0===n?void 0:n.call(e,t,o)).bind(t=>{if(null===t.offsetNode)return _.none();const o=e.createRange();return o.setStart(t.offsetNode,t.offset),o.collapse(),_.some(o)})})(e,t,o):e.caretRangeFromPoint?((e,t,o)=>{var n;return _.from(null===(n=e.caretRangeFromPoint)||void 0===n?void 0:n.call(e,t,o))})(e,t,o):_.none(),Yn=(e,t)=>{const o=Nt(e);return"input"===o?Zn.after(e):E(["br","img"],o)?0===t?Zn.before(e):Zn.after(e):Zn.on(e,t)},Xn=e=>_.from(e.getSelection()),Jn=(e,t)=>{Xn(e).each(e=>{e.removeAllRanges(),e.addRange(t)})},Qn=(e,t,o,n,r)=>{const a=Ue(e,t,o,n,r);Jn(e,a)},er=(e,t)=>qe(e,t).match({ltr:(t,o,n,r)=>{Qn(e,t,o,n,r)},rtl:(t,o,n,r)=>{Xn(e).each(a=>{if(a.setBaseAndExtent)a.setBaseAndExtent(t.dom,o,n.dom,r);else if(a.extend)try{((e,t,o,n,r,a)=>{t.collapse(o.dom,n),t.extend(r.dom,a)})(0,a,t,o,n,r)}catch(a){Qn(e,n,r,t,o)}else Qn(e,n,r,t,o)})}}),tr=(e,t,o,n,r)=>{const a=((e,t,o,n)=>{const r=Yn(e,t),a=Yn(o,n);return Gn.relative(r,a)})(t,o,n,r);er(e,a)},or=(e,t,o)=>{const n=((e,t)=>{const o=e.fold(Zn.before,Yn,Zn.after),n=t.fold(Zn.before,Yn,Zn.after);return Gn.relative(o,n)})(t,o);er(e,n)},nr=e=>{if(e.rangeCount>0){const t=e.getRangeAt(0),o=e.getRangeAt(e.rangeCount-1);return _.some(Ln(Ie.fromDom(t.startContainer),t.startOffset,Ie.fromDom(o.endContainer),o.endOffset))}return _.none()},rr=e=>{if(null===e.anchorNode||null===e.focusNode)return nr(e);{const t=Ie.fromDom(e.anchorNode),o=Ie.fromDom(e.focusNode);return Jt(t,e.anchorOffset,o,e.focusOffset)?_.some(Ln(t,e.anchorOffset,o,e.focusOffset)):nr(e)}},ar=(e,t,o=!0)=>{const n=(o?Fe:Pe)(e,t);Jn(e,n)},sr=e=>(e=>Xn(e).filter(e=>e.rangeCount>0).bind(rr))(e).map(e=>Gn.exact(e.start,e.soffset,e.finish,e.foffset)),ir=(e,t)=>(e=>{const t=e.getClientRects(),o=t.length>0?t[0]:e.getBoundingClientRect();return o.width>0||o.height>0?_.some(o).map(je):_.none()})(Ge(e,t)),lr=(e,t,o)=>((e,t,o)=>{const n=e.document;return Kn(n,t,o).map(e=>Ln(Ie.fromDom(e.startContainer),e.startOffset,Ie.fromDom(e.endContainer),e.endOffset))})(e,t,o),cr={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},dr=(()=>{const e="[0-9]+",t="[eE]"+("[+-]?"+e),o=e=>`(?:${e})?`,n=["Infinity",e+"\\."+o(e)+o(t),"\\."+e+o(t),e+o(t)].join("|");return new RegExp(`^(${`[+-]?(?:${n})`})(.*)$`)})(),mr=(e,t)=>_.from(dr.exec(e)).bind(e=>{const o=Number(e[1]),n=e[2];return((e,t)=>O(t,t=>O(cr[t],t=>e===t)))(n,t)?_.some({value:o,unit:n}):_.none()}),ur=e=>A(e,p(0)),gr=(e,t,o,n,r)=>r(e.slice(0,t)).concat(n).concat(r(e.slice(o))),pr=e=>(t,o,n,r)=>{if(e(n)){const e=Math.max(r,t[o]-Math.abs(n)),a=Math.abs(e-t[o]);return n>=0?a:-a}return n},hr=pr(e=>e<0),fr=pr(w),br=()=>{const e=(e,t,o,n)=>{const r=(100+o)/100,a=Math.max(n,(e[t]+o)/r);return A(e,(e,o)=>(o===t?a:e/r)-e)},t=(t,o,n,r,a,s)=>s?e(t,o,r,a):((e,t,o,n,r)=>{const a=hr(e,t,n,r);return gr(e,t,o+1,[a,0],ur)})(t,o,n,r,a);return{resizeTable:(e,t)=>e(t),clampTableDelta:hr,calcLeftEdgeDeltas:t,calcMiddleDeltas:(e,o,n,r,a,s,i)=>t(e,n,r,a,s,i),calcRightEdgeDeltas:(t,o,n,r,a,s)=>{if(s)return e(t,n,r,a);{const e=hr(t,n,r,a);return ur(t.slice(0,n)).concat([e])}},calcRedestributedWidths:(e,t,o,n)=>{if(n){const n=(t+o)/t,r=A(e,e=>e/n);return{delta:100*n-100,newSizes:r}}return{delta:o,newSizes:e}}}},xr=()=>{const e=(e,t,o,n,r)=>{const a=fr(e,n>=0?o:t,n,r);return gr(e,t,o+1,[a,-a],ur)};return{resizeTable:(e,t,o)=>{o&&e(t)},clampTableDelta:(e,t,o,n,r)=>{if(r){if(o>=0)return o;{const t=B(e,(e,t)=>e+t-n,0);return Math.max(-t,o)}}return hr(e,t,o,n)},calcLeftEdgeDeltas:e,calcMiddleDeltas:(t,o,n,r,a,s)=>e(t,n,r,a,s),calcRightEdgeDeltas:(e,t,o,n,r,a)=>{if(a)return ur(e);{const t=n/e.length;return A(e,p(t))}},calcRedestributedWidths:(e,t,o,n)=>({delta:0,newSizes:e})}},vr=(e,t,o=0)=>wo(e,t).map(e=>parseInt(e,10)).getOr(o),yr=(e,t)=>vr(e,t,1),wr=e=>Zt("col")(e)?vr(e,"span",1)>1:yr(e,"colspan")>1,_r=(e,t)=>parseInt(Ho(e,t),10),Cr=p(10),kr=p(10),Sr=(e,t)=>Er(e,t,w),Er=(e,t,o)=>I(Yt(e),e=>Ke(e,t)?o(e)?[e]:[]:Er(e,t,o)),Or=(e,t)=>((e,t,o=y)=>o(t)?_.none():E(e,Nt(t))?_.some(t):hn(t,e.join(","),e=>Ke(e,"table")||o(e)))(["td","th"],e,t),Tr=e=>Sr(e,"th,td"),Ar=e=>Ke(e,"colgroup")?Tn(e,"col"):I(Rr(e),e=>Tn(e,"col")),Dr=(e,t)=>xn(e,"table",t),Mr=e=>Sr(e,"tr"),Rr=e=>Dr(e).fold(p([]),e=>Tn(e,"colgroup")),Nr=Zt("th"),Br=e=>P(e,e=>Nr(e.element)),zr=(e,t)=>e&&t?"sectionCells":e?"section":"cells",Hr=e=>{const t="thead"===e.section,o=me(Lr(e.cells),"th");return"tfoot"===e.section?{type:"footer"}:t||o?{type:"header",subType:zr(t,o)}:{type:"body"}},Lr=e=>{const t=R(e,e=>Nr(e.element));return 0===t.length?_.some("td"):t.length===e.length?_.some("th"):_.none()},Ir=(e,t)=>A(e,e=>{if("colgroup"===Nt(e)){const t=A(Ar(e),e=>{const t=vr(e,"span",1);return ke(e,1,t)});return Se(e,t,"colgroup")}{const o=A(Tr(e),e=>{const t=vr(e,"rowspan",1),o=vr(e,"colspan",1);return ke(e,t,o)});return Se(e,o,t(e))}}),Pr=e=>Wt(e).map(e=>{const t=Nt(e);return(e=>E(Ce,e))(t)?t:"tbody"}).getOr("tbody"),Fr=e=>{const t=Mr(e),o=[...Rr(e),...t];return Ir(o,Pr)},Vr="data-snooker-locked-cols",Zr=e=>wo(e,Vr).bind(e=>_.from(e.match(/\d+/g))).map(e=>F(e,w)),Ur=e=>{const t=B(ze(e).rows,(e,t)=>(D(t.cells,(t,o)=>{t.isLocked&&(e[o]=!0)}),e),{}),o=X(t,(e,t)=>parseInt(t,10));return((e,t)=>{const o=C.call(e,0);return o.sort(t),o})(o)},jr=(e,t)=>e+","+t,Wr=(e,t)=>{const o=I(e.all,e=>e.cells);return R(o,t)},$r=e=>{const t={},o=[],n=Z(e).map(e=>e.element).bind(Dr).bind(Zr).getOr({});let r=0,a=0,s=0;const{pass:i,fail:l}=M(e,e=>"colgroup"===e.section);D(l,e=>{const i=[];D(e.cells,e=>{let o=0;for(;void 0!==t[jr(s,o)];)o++;const r=((e,t)=>Q(e,t)&&void 0!==e[t]&&null!==e[t])(n,o.toString()),l=((e,t,o,n,r,a)=>({element:e,rowspan:t,colspan:o,row:n,column:r,isLocked:a}))(e.element,e.rowspan,e.colspan,s,o,r);for(let n=0;n<e.colspan;n++)for(let r=0;r<e.rowspan;r++){const e=o+n,i=jr(s+r,e);t[i]=l,a=Math.max(a,e+1)}i.push(l)}),r++,o.push(Se(e.element,i,e.section)),s++});const{columns:c,colgroups:d}=U(i).map(e=>{const t=(e=>{const t={};let o=0;return D(e.cells,e=>{const n=e.colspan;T(n,r=>{const a=o+r;t[a]=((e,t,o)=>({element:e,colspan:t,column:o}))(e.element,n,a)}),o+=n}),t})(e),o=((e,t)=>({element:e,columns:t}))(e.element,J(t));return{colgroups:[o],columns:t}}).getOrThunk(()=>({colgroups:[],columns:{}})),m=((e,t)=>({rows:e,columns:t}))(r,a);return{grid:m,access:t,all:o,columns:c,colgroups:d}},qr={fromTable:e=>{const t=Fr(e);return $r(t)},generate:$r,getAt:(e,t,o)=>_.from(e.access[jr(t,o)]),findItem:(e,t,o)=>{const n=Wr(e,e=>o(t,e.element));return n.length>0?_.some(n[0]):_.none()},filterItems:Wr,justCells:e=>I(e.all,e=>e.cells),justColumns:e=>J(e.columns),hasColumns:e=>W(e.columns).length>0,getColumnAt:(e,t)=>_.from(e.columns[t])},Gr=(e,t,o)=>Ee(o(e.element,t),!0,e.isLocked),Kr=(e,t)=>e.section!==t?Oe(e.element,e.cells,t,e.isNew):e,Yr=()=>({transformRow:Kr,transformCell:(e,t,o)=>{const n=o(e.element,t),r="td"!==Nt(n)?((e,t)=>{const o=Do(e,t);mo(e,o);const n=Yt(e);return fo(o,n),So(e),o})(n,"td"):n;return Ee(r,e.isNew,e.isLocked)}}),Xr=()=>({transformRow:Kr,transformCell:Gr}),Jr=()=>({transformRow:(e,t)=>Kr(e,"thead"===t?"tbody":t),transformCell:Gr}),Qr=(e,t)=>{const o=(e=>j(e.all,e=>{const t=Hr(e);return"header"===t.type?_.from(t.subType):_.none()}))(qr.fromTable(e)).getOr(t);switch(o){case"section":return Yr();case"sectionCells":return Xr();case"cells":return Jr()}},ea=Yr,ta=Xr,oa=Jr,na=()=>({transformRow:h,transformCell:Gr}),ra=(e,t=w)=>{const o=e.grid,n=T(o.columns,h),r=T(o.rows,h);return A(n,o=>aa(()=>I(r,t=>qr.getAt(e,t,o).filter(e=>e.column===o).toArray()),e=>1===e.colspan&&t(e.element),()=>qr.getAt(e,0,o)))},aa=(e,t,o)=>{const n=e();return z(n,t).orThunk(()=>_.from(n[0]).orThunk(o)).map(e=>e.element)},sa=e=>{const t=e.grid,o=T(t.rows,h),n=T(t.columns,h);return A(o,t=>aa(()=>I(n,o=>qr.getAt(e,t,o).filter(e=>e.row===t).fold(p([]),e=>[e])),e=>1===e.rowspan,()=>qr.getAt(e,t,0)))},ia=(e,t)=>{if(t<0||t>=e.length-1)return _.none();const o=e[t].fold(()=>{const o=(e=>{const t=C.call(e,0);return t.reverse(),t})(e.slice(0,t));return j(o,(e,t)=>e.map(e=>({value:e,delta:t+1})))},e=>_.some({value:e,delta:0})),n=e[t+1].fold(()=>{const o=e.slice(t+1);return j(o,(e,t)=>e.map(e=>({value:e,delta:t+1})))},e=>_.some({value:e,delta:1}));return o.bind(e=>n.map(t=>{const o=t.delta+e.delta;return Math.abs(t.value-e.value)/o}))},la=(e,t)=>({row:e,y:t}),ca=(e,t)=>({col:e,x:t}),da=e=>on(e).left+Yo(e),ma=e=>on(e).left,ua=(e,t)=>ca(e,ma(t)),ga=(e,t)=>ca(e,da(t)),pa=e=>on(e).top,ha=(e,t)=>la(e,pa(t)),fa=(e,t)=>la(e,pa(t)+$o(t)),ba=(e,t,o)=>{if(0===o.length)return[];const n=A(o.slice(1),(t,o)=>t.map(t=>e(o,t))),r=o[o.length-1].map(e=>t(o.length-1,e));return n.concat([r])},xa={delta:h,positions:e=>ba(ha,fa,e),edge:pa},va=cn({delta:h,edge:ma,positions:e=>ba(ua,ga,e)},{delta:e=>-e,edge:da,positions:e=>ba(ga,ua,e)}),ya={delta:(e,t)=>va(t).delta(e,t),positions:(e,t)=>va(t).positions(e,t),edge:e=>va(e).edge(e)},wa=/(\d+(\.\d+)?)%/,_a=/(\d+(\.\d+)?)px|em/,Ca=Zt("col"),ka=Zt("tr"),Sa=(e,t,o)=>{const n=$t(e).getOrThunk(()=>(e=>{const t=e.dom.body;if(null==t)throw new Error("Body is not available yet");return Ie.fromDom(t)})(Ut(e)));return t(e)/o(n)*100},Ea=(e,t)=>{Bo(e,"width",t+"px")},Oa=(e,t)=>{Bo(e,"width",t+"%")},Ta=(e,t)=>{Bo(e,"height",t+"px")},Aa=(e,t,o,n)=>{const r=parseFloat(e);return ve(e,"%")&&"table"!==Nt(t)?((e,t,o,n)=>{const r=Dr(e).map(e=>{const n=o(e);return Math.floor(t/100*n)}).getOr(t);return n(e,r),r})(t,r,o,n):r},Da=e=>{const t=(e=>qo(e)+"px")(e);return t?Aa(t,e,Wo,Ta):Wo(e)},Ma=(e,t)=>Io(e,t).orThunk(()=>wo(e,t).map(e=>e+"px")),Ra=e=>Ma(e,"width"),Na=e=>Sa(e,Ko,Xo),Ba=e=>Ca(e)?Ko(e):Jo(e),za=e=>ka(e)?Wo(e):((e,t,o)=>o(e)/yr(e,t))(e,"rowspan",Da),Ha=(e,t,o)=>{Bo(e,"width",t+o)},La=e=>Sa(e,Ko,Xo)+"%",Ia=p(wa),Pa=Zt("col"),Fa=e=>Ra(e).getOrThunk(()=>Ba(e)+"px"),Va=e=>{return(t=e,Ma(t,"height")).getOrThunk(()=>za(e)+"px");var t},Za=(e,t,o,n,r,a)=>e.filter(n).fold(()=>a(ia(o,t)),e=>r(e)),Ua=(e,t,o,n)=>{const r=ra(e),a=qr.hasColumns(e)?(e=>A(qr.justColumns(e),e=>_.from(e.element)))(e):r,s=[_.some(ya.edge(t))].concat(A(ya.positions(r,t),e=>e.map(e=>e.x))),i=x(wr);return A(a,(e,t)=>Za(e,t,s,i,e=>{if((e=>{const t=At().browser,o=t.isChromium()||t.isFirefox();return!Pa(e)||o})(e))return o(e);{const e=(a=r[t],l=h,null!=a?l(a):_.none());return Za(e,t,s,i,e=>n(_.some(Ko(e))),n)}var a,l},n))},ja=e=>e.map(e=>e+"px").getOr(""),Wa=(e,t,o)=>Ua(e,t,Ba,e=>e.getOrThunk(o.minCellWidth)),$a=(e,t,o,n)=>{const r=sa(e),a=A(e.all,e=>_.some(e.element)),s=[_.some(xa.edge(t))].concat(A(xa.positions(r,t),e=>e.map(e=>e.y)));return A(a,(e,t)=>Za(e,t,s,w,o,n))},qa=(e,t)=>()=>Ro(e)?t(e):parseFloat(Io(e,"width").getOr("0")),Ga=e=>{const t=qa(e,Ko),o=p(0);return{width:t,pixelWidth:t,getWidths:(t,o)=>Wa(t,e,o),getCellDelta:o,singleColumnWidth:p([0]),minCellWidth:o,setElementWidth:g,adjustTableWidth:g,isRelative:!0,label:"none"}},Ka=e=>{const t=qa(e,e=>parseFloat(La(e))),o=qa(e,Ko);return{width:t,pixelWidth:o,getWidths:(t,o)=>((e,t,o)=>Ua(e,t,Na,e=>e.fold(()=>o.minCellWidth(),e=>e/o.pixelWidth()*100)))(t,e,o),getCellDelta:e=>e/o()*100,singleColumnWidth:(e,t)=>[100-e],minCellWidth:()=>Cr()/o()*100,setElementWidth:Oa,adjustTableWidth:o=>{const n=t();Oa(e,n+o/100*n)},isRelative:!0,label:"percent"}},Ya=e=>{const t=qa(e,Ko);return{width:t,pixelWidth:t,getWidths:(t,o)=>Wa(t,e,o),getCellDelta:h,singleColumnWidth:(e,t)=>[Math.max(Cr(),e+t)-e],minCellWidth:Cr,setElementWidth:Ea,adjustTableWidth:o=>{const n=t()+o;Ea(e,n)},isRelative:!1,label:"pixel"}},Xa=e=>Ra(e).fold(()=>Ga(e),t=>((e,t)=>null!==Ia().exec(t)?Ka(e):Ya(e))(e,t)),Ja=Ya,Qa=Ka,es=(e,t,o,n)=>{o===n?_o(e,t):xo(e,t,o)},ts=(e,t,o)=>{U(Tn(e,t)).fold(()=>uo(e,o),e=>mo(e,o))},os=(e,t)=>{const o=[],n=[],r=e=>A(e,e=>{e.isNew&&o.push(e.element);const t=e.element;return ko(t),D(e.cells,e=>{e.isNew&&n.push(e.element),es(e.element,"colspan",e.colspan,1),es(e.element,"rowspan",e.rowspan,1),go(t,e.element)}),t}),a=e=>I(e,e=>A(e.cells,e=>(es(e.element,"span",e.colspan,1),e.element))),s=(t,o)=>{const n=((e,t)=>{const o=fn(e,t).getOrThunk(()=>{const o=Ie.fromTag(t,Ut(e).dom);return"thead"===t?ts(e,"caption,colgroup",o):"colgroup"===t?ts(e,"caption",o):go(e,o),o});return ko(o),o})(e,o),s=("colgroup"===o?a:r)(t);fo(n,s)},i=(t,o)=>{t.length>0?s(t,o):(t=>{fn(e,t).each(So)})(o)},l=[],c=[],d=[],m=[];return D(t,e=>{switch(e.section){case"thead":l.push(e);break;case"tbody":c.push(e);break;case"tfoot":d.push(e);break;case"colgroup":m.push(e)}}),i(m,"colgroup"),i(l,"thead"),i(c,"tbody"),i(d,"tfoot"),{newRows:o,newCells:n}},ns=(e,t)=>{if(0===e.length)return 0;const o=e[0];return H(e,e=>!t(o.element,e.element)).getOr(e.length)},rs=(e,t,o,n)=>{const r=((e,t)=>e[t])(e,t),a="colgroup"===r.section,s=ns(r.cells.slice(o),n),i=a?1:ns(((e,t)=>A(e,e=>Re(e,t)))(e.slice(t),o),n);return{colspan:s,rowspan:i}},as=(e,t)=>{const o=A(e,e=>A(e.cells,y));return A(e,(n,r)=>{const a=I(n.cells,(n,a)=>{if(!1===o[r][a]){const d=rs(e,r,a,t);return((e,t,n,r)=>{for(let a=e;a<e+n;a++)for(let e=t;e<t+r;e++)o[a][e]=!0})(r,a,d.rowspan,d.colspan),[(s=n.element,i=d.rowspan,l=d.colspan,c=n.isNew,{element:s,rowspan:i,colspan:l,isNew:c})]}return[];var s,i,l,c});return((e,t,o,n)=>({element:e,cells:t,section:o,isNew:n}))(n.element,a,n.section,n.isNew)})},ss=(e,t,o)=>{const n=[];D(e.colgroups,r=>{const a=[];for(let n=0;n<e.grid.columns;n++){const r=qr.getColumnAt(e,n).map(e=>Ee(e.element,o,!1)).getOrThunk(()=>Ee(t.colGap(),!0,!1));a.push(r)}n.push(Oe(r.element,a,"colgroup",o))});for(let r=0;r<e.grid.rows;r++){const a=[];for(let n=0;n<e.grid.columns;n++){const s=qr.getAt(e,r,n).map(e=>Ee(e.element,o,e.isLocked)).getOrThunk(()=>Ee(t.gap(),!0,!1));a.push(s)}const s=e.all[r],i=Oe(s.element,a,s.section,o);n.push(i)}return n},is=e=>as(e,Je),ls=(e,t)=>j(e.all,e=>z(e.cells,e=>Je(t,e.element))),cs=(e,t,o)=>{const n=A(t.selection,t=>Or(t).bind(t=>ls(e,t)).filter(o)),r=ue(n);return ge(r.length>0,r)},ds=(e,t,o,n,r,a,s,i,l)=>{const c=qr.fromTable(a),d=_.from(null==l?void 0:l.section).getOrThunk(na);return t(c,s).map(t=>{const o=((e,t)=>ss(e,t,!1))(c,i),n=e(o,t,Je,r(i),d),a=Ur(n.grid);return{info:t,grid:is(n.grid),cursor:n.cursor,lockedColumns:a}}).bind(e=>{const t=os(a,e.grid),r=_.from(null==l?void 0:l.sizing).getOrThunk(()=>Xa(a)),s=_.from(null==l?void 0:l.resize).getOrThunk(xr);return o(a,e.grid,e.info,{sizing:r,resize:s,section:d}),n(a),_o(a,Vr),e.lockedColumns.length>0&&xo(a,Vr,e.lockedColumns.join(",")),_.some({cursor:e.cursor,newRows:t.newRows,newCells:t.newCells})})},ms=(e,t)=>Or(t.element).bind(o=>ls(e,o).map(e=>({...e,generators:t.generators,clipboard:t.clipboard}))),us=(e,t)=>cs(e,t,w).map(e=>({cells:e,generators:t.generators,clipboard:t.clipboard})),gs=(e,t)=>cs(e,t,w),ps=(e,t)=>cs(e,t,e=>!e.isLocked),hs=(e,t)=>P(t,t=>((e,t)=>ls(e,t).exists(e=>!e.isLocked))(e,t)),fs=(e,t)=>((e,t)=>t.mergable)(0,t).filter(t=>hs(e,t.cells)),bs=(e,t)=>((e,t)=>t.unmergable)(0,t).filter(t=>hs(e,t)),xs={...ee([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])},vs=(e,t,o,n,r)=>{const a=e.slice(0),s=((e,t)=>0===e.length?xs.none():1===e.length?xs.only(0):0===t?xs.left(0,1):t===e.length-1?xs.right(t-1,t):t>0&&t<e.length-1?xs.middle(t-1,t,t+1):xs.none())(e,t),i=p(A(a,p(0)));return s.fold(i,e=>n.singleColumnWidth(a[e],o),(e,t)=>r.calcLeftEdgeDeltas(a,e,t,o,n.minCellWidth(),n.isRelative),(e,t,s)=>r.calcMiddleDeltas(a,e,t,s,o,n.minCellWidth(),n.isRelative),(e,t)=>r.calcRightEdgeDeltas(a,e,t,o,n.minCellWidth(),n.isRelative))},ys=(e,t)=>qr.hasColumns(e)?((e,t)=>{const o=qr.justColumns(e);return A(o,(e,o)=>({element:e.element,width:t[o],colspan:e.colspan}))})(e,t):((e,t)=>{const o=qr.justCells(e);return A(o,e=>{const o=((e,t,o)=>{let n=0;for(let r=e;r<t;r++)n+=void 0!==o[r]?o[r]:0;return n})(e.column,e.column+e.colspan,t);return{element:e.element,width:o,colspan:e.colspan}})})(e,t),ws=(e,t,o)=>{const n=ys(e,t);D(n,e=>{o.setElementWidth(e.element,e.width)})},_s=(e,t,o,n,r)=>{const a=qr.fromTable(e),s=r.getCellDelta(t),i=r.getWidths(a,r),l=o===a.grid.columns-1,c=n.clampTableDelta(i,o,s,r.minCellWidth(),l),d=vs(i,o,c,r,n),m=A(d,(e,t)=>e+i[t]);ws(a,m,r),n.resizeTable(r.adjustTableWidth,c,l)},Cs=(e,t,o)=>{const n=qr.fromTable(e),r=((e,t)=>$a(e,t,za,e=>e.getOrThunk(kr)))(n,e),a=A(r,(e,n)=>o===n?Math.max(t+e,kr()):e),s=((e,t)=>A(e.all,(e,o)=>({element:e.element,height:t[o]})))(n,a);D(s,e=>{Ta(e.element,e.height)}),D(qr.justCells(n),e=>{(e=>{Po(e,"height")})(e.element)});const i=N(a,(e,t)=>e+t,0);Ta(e,i)},ks=(e,t)=>{if(!wr(e)){const o=(e=>Ra(e).bind(e=>mr(e,["fixed","relative","empty"])))(e);o.each(o=>{const n=o.value/2;Ha(e,n,o.unit),Ha(t,n,o.unit)})}},Ss=(e,t,o)=>{const n=vr(e,t,1);1===o||n<=1?_o(e,t):xo(e,t,Math.min(o,n))},Es=(e,t)=>o=>{const n=o.column+o.colspan-1,r=o.column;return n>=e&&r<t},Os=(e,t)=>{const o=qr.fromTable(e);return ps(o,t).map(e=>{const t=e[e.length-1],n=e[0].column,r=t.column+t.colspan,a=((e,t,o)=>{if(qr.hasColumns(e)){const n=R(qr.justColumns(e),Es(t,o)),r=A(n,e=>{const n=Ao(e.element);return Ss(n,"span",o-t),n}),a=Ie.fromTag("colgroup");return fo(a,r),[a]}return[]})(o,n,r),s=((e,t,o)=>A(e.all,e=>{const n=R(e.cells,Es(t,o)),r=A(n,e=>{const n=Ao(e.element);return Ss(n,"colspan",o-t),n}),a=Ie.fromTag("tr");return fo(a,r),a}))(o,n,r);return[...a,...s]})},Ts=(e,t,o)=>{const n=qr.fromTable(e);return gs(n,t).bind(e=>{const t=ss(n,o,!1),r=ze(t).rows.slice(e[0].row,e[e.length-1].row+e[e.length-1].rowspan),a=I(r,e=>{const t=R(e.cells,e=>!e.isLocked);return t.length>0?[{...e,cells:t}]:[]}),s=is(a);return ge(s.length>0,s)}).map(e=>(e=>A(e,e=>{const t=To(e.element);return D(e.cells,e=>{const o=Ao(e.element);es(o,"colspan",e.colspan,1),es(o,"rowspan",e.rowspan,1),go(t,o)}),t}))(e))},As=(e,t,o)=>{const n=e[o].element,r=Ie.fromTag("td");go(r,Ie.fromTag("br"));(t?go:uo)(n,r)},Ds=(e,t)=>{const o=e=>Ke(e.element,t),n=Ao(e),r=Fr(n),a=Xa(e),s=qr.generate(r),i=((e,t)=>{const o=e.grid.columns;let n=e.grid.rows,r=o,a=0,s=0;const i=[],l=[];return q(e.access,e=>{if(i.push(e),t(e)){l.push(e);const t=e.row,o=t+e.rowspan-1,i=e.column,c=i+e.colspan-1;t<n?n=t:o>a&&(a=o),i<r?r=i:c>s&&(s=c)}}),((e,t,o,n,r,a)=>({minRow:e,minCol:t,maxRow:o,maxCol:n,allCells:r,selectedCells:a}))(n,r,a,s,i,l)})(s,o),l="th:not("+t+"),td:not("+t+")",c=Er(n,"th,td",e=>Ke(e,l));D(c,So),((e,t,o,n)=>{const r=R(e,e=>"colgroup"!==e.section),a=t.grid.columns,s=t.grid.rows;for(let e=0;e<s;e++){let s=!1;for(let i=0;i<a;i++)e<o.minRow||e>o.maxRow||i<o.minCol||i>o.maxCol||(qr.getAt(t,e,i).filter(n).isNone()?As(r,s,e):s=!0)}})(r,s,i,o);const d=((e,t,o,n)=>{if(0===n.minCol&&t.grid.columns===n.maxCol+1)return 0;const r=Wa(t,e,o),a=B(r,(e,t)=>e+t,0),s=B(r.slice(n.minCol,n.maxCol+1),(e,t)=>e+t,0),i=s/a*o.pixelWidth()-o.pixelWidth();return o.getCellDelta(i)})(e,qr.fromTable(e),a,i);return((e,t,o,n)=>{q(o.columns,e=>{(e.column<t.minCol||e.column>t.maxCol)&&So(e.element)});const r=R(Sr(e,"tr"),e=>0===e.dom.childElementCount);D(r,So),t.minCol!==t.maxCol&&t.minRow!==t.maxRow||D(Sr(e,"th,td"),e=>{_o(e,"rowspan"),_o(e,"colspan")}),_o(e,Vr),_o(e,"data-snooker-col-series"),Xa(e).adjustTableWidth(n)})(n,i,s,d),n},Ms=Zt("col"),Rs=Zt("colgroup"),Ns=e=>"tr"===Nt(e)||Rs(e),Bs=e=>({element:e,colspan:vr(e,"colspan",1),rowspan:vr(e,"rowspan",1)}),zs=e=>wo(e,"scope").map(e=>e.substr(0,3)),Hs=(e,t=Bs)=>{const o=o=>{if(Ns(o))return Rs((r={element:o}).element)?e.colgroup(r):e.row(r);{const r=o,a=(t=>Ms(t.element)?e.col(t):e.cell(t))(t(r));return n=_.some({item:r,replacement:a}),a}var r};let n=_.none();return{getOrInit:(e,t)=>n.fold(()=>o(e),n=>t(e,n.item)?n.replacement:o(e))}},Ls=e=>t=>{const o=[],n=n=>{const r="td"===e?{scope:null}:{},a=t.replace(n,e,r);return o.push({item:n,sub:a}),a};return{replaceOrInit:(e,t)=>{if(Ns(e)||Ms(e))return e;{const r=e;return((e,t)=>z(o,o=>t(o.item,e)))(r,t).fold(()=>n(r),o=>t(e,o.item)?o.sub:n(r))}}}},Is=e=>({unmerge:t=>{const o=zs(t);return o.each(e=>xo(t,"scope",e)),()=>{const n=e.cell({element:t,colspan:1,rowspan:1});return Po(n,"width"),Po(t,"width"),o.each(e=>xo(n,"scope",e)),n}},merge:e=>(Po(e[0],"width"),(()=>{const t=ue(A(e,zs));if(0===t.length)return _.none();{const e=t[0],o=["row","col"];return O(t,t=>t!==e&&E(o,t))?_.none():_.from(e)}})().fold(()=>_o(e[0],"scope"),t=>xo(e[0],"scope",t+"group")),p(e[0]))}),Ps=(e,t,o)=>{const n=qr.fromTable(e);return gs(n,t).map(e=>{const t=ss(n,o,!1),{rows:r}=ze(t),a=((e,t)=>{const o=e.slice(0,t[t.length-1].row+1),n=is(o);return I(n,e=>{const o=e.cells.slice(0,t[t.length-1].column+1);return A(o,e=>e.element)})})(r,e),s=((e,t)=>{const o=e.slice(t[0].row+t[0].rowspan-1,e.length),n=is(o);return I(n,e=>{const o=e.cells.slice(t[0].column+t[0].colspan-1,e.cells.length);return A(o,e=>e.element)})})(r,e);return{upOrLeftCells:a,downOrRightCells:s}})},Fs=(e,t)=>({parent:p(e),view:p(e),dragContainer:p(e),origin:()=>on(e),isResizable:t}),Vs=ee([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),Zs=(e,t,o)=>{const n=o.substring(0,o.length-e.length),r=parseFloat(n);return n===r.toString()?t(r):Vs.invalid(o)},Us={...Vs,from:e=>ve(e,"%")?Zs("%",Vs.percent,e):ve(e,"px")?Zs("px",Vs.pixels,e):Vs.invalid(e)},js=(e,t,o)=>e.fold(()=>t,e=>((e,t,o)=>{const n=o/t;return A(e,e=>Us.from(e).fold(()=>e,e=>e*n+"px",e=>e/100*o+"px"))})(t,o,e),e=>((e,t)=>A(e,e=>Us.from(e).fold(()=>e,e=>e/t*100+"%",e=>e+"%")))(t,o)),Ws=(e,t,o)=>{const n=Us.from(o),r=P(e,e=>"0px"===e)?((e,t)=>{const o=e.fold(()=>p(""),e=>p(e/t+"px"),()=>p(100/t+"%"));return T(t,o)})(n,e.length):js(n,e,t);return Gs(r)},$s=(e,t)=>0===e.length?t:N(e,(e,t)=>Us.from(t).fold(p(0),h,h)+e,0),qs=(e,t)=>Us.from(e).fold(p(e),e=>e+t+"px",e=>e+t+"%"),Gs=e=>{if(0===e.length)return e;const t=N(e,(e,t)=>{const o=Us.from(t).fold(()=>({value:t,remainder:0}),e=>((e,t)=>{const o=Math.floor(e);return{value:o+t,remainder:e-o}})(e,"px"),e=>({value:e+"%",remainder:0}));return{output:[o.value].concat(e.output),remainder:e.remainder+o.remainder}},{output:[],remainder:0}),o=t.output;return o.slice(0,o.length-1).concat([qs(o[o.length-1],Math.round(t.remainder))])},Ks=Us.from,Ys=(e,t,o)=>{const n=qr.fromTable(e),r=n.all,a=qr.justCells(n),s=qr.justColumns(n);t.each(t=>{const o=Ks(t).fold(p("px"),p("px"),p("%"));const r=Ko(e),i=((e,t)=>Ua(e,t,Fa,ja))(n,e),l=Ws(i,r,t);qr.hasColumns(n)?((e,t,o)=>{D(t,(t,n)=>{const r=$s([e[n]],Cr());Bo(t.element,"width",r+o)})})(l,s,o):((e,t,o)=>{D(t,t=>{const n=e.slice(t.column,t.colspan+t.column),r=$s(n,Cr());Bo(t.element,"width",r+o)})})(l,a,o),Bo(e,"width",t)}),o.each(t=>{const o=Wo(e),s=((e,t)=>$a(e,t,Va,ja))(n,e);((e,t,o)=>{D(o,e=>{Po(e.element,"height")}),D(t,(t,o)=>{Bo(t.element,"height",e[o])})})(Ws(s,o,t),r,a),Bo(e,"height",t)})},Xs=e=>Ra(e).exists(e=>wa.test(e)),Js=e=>Ra(e).exists(e=>_a.test(e)),Qs=e=>Ra(e).isNone();var ei=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],ti=()=>({up:p({selector:hn,closest:xn,predicate:gn,all:qt}),down:p({selector:An,predicate:En}),styles:p({get:Ho,getRaw:Io,set:Bo,remove:Po}),attrs:p({get:yo,set:xo,remove:_o,copyTo:(e,t)=>{const o=Co(e);vo(t,o)}}),insert:p({before:co,after:mo,afterAll:ho,append:go,appendAll:fo,prepend:uo,wrap:po}),remove:p({unwrap:Eo,remove:So}),create:p({nu:Ie.fromTag,clone:e=>Ie.fromDom(e.dom.cloneNode(!1)),text:Ie.fromText}),query:p({comparePosition:(e,t)=>e.dom.compareDocumentPosition(t.dom),prevSibling:Gt,nextSibling:Kt}),property:p({children:Yt,name:Nt,parent:Wt,document:e=>jt(e).dom,isText:Pt,isComment:Ht,isElement:It,isSpecial:e=>{const t=Nt(e);return E(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],t)},getLanguage:e=>It(e)?wo(e,"lang"):_.none(),getText:an,setText:ln,isBoundary:e=>!!It(e)&&("body"===Nt(e)||E(ei,Nt(e))),isEmptyTag:e=>!!It(e)&&E(["br","img","hr","input"],Nt(e)),isNonEditable:e=>It(e)&&"false"===yo(e,"contenteditable")}),eq:Je,is:et});const oi=(e,t)=>({item:e,mode:t}),ni=(e,t,o,n=ri)=>e.property().parent(t).map(e=>oi(e,n)),ri=(e,t,o,n=ai)=>o.sibling(e,t).map(e=>oi(e,n)),ai=(e,t,o,n=ai)=>{const r=e.property().children(t);return o.first(r).map(e=>oi(e,n))},si=[{current:ni,next:ri,fallback:_.none()},{current:ri,next:ai,fallback:_.some(ni)},{current:ai,next:ai,fallback:_.some(ri)}],ii=(e,t,o,n,r=si)=>z(r,e=>e.current===o).bind(o=>o.current(e,t,n,o.next).orThunk(()=>o.fallback.bind(o=>ii(e,t,o,n)))),li=()=>({sibling:(e,t)=>e.query().prevSibling(t),first:e=>e.length>0?_.some(e[e.length-1]):_.none()}),ci=()=>({sibling:(e,t)=>e.query().nextSibling(t),first:e=>e.length>0?_.some(e[0]):_.none()}),di=(e,t,o,n,r,a)=>ii(e,t,n,r).bind(t=>a(t.item)?_.none():o(t.item)?_.some(t.item):di(e,t.item,o,t.mode,r,a)),mi=(e,t)=>({element:e,offset:t}),ui=(e,t,o)=>e.property().isText(t)&&0===e.property().getText(t).trim().length||e.property().isComment(t)?o(t).bind(t=>ui(e,t,o).orThunk(()=>_.some(t))):_.none(),gi=(e,t)=>{if(e.property().isText(t))return e.property().getText(t).length;return e.property().children(t).length},pi=(e,t)=>{const o=ui(e,t,e.query().prevSibling).getOr(t);if(e.property().isText(o))return mi(o,gi(e,o));const n=e.property().children(o);return n.length>0?pi(e,n[n.length-1]):mi(o,gi(e,o))},hi=pi,fi=ti(),bi=e=>t=>0===e.property().children(t).length,xi=(e,t,o,n)=>di(e,t,o,ri,li(),n),vi=(e,t,o,n)=>di(e,t,o,ri,ci(),n),yi=ti(),wi=(e,t)=>((e,t,o)=>xi(e,t,bi(e),o))(yi,e,t),_i=(e,t)=>((e,t,o)=>vi(e,t,bi(e),o))(yi,e,t),Ci=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],ki=(e,t,o,n)=>{const r=t(e,o);return N(n,(o,n)=>{const r=t(e,n);return Si(e,o,r)},r)},Si=(e,t,o)=>t.bind(t=>o.filter(b(e.eq,t))),Ei=(e,t,o)=>o.length>0?((e,t,o,n)=>n(e,t,o[0],o.slice(1)))(e,t,o,ki):_.none(),Oi=(e,t,o,n=y)=>{const r=[t].concat(e.up().all(t)),a=[o].concat(e.up().all(o)),s=e=>H(e,n).fold(()=>e,t=>e.slice(0,t+1)),i=s(r),l=s(a),c=z(i,t=>O(l,((e,t)=>b(e.eq,t))(e,t)));return{firstpath:i,secondpath:l,shared:c}},Ti=ti(),Ai=(e,t)=>Ei(Ti,(t,o)=>e(o),t),Di=ti(),Mi=e=>((e,t)=>{const o=e.property().name(t);return E(Ci,o)})(Di,e),Ri=e=>((e,t)=>{const o=e.property().name(t);return E(["ol","ul"],o)})(Di,e),Ni=e=>((e,t)=>E(["br","img","hr","input"],e.property().name(t)))(Di,e),Bi=e=>{const t=Zt("br"),o=e=>zn(e).bind(o=>{const n=Kt(o).map(e=>!!Mi(e)||!!Ni(e)&&"img"!==Nt(e)).getOr(!1);return Wt(o).map(r=>!0===n||(e=>"li"===Nt(e)||gn(e,Ri).isSome())(r)||t(o)||Mi(r)&&!Je(e,r)?[]:[Ie.fromTag("br")])}).getOr([]),n=(()=>{const n=I(e,e=>{const n=Yt(e);return(e=>P(e,e=>t(e)||Pt(e)&&0===an(e).trim().length))(n)?[]:n.concat(o(e))});return 0===n.length?[Ie.fromTag("br")]:n})();ko(e[0]),fo(e[0],n)},zi=e=>{_o(e,"width"),_o(e,"height")},Hi=e=>{const t=La(e);Ys(e,_.some(t),_.none()),zi(e)},Li=e=>{const t=(e=>Ko(e)+"px")(e);Ys(e,_.some(t),_.none()),zi(e)},Ii=e=>{const t=(e=>Wo(e)+"px")(e);Ys(e,_.none(),_.some(t)),zi(e)},Pi=e=>{Po(e,"width");const t=Ar(e),o=t.length>0?t:Tr(e);D(o,e=>{Po(e,"width"),zi(e)}),zi(e)},Fi={scope:["row","col"]},Vi=e=>()=>{const t=Ie.fromTag("td",e.dom);return go(t,Ie.fromTag("br",e.dom)),t},Zi=e=>()=>Ie.fromTag("col",e.dom),Ui=e=>()=>Ie.fromTag("colgroup",e.dom),ji=e=>()=>Ie.fromTag("tr",e.dom),Wi=(e,t,o)=>{const n=((e,t)=>{const o=Do(e,t),n=Yt(Ao(e));return fo(o,n),o})(e,t);return q(o,(e,t)=>{null===e?_o(n,t):xo(n,t,e)}),n},$i=e=>e,qi=(e,t,o)=>{const n=(e,t)=>{((e,t)=>{const o=e.dom,n=t.dom;Mo(o)&&Mo(n)&&(n.style.cssText=o.style.cssText)})(e.element,t),Po(t,"height"),1!==e.colspan&&Po(t,"width")};return{col:o=>{const r=Ie.fromTag(Nt(o.element),t.dom);return n(o,r),e(o.element,r),r},colgroup:Ui(t),row:ji(t),cell:r=>{const a=Ie.fromTag(Nt(r.element),t.dom),s=o.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),i=s.length>0?((e,t,o)=>Bn(e).map(n=>{const r=o.join(","),a=On(n,r,t=>Je(t,e));return N(a,(e,t)=>{const o=To(t);return go(e,o),o},t)}).getOr(t))(r.element,a,s):a;return go(i,Ie.fromTag("br")),n(r,a),((e,t)=>{q(Fi,(o,n)=>wo(e,n).filter(e=>E(o,e)).each(e=>xo(t,n,e)))})(r.element,a),e(r.element,a),a},replace:Wi,colGap:Zi(t),gap:Vi(t)}},Gi=e=>({col:Zi(e),colgroup:Ui(e),row:ji(e),cell:Vi(e),replace:$i,colGap:Zi(e),gap:Vi(e)}),Ki=e=>qr.fromTable(e).grid,Yi=(e,t,o,n)=>{const r=ze(e).rows;let a=!0;for(let e=0;e<r.length;e++)for(let s=0;s<Be(r[0]);s++){const i=r[e],l=Re(i,s),c=o(l.element,t);c&&!a?De(i,s,Ee(n(),!0,l.isLocked)):c&&(a=!1)}return e},Xi=(e,t,o,n)=>{const r=ze(e).rows;if(t>0&&t<r.length){const e=((e,t)=>B(e,(e,o)=>O(e,e=>t(e.element,o.element))?e:e.concat([o]),[]))(r[t-1].cells,o);D(e,e=>{let a=_.none();for(let s=t;s<r.length;s++)for(let t=0;t<Be(r[0]);t++){const i=r[s],l=Re(i,t);o(l.element,e.element)&&(a.isNone()&&(a=_.some(n())),a.each(e=>{De(i,t,Ee(e,!0,l.isLocked))}))}})}return e},Ji=(e,t)=>({rowDelta:0,colDelta:Be(e[0])-Be(t[0])}),Qi=(e,t)=>({rowDelta:e.length-t.length,colDelta:0}),el=(e,t,o,n)=>{const r="colgroup"===t.section?o.col:o.cell;return T(e,e=>Ee(r(),!0,n(e)))},tl=(e,t,o,n)=>{const r=e[e.length-1];return e.concat(T(t,()=>{const e="colgroup"===r.section?o.colgroup:o.row,t=He(r,e,h),a=el(t.cells.length,t,o,e=>Q(n,e.toString()));return Me(t,a)}))},ol=(e,t,o,n)=>A(e,e=>{const r=el(t,e,o,y);return Te(e,n,r)}),nl=(e,t,o)=>{const n=t.colDelta<0?ol:h,r=t.rowDelta<0?tl:h,a=Ur(e),s=Be(e[0]),i=O(a,e=>e===s-1),l=n(e,Math.abs(t.colDelta),o,i?s-1:s),c=Ur(l);return r(l,Math.abs(t.rowDelta),o,F(c,w))},rl=(e,t,o,n)=>{const r=b(n,Re(e[t],o).element),a=e[t];return e.length>1&&Be(a)>1&&(o>0&&r(Ne(a,o-1))||o<a.cells.length-1&&r(Ne(a,o+1))||t>0&&r(Ne(e[t-1],o))||t<e.length-1&&r(Ne(e[t+1],o)))},al=(e,t,o)=>R(o,o=>o>=e.column&&o<=Be(t[0])+e.column),sl=(e,t,o,n,r)=>{const a=Ur(t),s=((e,t,o)=>{const n=Be(t[0]),r=ze(t).cols.length+e.row,a=T(n-e.column,t=>t+e.column),s=z(a,e=>P(o,t=>t!==e)).getOr(n-1);return{row:r,column:s}})(e,t,a),i=ze(o).rows,l=al(s,i,a),c=((e,t,o)=>{if(e.row>=t.length||e.column>Be(t[0]))return le.error("invalid start address out of table bounds, row: "+e.row+", column: "+e.column);const n=t.slice(e.row),r=n[0].cells.slice(e.column),a=Be(o[0]),s=o.length;return le.value({rowDelta:n.length-s,colDelta:r.length-a})})(s,t,i);return c.map(e=>{const o={...e,colDelta:e.colDelta-l.length},a=nl(t,o,n),c=Ur(a),d=al(s,i,c);return((e,t,o,n,r,a)=>{const s=e.row,i=e.column,l=s+o.length,c=i+Be(o[0])+a.length,d=F(a,w);for(let e=s;e<l;e++){let a=0;for(let l=i;l<c;l++){if(d[l]){a++;continue}rl(t,e,l,r)&&Yi(t,Ne(t[e],l),r,n.cell);const c=l-i-a,m=Re(o[e-s],c),u=m.element,g=n.replace(u);De(t[e],l,Ee(g,!0,m.isLocked))}}return t})(s,a,i,n,r,d)})},il=(e,t,o,n,r)=>{((e,t,o,n)=>{t>0&&t<e[0].cells.length&&D(e,e=>{const r=e.cells[t-1];let a=0;const s=n();for(;e.cells.length>t+a&&o(r.element,e.cells[t+a].element);)De(e,t+a,Ee(s,!0,e.cells[t+a].isLocked)),a++})})(t,e,r,n.cell);const a=Qi(o,t),s=nl(o,a,n),i=Qi(t,s),l=nl(t,i,n);return A(l,(t,o)=>Te(t,e,s[o].cells))},ll=(e,t,o,n,r)=>{Xi(t,e,r,n.cell);const a=Ur(t),s=Ji(t,o),i={...s,colDelta:s.colDelta-a.length},l=nl(t,i,n),{cols:c,rows:d}=ze(l),m=Ur(l),u=Ji(o,t),g={...u,colDelta:u.colDelta+m.length},p=((e,t,o)=>A(e,e=>B(o,(o,n)=>{const r=el(1,e,t,w)[0];return Ae(o,n,r)},e)))(o,n,m),h=nl(p,g,n);return[...c,...d.slice(0,e),...h,...d.slice(e,d.length)]},cl=(e,t,o,n,r)=>{const{rows:a,cols:s}=ze(e),i=a.slice(0,t),l=a.slice(t),c=((e,t,o,n)=>He(e,e=>n(e,o),t))(a[o],(e,o)=>t>0&&t<a.length&&n(Ne(a[t-1],o),Ne(a[t],o))?Re(a[t],o):Ee(r(e.element,n),!0,e.isLocked),n,r);return[...s,...i,c,...l]},dl=(e,t,o,n,r)=>A(e,e=>{const a=t>0&&t<Be(e)&&n(Ne(e,t-1),Ne(e,t)),s=((e,t,o,n,r,a,s)=>{if("colgroup"!==o&&n)return Re(e,t);{const t=Re(e,r);return Ee(s(t.element,a),!0,!1)}})(e,t,e.section,a,o,n,r);return Ae(e,t,s)}),ml=(e,t,o,n)=>((e,t,o,n)=>void 0!==Ne(e[t],o)&&t>0&&n(Ne(e[t-1],o),Ne(e[t],o)))(e,t,o,n)||((e,t,o)=>t>0&&o(Ne(e,t-1),Ne(e,t)))(e[t],o,n),ul=(e,t,o,n)=>{const r=e=>"row"===e?(e=>yr(e,"rowspan")>1)(t):wr(t),a=e=>r(e)?`${e}group`:e;if(e)return Nr(t)?a(o):null;if(n&&Nr(t)){return a("row"===o?"col":"row")}return null},gl=(e,t,o)=>Ee(o(e.element,t),!0,e.isLocked),pl=(e,t,o,n,r,a,s)=>A(e,(e,i)=>((e,t)=>{const o=e.cells,n=A(o,t);return Oe(e.element,n,e.section,e.isNew)})(e,(e,l)=>{if((e=>O(t,t=>o(e.element,t.element)))(e)){const t=s(e,i,l)?r(e,o,n):e;return a(t,i,l).each(e=>{var o,n;o=t.element,n={scope:_.from(e)},q(n,(e,t)=>{e.fold(()=>{_o(o,t)},e=>{bo(o.dom,t,e)})})}),t}return e})),hl=(e,t,o)=>I(e,(n,r)=>ml(e,r,t,o)?[]:[Re(n,t)]),fl=(e,t,o,n,r)=>{const a=ze(e).rows,s=I(t,e=>hl(a,e,n)),i=A(a,e=>Br(e.cells)),l=((e,t)=>P(t,h)&&Br(e)?w:(e,o,n)=>!("th"===Nt(e.element)&&t[o]))(s,i),c=((e,t)=>(o,n)=>_.some(ul(e,o.element,"row",t[n])))(o,i);return pl(e,s,n,r,gl,c,l)},bl=(e,t,o,n,r,a,s)=>{const{cols:i,rows:l}=ze(e),c=l[t[0]],d=I(t,e=>((e,t,o)=>{const n=e[t];return I(n.cells,(n,r)=>ml(e,t,r,o)?[]:[n])})(l,e,r)),m=A(c.cells,(e,t)=>Br(hl(l,t,r))),u=[...l];D(t,e=>{u[e]=s.transformRow(l[e],o)});const g=[...i,...u],p=((e,t)=>P(t,h)&&Br(e.cells)?w:(e,o,n)=>!("th"===Nt(e.element)&&t[n]))(c,m),f=((e,t)=>(o,n,r)=>_.some(ul(e,o.element,"col",t[r])))(n,m);return pl(g,d,r,a,s.transformCell,f,p)},xl=(e,t,o,n)=>{const r=ze(e).rows,a=A(t,e=>Re(r[e.row],e.column));return pl(e,a,o,n,gl,_.none,w)},vl=e=>B(e,(e,t)=>O(e,e=>e.column===t.column)?e:e.concat([t]),[]).sort((e,t)=>e.column-t.column),yl=e=>kn(e,!0),wl=e=>{0===Tr(e).length&&So(e)},_l=(e,t)=>({grid:e,cursor:t}),Cl=(e,t,o)=>{var n,r;const a=ze(e).rows;return _.from(null===(r=null===(n=a[t])||void 0===n?void 0:n.cells[o])||void 0===r?void 0:r.element).filter(yl).orThunk(()=>(e=>j(e,e=>j(e.cells,e=>{const t=e.element;return ge(yl(t),t)})))(a))},kl=(e,t,o)=>{const n=Cl(e,t,o);return _l(e,n)},Sl=e=>B(e,(e,t)=>O(e,e=>e.row===t.row)?e:e.concat([t]),[]).sort((e,t)=>e.row-t.row),El=(e,t,o,n)=>{const r=t[0].row,a=Sl(t),s=N(a,(e,t)=>({grid:cl(e.grid,r,t.row+e.delta,o,n.getOrInit),delta:e.delta+1}),{grid:e,delta:0}).grid;return kl(s,r,t[0].column)},Ol=(e,t,o,n)=>{const r=Sl(t),a=r[r.length-1],s=a.row+a.rowspan,i=N(r,(e,t)=>cl(e,s,t.row,o,n.getOrInit),e);return kl(i,s,t[0].column)},Tl=(e,t,o,n)=>{const r=t.details,a=vl(r),s=a[0].column,i=N(a,(e,t)=>({grid:dl(e.grid,s,t.column+e.delta,o,n.getOrInit),delta:e.delta+1}),{grid:e,delta:0}).grid;return kl(i,r[0].row,s)},Al=(e,t,o,n)=>{const r=t.details,a=r[r.length-1],s=a.column+a.colspan,i=vl(r),l=N(i,(e,t)=>dl(e,s,t.column,o,n.getOrInit),e);return kl(l,r[0].row,s)},Dl=(e,t,o,n)=>{const r=vl(t),a=A(r,e=>e.column),s=fl(e,a,!0,o,n.replaceOrInit);return kl(s,t[0].row,t[0].column)},Ml=(e,t,o,n)=>{const r=xl(e,t,o,n.replaceOrInit);return kl(r,t[0].row,t[0].column)},Rl=(e,t,o,n)=>{const r=vl(t),a=A(r,e=>e.column),s=fl(e,a,!1,o,n.replaceOrInit);return kl(s,t[0].row,t[0].column)},Nl=(e,t,o,n)=>{const r=xl(e,t,o,n.replaceOrInit);return kl(r,t[0].row,t[0].column)},Bl=(e,t)=>(o,n,r,a,s)=>{const i=Sl(n),l=A(i,e=>e.row),c=bl(o,l,e,t,r,a.replaceOrInit,s);return kl(c,n[0].row,n[0].column)},zl=Bl("thead",!0),Hl=Bl("tbody",!1),Ll=Bl("tfoot",!1),Il=(e,t,o,n)=>{const r=vl(t.details),a=((e,t)=>I(e,e=>{const o=e.cells,n=N(t,(e,t)=>t>=0&&t<e.length?e.slice(0,t).concat(e.slice(t+1)):e,o);return n.length>0?[Oe(e.element,n,e.section,e.isNew)]:[]}))(e,A(r,e=>e.column)),s=a.length>0?a[0].cells.length-1:0;return kl(a,r[0].row,Math.min(r[0].column,s))},Pl=(e,t,o,n)=>{const r=Sl(t),a=((e,t,o)=>{const{rows:n,cols:r}=ze(e);return[...r,...n.slice(0,t),...n.slice(o+1)]})(e,r[0].row,r[r.length-1].row),s=Math.max(ze(a).rows.length-1,0);return kl(a,Math.min(t[0].row,s),t[0].column)},Fl=(e,t,o,n)=>{const r=t.cells;Bi(r);const a=((e,t,o,n)=>{const r=ze(e).rows;if(0===r.length)return e;for(let e=t.startRow;e<=t.finishRow;e++)for(let o=t.startCol;o<=t.finishCol;o++){const t=r[e],a=Re(t,o).isLocked;De(t,o,Ee(n(),!1,a))}return e})(e,t.bounds,0,n.merge(r));return _l(a,_.from(r[0]))},Vl=(e,t,o,n)=>{const r=N(t,(e,t)=>Yi(e,t,o,n.unmerge(t)),e);return _l(r,_.from(t[0]))},Zl=(e,t,o,n)=>{const r=((e,t)=>{const o=qr.fromTable(e);return ss(o,t,!0)})(t.clipboard,t.generators),a=((e,t)=>({row:e,column:t}))(t.row,t.column);return sl(a,e,r,t.generators,o).fold(()=>_l(e,_.some(t.element)),e=>kl(e,t.row,t.column))},Ul=(e,t,o)=>{const n=((e,t)=>Ir(e,()=>t))(e,o.section),r=qr.generate(n);return ss(r,t,!0)},jl=(e,t,o,n)=>{const r=ze(e).rows,a=t.cells[0].column,s=r[t.cells[0].row],i=Ul(t.clipboard,t.generators,s),l=il(a,e,i,t.generators,o);return kl(l,t.cells[0].row,t.cells[0].column)},Wl=(e,t,o,n)=>{const r=ze(e).rows,a=t.cells[t.cells.length-1].column+t.cells[t.cells.length-1].colspan,s=r[t.cells[0].row],i=Ul(t.clipboard,t.generators,s),l=il(a,e,i,t.generators,o);return kl(l,t.cells[0].row,a)},$l=(e,t,o,n)=>{const r=ze(e).rows,a=t.cells[0].row,s=r[a],i=Ul(t.clipboard,t.generators,s),l=ll(a,e,i,t.generators,o);return kl(l,t.cells[0].row,t.cells[0].column)},ql=(e,t,o,n)=>{const r=ze(e).rows,a=t.cells[t.cells.length-1].row+t.cells[t.cells.length-1].rowspan,s=r[t.cells[0].row],i=Ul(t.clipboard,t.generators,s),l=ll(a,e,i,t.generators,o);return kl(l,a,t.cells[0].column)},Gl=(e,t,o,n)=>((e,t,o,n)=>{const r=qr.generate(t),a=n.getWidths(r,n);ws(r,a,n)})(0,t,0,n.sizing),Kl=(e,t,o,n)=>((e,t,o,n,r)=>{const a=qr.generate(t),s=n.getWidths(a,n),i=n.pixelWidth(),{newSizes:l,delta:c}=r.calcRedestributedWidths(s,i,o.pixelDelta,n.isRelative);ws(a,l,n),n.adjustTableWidth(c)})(0,t,o,n.sizing,n.resize),Yl=(e,t)=>O(t,e=>0===e.column&&e.isLocked),Xl=(e,t)=>O(t,t=>t.column+t.colspan>=e.grid.columns&&t.isLocked),Jl=(e,t)=>{const o=ra(e),n=vl(t);return B(n,(e,t)=>e+o[t.column].map(Yo).getOr(0),0)},Ql=e=>(t,o)=>gs(t,o).filter(o=>!(e?Yl:Xl)(t,o)).map(e=>({details:e,pixelDelta:Jl(t,e)})),ec=(e,t)=>ps(e,t).map(t=>({details:t,pixelDelta:-Jl(e,t)})),tc=e=>(t,o)=>us(t,o).filter(o=>!(e?Yl:Xl)(t,o.cells)),oc=Ls("th"),nc=Ls("td"),rc=(e,t,o,n)=>ds(El,gs,g,g,Hs,e,t,o,n),ac=(e,t,o,n)=>ds(Ol,gs,g,g,Hs,e,t,o,n),sc=(e,t,o,n)=>ds(Tl,Ql(!0),Kl,g,Hs,e,t,o,n),ic=(e,t,o,n)=>ds(Al,Ql(!1),Kl,g,Hs,e,t,o,n),lc=(e,t,o,n)=>ds(Il,ec,Kl,wl,Hs,e,t,o,n),cc=(e,t,o,n)=>ds(Pl,gs,g,wl,Hs,e,t,o,n),dc=(e,t,o,n)=>ds(Dl,ps,g,g,oc,e,t,o,n),mc=(e,t,o,n)=>ds(Rl,ps,g,g,nc,e,t,o,n),uc=(e,t,o,n)=>ds(zl,gs,g,g,oc,e,t,o,n),gc=(e,t,o,n)=>ds(Hl,gs,g,g,nc,e,t,o,n),pc=(e,t,o,n)=>ds(Ll,gs,g,g,nc,e,t,o,n),hc=(e,t,o,n)=>ds(Ml,ps,g,g,oc,e,t,o,n),fc=(e,t,o,n)=>ds(Nl,ps,g,g,nc,e,t,o,n),bc=(e,t,o,n)=>ds(Fl,fs,Gl,g,Is,e,t,o,n),xc=(e,t,o,n)=>ds(Vl,bs,Gl,g,Is,e,t,o,n),vc=(e,t,o,n)=>ds(Zl,ms,Gl,g,Hs,e,t,o,n),yc=(e,t,o,n)=>ds(jl,tc(!0),g,g,Hs,e,t,o,n),wc=(e,t,o,n)=>ds(Wl,tc(!1),g,g,Hs,e,t,o,n),_c=(e,t,o,n)=>ds($l,us,g,g,Hs,e,t,o,n),Cc=(e,t,o,n)=>ds(ql,us,g,g,Hs,e,t,o,n),kc=(e,t)=>{const o=qr.fromTable(e);return gs(o,t).bind(e=>{const t=e[e.length-1],n=e[0].column,r=t.column+t.colspan,a=L(A(o.all,e=>R(e.cells,e=>e.column>=n&&e.column<r)));return Lr(a)}).getOr("")},Sc=(e,t)=>{const o=qr.fromTable(e);return gs(o,t).bind(Lr).getOr("")},Ec=(e,t)=>{const o=qr.fromTable(e);return gs(o,t).bind(e=>{const t=e[e.length-1],n=e[0].row,r=t.row+t.rowspan;return(e=>{const t=A(e,e=>Hr(e).type),o=E(t,"header"),n=E(t,"footer");if(o||n){const e=E(t,"body");return!o||e||n?o||e||!n?_.none():_.some("footer"):_.some("header")}return _.some("body")})(o.all.slice(n,r))}).getOr("")},Oc=(e,t)=>{const o=t.column,n=t.column+t.colspan-1,r=t.row,a=t.row+t.rowspan-1;return o<=e.finishCol&&n>=e.startCol&&r<=e.finishRow&&a>=e.startRow},Tc=(e,t)=>t.column>=e.startCol&&t.column+t.colspan-1<=e.finishCol&&t.row>=e.startRow&&t.row+t.rowspan-1<=e.finishRow,Ac=(e,t,o)=>{const n=qr.findItem(e,t,Je),r=qr.findItem(e,o,Je);return n.bind(e=>r.map(t=>{return o=e,n=t,r=Math.min(o.row,n.row),a=Math.min(o.column,n.column),s=Math.max(o.row+o.rowspan-1,n.row+n.rowspan-1),i=Math.max(o.column+o.colspan-1,n.column+n.colspan-1),{startRow:r,startCol:a,finishRow:s,finishCol:i};var o,n,r,a,s,i}))},Dc=(e,t,o)=>Ac(e,t,o).bind(t=>((e,t)=>{let o=!0;const n=b(Tc,t);for(let r=t.startRow;r<=t.finishRow;r++)for(let a=t.startCol;a<=t.finishCol;a++)o=o&&qr.getAt(e,r,a).exists(n);return o?_.some(t):_.none()})(e,t)),Mc=(e,t,o)=>Ac(e,t,o).map(t=>{const o=qr.filterItems(e,b(Oc,t));return A(o,e=>e.element)}),Rc=(e,t)=>qr.findItem(e,t,(e,t)=>Qe(t,e)).map(e=>e.element),Nc=(e,t,o)=>Dr(e).bind(n=>((e,t,o,n)=>qr.findItem(e,t,Je).bind(t=>{const r=o>0?t.row+t.rowspan-1:t.row,a=n>0?t.column+t.colspan-1:t.column;return qr.getAt(e,r+o,a+n).map(e=>e.element)}))(Hc(n),e,t,o)),Bc=(e,t,o)=>{const n=Hc(e);return Mc(n,t,o)},zc=(e,t,o,n,r)=>{const a=Hc(e),s=Je(e,o)?_.some(t):Rc(a,t),i=Je(e,r)?_.some(n):Rc(a,n);return s.bind(e=>i.bind(t=>Mc(a,e,t)))},Hc=qr.fromTable,Lc={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},Ic=()=>Ie.fromTag("th"),Pc=()=>Ie.fromTag("td"),Fc=e=>{const t=Ie.fromTag("colgroup");return T(e,()=>go(t,Ie.fromTag("col"))),t},Vc=(e,t,o,n)=>T(e,e=>((e,t,o,n)=>{const r=Ie.fromTag("tr");for(let a=0;a<e;a++){const e=n<t||a<o?Ic():Pc();a<o&&xo(e,"scope","row"),n<t&&xo(e,"scope","col"),go(e,Ie.fromTag("br")),go(r,e)}return r})(t,o,n,e)),Zc=e=>{let t=[];return{bind:e=>{if(void 0===e)throw new Error("Event bind error: undefined handler");t.push(e)},unbind:e=>{t=R(t,t=>t!==e)},trigger:(...o)=>{const n={};D(e,(e,t)=>{n[e]=o[t]}),D(t,e=>{e(n)})}}},Uc=e=>({registry:G(e,e=>({bind:e.bind,unbind:e.unbind})),trigger:G(e,e=>e.trigger)}),jc=ae(["compare","extract","mutate","sink"]),Wc=ae(["element","start","stop","destroy"]),$c=ae(["forceDrop","drop","move","delayDrop"]),qc=()=>{let e=_.none();const t=Uc({move:Zc(["info"])});return{onEvent:(o,n)=>{n.extract(o).each(o=>{const r=((t,o)=>{const n=e.map(e=>t.compare(e,o));return e=_.some(o),n})(n,o);r.each(e=>{t.trigger.move(e)})})},reset:()=>{e=_.none()},events:t.registry}},Gc=()=>{const e=(()=>{const e=Uc({move:Zc(["info"])});return{onEvent:g,reset:g,events:e.registry}})(),t=qc();let o=e;return{on:()=>{o.reset(),o=t},off:()=>{o.reset(),o=e},isOn:()=>o===t,onEvent:(e,t)=>{o.onEvent(e,t)},events:t.events}},Kc=(e,t,o)=>{let n=!1;const r=Uc({start:Zc([]),stop:Zc([])}),a=Gc(),s=()=>{d.stop(),a.isOn()&&(a.off(),r.trigger.stop())},l=((e,t)=>{let o=null;const n=()=>{i(o)||(clearTimeout(o),o=null)};return{cancel:n,throttle:(...r)=>{n(),o=setTimeout(()=>{o=null,e.apply(null,r)},t)}}})(s,200);a.events.move.bind(o=>{t.mutate(e,o.info)});const c=e=>(...t)=>{n&&e.apply(null,t)},d=t.sink($c({forceDrop:s,drop:c(s),move:c(e=>{l.cancel(),a.onEvent(e,t)}),delayDrop:c(l.throttle)}),o);return{element:d.element,go:e=>{d.start(e),a.on(),r.trigger.start()},on:()=>{n=!0},off:()=>{n=!1},isActive:()=>n,destroy:()=>{d.destroy()},events:r.registry}},Yc=de("ephox-dragster").resolve;var Xc=jc({compare:(e,t)=>en(t.left-e.left,t.top-e.top),extract:e=>_.some(en(e.x,e.y)),sink:(e,t)=>{const o=(e=>{const t={layerClass:Yc("blocker"),...e},o=Ie.fromTag("div");return xo(o,"role","presentation"),zo(o,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),wn(o,Yc("blocker")),wn(o,t.layerClass),{element:p(o),destroy:()=>{So(o)}}})(t),n=io(o.element(),"mousedown",e.forceDrop),r=io(o.element(),"mouseup",e.drop),a=io(o.element(),"mousemove",e.move),s=io(o.element(),"mouseout",e.delayDrop);return Wc({element:o.element,start:e=>{go(e,o.element())},stop:()=>{So(o.element())},destroy:()=>{o.destroy(),r.unbind(),a.unbind(),s.unbind(),n.unbind()}})},mutate:(e,t)=>{e.mutate(t.left,t.top)}});const Jc=de("ephox-snooker").resolve,Qc=()=>{const e=Uc({drag:Zc(["xDelta","yDelta","target"])});let t=_.none();const o=(()=>{const e=Uc({drag:Zc(["xDelta","yDelta"])});return{mutate:(t,o)=>{e.trigger.drag(t,o)},events:e.registry}})();o.events.drag.bind(o=>{t.each(t=>{e.trigger.drag(o.xDelta,o.yDelta,t)})});return{assign:e=>{t=_.some(e)},get:()=>t,mutate:o.mutate,events:e.registry}},ed=Jc("resizer-bar"),td=Jc("resizer-rows"),od=Jc("resizer-cols"),nd=e=>{const t=An(e.parent(),"."+ed);D(t,So)},rd=(e,t,o)=>{const n=e.origin();D(t,t=>{t.each(t=>{const r=o(n,t);wn(r,ed),go(e.parent(),r)})})},ad=(e,t,o,n)=>{rd(e,t,(e,t)=>{const r=((e,t,o,n,r)=>{const a=Ie.fromTag("div");return zo(a,{position:"absolute",left:t-n/2+"px",top:o+"px",height:r+"px",width:n+"px"}),vo(a,{"data-mce-bogus":"all","data-column":e,role:"presentation"}),a})(t.col,t.x-e.left,o.top-e.top,7,n);return wn(r,od),r})},sd=(e,t,o,n)=>{rd(e,t,(e,t)=>{const r=((e,t,o,n,r)=>{const a=Ie.fromTag("div");return zo(a,{position:"absolute",left:t+"px",top:o-r/2+"px",height:r+"px",width:n+"px"}),vo(a,{"data-mce-bogus":"all","data-row":e,role:"presentation"}),a})(t.row,o.left-e.left,t.y-e.top,n,7);return wn(r,td),r})},id=(e,t,o,n,r)=>{const a=on(o),s=t.isResizable,i=n.length>0?xa.positions(n,o):[],l=i.length>0?((e,t)=>I(e.all,(e,o)=>t(e.element)?[o]:[]))(e,s):[],c=R(i,(e,t)=>O(l,e=>t===e));sd(t,c,a,Yo(o));const d=r.length>0?ya.positions(r,o):[],m=d.length>0?((e,t)=>{const o=[];return T(e.grid.columns,n=>{const r=qr.getColumnAt(e,n).map(e=>e.element);r.forall(t)&&o.push(n)}),R(o,o=>{const n=qr.filterItems(e,e=>e.column===o);return P(n,e=>t(e.element))})})(e,s):[],u=R(d,(e,t)=>O(m,e=>t===e));ad(t,u,a,$o(o))},ld=(e,t)=>{if(nd(e),e.isResizable(t)){const o=qr.fromTable(t),n=sa(o),r=ra(o);id(o,e,t,n,r)}},cd=(e,t)=>{const o=An(e.parent(),"."+ed);D(o,t)},dd=e=>{cd(e,e=>{Bo(e,"display","none")})},md=e=>{cd(e,e=>{Bo(e,"display","block")})},ud=Jc("resizer-bar-dragging"),gd=e=>{const t=Qc(),o=((e,t={})=>{var o;const n=null!==(o=t.mode)&&void 0!==o?o:Xc;return Kc(e,n,t)})(t,{});let n=_.none();const r=(e,t)=>_.from(yo(e,t));t.events.drag.bind(e=>{r(e.target,"data-row").each(t=>{const o=_r(e.target,"top");Bo(e.target,"top",o+e.yDelta+"px")}),r(e.target,"data-column").each(t=>{const o=_r(e.target,"left");Bo(e.target,"left",o+e.xDelta+"px")})});const a=(e,t)=>_r(e,t)-vr(e,"data-initial-"+t,0);o.events.stop.bind(()=>{t.get().each(t=>{n.each(o=>{r(t,"data-row").each(e=>{const n=a(t,"top");_o(t,"data-initial-top"),d.trigger.adjustHeight(o,n,parseInt(e,10))}),r(t,"data-column").each(e=>{const n=a(t,"left");_o(t,"data-initial-left"),d.trigger.adjustWidth(o,n,parseInt(e,10))}),ld(e,o)})})});const s=(n,r)=>{d.trigger.startAdjust(),t.assign(n),xo(n,"data-initial-"+r,_r(n,r)),wn(n,ud),Bo(n,"opacity","0.2"),o.go(e.dragContainer())},i=io(e.parent(),"mousedown",e=>{var t;t=e.target,_n(t,td)&&s(e.target,"top"),(e=>_n(e,od))(e.target)&&s(e.target,"left")}),l=t=>Je(t,e.view()),c=io(e.view(),"mouseover",t=>{var r;(r=t.target,xn(r,"table",l).filter(kn)).fold(()=>{Ro(t.target)&&!(e=>_n(e,"ephox-snooker-resizer-bar")||_n(e,"ephox-dragster-blocker"))(t.target)&&nd(e)},t=>{o.isActive()&&(n=_.some(t),ld(e,t))})}),d=Uc({adjustHeight:Zc(["table","delta","row"]),adjustWidth:Zc(["table","delta","column"]),startAdjust:Zc([])});return{destroy:()=>{i.unbind(),c.unbind(),o.destroy(),nd(e)},refresh:t=>{ld(e,t)},on:o.on,off:o.off,hideBars:b(dd,e),showBars:b(md,e),events:d.registry}},pd=(e,t,o)=>{const n=xa,r=ya,a=gd(e),s=Uc({beforeResize:Zc(["table","type"]),afterResize:Zc(["table","type"]),startDrag:Zc([])});return a.events.adjustHeight.bind(e=>{const t=e.table;s.trigger.beforeResize(t,"row");const o=n.delta(e.delta,t);Cs(t,o,e.row),s.trigger.afterResize(t,"row")}),a.events.startAdjust.bind(e=>{s.trigger.startDrag()}),a.events.adjustWidth.bind(e=>{const n=e.table;s.trigger.beforeResize(n,"col");const a=r.delta(e.delta,n),i=o(n);_s(n,a,e.column,t,i),s.trigger.afterResize(n,"col")}),{on:a.on,off:a.off,refreshBars:a.refresh,hideBars:a.hideBars,showBars:a.showBars,destroy:a.destroy,events:s.registry}},hd=e=>t=>t.options.get(e),fd="100%",bd=e=>{var t;const o=e.dom,n=null!==(t=o.getParent(e.selection.getStart(),o.isBlock))&&void 0!==t?t:e.getBody();return Xo(Ie.fromDom(n))+"px"},xd=e=>_.from(e.options.get("table_clone_elements")),vd=hd("table_header_type"),yd=hd("table_column_resizing"),wd=e=>"preservetable"===yd(e),_d=e=>"resizetable"===yd(e),Cd=hd("table_sizing_mode"),kd=e=>"relative"===Cd(e),Sd=e=>"fixed"===Cd(e),Ed=e=>"responsive"===Cd(e),Od=hd("table_resize_bars"),Td=hd("table_style_by_css"),Ad=hd("table_merge_content_on_paste"),Dd=e=>{const t=e.options,o=t.get("table_default_attributes");return t.isSet("table_default_attributes")?o:((e,t)=>Ed(e)||Td(e)?t:Sd(e)?{...t,width:bd(e)}:{...t,width:fd})(e,o)},Md=e=>{const t=e.options,o=t.get("table_default_styles");return t.isSet("table_default_styles")?o:((e,t)=>Ed(e)||!Td(e)?t:Sd(e)?{...t,width:bd(e)}:{...t,width:fd})(e,o)},Rd=hd("table_use_colgroups"),Nd=e=>Ie.fromDom(e.getBody()),Bd=e=>t=>Je(t,Nd(e)),zd=e=>{_o(e,"data-mce-style");const t=e=>_o(e,"data-mce-style");D(Tr(e),t),D(Ar(e),t),D(Mr(e),t)},Hd=e=>Ie.fromDom(e.selection.getStart()),Ld=e=>e.getBoundingClientRect().width,Id=e=>e.getBoundingClientRect().height,Pd=e=>(t,o)=>{const n=t.dom.getStyle(o,e)||t.dom.getAttrib(o,e);return _.from(n).filter(we)},Fd=Pd("width"),Vd=Pd("height"),Zd=e=>pn(e,Zt("table")).exists(kn),Ud=e=>hn(e,"table"),jd=(e,t,o)=>{const n=e=>t=>void 0!==o&&o(t)||Je(t,e);return Je(e,t)?_.some({boxes:_.some([e]),start:e,finish:t}):Ud(e).bind(r=>Ud(t).bind(a=>{if(Je(r,a))return _.some({boxes:Bc(r,e,t),start:e,finish:t});if(Qe(r,a)){const o=On(t,"td,th",n(r)),s=o.length>0?o[o.length-1]:t;return _.some({boxes:zc(r,e,r,t,a),start:e,finish:s})}if(Qe(a,r)){const o=On(e,"td,th",n(a)),s=o.length>0?o[o.length-1]:e;return _.some({boxes:zc(a,e,r,t,a),start:e,finish:s})}return((e,t,o)=>Oi(Ti,e,t,o))(e,t).shared.bind(s=>xn(s,"table",o).bind(o=>{const s=On(t,"td,th",n(o)),i=s.length>0?s[s.length-1]:t,l=On(e,"td,th",n(o)),c=l.length>0?l[l.length-1]:e;return _.some({boxes:zc(o,e,r,t,a),start:c,finish:i})}))}))},Wd=(e,t)=>{const o=An(e,t);return o.length>0?_.some(o):_.none()},$d=(e,t,o)=>bn(e,t).bind(t=>bn(e,o).bind(e=>Ai(Ud,[t,e]).map(o=>({first:t,last:e,table:o})))),qd=(e,t,o,n,r)=>((e,t)=>z(e,e=>Ke(e,t)))(e,r).bind(e=>Nc(e,t,o).bind(e=>((e,t)=>hn(e,"table").bind(o=>bn(o,t).bind(t=>jd(t,e).bind(e=>e.boxes.map(t=>({boxes:t,start:e.start,finish:e.finish}))))))(e,n))),Gd=(e,t)=>Wd(e,t),Kd=(e,t,o)=>$d(e,t,o).bind(t=>{const o=t=>Je(e,t),n="thead,tfoot,tbody,table",r=hn(t.first,n,o),a=hn(t.last,n,o);return r.bind(e=>a.bind(o=>Je(e,o)?((e,t,o)=>{const n=Hc(e);return Dc(n,t,o)})(t.table,t.first,t.last):_.none()))}),Yd=h,Xd=e=>{const t=(e,t)=>wo(e,t).exists(e=>parseInt(e,10)>1);return e.length>0&&P(e,e=>t(e,"rowspan")||t(e,"colspan"))?_.some(e):_.none()},Jd=(e,t,o)=>t.length<=1?_.none():Kd(e,o.firstSelectedSelector,o.lastSelectedSelector).map(e=>({bounds:e,cells:t})),Qd=(e,t)=>({selection:e,kill:t}),em=()=>({tag:"none"}),tm=e=>({tag:"multiple",elements:e}),om=e=>({tag:"single",element:e}),nm=(e,t,o,n)=>({start:Zn.on(e,t),finish:Zn.on(o,n)}),rm=(e,t)=>{const o=Ge(e,t);return Ln(Ie.fromDom(o.startContainer),o.startOffset,Ie.fromDom(o.endContainer),o.endOffset)},am=nm,sm=(e,t,o,n,r)=>Je(o,n)?_.none():jd(o,n,t).bind(t=>{const n=t.boxes.getOr([]);return n.length>1?(r(e,n,t.start,t.finish),_.some(Qd(_.some(am(o,0,o,Mn(o))),!0))):_.none()}),im=ee([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),lm=e=>xn(e,"tr"),cm={...im,verify:(e,t,o,n,r,a,s)=>xn(n,"td,th",s).bind(o=>xn(t,"td,th",s).map(t=>Je(o,t)?Je(n,o)&&Mn(o)===r?a(t):im.none("in same cell"):Ai(lm,[o,t]).fold(()=>((e,t,o)=>{const n=e.getRect(t),r=e.getRect(o);return r.right>n.left&&r.left<n.right})(e,t,o)?im.success():a(t),e=>a(t)))).getOr(im.none("default")),cata:(e,t,o,n,r)=>e.fold(t,o,n,r)},dm=Zt("br"),mm=(e,t,o)=>t(e,o).bind(e=>Pt(e)&&0===an(e).trim().length?mm(e,t,o):_.some(e)),um=(e,t,o,n)=>((e,t)=>Xt(e,t).filter(dm).orThunk(()=>Xt(e,t-1).filter(dm)))(t,o).bind(t=>n.traverse(t).fold(()=>mm(t,n.gather,e).map(n.relative),e=>(e=>Wt(e).bind(t=>{const o=Yt(t);return Dn(o,e).map(n=>((e,t,o,n)=>({parent:e,children:t,element:o,index:n}))(t,o,e,n))}))(e).map(e=>Zn.on(e.parent,e.index)))),gm=(e,t,o,n)=>{const r=dm(t)?((e,t,o)=>o.traverse(t).orThunk(()=>mm(t,o.gather,e)).map(o.relative))(e,t,n):um(e,t,o,n);return r.map(e=>({start:e,finish:e}))},pm=(e,t)=>({left:e.left,top:e.top+t,right:e.right,bottom:e.bottom+t}),hm=(e,t)=>({left:e.left,top:e.top-t,right:e.right,bottom:e.bottom-t}),fm=(e,t,o)=>({left:e.left+t,top:e.top+o,right:e.right+t,bottom:e.bottom+o}),bm=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom}),xm=(e,t)=>_.some(e.getRect(t)),vm=(e,t,o)=>It(t)?xm(e,t).map(bm):Pt(t)?((e,t,o)=>o>=0&&o<Mn(t)?e.getRangedRect(t,o,t,o+1):o>0?e.getRangedRect(t,o-1,t,o):_.none())(e,t,o).map(bm):_.none(),ym=(e,t)=>It(t)?xm(e,t).map(bm):Pt(t)?e.getRangedRect(t,0,t,Mn(t)).map(bm):_.none(),wm=ee([{none:[]},{retry:["caret"]}]),_m=(e,t,o)=>pn(t,Mi).fold(y,t=>ym(e,t).exists(e=>((e,t)=>e.left<t.left||Math.abs(t.right-e.left)<1||e.left>t.right)(o,e))),Cm={point:e=>e.bottom,adjuster:(e,t,o,n,r)=>{const a=pm(r,5);return Math.abs(o.bottom-n.bottom)<1||o.top>r.bottom?wm.retry(a):o.top===r.bottom?wm.retry(pm(r,1)):_m(e,t,r)?wm.retry(fm(a,5,0)):wm.none()},move:pm,gather:_i},km=(e,t,o,n,r)=>0===r?_.some(n):((e,t,o)=>e.elementFromPoint(t,o).filter(e=>"table"===Nt(e)).isSome())(e,n.left,t.point(n))?((e,t,o,n,r)=>km(e,t,o,t.move(n,5),r))(e,t,o,n,r-1):e.situsFromPoint(n.left,t.point(n)).bind(a=>a.start.fold(_.none,a=>ym(e,a).bind(s=>t.adjuster(e,a,s,o,n).fold(_.none,n=>km(e,t,o,n,r-1))).orThunk(()=>_.some(n)),_.none)),Sm=(e,t,o)=>{const n=e.move(o,5),r=km(t,e,o,n,100).getOr(n);return((e,t,o)=>e.point(t)>o.getInnerHeight()?_.some(e.point(t)-o.getInnerHeight()):e.point(t)<0?_.some(-e.point(t)):_.none())(e,r,t).fold(()=>t.situsFromPoint(r.left,e.point(r)),o=>(t.scrollBy(0,o),t.situsFromPoint(r.left,e.point(r)-o)))},Em={tryUp:b(Sm,{point:e=>e.top,adjuster:(e,t,o,n,r)=>{const a=hm(r,5);return Math.abs(o.top-n.top)<1||o.bottom<r.top?wm.retry(a):o.bottom===r.top?wm.retry(hm(r,1)):_m(e,t,r)?wm.retry(fm(a,5,0)):wm.none()},move:hm,gather:wi}),tryDown:b(Sm,Cm),getJumpSize:p(5)},Om=(e,t,o)=>e.getSelection().bind(n=>gm(t,n.finish,n.foffset,o).fold(()=>_.some(mi(n.finish,n.foffset)),r=>{const a=e.fromSitus(r);return(e=>cm.cata(e,e=>_.none(),()=>_.none(),e=>_.some(mi(e,0)),e=>_.some(mi(e,Mn(e)))))(cm.verify(e,n.finish,n.foffset,a.finish,a.foffset,o.failure,t))})),Tm=(e,t,o,n,r,a)=>0===a?_.none():Mm(e,t,o,n,r).bind(s=>{const i=e.fromSitus(s),l=cm.verify(e,o,n,i.finish,i.foffset,r.failure,t);return cm.cata(l,()=>_.none(),()=>_.some(s),s=>Je(o,s)&&0===n?Am(e,o,n,hm,r):Tm(e,t,s,0,r,a-1),s=>Je(o,s)&&n===Mn(s)?Am(e,o,n,pm,r):Tm(e,t,s,Mn(s),r,a-1))}),Am=(e,t,o,n,r)=>vm(e,t,o).bind(t=>Dm(e,r,n(t,Em.getJumpSize()))),Dm=(e,t,o)=>{const n=At().browser;return n.isChromium()||n.isSafari()||n.isFirefox()?t.retry(e,o):_.none()},Mm=(e,t,o,n,r)=>vm(e,o,n).bind(t=>Dm(e,r,t)),Rm=(e,t)=>{return gn(e,e=>Wt(e).exists(e=>Je(e,t)),o).isSome();var o},Nm=(e,t,o,n,r)=>xn(n,"td,th",t).bind(n=>xn(n,"table",t).bind(a=>Rm(r,a)?((e,t,o)=>Om(e,t,o).bind(n=>Tm(e,t,n.element,n.offset,o,20).map(e.fromSitus)))(e,t,o).bind(e=>xn(e.finish,"td,th",t).map(t=>({start:n,finish:t,range:e}))):_.none())),Bm=(e,t,o,n,r,a)=>a(n,t).orThunk(()=>Nm(e,t,o,n,r).map(e=>{const t=e.range;return Qd(_.some(am(t.start,t.soffset,t.finish,t.foffset)),!0)})),zm=(e,t)=>xn(e,"tr",t).bind(e=>xn(e,"table",t).bind(o=>{const n=An(o,"tr");return Je(e,n[0])?((e,t,o)=>xi(yi,e,t,o))(o,e=>zn(e).isSome(),t).map(e=>{const t=Mn(e);return Qd(_.some(am(e,t,e,t)),!0)}):_.none()})),Hm=(e,t)=>xn(e,"tr",t).bind(e=>xn(e,"table",t).bind(o=>{const n=An(o,"tr");return Je(e,n[n.length-1])?((e,t,o)=>vi(yi,e,t,o))(o,e=>Bn(e).isSome(),t).map(e=>Qd(_.some(am(e,0,e,0)),!0)):_.none()})),Lm=(e,t,o,n,r,a,s)=>Nm(e,o,n,r,a).bind(e=>sm(t,o,e.start,e.finish,s)),Im=(e,t)=>xn(e,"td,th",t),Pm=e=>$t(e).exists(kn),Fm={traverse:Kt,gather:_i,relative:Zn.before,retry:Em.tryDown,failure:cm.failedDown},Vm={traverse:Gt,gather:wi,relative:Zn.before,retry:Em.tryUp,failure:cm.failedUp},Zm=e=>t=>t===e,Um=Zm(38),jm=Zm(40),Wm=e=>e>=37&&e<=40,$m={isBackward:Zm(37),isForward:Zm(39)},qm={isBackward:Zm(39),isForward:Zm(37)},Gm=e=>({elementFromPoint:(t,o)=>Ie.fromPoint(Ie.fromDom(e.document),t,o),getRect:e=>e.dom.getBoundingClientRect(),getRangedRect:(t,o,n,r)=>{const a=Gn.exact(t,o,n,r);return ir(e,a)},getSelection:()=>sr(e).map(t=>rm(e,t)),fromSitus:t=>{const o=Gn.relative(t.start,t.finish);return rm(e,o)},situsFromPoint:(t,o)=>lr(e,t,o).map(e=>nm(e.start,e.soffset,e.finish,e.foffset)),clearSelection:()=>{(e=>{Xn(e).each(e=>e.removeAllRanges())})(e)},collapseSelection:(t=!1)=>{sr(e).each(o=>o.fold(e=>e.collapse(t),(o,n)=>{const r=t?o:n;or(e,r,r)},(o,n,r,a)=>{const s=t?o:r,i=t?n:a;tr(e,s,i,s,i)}))},setSelection:t=>{tr(e,t.start,t.soffset,t.finish,t.foffset)},setRelativeSelection:(t,o)=>{or(e,t,o)},selectNode:t=>{ar(e,t,!1)},selectContents:t=>{ar(e,t)},getInnerHeight:()=>e.innerHeight,getScrollY:()=>(e=>{const t=void 0!==e?e.dom:document,o=t.body.scrollLeft||t.documentElement.scrollLeft,n=t.body.scrollTop||t.documentElement.scrollTop;return en(o,n)})(Ie.fromDom(e.document)).top,scrollBy:(t,o)=>{((e,t,o)=>{const n=(void 0!==o?o.dom:document).defaultView;n&&n.scrollBy(e,t)})(t,o,Ie.fromDom(e.document))}}),Km=(e,t)=>({rows:e,cols:t}),Ym=(e,t,o,n)=>{const r=((e,t,o,n)=>{const r=he(),a=r.clear,s=a=>{r.on(r=>{n.clearBeforeUpdate(t),Im(a.target,o).each(s=>{jd(r,s,o).each(o=>{const r=o.boxes.getOr([]);if(1===r.length){const e=r[0],o="false"===Sn(e),s=me(Cn(a.target),e,Je);o&&s&&n.selectRange(t,r,e,e)}else r.length>1&&(n.selectRange(t,r,o.start,o.finish),e.selectContents(s))})})})};return{clearstate:a,mousedown:e=>{n.clear(t),Im(e.target,o).filter(Pm).each(r.set)},mouseover:e=>{s(e)},mouseup:e=>{s(e),a()}}})(Gm(e),t,o,n);return{clearstate:r.clearstate,mousedown:r.mousedown,mouseover:r.mouseover,mouseup:r.mouseup}},Xm=e=>pn(e,Lt).exists(kn),Jm=(e,t)=>Xm(e)||Xm(t),Qm=(e,t,o,n)=>{const r=Gm(e),a=()=>(n.clear(t),_.none());return{keydown:(e,s,i,l,c,d)=>{const m=e.raw,u=m.which,g=!0===m.shiftKey,p=Wd(t,n.selectedSelector).fold(()=>(Wm(u)&&!g&&n.clearBeforeUpdate(t),Wm(u)&&g&&!Jm(s,l)?_.none:jm(u)&&g?b(Lm,r,t,o,Fm,l,s,n.selectRange):Um(u)&&g?b(Lm,r,t,o,Vm,l,s,n.selectRange):jm(u)?b(Bm,r,o,Fm,l,s,Hm):Um(u)?b(Bm,r,o,Vm,l,s,zm):_.none),e=>{const o=o=>()=>{const a=j(o,o=>((e,t,o,n,r)=>qd(n,e,t,r.firstSelectedSelector,r.lastSelectedSelector).map(e=>(r.clearBeforeUpdate(o),r.selectRange(o,e.boxes,e.start,e.finish),e.boxes)))(o.rows,o.cols,t,e,n));return a.fold(()=>$d(t,n.firstSelectedSelector,n.lastSelectedSelector).map(e=>{const o=jm(u)||d.isForward(u)?Zn.after:Zn.before;return r.setRelativeSelection(Zn.on(e.first,0),o(e.table)),n.clear(t),Qd(_.none(),!0)}),e=>_.some(Qd(_.none(),!0)))};return Wm(u)&&g&&!Jm(s,l)?_.none:jm(u)&&g?o([Km(1,0)]):Um(u)&&g?o([Km(-1,0)]):d.isBackward(u)&&g?o([Km(0,-1),Km(-1,0)]):d.isForward(u)&&g?o([Km(0,1),Km(1,0)]):Wm(u)&&!g?a:_.none});return p()},keyup:(e,r,a,s,i)=>Wd(t,n.selectedSelector).fold(()=>{const l=e.raw,c=l.which;return!0===l.shiftKey&&Wm(c)&&Jm(r,s)?((e,t,o,n,r,a,s)=>Je(o,r)&&n===a?_.none():xn(o,"td,th",t).bind(o=>xn(r,"td,th",t).bind(n=>sm(e,t,o,n,s))))(t,o,r,a,s,i,n.selectRange):_.none()},_.none)}},eu=(e,t,o)=>{const n=t=>{_o(t,e.selected),_o(t,e.firstSelected),_o(t,e.lastSelected)},r=t=>{xo(t,e.selected,"1")},a=e=>{s(e),o()},s=t=>{const o=An(t,`${e.selectedSelector},${e.firstSelectedSelector},${e.lastSelectedSelector}`);D(o,n)};return{clearBeforeUpdate:s,clear:a,selectRange:(o,n,s,i)=>{a(o),D(n,r),xo(s,e.firstSelected,"1"),xo(i,e.lastSelected,"1"),t(n,s,i)},selectedSelector:e.selectedSelector,firstSelectedSelector:e.firstSelectedSelector,lastSelectedSelector:e.lastSelectedSelector}},tu="data-mce-selected",ou="data-mce-first-selected",nu="data-mce-last-selected",ru="["+tu+"]",au={selected:tu,selectedSelector:"td["+tu+"],th["+tu+"]",firstSelected:ou,firstSelectedSelector:"td["+ou+"],th["+ou+"]",lastSelected:nu,lastSelectedSelector:"td["+nu+"],th["+nu+"]"},su=(e,t,o)=>({element:o,mergable:Jd(t,e,au),unmergable:Xd(e),selection:Yd(e)}),iu=e=>(t,o)=>{const n=Nt(t),r="col"===n||"colgroup"===n?Dr(a=t).bind(e=>Gd(e,au.firstSelectedSelector)).fold(p(a),e=>e[0]):t;var a;return xn(r,e,o)},lu=iu("th,td,caption"),cu=iu("th,td"),du=e=>{return t=e.model.table.getSelectedCells(),A(t,Ie.fromDom);var t},mu=(e,t)=>{const o=e.getDoc(),n=eo(Ie.fromDom(e.getBody())),r=Ie.fromTag("div",o);xo(r,"data-mce-bogus","all"),zo(r,{position:"fixed",left:"-9999999px",top:"0",overflow:"hidden",opacity:"0"});const a=(e=>Qt(e)?e:Ie.fromDom(jt(e).dom.body))(n);fo(r,t),go(a,r);const s=r.dom.innerText;return So(r),s},uu=(e,t)=>{e.on("BeforeGetContent",t=>{const o=o=>{t.preventDefault(),(e=>Dr(e[0]).map(e=>{const t=Ds(e,ru);return zd(t),[t]}))(o).each(o=>{const n="text"===t.format?mu(e,o):((e,t)=>A(t,t=>e.selection.serializer.serialize(t.dom,{})).join(""))(e,o);t.content=n})};if(!0===t.selection){const t=(e=>R(du(e),e=>Ke(e,au.selectedSelector)))(e);t.length>=1&&o(t)}}),e.on("BeforeSetContent",o=>{if(!0===o.selection&&!0===o.paste){const n=du(e);Z(n).each(n=>{Dr(n).each(r=>{const a=R(((e,t)=>{const o=(t||document).createElement("div");return o.innerHTML=e,Yt(Ie.fromDom(o))})(o.content),e=>"meta"!==Nt(e)),s=Zt("table");if(Ad(e)&&1===a.length&&s(a[0])){o.preventDefault();const s=Ie.fromDom(e.getDoc()),i=Gi(s),l=((e,t,o)=>({element:e,clipboard:t,generators:o}))(n,a[0],i);t.pasteCells(r,l).each(()=>{e.focus()})}})})}})},gu=(e,t)=>e.dispatch("NewRow",{node:t}),pu=(e,t)=>e.dispatch("NewCell",{node:t}),hu=(e,t,o)=>{e.dispatch("TableModified",{...o,table:t})},fu={structure:!1,style:!0},bu={structure:!0,style:!1},xu={structure:!0,style:!0},vu=(e,t)=>kd(e)?Qa(t):Sd(e)?Ja(t):Xa(t),yu=(e,t,o)=>{const n=e=>"table"===Nt(Nd(e)),r=xd(e),a=_d(e)?g:ks,s=t=>{switch(vd(e)){case"section":return ea();case"sectionCells":return ta();case"cells":return oa();default:return Qr(t,"section")}},i=(t,n)=>n.cursor.fold(()=>{const n=Tr(t);return Z(n).filter(Ro).map(n=>{o.clearSelectedCells(t.dom);const r=e.dom.createRng();return r.selectNode(n.dom),e.selection.setRng(r),xo(n,"data-mce-selected","1"),r})},n=>{const r=hi(fi,n);const a=e.dom.createRng();return a.setStart(r.element.dom,r.offset),a.setEnd(r.element.dom,r.offset),e.selection.setRng(a),o.clearSelectedCells(t.dom),_.some(a)}),l=(o,n,a,l)=>(c,d,m=!1)=>{zd(c);const u=Ie.fromDom(e.getDoc()),g=qi(a,u,r),p={sizing:vu(e,c),resize:_d(e)?br():xr(),section:s(c)};return n(c)?o(c,d,g,p).bind(o=>{t.refresh(c.dom),D(o.newRows,t=>{gu(e,t.dom)}),D(o.newCells,t=>{pu(e,t.dom)});const n=i(c,o);return Ro(c)&&(zd(c),m||hu(e,c.dom,l)),n.map(e=>({rng:e,effect:l}))}):_.none()},c=l(cc,t=>!n(e)||Ki(t).rows>1,g,bu),d=l(lc,t=>!n(e)||Ki(t).columns>1,g,bu);return{deleteRow:c,deleteColumn:d,insertRowsBefore:l(rc,w,g,bu),insertRowsAfter:l(ac,w,g,bu),insertColumnsBefore:l(sc,w,a,bu),insertColumnsAfter:l(ic,w,a,bu),mergeCells:l(bc,w,g,bu),unmergeCells:l(xc,w,g,bu),pasteColsBefore:l(yc,w,g,bu),pasteColsAfter:l(wc,w,g,bu),pasteRowsBefore:l(_c,w,g,bu),pasteRowsAfter:l(Cc,w,g,bu),pasteCells:l(vc,w,g,xu),makeCellsHeader:l(hc,w,g,bu),unmakeCellsHeader:l(fc,w,g,bu),makeColumnsHeader:l(dc,w,g,bu),unmakeColumnsHeader:l(mc,w,g,bu),makeRowsHeader:l(uc,w,g,bu),makeRowsBody:l(gc,w,g,bu),makeRowsFooter:l(pc,w,g,bu),getTableRowType:Ec,getTableCellType:Sc,getTableColType:kc}},wu=(e,t)=>{e.selection.select(t.dom,!0),e.selection.collapse(!0)},_u=(e,t,o,n,a)=>{const s=Md(e),i={styles:s,attributes:Dd(e),colGroups:Rd(e)};return e.undoManager.ignore(()=>{const r=((e,t,o,n,r,a=Lc)=>{const s=Ie.fromTag("table"),i="cells"!==r;zo(s,a.styles),vo(s,a.attributes),a.colGroups&&go(s,Fc(t));const l=Math.min(e,o);if(i&&o>0){const e=Ie.fromTag("thead");go(s,e);const a=Vc(o,t,"sectionCells"===r?l:0,n);fo(e,a)}const c=Ie.fromTag("tbody");go(s,c);const d=Vc(i?e-l:e,t,i?0:o,n);return fo(c,d),s})(o,t,a,n,vd(e),i);xo(r,"data-mce-id","__mce");const s=(e=>{const t=Ie.fromTag("div"),o=Ie.fromDom(e.dom.cloneNode(!0));return go(t,o),(e=>e.dom.innerHTML)(t)})(r);e.insertContent(s),e.addVisual()}),bn(Nd(e),'table[data-mce-id="__mce"]').map(t=>(Sd(e)?Li(t):Ed(e)?Pi(t):(kd(e)||(e=>r(e)&&-1!==e.indexOf("%"))(s.width))&&Hi(t),zd(t),_o(t,"data-mce-id"),((e,t)=>{D(An(t,"tr"),t=>{gu(e,t.dom),D(An(t,"th,td"),t=>{pu(e,t.dom)})})})(e,t),((e,t)=>{bn(t,"td,th").each(b(wu,e))})(e,t),t.dom)).getOrNull()};var Cu=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const ku="x-tinymce/dom-table-",Su=ku+"rows",Eu=ku+"columns",Ou=e=>{const t=Cu.FakeClipboardItem(e);Cu.write([t])},Tu=e=>{var t;const o=null!==(t=Cu.read())&&void 0!==t?t:[];return j(o,t=>_.from(t.getType(e)))},Au=e=>{Tu(e).isSome()&&Cu.clear()},Du=e=>{e.fold(Ru,e=>Ou({[Su]:e}))},Mu=()=>Tu(Su),Ru=()=>Au(Su),Nu=e=>{e.fold(zu,e=>Ou({[Eu]:e}))},Bu=()=>Tu(Eu),zu=()=>Au(Eu),Hu=e=>lu(Hd(e),Bd(e)).filter(Zd),Lu=(e,t)=>{const o=Bd(e),n=e=>Dr(e,o),s=t=>(e=>cu(Hd(e),Bd(e)).filter(Zd))(e).bind(e=>n(e).map(o=>t(o,e))),i=t=>{e.focus()},l=(t,o=!1)=>s((n,r)=>{const a=su(du(e),n,r);t(n,a,o).each(i)}),c=()=>s((t,o)=>{const n=su(du(e),t,o),r=qi(g,Ie.fromDom(e.getDoc()),_.none());return Ts(t,n,r)}),d=()=>s((t,o)=>{const n=su(du(e),t,o);return Os(t,n)}),m=(t,o)=>o().each(o=>{const n=A(o,e=>Ao(e));s((o,r)=>{const a=Gi(Ie.fromDom(e.getDoc())),s=((e,t,o,n)=>({selection:Yd(e),clipboard:o,generators:n}))(du(e),0,n,a);t(o,s).each(i)})}),p=e=>(t,o)=>((e,t)=>Q(e,t)?_.from(e[t]):_.none())(o,"type").each(t=>{l(e(t),o.no_events)});q({mceTableSplitCells:()=>l(t.unmergeCells),mceTableMergeCells:()=>l(t.mergeCells),mceTableInsertRowBefore:()=>l(t.insertRowsBefore),mceTableInsertRowAfter:()=>l(t.insertRowsAfter),mceTableInsertColBefore:()=>l(t.insertColumnsBefore),mceTableInsertColAfter:()=>l(t.insertColumnsAfter),mceTableDeleteCol:()=>l(t.deleteColumn),mceTableDeleteRow:()=>l(t.deleteRow),mceTableCutCol:()=>d().each(e=>{Nu(e),l(t.deleteColumn)}),mceTableCutRow:()=>c().each(e=>{Du(e),l(t.deleteRow)}),mceTableCopyCol:()=>d().each(e=>Nu(e)),mceTableCopyRow:()=>c().each(e=>Du(e)),mceTablePasteColBefore:()=>m(t.pasteColsBefore,Bu),mceTablePasteColAfter:()=>m(t.pasteColsAfter,Bu),mceTablePasteRowBefore:()=>m(t.pasteRowsBefore,Mu),mceTablePasteRowAfter:()=>m(t.pasteRowsAfter,Mu),mceTableDelete:()=>Hu(e).each(t=>{Dr(t,o).filter(x(o)).each(t=>{const o=Ie.fromText("");if(mo(t,o),So(t),e.dom.isEmpty(e.getBody()))e.setContent(""),e.selection.setCursorLocation();else{const t=e.dom.createRng();t.setStart(o.dom,0),t.setEnd(o.dom,0),e.selection.setRng(t),e.nodeChanged()}})}),mceTableCellToggleClass:(t,o)=>{s(t=>{const n=du(e),r=P(n,t=>e.formatter.match("tablecellclass",{value:o},t.dom)),a=r?e.formatter.remove:e.formatter.apply;D(n,e=>a("tablecellclass",{value:o},e.dom)),hu(e,t.dom,fu)})},mceTableToggleClass:(t,o)=>{s(t=>{e.formatter.toggle("tableclass",{value:o},t.dom),hu(e,t.dom,fu)})},mceTableToggleCaption:()=>{Hu(e).each(t=>{Dr(t,o).each(o=>{fn(o,"caption").fold(()=>{const t=Ie.fromTag("caption");go(t,Ie.fromText("Caption")),((e,t,o)=>{Xt(e,o).fold(()=>{go(e,t)},e=>{co(e,t)})})(o,t,0),e.selection.setCursorLocation(t.dom,0)},n=>{Zt("caption")(t)&&Xe("td",o).each(t=>e.selection.setCursorLocation(t.dom,0)),So(n)}),hu(e,o.dom,bu)})})},mceTableSizingMode:(t,n)=>(t=>Hu(e).each(n=>{Ed(e)||Sd(e)||kd(e)||Dr(n,o).each(o=>{"relative"!==t||Xs(o)?"fixed"!==t||Js(o)?"responsive"!==t||Qs(o)||Pi(o):Li(o):Hi(o),zd(o),hu(e,o.dom,bu)})}))(n),mceTableCellType:p(e=>"th"===e?t.makeCellsHeader:t.unmakeCellsHeader),mceTableColType:p(e=>"th"===e?t.makeColumnsHeader:t.unmakeColumnsHeader),mceTableRowType:p(e=>{switch(e){case"header":return t.makeRowsHeader;case"footer":return t.makeRowsFooter;default:return t.makeRowsBody}})},(t,o)=>e.addCommand(o,t)),e.addCommand("mceInsertTable",(t,o)=>{((e,t,o,n={})=>{const r=e=>u(e)&&e>0;if(r(t)&&r(o)){const r=n.headerRows||0,a=n.headerColumns||0;return _u(e,o,t,a,r)}console.error("Invalid values for mceInsertTable - rows and columns values are required to insert a table.")})(e,o.rows,o.columns,o.options)}),e.addCommand("mceTableApplyCellStyle",(t,o)=>{const s=e=>"tablecell"+e.toLowerCase().replace("-","");if(!a(o))return;const i=R(du(e),Zd);if(0===i.length)return;const l=Y(o,(t,o)=>e.formatter.has(s(o))&&r(t));(e=>{for(const t in e)if($.call(e,t))return!1;return!0})(l)||(q(l,(t,o)=>{const n=s(o);D(i,o=>{""===t?e.formatter.remove(n,{value:null},o.dom,!0):e.formatter.apply(n,{value:t},o.dom)})}),n(i[0]).each(t=>hu(e,t.dom,fu)))})},Iu=e=>!_n(Ie.fromDom(e.target),"ephox-snooker-resizer-bar"),Pu=(e,t)=>{const o=((e,t,o)=>({get:()=>Gd(e(),o).fold(()=>t().fold(em,om),tm)}))(()=>Ie.fromDom(e.getBody()),()=>cu(Hd(e),Bd(e)),au.selectedSelector),n=eu(au,(t,o,n)=>{Dr(o).each(r=>{const a=A(t,e=>e.dom),s=xd(e),i=qi(g,Ie.fromDom(e.getDoc()),s),l=du(e),c=Ps(r,{selection:l},i).map(e=>G(e,e=>A(e,e=>e.dom))).getOrUndefined();((e,t,o,n,r)=>{e.dispatch("TableSelectionChange",{cells:t,start:o,finish:n,otherCells:r})})(e,a,o.dom,n.dom,c)})},()=>(e=>{e.dispatch("TableSelectionClear")})(e));e.on("init",o=>{const r=e.getWin(),a=Nd(e),s=Bd(e),i=Ym(r,a,s,n),l=Qm(r,a,s,n),c=((e,t,o,n)=>{const r=Gm(e);return(e,a)=>{n.clearBeforeUpdate(t),jd(e,a,o).each(e=>{const o=e.boxes.getOr([]);n.selectRange(t,o,e.start,e.finish),r.selectContents(a),r.collapseSelection()})}})(r,a,s,n);e.on("TableSelectorChange",e=>c(e.start,e.finish));const d=(t,o)=>{(e=>!0===e.raw.shiftKey)(t)&&(o.kill&&t.kill(),o.selection.each(t=>{const o=Gn.relative(t.start,t.finish),n=Ge(r,o);e.selection.setRng(n)}))},m=e=>0===e.button,u=(()=>{const e=te(Ie.fromDom(a)),t=te(0);return{touchEnd:o=>{const n=Ie.fromDom(o.target);if(Zt("td")(n)||Zt("th")(n)){const r=e.get(),a=t.get();Je(r,n)&&o.timeStamp-a<300&&(o.preventDefault(),c(n,n))}e.set(n),t.set(o.timeStamp)}}})();e.on("dragstart",e=>{i.clearstate()}),e.on("mousedown",e=>{m(e)&&Iu(e)&&i.mousedown(lo(e))}),e.on("mouseover",e=>{var t;(void 0===(t=e).buttons||1&t.buttons)&&Iu(e)&&i.mouseover(lo(e))}),e.on("mouseup",e=>{m(e)&&Iu(e)&&i.mouseup(lo(e))}),e.on("touchend",u.touchEnd),e.on("keyup",t=>{const o=lo(t);if(o.raw.shiftKey&&Wm(o.raw.which)){const t=e.selection.getRng(),n=Ie.fromDom(t.startContainer),r=Ie.fromDom(t.endContainer);l.keyup(o,n,t.startOffset,r,t.endOffset).each(e=>{d(o,e)})}}),e.on("keydown",o=>{const n=lo(o);t.hide();const r=e.selection.getRng(),a=Ie.fromDom(r.startContainer),s=Ie.fromDom(r.endContainer),i=cn($m,qm)(Ie.fromDom(e.selection.getStart()));l.keydown(n,a,r.startOffset,s,r.endOffset,i).each(e=>{d(n,e)}),t.show()}),e.on("NodeChange",()=>{const t=e.selection,o=Ie.fromDom(t.getStart()),r=Ie.fromDom(t.getEnd());Ai(Dr,[o,r]).fold(()=>n.clear(a),g)})}),e.on("PreInit",()=>{e.serializer.addTempAttr(au.firstSelected),e.serializer.addTempAttr(au.lastSelected)});return{getSelectedCells:()=>((e,t,o,n)=>{switch(e.tag){case"none":return t();case"single":return n(e.element);case"multiple":return o(e.elements)}})(o.get(),p([]),e=>A(e,e=>e.dom),e=>[e.dom]),clearSelectedCells:e=>n.clear(Ie.fromDom(e))}},Fu=e=>d(e)&&"TABLE"===e.nodeName,Vu="bar-",Zu=e=>"false"!==yo(e,"data-mce-resize"),Uu=e=>{return xe(t=e,o="corner-")?((e,t)=>e.substring(t))(t,o.length):t;var t,o},ju=e=>{const t=he(),o=he(),n=he();let r,a,s,i;const l=t=>vu(e,t),c=()=>wd(e)?xr():br(),d=(t,o,n,d)=>{const m=Uu(o),u=ve(m,"e"),g=xe(m,"n");if(""===a&&Hi(t),""===i&&Ii(t),n!==r&&""!==a){Bo(t,"width",a);const o=c(),s=l(t),i=wd(e)||u?(e=>Ki(e).columns)(t)-1:0;_s(t,n-r,i,o,s)}else if((e=>/^(\d+(\.\d+)?)%$/.test(e))(a)){const e=parseFloat(a.replace("%",""));Bo(t,"width",n*e/r+"%")}if((e=>/^(\d+(\.\d+)?)px$/.test(e))(a)&&(e=>{const t=qr.fromTable(e);qr.hasColumns(t)||D(Tr(e),e=>{const t=Ho(e,"width");Bo(e,"width",t),_o(e,"width")})})(t),d!==s&&""!==i){Bo(t,"height",i);const e=g?0:(e=>Ki(e).rows)(t)-1;Cs(t,d-s,e)}};e.on("init",()=>{const r=((e,t)=>{const o=Ie.fromDom(e.getBody());return Fs(o,t)})(e,Zu);if(n.set(r),(e=>{const t=e.options.get("object_resizing");return E(t.split(","),"table")})(e)&&Od(e)){const n=c(),a=pd(r,n,l);e.mode.isReadOnly()||a.on(),a.events.startDrag.bind(o=>{t.set(e.selection.getRng())}),a.events.beforeResize.bind(t=>{const o=t.table.dom;((e,t,o,n,r)=>{e.dispatch("ObjectResizeStart",{target:t,width:o,height:n,origin:r})})(e,o,Ld(o),Id(o),Vu+t.type)}),a.events.afterResize.bind(o=>{const n=o.table,r=n.dom;zd(n),t.on(t=>{e.selection.setRng(t),e.focus()}),((e,t,o,n,r)=>{e.dispatch("ObjectResized",{target:t,width:o,height:n,origin:r})})(e,r,Ld(r),Id(r),Vu+o.type),e.undoManager.add()}),o.set(a)}}),e.on("ObjectResizeStart",t=>{const o=t.target;if(Fu(o)&&!e.mode.isReadOnly()){const n=Ie.fromDom(o);D(e.dom.select(".mce-clonedresizable"),t=>{e.dom.addClass(t,"mce-"+yd(e)+"-columns")}),!Js(n)&&Sd(e)?Li(n):!Xs(n)&&kd(e)&&Hi(n),Qs(n)&&xe(t.origin,Vu)&&Hi(n),r=t.width,a=Ed(e)?"":Fd(e,o).getOr(""),s=t.height,i=Vd(e,o).getOr("")}}),e.on("ObjectResized",t=>{const o=t.target;if(Fu(o)){const n=Ie.fromDom(o),r=t.origin;(e=>xe(e,"corner-"))(r)&&d(n,r,t.width,t.height),zd(n),hu(e,n.dom,fu)}});const m=()=>{o.on(e=>{e.on(),e.showBars()})},u=()=>{o.on(e=>{e.off(),e.hideBars()})};e.on("DisabledStateChange",e=>{e.state?u():m()}),e.on("SwitchMode",()=>{e.mode.isReadOnly()?u():m()}),e.on("dragstart dragend",e=>{"dragstart"===e.type?u():m()}),e.on("remove",()=>{o.on(e=>{e.destroy()})});return{refresh:e=>{o.on(t=>t.refreshBars(Ie.fromDom(e)))},hide:()=>{o.on(e=>e.hideBars())},show:()=>{o.on(e=>e.showBars())}}},Wu=e=>{(e=>{const t=e.options.register;t("table_clone_elements",{processor:"string[]"}),t("table_use_colgroups",{processor:"boolean",default:!0}),t("table_header_type",{processor:e=>{const t=E(["section","cells","sectionCells","auto"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be one of: section, cells, sectionCells or auto."}},default:"section"}),t("table_sizing_mode",{processor:"string",default:"auto"}),t("table_default_attributes",{processor:"object",default:{border:"1"}}),t("table_default_styles",{processor:"object",default:{"border-collapse":"collapse"}}),t("table_column_resizing",{processor:e=>{const t=E(["preservetable","resizetable"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be preservetable, or resizetable."}},default:"preservetable"}),t("table_resize_bars",{processor:"boolean",default:!0}),t("table_style_by_css",{processor:"boolean",default:!0}),t("table_merge_content_on_paste",{processor:"boolean",default:!0})})(e);const t=ju(e),o=Pu(e,t),n=yu(e,t,o);return Lu(e,n),((e,t)=>{const o=Bd(e),n=t=>cu(Hd(e)).bind(n=>Dr(n,o).map(o=>{const r=su(du(e),o,n);return t(o,r)})).getOr("");q({mceTableRowType:()=>n(t.getTableRowType),mceTableCellType:()=>n(t.getTableCellType),mceTableColType:()=>n(t.getTableColType)},(t,o)=>e.addQueryValueHandler(o,t))})(e,n),uu(e,n),{getSelectedCells:o.getSelectedCells,clearSelectedCells:o.clearSelectedCells}},$u=e=>({table:Wu(e)});e.add("dom",$u)}()},81979:()=>{tinymce.Resource.add("content/default/content.css",'body{font-family:-apple-system,BlinkMacSystemFont,\'Segoe UI\',Roboto,Oxygen,Ubuntu,Cantarell,\'Open Sans\',\'Helvetica Neue\',sans-serif;line-height:1.4;margin:1rem}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#ccc}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}')},92890:(e,t,o)=>{o(94511)},94511:()=>{!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=Object.getPrototypeOf,o=(e,t,o)=>{var n;return!!o(e,t.prototype)||(null===(n=e.constructor)||void 0===n?void 0:n.name)===t.name},n=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&o(e,String,(e,t)=>t.isPrototypeOf(e))?"string":t})(t)===e,r=e=>t=>typeof t===e,a=n("string"),s=n("object"),i=e=>((e,n)=>s(e)&&o(e,n,(e,o)=>t(e)===o))(e,Object),l=n("array"),c=(d=null,e=>d===e);var d;const m=r("boolean"),u=e=>!(e=>null==e)(e),g=r("function"),p=r("number"),h=()=>{};class f{constructor(e,t){this.tag=e,this.value=t}static some(e){return new f(!0,e)}static none(){return f.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?f.some(e(this.value)):f.none()}bind(e){return this.tag?e(this.value):f.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:f.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return u(e)?f.some(e):f.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}f.singletonNone=new f(!1);Array.prototype.slice;const b=Array.prototype.push,x=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!l(e[o]))throw new Error("Arr.flatten item "+o+" was not an array, input: "+e);b.apply(t,e[o])}return t},v=e=>((e,t)=>t>=0&&t<e.length?f.some(e[t]):f.none())(e,0);g(Array.from)&&Array.from;const y=Object.keys,w=Object.hasOwnProperty,_=(e,t,o,n)=>{((e,t)=>{const o=y(e);for(let n=0,r=o.length;n<r;n++){const r=o[n];t(e[r],r)}})(e,(e,r)=>{(t(e,r)?o:n)(e,r)})},C=(e,t)=>w.call(e,t),k=(S=(e,t)=>i(e)&&i(t)?k(e,t):t,(...e)=>{if(0===e.length)throw new Error("Can't merge zero objects");const t={};for(let o=0;o<e.length;o++){const n=e[o];for(const e in n)C(n,e)&&(t[e]=S(t[e],n[e]))}return t});var S;const E=e=>e.length>0,O=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},T={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return O(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return O(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return O(o)},fromDom:O,fromPoint:(e,t,o)=>f.from(e.dom.elementFromPoint(t,o)).map(O)},A=(e,t,o)=>{((e,t,o)=>{if(!(a(o)||m(o)||p(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")})(e.dom,t,o)};var D=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),M=tinymce.util.Tools.resolve("tinymce.util.URI");const R=e=>t=>t.options.get(e),N=e=>{const t=e.options.register;t("image_dimensions",{processor:"boolean",default:!0}),t("image_advtab",{processor:"boolean",default:!1}),t("image_uploadtab",{processor:"boolean",default:!0}),t("image_prepend_url",{processor:"string",default:""}),t("image_class_list",{processor:"object[]"}),t("image_description",{processor:"boolean",default:!0}),t("image_title",{processor:"boolean",default:!1}),t("image_caption",{processor:"boolean",default:!1}),t("image_list",{processor:e=>{const t=!1===e||a(e)||((e,t)=>{if(l(e)){for(let o=0,n=e.length;o<n;++o)if(!t(e[o]))return!1;return!0}return!1})(e,s)||g(e);return t?{value:e,valid:t}:{valid:!1,message:"Must be false, a string, an array or a function."}},default:!1})},B=R("image_dimensions"),z=R("image_advtab"),H=R("image_uploadtab"),L=R("image_prepend_url"),I=R("image_class_list"),P=R("image_description"),F=R("image_title"),V=R("image_caption"),Z=R("image_list"),U=R("a11y_advanced_options"),j=R("automatic_uploads"),W=(e,t)=>Math.max(parseInt(e,10),parseInt(t,10)),$=e=>(e&&(e=e.replace(/px$/,"")),e),q=e=>(e.length>0&&/^[0-9]+$/.test(e)&&(e+="px"),e),G=e=>"IMG"===e.nodeName&&(e.hasAttribute("data-mce-object")||e.hasAttribute("data-mce-placeholder")),K=(e,t)=>{const o=e.options.get;return M.isDomSafe(t,"img",{allow_html_data_urls:o("allow_html_data_urls"),allow_script_urls:o("allow_script_urls"),allow_svg_data_urls:o("allow_svg_data_urls")})},Y=D.DOM,X=e=>e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight?$(e.style.marginLeft):"",J=e=>e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom?$(e.style.marginTop):"",Q=e=>e.style.borderWidth?$(e.style.borderWidth):"",ee=(e,t)=>{var o;return e.hasAttribute(t)&&null!==(o=e.getAttribute(t))&&void 0!==o?o:""},te=e=>null!==e.parentNode&&"FIGURE"===e.parentNode.nodeName,oe=(e,t,o)=>{""===o||null===o?e.removeAttribute(t):e.setAttribute(t,o)},ne=e=>{te(e)?(e=>{const t=e.parentNode;u(t)&&(Y.insertAfter(e,t),Y.remove(t))})(e):(e=>{const t=Y.create("figure",{class:"image"});Y.insertAfter(t,e),t.appendChild(e),t.appendChild(Y.create("figcaption",{contentEditable:"true"},"Caption")),t.contentEditable="false"})(e)},re=(e,t)=>{const o=e.getAttribute("style"),n=t(null!==o?o:"");n.length>0?(e.setAttribute("style",n),e.setAttribute("data-mce-style",n)):e.removeAttribute("style")},ae=(e,t)=>(e,o,n)=>{const r=e.style;r[o]?(r[o]=q(n),re(e,t)):oe(e,o,n)},se=(e,t)=>e.style[t]?$(e.style[t]):ee(e,t),ie=(e,t)=>{const o=q(t);e.style.marginLeft=o,e.style.marginRight=o},le=(e,t)=>{const o=q(t);e.style.marginTop=o,e.style.marginBottom=o},ce=(e,t)=>{const o=q(t);e.style.borderWidth=o},de=(e,t)=>{e.style.borderStyle=t},me=e=>{var t;return null!==(t=e.style.borderStyle)&&void 0!==t?t:""},ue=e=>u(e)&&"FIGURE"===e.nodeName,ge=e=>0===Y.getAttrib(e,"alt").length&&"presentation"===Y.getAttrib(e,"role"),pe=e=>ge(e)?"":ee(e,"alt"),he=(e,t)=>{var o;const n=document.createElement("img");return oe(n,"style",t.style),(X(n)||""!==t.hspace)&&ie(n,t.hspace),(J(n)||""!==t.vspace)&&le(n,t.vspace),(Q(n)||""!==t.border)&&ce(n,t.border),(me(n)||""!==t.borderStyle)&&de(n,t.borderStyle),e(null!==(o=n.getAttribute("style"))&&void 0!==o?o:"")},fe=(e,t)=>({src:ee(t,"src"),alt:pe(t),title:ee(t,"title"),width:se(t,"width"),height:se(t,"height"),class:ee(t,"class"),style:e(ee(t,"style")),caption:te(t),hspace:X(t),vspace:J(t),border:Q(t),borderStyle:me(t),isDecorative:ge(t)}),be=(e,t,o,n,r)=>{o[n]!==t[n]&&r(e,n,String(o[n]))},xe=(e,t,o)=>{if(o){Y.setAttrib(e,"role","presentation");const t=T.fromDom(e);A(t,"alt","")}else{if(c(t)){const t=T.fromDom(e);n="alt",t.dom.removeAttribute(n)}else{const o=T.fromDom(e);A(o,"alt",t)}"presentation"===Y.getAttrib(e,"role")&&Y.setAttrib(e,"role","")}var n},ve=(e,t)=>(o,n,r)=>{e(o,r),re(o,t)},ye=(e,t,o)=>{const n=fe(e,o);be(o,n,t,"caption",(e,t,o)=>ne(e)),be(o,n,t,"src",oe),be(o,n,t,"title",oe),be(o,n,t,"width",ae(0,e)),be(o,n,t,"height",ae(0,e)),be(o,n,t,"class",oe),be(o,n,t,"style",ve((e,t)=>oe(e,"style",t),e)),be(o,n,t,"hspace",ve(ie,e)),be(o,n,t,"vspace",ve(le,e)),be(o,n,t,"border",ve(ce,e)),be(o,n,t,"borderStyle",ve(de,e)),((e,t,o)=>{o.alt===t.alt&&o.isDecorative===t.isDecorative||xe(e,o.alt,o.isDecorative)})(o,n,t)},we=(e,t)=>{const o=(e=>{if(e.margin){const t=String(e.margin).split(" ");switch(t.length){case 1:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[0],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[0];break;case 2:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[1];break;case 3:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[1];break;case 4:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[3]}delete e.margin}return e})(e.dom.styles.parse(t)),n=e.dom.styles.parse(e.dom.styles.serialize(o));return e.dom.styles.serialize(n)},_e=e=>{const t=e.selection.getNode(),o=e.dom.getParent(t,"figure.image");return o?e.dom.select("img",o)[0]:t&&("IMG"!==t.nodeName||G(t))?null:t},Ce=(e,t)=>{var o;const n=e.dom,r=((e,t)=>{const o={};var n;return _(e,t,(n=o,(e,t)=>{n[t]=e}),h),o})(e.schema.getTextBlockElements(),(t,o)=>!e.schema.isValidChild(o,"figure")),a=n.getParent(t.parentNode,e=>{return t=r,o=e.nodeName,C(t,o)&&void 0!==t[o]&&null!==t[o];var t,o},e.getBody());return a&&null!==(o=n.split(a,t))&&void 0!==o?o:t},ke=(e,t)=>{const o=((e,t)=>{const o=document.createElement("img");if(ye(e,{...t,caption:!1},o),xe(o,t.alt,t.isDecorative),t.caption){const e=Y.create("figure",{class:"image"});return e.appendChild(o),e.appendChild(Y.create("figcaption",{contentEditable:"true"},"Caption")),e.contentEditable="false",e}return o})(t=>we(e,t),t);e.dom.setAttrib(o,"data-mce-id","__mcenew"),e.focus(),e.selection.setContent(o.outerHTML);const n=e.dom.select('*[data-mce-id="__mcenew"]')[0];if(e.dom.setAttrib(n,"data-mce-id",null),ue(n)){const t=Ce(e,n);e.selection.select(t)}else e.selection.select(n)},Se=(e,t)=>{const o=_e(e);if(o)if(ye(t=>we(e,t),t,o),((e,t)=>{e.dom.setAttrib(t,"src",t.getAttribute("src"))})(e,o),ue(o.parentNode)){e.dom.setStyle(o,"float","");const t=o.parentNode;Ce(e,t),e.selection.select(o.parentNode)}else e.selection.select(o),((e,t,o)=>{const n=()=>{o.onload=o.onerror=null,e.selection&&(e.selection.select(o),e.nodeChanged())};o.onload=()=>{t.width||t.height||!B(e)||e.dom.setAttribs(o,{width:String(o.clientWidth),height:String(o.clientHeight)}),n()},o.onerror=n})(e,t,o)},Ee=(e,t)=>{const o=_e(e);if(o){const n={...fe(t=>we(e,t),o),...t},r=((e,t)=>{const o=t.src;return{...t,src:K(e,o)?o:""}})(e,n);n.src?Se(e,r):((e,t)=>{if(t){const o=e.dom.is(t.parentNode,"figure.image")?t.parentNode:t;e.dom.remove(o),e.focus(),e.nodeChanged(),e.dom.isEmpty(e.getBody())&&(e.setContent(""),e.selection.setCursorLocation())}})(e,o)}else t.src&&ke(e,{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1,...t})};var Oe=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),Te=tinymce.util.Tools.resolve("tinymce.util.Tools");const Ae=e=>a(e.value)?e.value:"",De=(e,t)=>{const o=[];return Te.each(e,e=>{const n=(e=>a(e.text)?e.text:a(e.title)?e.title:"")(e);if(void 0!==e.menu){const r=De(e.menu,t);o.push({text:n,items:r})}else{const r=t(e);o.push({text:n,value:r})}}),o},Me=(e=Ae)=>t=>t?f.from(t).map(t=>De(t,e)):f.none(),Re=(e,t)=>((e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome())return n}return f.none()})(e,e=>(e=>C(e,"items"))(e)?Re(e.items,t):e.value===t?f.some(e):f.none()),Ne=Me,Be=e=>Me(Ae)(e),ze=(e,t)=>e.bind(e=>Re(e,t)),He=e=>({title:"Advanced",name:"advanced",items:[{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"listbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]}),Le=e=>{const t=Ne(t=>e.convertURL(t.value||t.url||"","src")),o=new Promise(o=>{((e,t)=>{const o=Z(e);a(o)?fetch(o).then(e=>{e.ok&&e.json().then(t)}):g(o)?o(t):t(o)})(e,e=>{o(t(e).map(e=>x([[{text:"None",value:""}],e])))})}),n=Be(I(e)),r=z(e),s=H(e),i=(e=>E(e.options.get("images_upload_url")))(e),l=(e=>u(e.options.get("images_upload_handler")))(e),c=(e=>{const t=_e(e);return t?fe(t=>we(e,t),t):{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}})(e),d=P(e),m=F(e),p=B(e),h=V(e),b=U(e),v=j(e),y=f.some(L(e)).filter(e=>a(e)&&e.length>0);return o.then(e=>({image:c,imageList:e,classList:n,hasAdvTab:r,hasUploadTab:s,hasUploadUrl:i,hasUploadHandler:l,hasDescription:d,hasImageTitle:m,hasDimensions:p,hasImageCaption:h,prependURL:y,hasAccessibilityOptions:b,automaticUploads:v}))},Ie=e=>{const t=e.imageList.map(e=>({name:"images",type:"listbox",label:"Image list",items:e})),o={name:"alt",type:"input",label:"Alternative description",enabled:!(e.hasAccessibilityOptions&&e.image.isDecorative)},n=e.classList.map(e=>({name:"classes",type:"listbox",label:"Class",items:e}));return x([[{name:"src",type:"urlinput",filetype:"image",label:"Source",picker_text:"Browse files"}],t.toArray(),e.hasAccessibilityOptions&&e.hasDescription?[{type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]}]:[],e.hasDescription?[o]:[],e.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],e.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[{...(r=e.classList.isSome()&&e.hasImageCaption,r?{type:"grid",columns:2}:{type:"panel"}),items:x([n.toArray(),e.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])}]]);var r},Pe=e=>({title:"General",name:"general",items:Ie(e)}),Fe=Ie,Ve=e=>({title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}),Ze=e=>({src:{value:e.src,meta:{}},images:e.src,alt:e.alt,title:e.title,dimensions:{width:e.width,height:e.height},classes:e.class,caption:e.caption,style:e.style,vspace:e.vspace,border:e.border,hspace:e.hspace,borderstyle:e.borderStyle,fileinput:[],isDecorative:e.isDecorative}),Ue=(e,t)=>({src:e.src.value,alt:null!==e.alt&&0!==e.alt.length||!t?e.alt:null,title:e.title,width:e.dimensions.width,height:e.dimensions.height,class:e.classes,style:e.style,caption:e.caption,hspace:e.hspace,vspace:e.vspace,border:e.border,borderStyle:e.borderstyle,isDecorative:e.isDecorative}),je=(e,t)=>{const o=t.getData();((e,t)=>/^(?:[a-zA-Z]+:)?\/\//.test(t)?f.none():e.prependURL.bind(e=>t.substring(0,e.length)!==e?f.some(e+t):f.none()))(e,o.src.value).each(e=>{t.setData({src:{value:e,meta:o.src.meta}})})},We=(e,t)=>{const o=t.getData(),n=o.src.meta;if(void 0!==n){const r=k({},o);((e,t,o)=>{e.hasDescription&&a(o.alt)&&(t.alt=o.alt),e.hasAccessibilityOptions&&(t.isDecorative=o.isDecorative||t.isDecorative||!1),e.hasImageTitle&&a(o.title)&&(t.title=o.title),e.hasDimensions&&(a(o.width)&&(t.dimensions.width=o.width),a(o.height)&&(t.dimensions.height=o.height)),a(o.class)&&ze(e.classList,o.class).each(e=>{t.classes=e.value}),e.hasImageCaption&&m(o.caption)&&(t.caption=o.caption),e.hasAdvTab&&(a(o.style)&&(t.style=o.style),a(o.vspace)&&(t.vspace=o.vspace),a(o.border)&&(t.border=o.border),a(o.hspace)&&(t.hspace=o.hspace),a(o.borderstyle)&&(t.borderstyle=o.borderstyle))})(e,r,n),t.setData(r)}},$e=(e,t,o,n)=>{je(t,n),We(t,n),((e,t,o,n)=>{const r=n.getData(),a=r.src.value,s=r.src.meta||{};s.width||s.height||!t.hasDimensions||(E(a)?e.imageSize(a).then(e=>{o.open&&n.setData({dimensions:e})}).catch(e=>console.error(e)):n.setData({dimensions:{width:"",height:""}}))})(e,t,o,n),((e,t,o)=>{const n=o.getData(),r=ze(e.imageList,n.src.value);t.prevImage=r,o.setData({images:r.map(e=>e.value).getOr("")})})(t,o,n)},qe=(e,t,o,n)=>{const r=n.getData();n.block("Uploading image"),v(r.fileinput).fold(()=>{n.unblock()},r=>{const a=URL.createObjectURL(r),s=()=>{n.unblock(),URL.revokeObjectURL(a)},i=r=>{n.setData({src:{value:r,meta:{}}}),n.showTab("general"),$e(e,t,o,n),n.focus("src")};var l;(l=r,new Promise((e,t)=>{const o=new FileReader;o.onload=()=>{e(o.result)},o.onerror=()=>{var e;t(null===(e=o.error)||void 0===e?void 0:e.message)},o.readAsDataURL(l)})).then(o=>{const l=e.createBlobCache(r,a,o);t.automaticUploads?e.uploadImage(l).then(e=>{i(e.url),s()}).catch(t=>{s(),e.alertErr(t,()=>{n.focus("fileinput")})}):(e.addToBlobCache(l),i(l.blobUri()),n.unblock())})})},Ge=(e,t,o)=>(n,r)=>{"src"===r.name?$e(e,t,o,n):"images"===r.name?((e,t,o,n)=>{const r=n.getData(),a=ze(t.imageList,r.images);a.each(e=>{const t=""===r.alt||o.prevImage.map(e=>e.text===r.alt).getOr(!1);t?""===e.value?n.setData({src:e,alt:o.prevAlt}):n.setData({src:e,alt:e.text}):n.setData({src:e})}),o.prevImage=a,$e(e,t,o,n)})(e,t,o,n):"alt"===r.name?o.prevAlt=n.getData().alt:"fileinput"===r.name?qe(e,t,o,n):"isDecorative"===r.name&&n.setEnabled("alt",!n.getData().isDecorative)},Ke=e=>()=>{e.open=!1},Ye=e=>{if(e.hasAdvTab||e.hasUploadUrl||e.hasUploadHandler){return{type:"tabpanel",tabs:x([[Pe(e)],e.hasAdvTab?[He(e)]:[],e.hasUploadTab&&(e.hasUploadUrl||e.hasUploadHandler)?[Ve(e)]:[]])}}return{type:"panel",items:Fe(e)}},Xe=(e,t,o)=>n=>{const r=k(Ze(t.image),n.getData()),a={...r,style:he(o.normalizeCss,Ue(r,!1))};e.execCommand("mceUpdateImage",!1,Ue(a,t.hasAccessibilityOptions)),e.editorUpload.uploadImagesAuto(),n.close()},Je=e=>t=>K(e,t)?(e=>new Promise(t=>{const o=document.createElement("img"),n=e=>{o.parentNode&&o.parentNode.removeChild(o),t(e)};o.addEventListener("load",()=>{const e={width:W(o.width,o.clientWidth),height:W(o.height,o.clientHeight)};n(Promise.resolve(e))}),o.addEventListener("error",()=>{n(Promise.reject(`Failed to get image dimensions for: ${e}`))});const r=o.style;r.visibility="hidden",r.position="fixed",r.bottom=r.left="0px",r.width=r.height="auto",document.body.appendChild(o),o.src=e}))(e.documentBaseURI.toAbsolute(t)).then(e=>({width:String(e.width),height:String(e.height)})):Promise.resolve({width:"",height:""}),Qe=e=>(t,o,n)=>{var r;return e.editorUpload.blobCache.create({blob:t,blobUri:o,name:null===(r=t.name)||void 0===r?void 0:r.replace(/\.[^\.]+$/,""),filename:t.name,base64:n.split(",")[1]})},et=e=>t=>{e.editorUpload.blobCache.add(t)},tt=e=>(t,o)=>{e.windowManager.alert(t,o)},ot=e=>t=>we(e,t),nt=e=>t=>e.dom.parseStyle(t),rt=e=>(t,o)=>e.dom.serializeStyle(t,o),at=e=>t=>Oe(e).upload([t],!1).then(e=>{var t;return 0===e.length?Promise.reject("Failed to upload image"):!1===e[0].status?Promise.reject(null===(t=e[0].error)||void 0===t?void 0:t.message):e[0]}),st=e=>{const t={imageSize:Je(e),addToBlobCache:et(e),createBlobCache:Qe(e),alertErr:tt(e),normalizeCss:ot(e),parseStyle:nt(e),serializeStyle:rt(e),uploadImage:at(e)};return{open:()=>{Le(e).then(o=>{const n=(e=>({prevImage:ze(e.imageList,e.image.src),prevAlt:e.image.alt,open:!0}))(o);return{title:"Insert/Edit Image",size:"normal",body:Ye(o),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Ze(o.image),onSubmit:Xe(e,o,t),onChange:Ge(t,o,n),onClose:Ke(n)}}).then(e.windowManager.open)}}},it=e=>{const t=e.attr("class");return u(t)&&/\bimage\b/.test(t)},lt=e=>t=>{let o=t.length;const n=t=>{t.attr("contenteditable",e?"true":null)};for(;o--;){const r=t[o];it(r)&&(r.attr("contenteditable",e?"false":null),Te.each(r.getAll("figcaption"),n))}},ct=e=>t=>{const o=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",o),o(),()=>{e.off("NodeChange",o)}};e.add("image",e=>{N(e),(e=>{e.on("PreInit",()=>{e.parser.addNodeFilter("figure",lt(!0)),e.serializer.addNodeFilter("figure",lt(!1))})})(e),(e=>{e.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:st(e).open,onSetup:t=>{t.setActive(u(_e(e)));const o=e.selection.selectorChangedWithUnbind("img:not([data-mce-object]):not([data-mce-placeholder]),figure.image",t.setActive).unbind,n=ct(e)(t);return()=>{o(),n()}}}),e.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:st(e).open,onSetup:ct(e)}),e.ui.registry.addContextMenu("image",{update:t=>e.selection.isEditable()&&(ue(t)||"IMG"===t.nodeName&&!G(t))?["image"]:[]})})(e),(e=>{e.addCommand("mceImage",st(e).open),e.addCommand("mceUpdateImage",(t,o)=>{e.undoManager.transact(()=>Ee(e,o))})})(e)})}()}}]);