blog-web/js/tinymce.280bb166.js
2024-05-09 14:47:05 +08:00

1 line
1.1 MiB
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(self["webpackChunkscui"]=self["webpackChunkscui"]||[]).push([[8774],{2983:function(){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>',"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>',"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 17c.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7v-1c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3Zm0-10a1 1 0 0 1-.7-.3A1 1 0 0 1 11 6V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3Zm7 4c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-1a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1ZM7 12c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3H5a1 1 0 0 1-.7-.3A1 1 0 0 1 4 12c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1c.3 0 .5.1.7.3.2.2.3.4.3.7Zm10 3.5.7.8c.2.1.3.4.3.6 0 .3-.1.6-.3.8a1 1 0 0 1-.8.3 1 1 0 0 1-.6-.3l-.8-.7a1 1 0 0 1-.3-.8c0-.2.1-.5.3-.7a1 1 0 0 1 1.4 0Zm-10-7-.7-.8a1 1 0 0 1-.3-.6c0-.3.1-.6.3-.8.2-.2.5-.3.8-.3.2 0 .5.1.7.3l.7.7c.2.2.3.5.3.8 0 .2-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.8-.3Zm10 0a1 1 0 0 1-.8.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.6.3-.8l.8-.7c.1-.2.4-.3.6-.3.3 0 .6.1.8.3.2.2.3.5.3.8 0 .2-.1.5-.3.7l-.7.7Zm-10 7c.2-.2.5-.3.8-.3.2 0 .5.1.7.3a1 1 0 0 1 0 1.4l-.8.8a1 1 0 0 1-.6.3 1 1 0 0 1-.8-.3 1 1 0 0 1-.3-.8c0-.2.1-.5.3-.6l.7-.8ZM12 8a4 4 0 0 1 3.7 2.4 4 4 0 0 1 0 3.2A4 4 0 0 1 12 16a4 4 0 0 1-3.7-2.4 4 4 0 0 1 0-3.2A4 4 0 0 1 12 8Zm0 6.5c.7 0 1.3-.2 1.8-.7.5-.5.7-1.1.7-1.8s-.2-1.3-.7-1.8c-.5-.5-1.1-.7-1.8-.7s-1.3.2-1.8.7c-.5.5-.7 1.1-.7 1.8s.2 1.3.7 1.8c.5.5 1.1.7 1.8.7Z" fill-rule="evenodd"/></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"><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 d="M12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4Zm-6 8a6 6 0 0 0 6 6V6a6 6 0 0 0-6 6Z" fill-rule="evenodd"/></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-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 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 2v14h14V5H5Zm6.5 11.8V14L9.2 8.7a5.1 5.1 0 0 0-.4-.8l-.1-.2H8v-1l.3-.1.3-.1h.7a1 1 0 0 1 .6.5l.1.3a8.5 8.5 0 0 1 .3.6l1.9 4.6 2-5.2a1 1 0 0 1 1-.6.5.5 0 0 1 .5.6L13 14v2.8a.7.7 0 0 1-1.4 0Z" fill-rule="nonzero"/></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 id="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 width="24" height="24"><path d="M18 19.3 16.5 18a5.8 5.8 0 0 1-3.1 1.9 6.1 6.1 0 0 1-5.5-1.6A5.8 5.8 0 0 1 6 14v-.3l.1-1.2A13.9 13.9 0 0 1 7.7 9l-3-3 .7-.8 2.8 2.9 9 8.9 1.5 1.6-.7.6Zm0-5.5v.3l-.1 1.1-.4 1-1.2-1.2a4.3 4.3 0 0 0 .2-1v-.2c0-.4 0-.8-.2-1.3l-.5-1.4a14.8 14.8 0 0 0-3-4.2L12 6a26.1 26.1 0 0 0-2.2 2.5l-1-1a20.9 20.9 0 0 1 2.9-3.3L12 4l1 .8a22.2 22.2 0 0 1 4 5.4c.6 1.2 1 2.4 1 3.6Z" fill-rule="evenodd"/></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 width="48" height="48"><g fill-rule="evenodd"><path d="M11 16a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6ZM11 26a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6ZM11 36a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6Z" fill-rule="nonzero"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-default":'<svg width="48" height="48"><g fill-rule="evenodd"><circle cx="11" cy="14" r="3"/><circle cx="11" cy="24" r="3"/><circle cx="11" cy="34" r="3"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-square":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M8 11h6v6H8zM8 21h6v6H8zM8 31h6v6H8z"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></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>',"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>',"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>',"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>',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 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" fill-rule="evenodd"/></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:'<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 id="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>',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>',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>'}})},7741:function(e,t,o){o(2983)},7726:function(e,t,o){o(9595)},9595:function(){(function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.ModelManager");const 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=>{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},n=e=>t=>o(t)===e,r=e=>t=>typeof t===e,s=e=>t=>e===t,a=n("string"),i=n("object"),l=n("array"),c=s(null),d=r("boolean"),m=s(void 0),u=e=>null===e||void 0===e,g=e=>!u(e),h=r("function"),p=r("number"),f=()=>{},b=(e,t)=>(...o)=>e(t.apply(null,o)),v=(e,t)=>o=>e(t(o)),y=e=>()=>e,w=e=>e,x=(e,t)=>e===t;function C(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const S=e=>t=>!e(t),k=e=>()=>{throw new Error(e)},_=e=>e(),O=y(!1),T=y(!0);class E{constructor(e,t){this.tag=e,this.value=t}static some(e){return new E(!0,e)}static none(){return E.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?E.some(e(this.value)):E.none()}bind(e){return this.tag?e(this.value):E.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:E.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&&void 0!==e?e:"Called getOrDie on None")}static from(e){return g(e)?E.some(e):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()"}}E.singletonNone=new E(!1);const D=Array.prototype.slice,A=Array.prototype.indexOf,M=Array.prototype.push,N=(e,t)=>A.call(e,t),R=(e,t)=>N(e,t)>-1,B=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];if(t(n,o))return!0}return!1},L=(e,t)=>{const o=[];for(let n=0;n<e;n++)o.push(t(n));return o},H=(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},I=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];t(n,o)}},P=(e,t)=>{for(let o=e.length-1;o>=0;o--){const n=e[o];t(n,o)}},z=(e,t)=>{const o=[],n=[];for(let r=0,s=e.length;r<s;r++){const s=e[r],a=t(s,r)?o:n;a.push(s)}return{pass:o,fail:n}},F=(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},V=(e,t,o)=>(P(e,((e,n)=>{o=t(o,e,n)})),o),Z=(e,t,o)=>(I(e,((e,n)=>{o=t(o,e,n)})),o),U=(e,t,o)=>{for(let n=0,r=e.length;n<r;n++){const r=e[n];if(t(r,n))return E.some(r);if(o(r,n))break}return E.none()},j=(e,t)=>U(e,t,O),$=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];if(t(n,o))return E.some(o)}return E.none()},W=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);M.apply(t,e[o])}return t},q=(e,t)=>W(H(e,t)),G=(e,t)=>{for(let o=0,n=e.length;o<n;++o){const n=e[o];if(!0!==t(n,o))return!1}return!0},K=e=>{const t=D.call(e,0);return t.reverse(),t},Y=(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},X=(e,t)=>{const o=D.call(e,0);return o.sort(t),o},J=(e,t)=>t>=0&&t<e.length?E.some(e[t]):E.none(),Q=e=>J(e,0),ee=e=>J(e,e.length-1),te=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome())return n}return E.none()},oe=Object.keys,ne=Object.hasOwnProperty,re=(e,t)=>{const o=oe(e);for(let n=0,r=o.length;n<r;n++){const r=o[n],s=e[r];t(s,r)}},se=(e,t)=>ae(e,((e,o)=>({k:o,v:t(e,o)}))),ae=(e,t)=>{const o={};return re(e,((e,n)=>{const r=t(e,n);o[r.k]=r.v})),o},ie=e=>(t,o)=>{e[o]=t},le=(e,t,o,n)=>{re(e,((e,r)=>{(t(e,r)?o:n)(e,r)}))},ce=(e,t)=>{const o={};return le(e,t,ie(o),f),o},de=(e,t)=>{const o=[];return re(e,((e,n)=>{o.push(t(e,n))})),o},me=e=>de(e,w),ue=(e,t)=>ge(e,t)?E.from(e[t]):E.none(),ge=(e,t)=>ne.call(e,t),he=(e,t)=>ge(e,t)&&void 0!==e[t]&&null!==e[t],pe=e=>{for(const t in e)if(ne.call(e,t))return!1;return!0};"undefined"!==typeof window?window:Function("return this;")();const fe=8,be=9,ve=11,ye=1,we=3,xe=e=>{const t=e.dom.nodeName;return t.toLowerCase()},Ce=e=>e.dom.nodeType,Se=e=>t=>Ce(t)===e,ke=e=>Ce(e)===fe||"#comment"===xe(e),_e=Se(ye),Oe=Se(we),Te=Se(be),Ee=Se(ve),De=e=>t=>_e(t)&&xe(t)===e,Ae=(e,t,o)=>{if(!(a(o)||d(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+"")},Me=(e,t,o)=>{Ae(e.dom,t,o)},Ne=(e,t)=>{const o=e.dom;re(t,((e,t)=>{Ae(o,t,e)}))},Re=(e,t)=>{re(t,((t,o)=>{t.fold((()=>{He(e,o)}),(t=>{Ae(e.dom,o,t)}))}))},Be=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},Le=(e,t)=>E.from(Be(e,t)),He=(e,t)=>{e.dom.removeAttribute(t)},Ie=e=>Z(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}),Pe=(e,t)=>{const o=t||document,n=o.createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return Ve(n.childNodes[0])},ze=(e,t)=>{const o=t||document,n=o.createElement(e);return Ve(n)},Fe=(e,t)=>{const o=t||document,n=o.createTextNode(e);return Ve(n)},Ve=e=>{if(null===e||void 0===e)throw new Error("Node cannot be null or undefined");return{dom:e}},Ze=(e,t,o)=>E.from(e.dom.elementFromPoint(t,o)).map(Ve),Ue={fromHtml:Pe,fromTag:ze,fromText:Fe,fromDom:Ve,fromPoint:Ze},je=(e,t)=>{const o=e.dom;if(o.nodeType!==ye)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")}},$e=e=>e.nodeType!==ye&&e.nodeType!==be&&e.nodeType!==ve||0===e.childElementCount,We=(e,t)=>{const o=void 0===t?document:t.dom;return $e(o)?[]:H(o.querySelectorAll(e),Ue.fromDom)},qe=(e,t)=>{const o=void 0===t?document:t.dom;return $e(o)?E.none():E.from(o.querySelector(e)).map(Ue.fromDom)},Ge=(e,t)=>e.dom===t.dom,Ke=(e,t)=>{const o=e.dom,n=t.dom;return o!==n&&o.contains(n)},Ye=je,Xe=e=>Ue.fromDom(e.dom.ownerDocument),Je=e=>Te(e)?e:Xe(e),Qe=e=>Ue.fromDom(Je(e).dom.documentElement),et=e=>Ue.fromDom(Je(e).dom.defaultView),tt=e=>E.from(e.dom.parentNode).map(Ue.fromDom),ot=e=>E.from(e.dom.parentElement).map(Ue.fromDom),nt=(e,t)=>{const o=h(t)?t:O;let n=e.dom;const r=[];while(null!==n.parentNode&&void 0!==n.parentNode){const e=n.parentNode,t=Ue.fromDom(e);if(r.push(t),!0===o(t))break;n=e}return r},rt=e=>E.from(e.dom.previousSibling).map(Ue.fromDom),st=e=>E.from(e.dom.nextSibling).map(Ue.fromDom),at=e=>H(e.dom.childNodes,Ue.fromDom),it=(e,t)=>{const o=e.dom.childNodes;return E.from(o[t]).map(Ue.fromDom)},lt=e=>it(e,0),ct=(e,t)=>{const o=tt(e);o.each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},dt=(e,t)=>{const o=st(e);o.fold((()=>{const o=tt(e);o.each((e=>{ut(e,t)}))}),(e=>{ct(e,t)}))},mt=(e,t)=>{const o=lt(e);o.fold((()=>{ut(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))},ut=(e,t)=>{e.dom.appendChild(t.dom)},gt=(e,t,o)=>{it(e,o).fold((()=>{ut(e,t)}),(e=>{ct(e,t)}))},ht=(e,t)=>{ct(e,t),ut(t,e)},pt=(e,t)=>{I(t,((o,n)=>{const r=0===n?e:t[n-1];dt(r,o)}))},ft=(e,t)=>{I(t,(t=>{ut(e,t)}))},bt=e=>{e.dom.textContent="",I(at(e),(e=>{vt(e)}))},vt=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},yt=e=>{const t=at(e);t.length>0&&pt(e,t),vt(e)},wt=(e,t)=>Ue.fromDom(e.dom.cloneNode(t)),xt=e=>wt(e,!1),Ct=e=>wt(e,!0),St=(e,t)=>{const o=Ue.fromTag(t),n=Ie(e);return Ne(o,n),o},kt=(e,t)=>{const o=St(e,t),n=at(Ct(e));return ft(o,n),o},_t=(e,t)=>{const o=St(e,t);dt(e,o);const n=at(e);return ft(o,n),vt(e),o},Ot=["tfoot","thead","tbody","colgroup"],Tt=e=>R(Ot,e),Et=(e,t)=>({rows:e,columns:t}),Dt=(e,t)=>({row:e,column:t}),At=(e,t,o)=>({element:e,rowspan:t,colspan:o}),Mt=(e,t,o,n)=>({element:e,rowspan:t,colspan:o,isNew:n}),Nt=(e,t,o,n,r,s)=>({element:e,rowspan:t,colspan:o,row:n,column:r,isLocked:s}),Rt=(e,t,o)=>({element:e,cells:t,section:o}),Bt=(e,t,o,n)=>({element:e,cells:t,section:o,isNew:n}),Lt=(e,t,o)=>({element:e,isNew:t,isLocked:o}),Ht=(e,t,o,n)=>({element:e,cells:t,section:o,isNew:n}),It=(e,t,o,n)=>({startRow:e,startCol:t,finishRow:o,finishCol:n}),Pt=(e,t,o)=>({element:e,colspan:t,column:o}),zt=(e,t)=>({element:e,columns:t}),Ft=e=>Ee(e)&&g(e.dom.host),Vt=h(Element.prototype.attachShadow)&&h(Node.prototype.getRootNode),Zt=y(Vt),Ut=Vt?e=>Ue.fromDom(e.dom.getRootNode()):Je,jt=e=>{const t=Ut(e);return Ft(t)?E.some(t):E.none()},$t=e=>Ue.fromDom(e.dom.host),Wt=e=>{if(Zt()&&g(e.target)){const t=Ue.fromDom(e.target);if(_e(t)&&qt(t)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return Q(t)}}return E.from(e.target)},qt=e=>g(e.dom.shadowRoot),Gt=e=>{const t=Oe(e)?e.dom.parentNode:e.dom;if(void 0===t||null===t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return jt(Ue.fromDom(t)).fold((()=>o.body.contains(t)),v(Gt,$t))},Kt=()=>Yt(Ue.fromDom(document)),Yt=e=>{const t=e.dom.body;if(null===t||void 0===t)throw new Error("Body is not available yet");return Ue.fromDom(t)},Xt=(e,t,o)=>F(nt(e,o),t),Jt=(e,t)=>F(at(e),t),Qt=(e,t)=>{let o=[];return I(at(e),(e=>{t(e)&&(o=o.concat([e])),o=o.concat(Qt(e,t))})),o},eo=(e,t,o)=>Xt(e,(e=>je(e,t)),o),to=(e,t)=>Jt(e,(e=>je(e,t))),oo=(e,t)=>We(t,e);var no=(e,t,o,n,r)=>e(o,n)?E.some(o):h(r)&&r(o)?E.none():t(o,n,r);const ro=(e,t,o)=>{let n=e.dom;const r=h(o)?o:O;while(n.parentNode){n=n.parentNode;const e=Ue.fromDom(n);if(t(e))return E.some(e);if(r(e))break}return E.none()},so=(e,t,o)=>{const n=(e,t)=>t(e);return no(n,ro,e,t,o)},ao=(e,t)=>{const o=e=>t(Ue.fromDom(e)),n=j(e.dom.childNodes,o);return n.map(Ue.fromDom)},io=(e,t)=>{const o=e=>{for(let n=0;n<e.childNodes.length;n++){const r=Ue.fromDom(e.childNodes[n]);if(t(r))return E.some(r);const s=o(e.childNodes[n]);if(s.isSome())return s}return E.none()};return o(e.dom)},lo=(e,t,o)=>ro(e,(e=>je(e,t)),o),co=(e,t)=>ao(e,(e=>je(e,t))),mo=(e,t)=>qe(t,e),uo=(e,t,o)=>{const n=(e,t)=>je(e,t);return no(n,lo,e,t,o)},go=(e,t,o=x)=>e.exists((e=>o(e,t))),ho=e=>{const t=[],o=e=>{t.push(e)};for(let n=0;n<e.length;n++)e[n].each(o);return t},po=(e,t)=>void 0!==e&&null!==e?t(e):E.none(),fo=(e,t)=>e?E.some(t):E.none(),bo=(e,t,o)=>""===t||e.length>=t.length&&e.substr(o,o+t.length)===t,vo=(e,t,o=0,n)=>{const r=e.indexOf(t,o);return-1!==r&&(!!m(n)||r+t.length<=n)},yo=(e,t)=>bo(e,t,0),wo=(e,t)=>bo(e,t,e.length-t.length),xo=e=>t=>t.replace(e,""),Co=xo(/^\s+|\s+$/g),So=e=>e.length>0,ko=e=>{const t=parseFloat(e);return isNaN(t)?E.none():E.some(t)},_o=e=>void 0!==e.style&&h(e.style.getPropertyValue),Oo=(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);_o(e)&&e.style.setProperty(t,o)},To=(e,t)=>{_o(e)&&e.style.removeProperty(t)},Eo=(e,t,o)=>{const n=e.dom;Oo(n,t,o)},Do=(e,t)=>{const o=e.dom;re(t,((e,t)=>{Oo(o,t,e)}))},Ao=(e,t)=>{const o=e.dom,n=window.getComputedStyle(o),r=n.getPropertyValue(t);return""!==r||Gt(e)?r:Mo(o,t)},Mo=(e,t)=>_o(e)?e.style.getPropertyValue(t):"",No=(e,t)=>{const o=e.dom,n=Mo(o,t);return E.from(n).filter((e=>e.length>0))},Ro=(e,t)=>{const o=e.dom;To(o,t),go(Le(e,"style").map(Co),"")&&He(e,"style")},Bo=(e,t)=>{const o=e.dom,n=t.dom;_o(o)&&_o(n)&&(n.style.cssText=o.style.cssText)},Lo=(e,t,o=0)=>Le(e,t).map((e=>parseInt(e,10))).getOr(o),Ho=(e,t)=>Lo(e,t,1),Io=e=>De("col")(e)?Lo(e,"span",1)>1:Ho(e,"colspan")>1,Po=e=>Ho(e,"rowspan")>1,zo=(e,t)=>parseInt(Ao(e,t),10),Fo=y(10),Vo=y(10),Zo=(e,t)=>Uo(e,t,T),Uo=(e,t,o)=>q(at(e),(e=>je(e,t)?o(e)?[e]:[]:Uo(e,t,o))),jo=(e,t,o=O)=>{if(o(t))return E.none();if(R(e,xe(t)))return E.some(t);const n=e=>je(e,"table")||o(e);return lo(t,e.join(","),n)},$o=(e,t)=>jo(["td","th"],e,t),Wo=e=>Zo(e,"th,td"),qo=e=>je(e,"colgroup")?to(e,"col"):q(Yo(e),(e=>to(e,"col"))),Go=(e,t)=>uo(e,"table",t),Ko=e=>Zo(e,"tr"),Yo=e=>Go(e).fold(y([]),(e=>to(e,"colgroup"))),Xo=(e,t)=>H(e,(e=>{if("colgroup"===xe(e)){const t=H(qo(e),(e=>{const t=Lo(e,"span",1);return At(e,1,t)}));return Rt(e,t,"colgroup")}{const o=H(Wo(e),(e=>{const t=Lo(e,"rowspan",1),o=Lo(e,"colspan",1);return At(e,t,o)}));return Rt(e,o,t(e))}})),Jo=e=>tt(e).map((e=>{const t=xe(e);return Tt(t)?t:"tbody"})).getOr("tbody"),Qo=e=>{const t=Ko(e),o=Yo(e),n=[...o,...t];return Xo(n,Jo)},en=(e,t)=>Xo(e,(()=>t)),tn=e=>{let t,o=!1;return(...n)=>(o||(o=!0,t=e.apply(null,n)),t)},on=(e,t,o,n)=>{const r=e.isiOS()&&!0===/ipad/i.test(o),s=e.isiOS()&&!r,a=e.isiOS()||e.isAndroid(),i=a||n("(pointer:coarse)"),l=r||!s&&a&&n("(min-device-width:768px)"),c=s||a&&!l,d=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),m=!c&&!l&&!d;return{isiPad:y(r),isiPhone:y(s),isTablet:y(l),isPhone:y(c),isTouch:y(i),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:y(d),isDesktop:y(m)}},nn=(e,t)=>{for(let o=0;o<e.length;o++){const n=e[o];if(n.test(t))return n}},rn=(e,t)=>{const o=nn(e,t);if(!o)return{major:0,minor:0};const n=e=>Number(t.replace(o,"$"+e));return ln(n(1),n(2))},sn=(e,t)=>{const o=String(t).toLowerCase();return 0===e.length?an():rn(e,o)},an=()=>ln(0,0),ln=(e,t)=>({major:e,minor:t}),cn={nu:ln,detect:sn,unknown:an},dn=(e,t)=>te(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:cn.nu(parseInt(t.version,10),0)})))})),mn=(e,t)=>{const o=String(t).toLowerCase();return j(e,(e=>e.search(o)))},un=(e,t)=>mn(e,t).map((e=>{const o=cn.detect(e.versionRegexes,t);return{current:e.name,version:o}})),gn=(e,t)=>mn(e,t).map((e=>{const o=cn.detect(e.versionRegexes,t);return{current:e.name,version:o}})),hn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,pn=e=>t=>vo(t,e),fn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>vo(e,"edge/")&&vo(e,"chrome")&&vo(e,"safari")&&vo(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,hn],search:e=>vo(e,"chrome")&&!vo(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>vo(e,"msie")||vo(e,"trident")},{name:"Opera",versionRegexes:[hn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:pn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:pn("firefox")},{name:"Safari",versionRegexes:[hn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(vo(e,"safari")||vo(e,"mobile/"))&&vo(e,"applewebkit")}],bn=[{name:"Windows",search:pn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>vo(e,"iphone")||vo(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:pn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:pn("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:pn("linux"),versionRegexes:[]},{name:"Solaris",search:pn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:pn("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:pn("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],vn={browsers:y(fn),oses:y(bn)},yn="Edge",wn="Chromium",xn="IE",Cn="Opera",Sn="Firefox",kn="Safari",_n=()=>On({current:void 0,version:cn.unknown()}),On=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isEdge:n(yn),isChromium:n(wn),isIE:n(xn),isOpera:n(Cn),isFirefox:n(Sn),isSafari:n(kn)}},Tn={unknown:_n,nu:On,edge:y(yn),chromium:y(wn),ie:y(xn),opera:y(Cn),firefox:y(Sn),safari:y(kn)},En="Windows",Dn="iOS",An="Android",Mn="Linux",Nn="macOS",Rn="Solaris",Bn="FreeBSD",Ln="ChromeOS",Hn=()=>In({current:void 0,version:cn.unknown()}),In=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isWindows:n(En),isiOS:n(Dn),isAndroid:n(An),isMacOS:n(Nn),isLinux:n(Mn),isSolaris:n(Rn),isFreeBSD:n(Bn),isChromeOS:n(Ln)}},Pn={unknown:Hn,nu:In,windows:y(En),ios:y(Dn),android:y(An),linux:y(Mn),macos:y(Nn),solaris:y(Rn),freebsd:y(Bn),chromeos:y(Ln)},zn=(e,t,o)=>{const n=vn.browsers(),r=vn.oses(),s=t.bind((e=>dn(n,e))).orThunk((()=>un(n,e))).fold(Tn.unknown,Tn.nu),a=gn(r,e).fold(Pn.unknown,Pn.nu),i=on(a,s,e,o);return{browser:s,os:a,deviceType:i}},Fn={detect:zn},Vn=e=>window.matchMedia(e).matches;let Zn=tn((()=>Fn.detect(navigator.userAgent,E.from(navigator.userAgentData),Vn)));const Un=()=>Zn(),jn=(e,t)=>{const o=(t,o)=>{if(!p(o)&&!o.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+o);const n=t.dom;_o(n)&&(n.style[e]=o+"px")},n=o=>{const n=t(o);if(n<=0||null===n){const t=Ao(o,e);return parseFloat(t)||0}return n},r=n,s=(e,t)=>Z(t,((t,o)=>{const n=Ao(e,o),r=void 0===n?0:parseInt(n,10);return isNaN(r)?t:t+r}),0),a=(e,t,o)=>{const n=s(e,o),r=t>n?t-n:0;return r};return{set:o,get:n,getOuter:r,aggregate:s,max:a}},$n=(e,t)=>ko(e).getOr(t),Wn=(e,t,o)=>$n(Ao(e,t),o),qn=(e,t,o,n)=>{const r=Wn(e,`padding-${o}`,0),s=Wn(e,`padding-${n}`,0),a=Wn(e,`border-${o}-width`,0),i=Wn(e,`border-${n}-width`,0);return t-r-s-a-i},Gn=(e,t)=>{const o=e.dom,n=o.getBoundingClientRect().width||o.offsetWidth;return"border-box"===t?n:qn(e,n,"left","right")},Kn=e=>Wn(e,"height",e.dom.offsetHeight),Yn=e=>Wn(e,"width",e.dom.offsetWidth),Xn=e=>Gn(e,"content-box"),Jn=jn("width",(e=>e.dom.offsetWidth)),Qn=e=>Jn.get(e),er=e=>Jn.getOuter(e),tr=Xn,or=Yn,nr=(e,t,o)=>{const n=e.cells,r=n.slice(0,t),s=n.slice(t),a=r.concat(o).concat(s);return ar(e,a)},rr=(e,t,o)=>nr(e,t,[o]),sr=(e,t,o)=>{const n=e.cells;n[t]=o},ar=(e,t)=>Ht(e.element,t,e.section,e.isNew),ir=(e,t)=>{const o=e.cells,n=H(o,t);return Ht(e.element,n,e.section,e.isNew)},lr=(e,t)=>e.cells[t],cr=(e,t)=>lr(e,t).element,dr=e=>e.cells.length,mr=e=>{const t=z(e,(e=>"colgroup"===e.section));return{rows:t.fail,cols:t.pass}},ur=(e,t,o)=>{const n=H(e.cells,o);return Ht(t(e.element),n,e.section,!0)},gr="data-snooker-locked-cols",hr=e=>Le(e,gr).bind((e=>E.from(e.match(/\d+/g)))).map((e=>Y(e,T))),pr=e=>{const t=Z(mr(e).rows,((e,t)=>(I(t.cells,((t,o)=>{t.isLocked&&(e[o]=!0)})),e)),{}),o=de(t,((e,t)=>parseInt(t,10)));return X(o)},fr=(e,t)=>e+","+t,br=(e,t,o)=>E.from(e.access[fr(t,o)]),vr=(e,t,o)=>{const n=yr(e,(e=>o(t,e.element)));return n.length>0?E.some(n[0]):E.none()},yr=(e,t)=>{const o=q(e.all,(e=>e.cells));return F(o,t)},wr=e=>{const t={};let o=0;return I(e.cells,(e=>{const n=e.colspan;L(n,(r=>{const s=o+r;t[s]=Pt(e.element,n,s)})),o+=n})),t},xr=e=>{const t={},o=[],n=Q(e).map((e=>e.element)).bind(Go),r=n.bind(hr).getOr({});let s=0,a=0,i=0;const{pass:l,fail:c}=z(e,(e=>"colgroup"===e.section));I(c,(e=>{const n=[];I(e.cells,(e=>{let o=0;while(void 0!==t[fr(i,o)])o++;const s=he(r,o.toString()),l=Nt(e.element,e.rowspan,e.colspan,i,o,s);for(let n=0;n<e.colspan;n++)for(let r=0;r<e.rowspan;r++){const e=i+r,s=o+n,c=fr(e,s);t[c]=l,a=Math.max(a,s+1)}n.push(l)})),s++,o.push(Rt(e.element,n,e.section)),i++}));const{columns:d,colgroups:m}=ee(l).map((e=>{const t=wr(e),o=zt(e.element,me(t));return{colgroups:[o],columns:t}})).getOrThunk((()=>({colgroups:[],columns:{}}))),u=Et(s,a);return{grid:u,access:t,all:o,columns:d,colgroups:m}},Cr=e=>{const t=Qo(e);return xr(t)},Sr=e=>q(e.all,(e=>e.cells)),kr=e=>me(e.columns),_r=e=>oe(e.columns).length>0,Or=(e,t)=>E.from(e.columns[t]),Tr={fromTable:Cr,generate:xr,getAt:br,findItem:vr,filterItems:yr,justCells:Sr,justColumns:kr,hasColumns:_r,getColumnAt:Or},Er=(e,t=T)=>{const o=e.grid,n=L(o.columns,w),r=L(o.rows,w);return H(n,(o=>{const n=()=>q(r,(t=>Tr.getAt(e,t,o).filter((e=>e.column===o)).toArray())),s=e=>1===e.colspan&&t(e.element),a=()=>Tr.getAt(e,0,o);return Dr(n,s,a)}))},Dr=(e,t,o)=>{const n=e(),r=j(n,t),s=r.orThunk((()=>E.from(n[0]).orThunk(o)));return s.map((e=>e.element))},Ar=e=>{const t=e.grid,o=L(t.rows,w),n=L(t.columns,w);return H(o,(t=>{const o=()=>q(n,(o=>Tr.getAt(e,t,o).filter((e=>e.row===t)).fold(y([]),(e=>[e])))),r=e=>1===e.rowspan,s=()=>Tr.getAt(e,t,0);return Dr(o,r,s)}))},Mr=(e,t)=>{if(t<0||t>=e.length-1)return E.none();const o=e[t].fold((()=>{const o=K(e.slice(0,t));return te(o,((e,t)=>e.map((e=>({value:e,delta:t+1})))))}),(e=>E.some({value:e,delta:0}))),n=e[t+1].fold((()=>{const o=e.slice(t+1);return te(o,((e,t)=>e.map((e=>({value:e,delta:t+1})))))}),(e=>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}))))},Nr=(e,t)=>o=>"rtl"===Rr(o)?t:e,Rr=e=>"rtl"===Ao(e,"direction")?"rtl":"ltr",Br=jn("height",(e=>{const t=e.dom;return Gt(e)?t.getBoundingClientRect().height:t.offsetHeight})),Lr=e=>Br.get(e),Hr=e=>Br.getOuter(e),Ir=Kn,Pr=(e,t)=>{const o=(o,n)=>Pr(e+o,t+n);return{left:e,top:t,translate:o}},zr=Pr,Fr=e=>{const t=e.getBoundingClientRect();return zr(t.left,t.top)},Vr=(e,t)=>void 0!==e?e:void 0!==t?t:0,Zr=e=>{const t=e.dom.ownerDocument,o=t.body,n=t.defaultView,r=t.documentElement;if(o===e.dom)return zr(o.offsetLeft,o.offsetTop);const s=Vr(null===n||void 0===n?void 0:n.pageYOffset,r.scrollTop),a=Vr(null===n||void 0===n?void 0:n.pageXOffset,r.scrollLeft),i=Vr(r.clientTop,o.clientTop),l=Vr(r.clientLeft,o.clientLeft);return Ur(e).translate(a-l,s-i)},Ur=e=>{const t=e.dom,o=t.ownerDocument,n=o.body;return n===t?zr(n.offsetLeft,n.offsetTop):Gt(e)?Fr(t):zr(0,0)},jr=(e,t)=>({row:e,y:t}),$r=(e,t)=>({col:e,x:t}),Wr=e=>{const t=Zr(e);return t.left+er(e)},qr=e=>Zr(e).left,Gr=(e,t)=>$r(e,qr(t)),Kr=(e,t)=>$r(e,Wr(t)),Yr=e=>Zr(e).top,Xr=(e,t)=>jr(e,Yr(t)),Jr=(e,t)=>jr(e,Yr(t)+Hr(t)),Qr=(e,t,o)=>{if(0===o.length)return[];const n=H(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])},es=e=>-e,ts={delta:w,positions:e=>Qr(Xr,Jr,e),edge:Yr},os={delta:w,edge:qr,positions:e=>Qr(Gr,Kr,e)},ns={delta:es,edge:Wr,positions:e=>Qr(Kr,Gr,e)},rs=Nr(os,ns),ss={delta:(e,t)=>rs(t).delta(e,t),positions:(e,t)=>rs(t).positions(e,t),edge:e=>rs(e).edge(e)},as={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:[""]},is=(()=>{const e="[0-9]+",t="[+-]?"+e,o="[eE]"+t,n="\\.",r=e=>`(?:${e})?`,s=["Infinity",e+n+r(e)+r(o),n+e+r(o),e+r(o)].join("|"),a=`[+-]?(?:${s})`;return new RegExp(`^(${a})(.*)$`)})(),ls=(e,t)=>B(t,(t=>B(as[t],(t=>e===t)))),cs=(e,t)=>{const o=E.from(is.exec(e));return o.bind((e=>{const o=Number(e[1]),n=e[2];return ls(n,t)?E.some({value:o,unit:n}):E.none()}))},ds=/(\d+(\.\d+)?)%/,ms=/(\d+(\.\d+)?)px|em/,us=De("col"),gs=(e,t,o)=>{const n=ot(e).getOrThunk((()=>Yt(Xe(e))));return t(e)/o(n)*100},hs=(e,t)=>{Eo(e,"width",t+"px")},ps=(e,t)=>{Eo(e,"width",t+"%")},fs=(e,t)=>{Eo(e,"height",t+"px")},bs=e=>Ir(e)+"px",vs=(e,t,o,n)=>{const r=Go(e).map((e=>{const n=o(e);return Math.floor(t/100*n)})).getOr(t);return n(e,r),r},ys=(e,t,o,n)=>{const r=parseFloat(e);return wo(e,"%")&&"table"!==xe(t)?vs(t,r,o,n):r},ws=e=>{const t=bs(e);return t?ys(t,e,Lr,fs):Lr(e)},xs=(e,t,o)=>{const n=o(e),r=Ho(e,t);return n/r},Cs=(e,t)=>No(e,t).orThunk((()=>Le(e,t).map((e=>e+"px")))),Ss=e=>Cs(e,"width"),ks=e=>Cs(e,"height"),_s=e=>gs(e,Qn,tr),Os=e=>us(e)?Qn(e):or(e),Ts=e=>xs(e,"rowspan",ws),Es=e=>{const t=Ss(e);return t.bind((e=>cs(e,["fixed","relative","empty"])))},Ds=(e,t,o)=>{Eo(e,"width",t+o)},As=e=>Qn(e)+"px",Ms=e=>gs(e,Qn,tr)+"%",Ns=e=>Ss(e).exists((e=>ds.test(e))),Rs=e=>Ss(e).exists((e=>ms.test(e))),Bs=e=>Ss(e).isNone(),Ls=y(ds),Hs=De("col"),Is=e=>Ss(e).getOrThunk((()=>Os(e)+"px")),Ps=e=>ks(e).getOrThunk((()=>Ts(e)+"px")),zs=e=>H(Tr.justColumns(e),(e=>E.from(e.element))),Fs=e=>{const t=Un().browser,o=t.isChromium()||t.isFirefox();return!Hs(e)||o},Vs=(e,t,o,n,r,s)=>e.filter(n).fold((()=>s(Mr(o,t))),(e=>r(e))),Zs=(e,t,o,n)=>{const r=Er(e),s=Tr.hasColumns(e)?zs(e):r,a=[E.some(ss.edge(t))].concat(H(ss.positions(r,t),(e=>e.map((e=>e.x))))),i=S(Io);return H(s,((e,t)=>Vs(e,t,a,i,(e=>{if(Fs(e))return o(e);{const e=po(r[t],w);return Vs(e,t,a,i,(e=>n(E.some(Qn(e)))),n)}}),n)))},Us=e=>e.map((e=>e+"px")).getOr(""),js=(e,t)=>Zs(e,t,Is,Us),$s=(e,t,o)=>Zs(e,t,_s,(e=>e.fold((()=>o.minCellWidth()),(e=>e/o.pixelWidth()*100)))),Ws=(e,t,o)=>Zs(e,t,Os,(e=>e.getOrThunk(o.minCellWidth))),qs=(e,t,o,n,r)=>{const s=Ar(e),a=[E.some(o.edge(t))].concat(H(o.positions(s,t),(e=>e.map((e=>e.y)))));return H(s,((e,t)=>Vs(e,t,a,S(Po),n,r)))},Gs=(e,t,o)=>qs(e,t,o,Ts,(e=>e.getOrThunk(Vo))),Ks=(e,t,o)=>qs(e,t,o,Ps,Us),Ys=(e,t)=>()=>Gt(e)?t(e):parseFloat(No(e,"width").getOr("0")),Xs=e=>{const t=Ys(e,Qn),o=y(0),n=(t,o)=>Ws(t,e,o);return{width:t,pixelWidth:t,getWidths:n,getCellDelta:o,singleColumnWidth:y([0]),minCellWidth:o,setElementWidth:f,adjustTableWidth:f,isRelative:!0,label:"none"}},Js=e=>{const t=Ys(e,(e=>parseFloat(Ms(e)))),o=Ys(e,Qn),n=e=>e/o()*100,r=(e,t)=>[100-e],s=()=>Fo()/o()*100,a=o=>{const n=t(),r=o/100*n,s=n+r;ps(e,s)},i=(t,o)=>$s(t,e,o);return{width:t,pixelWidth:o,getWidths:i,getCellDelta:n,singleColumnWidth:r,minCellWidth:s,setElementWidth:ps,adjustTableWidth:a,isRelative:!0,label:"percent"}},Qs=e=>{const t=Ys(e,Qn),o=w,n=(e,t)=>{const o=Math.max(Fo(),e+t);return[o-e]},r=o=>{const n=t()+o;hs(e,n)},s=(t,o)=>Ws(t,e,o);return{width:t,pixelWidth:t,getWidths:s,getCellDelta:o,singleColumnWidth:n,minCellWidth:Fo,setElementWidth:hs,adjustTableWidth:r,isRelative:!1,label:"pixel"}},ea=(e,t)=>{const o=Ls().exec(t);return null!==o?Js(e):Qs(e)},ta=e=>{const t=Ss(e);return t.fold((()=>Xs(e)),(t=>ea(e,t)))},oa={getTableSize:ta,pixelSize:Qs,percentageSize:Js,noneSize:Xs},na=(e,t,o,n,r,s)=>({minRow:e,minCol:t,maxRow:o,maxCol:n,allCells:r,selectedCells:s}),ra=(e,t)=>{const o=e.grid.columns,n=e.grid.rows;let r=n,s=o,a=0,i=0;const l=[],c=[];return re(e.access,(e=>{if(l.push(e),t(e)){c.push(e);const t=e.row,o=t+e.rowspan-1,n=e.column,l=n+e.colspan-1;t<r?r=t:o>a&&(a=o),n<s?s=n:l>i&&(i=l)}})),na(r,s,a,i,l,c)},sa=(e,t,o)=>{const n=e[o].element,r=Ue.fromTag("td");ut(r,Ue.fromTag("br"));const s=t?ut:mt;s(n,r)},aa=(e,t,o,n)=>{const r=F(e,(e=>"colgroup"!==e.section)),s=t.grid.columns,a=t.grid.rows;for(let i=0;i<a;i++){let e=!1;for(let a=0;a<s;a++)if(!(i<o.minRow||i>o.maxRow||a<o.minCol||a>o.maxCol)){const o=Tr.getAt(t,i,a).filter(n).isNone();o?sa(r,e,i):e=!0}}},ia=(e,t,o,n)=>{re(o.columns,(e=>{(e.column<t.minCol||e.column>t.maxCol)&&vt(e.element)}));const r=F(Zo(e,"tr"),(e=>0===e.dom.childElementCount));I(r,vt),t.minCol!==t.maxCol&&t.minRow!==t.maxRow||I(Zo(e,"th,td"),(e=>{He(e,"rowspan"),He(e,"colspan")})),He(e,gr),He(e,"data-snooker-col-series");const s=oa.getTableSize(e);s.adjustTableWidth(n)},la=(e,t,o,n)=>{if(0===n.minCol&&t.grid.columns===n.maxCol+1)return 0;const r=Ws(t,e,o),s=Z(r,((e,t)=>e+t),0),a=Z(r.slice(n.minCol,n.maxCol+1),((e,t)=>e+t),0),i=a/s*o.pixelWidth(),l=i-o.pixelWidth();return o.getCellDelta(l)},ca=(e,t)=>{const o=e=>je(e.element,t),n=Ct(e),r=Qo(n),s=oa.getTableSize(e),a=Tr.generate(r),i=ra(a,o),l="th:not("+t+"),td:not("+t+")",c=Uo(n,"th,td",(e=>je(e,l)));I(c,vt),aa(r,a,i,o);const d=Tr.fromTable(e),m=la(e,d,s,i);return ia(n,i,a,m),n},da=" ",ma=(e,t)=>{const o=o=>{if(!e(o))throw new Error("Can only get "+t+" value of a "+t+" node");return n(o).getOr("")},n=t=>e(t)?E.from(t.dom.nodeValue):E.none(),r=(o,n)=>{if(!e(o))throw new Error("Can only set raw "+t+" value of a "+t+" node");o.dom.nodeValue=n};return{get:o,getOption:n,set:r}},ua=ma(Oe,"text"),ga=e=>ua.get(e),ha=e=>ua.getOption(e),pa=(e,t)=>ua.set(e,t),fa=e=>"img"===xe(e)?1:ha(e).fold((()=>at(e).length),(e=>e.length)),ba=e=>ha(e).filter((e=>0!==e.trim().length||e.indexOf(da)>-1)).isSome(),va=["img","br"],ya=e=>{const t=ba(e);return t||R(va,xe(e))},wa=e=>io(e,ya),xa=e=>Ca(e,ya),Ca=(e,t)=>{const o=e=>{const n=at(e);for(let r=n.length-1;r>=0;r--){const e=n[r];if(t(e))return E.some(e);const s=o(e);if(s.isSome())return s}return E.none()};return o(e)},Sa={scope:["row","col"]},ka=e=>()=>{const t=Ue.fromTag("td",e.dom);return ut(t,Ue.fromTag("br",e.dom)),t},_a=e=>()=>Ue.fromTag("col",e.dom),Oa=e=>()=>Ue.fromTag("colgroup",e.dom),Ta=e=>()=>Ue.fromTag("tr",e.dom),Ea=(e,t,o)=>{const n=kt(e,t);return re(o,((e,t)=>{null===e?He(n,t):Me(n,t,e)})),n},Da=e=>e,Aa=(e,t,o)=>{const n=wa(e);return n.map((n=>{const r=o.join(","),s=eo(n,r,(t=>Ge(t,e)));return V(s,((e,t)=>{const o=xt(t);return He(o,"contenteditable"),ut(e,o),o}),t)})).getOr(t)},Ma=(e,t)=>{re(Sa,((o,n)=>Le(e,n).filter((e=>R(o,e))).each((e=>Me(t,n,e)))))},Na=(e,t,o)=>{const n=(e,t)=>{Bo(e.element,t),Ro(t,"height"),1!==e.colspan&&Ro(t,"width")},r=r=>{const s=Ue.fromTag(xe(r.element),t.dom),a=o.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),i=a.length>0?Aa(r.element,s,a):s;return ut(i,Ue.fromTag("br")),n(r,s),Ma(r.element,s),e(r.element,s),s},s=o=>{const r=Ue.fromTag(xe(o.element),t.dom);return n(o,r),e(o.element,r),r};return{col:s,colgroup:Oa(t),row:Ta(t),cell:r,replace:Ea,colGap:_a(t),gap:ka(t)}},Ra=e=>({col:_a(e),colgroup:Oa(e),row:Ta(e),cell:ka(e),replace:Da,colGap:_a(e),gap:ka(e)}),Ba=(e,t)=>{const o=t||document,n=o.createElement("div");return n.innerHTML=e,at(Ue.fromDom(n))},La=e=>H(e,Ue.fromDom),Ha=e=>Ue.fromDom(e.getBody()),Ia=e=>t=>Ge(t,Ha(e)),Pa=e=>{He(e,"data-mce-style");const t=e=>He(e,"data-mce-style");I(Wo(e),t),I(qo(e),t),I(Ko(e),t)},za=e=>Ue.fromDom(e.selection.getStart()),Fa=e=>e.getBoundingClientRect().width,Va=e=>e.getBoundingClientRect().height,Za=(e,t)=>{const o=e.dom.getStyle(t,"width")||e.dom.getAttrib(t,"width");return E.from(o).filter(So)},Ua=e=>/^(\d+(\.\d+)?)%$/.test(e),ja=e=>/^(\d+(\.\d+)?)px$/.test(e),$a=(e,t)=>{const o=t.column,n=t.column+t.colspan-1,r=t.row,s=t.row+t.rowspan-1;return o<=e.finishCol&&n>=e.startCol&&r<=e.finishRow&&s>=e.startRow},Wa=(e,t)=>t.column>=e.startCol&&t.column+t.colspan-1<=e.finishCol&&t.row>=e.startRow&&t.row+t.rowspan-1<=e.finishRow,qa=(e,t)=>{let o=!0;const n=C(Wa,t);for(let r=t.startRow;r<=t.finishRow;r++)for(let s=t.startCol;s<=t.finishCol;s++)o=o&&Tr.getAt(e,r,s).exists(n);return o?E.some(t):E.none()},Ga=(e,t)=>It(Math.min(e.row,t.row),Math.min(e.column,t.column),Math.max(e.row+e.rowspan-1,t.row+t.rowspan-1),Math.max(e.column+e.colspan-1,t.column+t.colspan-1)),Ka=(e,t,o)=>{const n=Tr.findItem(e,t,Ge),r=Tr.findItem(e,o,Ge);return n.bind((e=>r.map((t=>Ga(e,t)))))},Ya=(e,t,o)=>Ka(e,t,o).bind((t=>qa(e,t))),Xa=(e,t,o,n)=>Tr.findItem(e,t,Ge).bind((t=>{const r=o>0?t.row+t.rowspan-1:t.row,s=n>0?t.column+t.colspan-1:t.column,a=Tr.getAt(e,r+o,s+n);return a.map((e=>e.element))})),Ja=(e,t,o)=>Ka(e,t,o).map((t=>{const o=Tr.filterItems(e,C($a,t));return H(o,(e=>e.element))})),Qa=(e,t)=>{const o=(e,t)=>Ke(t,e);return Tr.findItem(e,t,o).map((e=>e.element))},ei=(e,t,o)=>Go(e).bind((n=>{const r=ri(n);return Xa(r,e,t,o)})),ti=(e,t,o)=>{const n=ri(e);return Ja(n,t,o)},oi=(e,t,o,n,r)=>{const s=ri(e),a=Ge(e,o)?E.some(t):Qa(s,t),i=Ge(e,r)?E.some(n):Qa(s,n);return a.bind((e=>i.bind((t=>Ja(s,e,t)))))},ni=(e,t,o)=>{const n=ri(e);return Ya(n,t,o)},ri=Tr.fromTable;var si=["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"],ai=()=>{const e=e=>Ue.fromDom(e.dom.cloneNode(!1)),t=e=>Je(e).dom,o=e=>!!_e(e)&&("body"===xe(e)||R(si,xe(e))),n=e=>!!_e(e)&&R(["br","img","hr","input"],xe(e)),r=e=>_e(e)&&"false"===Be(e,"contenteditable"),s=(e,t)=>e.dom.compareDocumentPosition(t.dom),a=(e,t)=>{const o=Ie(e);Ne(t,o)},i=e=>{const t=xe(e);return R(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],t)},l=e=>_e(e)?Le(e,"lang"):E.none();return{up:y({selector:lo,closest:uo,predicate:ro,all:nt}),down:y({selector:oo,predicate:Qt}),styles:y({get:Ao,getRaw:No,set:Eo,remove:Ro}),attrs:y({get:Be,set:Me,remove:He,copyTo:a}),insert:y({before:ct,after:dt,afterAll:pt,append:ut,appendAll:ft,prepend:mt,wrap:ht}),remove:y({unwrap:yt,remove:vt}),create:y({nu:Ue.fromTag,clone:e,text:Ue.fromText}),query:y({comparePosition:s,prevSibling:rt,nextSibling:st}),property:y({children:at,name:xe,parent:tt,document:t,isText:Oe,isComment:ke,isElement:_e,isSpecial:i,getLanguage:l,getText:ga,setText:pa,isBoundary:o,isEmptyTag:n,isNonEditable:r}),eq:Ge,is:Ye}};const ii=(e,t,o,n)=>{const r=o[0],s=o.slice(1);return n(e,t,r,s)},li=(e,t,o)=>o.length>0?ii(e,t,o,ci):E.none(),ci=(e,t,o,n)=>{const r=t(e,o);return V(n,((o,n)=>{const r=t(e,n);return di(e,o,r)}),r)},di=(e,t,o)=>t.bind((t=>o.filter(C(e.eq,t)))),mi=(e,t)=>C(e.eq,t),ui=(e,t,o,n=O)=>{const r=[t].concat(e.up().all(t)),s=[o].concat(e.up().all(o)),a=e=>{const t=$(e,n);return t.fold((()=>e),(t=>e.slice(0,t+1)))},i=a(r),l=a(s),c=j(i,(t=>B(l,mi(e,t))));return{firstpath:i,secondpath:l,shared:c}},gi=li,hi=ui,pi=ai(),fi=(e,t)=>gi(pi,((t,o)=>e(o)),t),bi=(e,t,o)=>hi(pi,e,t,o),vi=e=>lo(e,"table"),yi=(e,t,o)=>{const n=e=>t=>void 0!==o&&o(t)||Ge(t,e);return Ge(e,t)?E.some({boxes:E.some([e]),start:e,finish:t}):vi(e).bind((r=>vi(t).bind((s=>{if(Ge(r,s))return E.some({boxes:ti(r,e,t),start:e,finish:t});if(Ke(r,s)){const o=eo(t,"td,th",n(r)),a=o.length>0?o[o.length-1]:t;return E.some({boxes:oi(r,e,r,t,s),start:e,finish:a})}if(Ke(s,r)){const o=eo(e,"td,th",n(s)),a=o.length>0?o[o.length-1]:e;return E.some({boxes:oi(s,e,r,t,s),start:e,finish:a})}return bi(e,t).shared.bind((a=>uo(a,"table",o).bind((o=>{const a=eo(t,"td,th",n(o)),i=a.length>0?a[a.length-1]:t,l=eo(e,"td,th",n(o)),c=l.length>0?l[l.length-1]:e;return E.some({boxes:oi(o,e,r,t,s),start:c,finish:i})}))))}))))},wi=(e,t)=>{const o=oo(e,t);return o.length>0?E.some(o):E.none()},xi=(e,t)=>j(e,(e=>je(e,t))),Ci=(e,t,o)=>mo(e,t).bind((t=>mo(e,o).bind((e=>fi(vi,[t,e]).map((o=>({first:t,last:e,table:o}))))))),Si=(e,t)=>lo(e,"table").bind((o=>mo(o,t).bind((t=>yi(t,e).bind((e=>e.boxes.map((t=>({boxes:t,start:e.start,finish:e.finish}))))))))),ki=(e,t,o,n,r)=>xi(e,r).bind((e=>ei(e,t,o).bind((e=>Si(e,n))))),_i=(e,t)=>wi(e,t),Oi=(e,t,o)=>Ci(e,t,o).bind((t=>{const o=t=>Ge(e,t),n="thead,tfoot,tbody,table",r=lo(t.first,n,o),s=lo(t.last,n,o);return r.bind((e=>s.bind((o=>Ge(e,o)?ni(t.table,t.first,t.last):E.none()))))})),Ti=w,Ei=e=>{const t=(e,t)=>Le(e,t).exists((e=>parseInt(e,10)>1)),o=e=>t(e,"rowspan")||t(e,"colspan");return e.length>0&&G(e,o)?E.some(e):E.none()},Di=(e,t,o)=>t.length<=1?E.none():Oi(e,o.firstSelectedSelector,o.lastSelectedSelector).map((e=>({bounds:e,cells:t}))),Ai="data-mce-selected",Mi="td["+Ai+"],th["+Ai+"]",Ni="["+Ai+"]",Ri="data-mce-first-selected",Bi="td["+Ri+"],th["+Ri+"]",Li="data-mce-last-selected",Hi="td["+Li+"],th["+Li+"]",Ii=Ni,Pi={selected:Ai,selectedSelector:Mi,firstSelected:Ri,firstSelectedSelector:Bi,lastSelected:Li,lastSelectedSelector:Hi},zi=(e,t,o)=>({element:o,mergable:Di(t,e,Pi),unmergable:Ei(e),selection:Ti(e)}),Fi=(e,t,o)=>({element:e,clipboard:t,generators:o}),Vi=(e,t,o,n)=>({selection:Ti(e),clipboard:o,generators:n}),Zi=e=>Go(e).bind((e=>_i(e,Pi.firstSelectedSelector))).fold(y(e),(e=>e[0])),Ui=e=>(t,o)=>{const n=xe(t),r="col"===n||"colgroup"===n?Zi(t):t;return uo(r,e,o)},ji=Ui("th,td,caption"),$i=Ui("th,td"),Wi=e=>La(e.model.table.getSelectedCells()),qi=e=>F(Wi(e),(e=>je(e,Pi.selectedSelector))),Gi=e=>Go(e[0]).map((e=>{const t=ca(e,Ii);return Pa(t),[t]})),Ki=(e,t)=>H(t,(t=>e.selection.serializer.serialize(t.dom,{}))).join(""),Yi=e=>H(e,(e=>e.dom.innerText)).join(""),Xi=(e,t)=>{e.on("BeforeGetContent",(t=>{const o=o=>{t.preventDefault(),Gi(o).each((o=>{t.content="text"===t.format?Yi(o):Ki(e,o)}))};if(!0===t.selection){const t=qi(e);t.length>=1&&o(t)}})),e.on("BeforeSetContent",(o=>{if(!0===o.selection&&!0===o.paste){const n=Wi(e);Q(n).each((n=>{Go(n).each((r=>{const s=F(Ba(o.content),(e=>"meta"!==xe(e))),a=De("table");if(1===s.length&&a(s[0])){o.preventDefault();const a=Ue.fromDom(e.getDoc()),i=Ra(a),l=Fi(n,s[0],i);t.pasteCells(r,l).each((()=>{e.focus()}))}}))}))}}))},Ji=(e,t)=>({element:e,offset:t}),Qi=(e,t,o)=>e.property().isText(t)&&0===e.property().getText(t).trim().length||e.property().isComment(t)?o(t).bind((t=>Qi(e,t,o).orThunk((()=>E.some(t))))):E.none(),el=(e,t)=>{if(e.property().isText(t))return e.property().getText(t).length;const o=e.property().children(t);return o.length},tl=(e,t)=>{const o=Qi(e,t,e.query().prevSibling).getOr(t);if(e.property().isText(o))return Ji(o,el(e,o));const n=e.property().children(o);return n.length>0?tl(e,n[n.length-1]):Ji(o,el(e,o))},ol=tl,nl=ai(),rl=e=>ol(nl,e),sl=(e,t)=>{if(!Io(e)){const o=Es(e);o.each((o=>{const n=o.value/2;Ds(e,n,o.unit),Ds(t,n,o.unit)}))}},al=e=>H(e,y(0)),il=(e,t,o,n,r)=>r(e.slice(0,t)).concat(n).concat(r(e.slice(o))),ll=e=>(t,o,n,r)=>{if(e(n)){const e=Math.max(r,t[o]-Math.abs(n)),s=Math.abs(e-t[o]);return n>=0?s:-s}return n},cl=ll((e=>e<0)),dl=ll(T),ml=()=>{const e=(e,t,o,n,r)=>{const s=cl(e,t,n,r);return il(e,t,o+1,[s,0],al)},t=(e,t,o,n)=>{const r=(100+o)/100,s=Math.max(n,(e[t]+o)/r);return H(e,((e,o)=>{const n=o===t?s:e/r;return n-e}))},o=(o,n,r,s,a,i)=>i?t(o,n,s,a):e(o,n,r,s,a),n=(e,t,n,r,s,a,i)=>o(e,n,r,s,a,i),r=(e,t)=>e(t),s=(e,o,n,r,s,a)=>{if(a)return t(e,n,r,s);{const t=cl(e,n,r,s);return al(e.slice(0,n)).concat([t])}},a=(e,t,o,n)=>{if(n){const n=t+o,r=n/t,s=H(e,(e=>e/r));return{delta:100*r-100,newSizes:s}}return{delta:o,newSizes:e}};return{resizeTable:r,clampTableDelta:cl,calcLeftEdgeDeltas:o,calcMiddleDeltas:n,calcRightEdgeDeltas:s,calcRedestributedWidths:a}},ul=()=>{const e=(e,t,o,n,r)=>{const s=n>=0?o:t,a=dl(e,s,n,r);return il(e,t,o+1,[a,-a],al)},t=(t,o,n,r,s,a)=>e(t,n,r,s,a),o=(e,t,o)=>{o&&e(t)},n=(e,t,o,n,r,s)=>{if(s)return al(e);{const t=n/e.length;return H(e,y(t))}},r=(e,t,o,n,r)=>{if(r){if(o>=0)return o;{const t=Z(e,((e,t)=>e+t-n),0);return Math.max(-t,o)}}return cl(e,t,o,n)},s=(e,t,o,n)=>({delta:0,newSizes:e});return{resizeTable:o,clampTableDelta:r,calcLeftEdgeDeltas:e,calcMiddleDeltas:t,calcRightEdgeDeltas:n,calcRedestributedWidths:s}},gl=e=>{const t=Tr.fromTable(e);return t.grid},hl=De("th"),pl=e=>G(e,(e=>hl(e.element))),fl=(e,t)=>e&&t?"sectionCells":e?"section":"cells",bl=e=>{const t="thead"===e.section,o=go(vl(e.cells),"th");return"tfoot"===e.section?{type:"footer"}:t||o?{type:"header",subType:fl(t,o)}:{type:"body"}},vl=e=>{const t=F(e,(e=>hl(e.element)));return 0===t.length?E.some("td"):t.length===e.length?E.some("th"):E.none()},yl=e=>{const t=H(e,(e=>bl(e).type)),o=R(t,"header"),n=R(t,"footer");if(o||n){const e=R(t,"body");return!o||e||n?o||e||!n?E.none():E.some("footer"):E.some("header")}return E.some("body")},wl=e=>te(e.all,(e=>{const t=bl(e);return"header"===t.type?E.from(t.subType):E.none()})),xl=(e,t,o)=>Lt(o(e.element,t),!0,e.isLocked),Cl=(e,t)=>e.section!==t?Ht(e.element,e.cells,t,e.isNew):e,Sl=()=>({transformRow:Cl,transformCell:(e,t,o)=>{const n=o(e.element,t),r="td"!==xe(n)?_t(n,"td"):n;return Lt(r,e.isNew,e.isLocked)}}),kl=()=>({transformRow:Cl,transformCell:xl}),_l=()=>({transformRow:(e,t)=>{const o="thead"===t?"tbody":t;return Cl(e,o)},transformCell:xl}),Ol=()=>({transformRow:w,transformCell:xl}),Tl=(e,t)=>{const o=Tr.fromTable(e),n=wl(o).getOr(t);switch(n){case"section":return Sl();case"sectionCells":return kl();case"cells":return _l()}},El={getTableSectionType:Tl,section:Sl,sectionCells:kl,cells:_l,fallback:Ol},Dl=e=>uo(e,"[contenteditable]"),Al=(e,t=!1)=>Gt(e)?e.dom.isContentEditable:Dl(e).fold(y(t),(e=>"true"===Ml(e))),Ml=e=>e.dom.contentEditable,Nl=(e,t,o,n)=>{o===n?He(e,t):Me(e,t,o)},Rl=(e,t,o)=>{ee(to(e,t)).fold((()=>mt(e,o)),(e=>dt(e,o)))},Bl=(e,t)=>{const o=co(e,t).getOrThunk((()=>{const o=Ue.fromTag(t,Xe(e).dom);return"thead"===t?Rl(e,"caption,colgroup",o):"colgroup"===t?Rl(e,"caption",o):ut(e,o),o}));return bt(o),o},Ll=(e,t)=>{const o=[],n=[],r=e=>H(e,(e=>{e.isNew&&o.push(e.element);const t=e.element;return bt(t),I(e.cells,(e=>{e.isNew&&n.push(e.element),Nl(e.element,"colspan",e.colspan,1),Nl(e.element,"rowspan",e.rowspan,1),ut(t,e.element)})),t})),s=e=>q(e,(e=>H(e.cells,(e=>(Nl(e.element,"span",e.colspan,1),e.element))))),a=(t,o)=>{const n=Bl(e,o),a="colgroup"===o?s:r,i=a(t);ft(n,i)},i=t=>{co(e,t).each(vt)},l=(e,t)=>{e.length>0?a(e,t):i(t)},c=[],d=[],m=[],u=[];return I(t,(e=>{switch(e.section){case"thead":c.push(e);break;case"tbody":d.push(e);break;case"tfoot":m.push(e);break;case"colgroup":u.push(e);break}})),l(u,"colgroup"),l(c,"thead"),l(d,"tbody"),l(m,"tfoot"),{newRows:o,newCells:n}},Hl=e=>H(e,(e=>{const t=xt(e.element);return I(e.cells,(e=>{const o=Ct(e.element);Nl(o,"colspan",e.colspan,1),Nl(o,"rowspan",e.rowspan,1),ut(t,o)})),t})),Il=(e,t)=>H(e,(e=>lr(e,t))),Pl=(e,t)=>e[t],zl=(e,t)=>{if(0===e.length)return 0;const o=e[0],n=$(e,(e=>!t(o.element,e.element)));return n.getOr(e.length)},Fl=(e,t,o,n)=>{const r=Pl(e,t),s="colgroup"===r.section,a=zl(r.cells.slice(o),n),i=s?1:zl(Il(e.slice(t),o),n);return{colspan:a,rowspan:i}},Vl=(e,t)=>{const o=H(e,(e=>H(e.cells,O))),n=(e,t,n,r)=>{for(let s=e;s<e+n;s++)for(let e=t;e<t+r;e++)o[s][e]=!0};return H(e,((r,s)=>{const a=q(r.cells,((r,a)=>{if(!1===o[s][a]){const o=Fl(e,s,a,t);return n(s,a,o.rowspan,o.colspan),[Mt(r.element,o.rowspan,o.colspan,r.isNew)]}return[]}));return Bt(r.element,a,r.section,r.isNew)}))},Zl=(e,t,o)=>{const n=[];I(e.colgroups,(r=>{const s=[];for(let n=0;n<e.grid.columns;n++){const r=Tr.getColumnAt(e,n).map((e=>Lt(e.element,o,!1))).getOrThunk((()=>Lt(t.colGap(),!0,!1)));s.push(r)}n.push(Ht(r.element,s,"colgroup",o))}));for(let r=0;r<e.grid.rows;r++){const s=[];for(let n=0;n<e.grid.columns;n++){const a=Tr.getAt(e,r,n).map((e=>Lt(e.element,o,e.isLocked))).getOrThunk((()=>Lt(t.gap(),!0,!1)));s.push(a)}const a=e.all[r],i=Ht(a.element,s,a.section,o);n.push(i)}return n},Ul=(e,t)=>Zl(e,t,!1),jl=e=>Vl(e,Ge),$l=(e,t)=>te(e.all,(e=>j(e.cells,(e=>Ge(t,e.element))))),Wl=(e,t,o)=>{const n=H(t.selection,(t=>$o(t).bind((t=>$l(e,t))).filter(o))),r=ho(n);return fo(r.length>0,r)},ql=(e,t,o,n,r)=>(s,a,i,l)=>{const c=Tr.fromTable(s),d=E.from(null===l||void 0===l?void 0:l.section).getOrThunk(El.fallback),m=t(c,a).map((t=>{const o=Ul(c,i),n=e(o,t,Ge,r(i),d),s=pr(n.grid),a=jl(n.grid);return{info:t,grid:a,cursor:n.cursor,lockedColumns:s}}));return m.bind((e=>{const t=Ll(s,e.grid),r=E.from(null===l||void 0===l?void 0:l.sizing).getOrThunk((()=>oa.getTableSize(s))),a=E.from(null===l||void 0===l?void 0:l.resize).getOrThunk(ul);return o(s,e.grid,e.info,{sizing:r,resize:a,section:d}),n(s),He(s,gr),e.lockedColumns.length>0&&Me(s,gr,e.lockedColumns.join(",")),E.some({cursor:e.cursor,newRows:t.newRows,newCells:t.newCells})}))},Gl=(e,t)=>$o(t.element).bind((o=>$l(e,o).map((e=>{const o={...e,generators:t.generators,clipboard:t.clipboard};return o})))),Kl=(e,t)=>Wl(e,t,T).map((e=>({cells:e,generators:t.generators,clipboard:t.clipboard}))),Yl=(e,t)=>t.mergable,Xl=(e,t)=>t.unmergable,Jl=(e,t)=>Wl(e,t,T),Ql=(e,t)=>Wl(e,t,(e=>!e.isLocked)),ec=(e,t)=>$l(e,t).exists((e=>!e.isLocked)),tc=(e,t)=>G(t,(t=>ec(e,t))),oc=(e,t)=>Yl(e,t).filter((t=>tc(e,t.cells))),nc=(e,t)=>Xl(e,t).filter((t=>tc(e,t))),rc=(e,t,o,n)=>{const r=mr(e).rows;if(0===r.length)return e;for(let s=t.startRow;s<=t.finishRow;s++)for(let e=t.startCol;e<=t.finishCol;e++){const t=r[s],o=lr(t,e).isLocked;sr(t,e,Lt(n(),!1,o))}return e},sc=(e,t,o,n)=>{const r=mr(e).rows;let s=!0;for(let a=0;a<r.length;a++)for(let e=0;e<dr(r[0]);e++){const i=r[a],l=lr(i,e),c=l.element,d=o(c,t);d&&!s?sr(i,e,Lt(n(),!0,l.isLocked)):d&&(s=!1)}return e},ac=(e,t)=>Z(e,((e,o)=>B(e,(e=>t(e.element,o.element)))?e:e.concat([o])),[]),ic=(e,t,o,n)=>(t>0&&t<e[0].cells.length&&I(e,(e=>{const r=e.cells[t-1];let s=0;const a=n();while(e.cells.length>t+s&&o(r.element,e.cells[t+s].element))sr(e,t+s,Lt(a,!0,e.cells[t+s].isLocked)),s++})),e),lc=(e,t,o,n)=>{const r=mr(e).rows;if(t>0&&t<r.length){const e=r[t-1].cells,s=ac(e,o);I(s,(e=>{let s=E.none();for(let a=t;a<r.length;a++)for(let t=0;t<dr(r[0]);t++){const i=r[a],l=lr(i,t),c=o(l.element,e.element);c&&(s.isNone()&&(s=E.some(n())),s.each((e=>{sr(i,t,Lt(e,!0,l.isLocked))})))}}))}return e},cc=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=>uc.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:()=>E.some(e)};return r},dc=e=>{const t=()=>o,o={tag:!1,inner:e,fold:(t,o)=>t(e),isValue:O,isError:T,map:t,mapError:t=>uc.error(t(e)),bind:t,exists:O,forall:T,getOr:w,or:w,getOrThunk:_,orThunk:_,getOrDie:k(String(e)),each:f,toOptional:E.none};return o},mc=(e,t)=>e.fold((()=>dc(t)),cc),uc={value:cc,error:dc,fromOption:mc},gc=(e,t,o)=>{if(e.row>=t.length||e.column>dr(t[0]))return uc.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),s=dr(o[0]),a=o.length;return uc.value({rowDelta:n.length-a,colDelta:r.length-s})},hc=(e,t)=>{const o=dr(e[0]),n=dr(t[0]);return{rowDelta:0,colDelta:o-n}},pc=(e,t)=>{const o=e.length,n=t.length;return{rowDelta:o-n,colDelta:0}},fc=(e,t,o,n)=>{const r="colgroup"===t.section?o.col:o.cell;return L(e,(e=>Lt(r(),!0,n(e))))},bc=(e,t,o,n)=>{const r=e[e.length-1];return e.concat(L(t,(()=>{const e="colgroup"===r.section?o.colgroup:o.row,t=ur(r,e,w),s=fc(t.cells.length,t,o,(e=>ge(n,e.toString())));return ar(t,s)})))},vc=(e,t,o,n)=>H(e,(e=>{const r=fc(t,e,o,O);return nr(e,n,r)})),yc=(e,t,o)=>H(e,(e=>Z(o,((o,n)=>{const r=fc(1,e,t,T)[0];return rr(o,n,r)}),e))),wc=(e,t,o)=>{const n=t.colDelta<0?vc:w,r=t.rowDelta<0?bc:w,s=pr(e),a=dr(e[0]),i=B(s,(e=>e===a-1)),l=n(e,Math.abs(t.colDelta),o,i?a-1:a),c=pr(l);return r(l,Math.abs(t.rowDelta),o,Y(c,T))},xc=(e,t,o,n)=>{const r=lr(e[t],o),s=C(n,r.element),a=e[t];return e.length>1&&dr(a)>1&&(o>0&&s(cr(a,o-1))||o<a.cells.length-1&&s(cr(a,o+1))||t>0&&s(cr(e[t-1],o))||t<e.length-1&&s(cr(e[t+1],o)))},Cc=(e,t,o,n,r,s)=>{const a=e.row,i=e.column,l=o.length,c=dr(o[0]),d=a+l,m=i+c+s.length,u=Y(s,T);for(let g=a;g<d;g++){let e=0;for(let s=i;s<m;s++){if(u[s]){e++;continue}xc(t,g,s,r)&&sc(t,cr(t[g],s),r,n.cell);const l=s-i-e,c=lr(o[g-a],l),d=c.element,m=n.replace(d);sr(t[g],s,Lt(m,!0,c.isLocked))}}return t},Sc=(e,t,o)=>{const n=dr(t[0]),r=mr(t).cols.length+e.row,s=L(n-e.column,(t=>t+e.column)),a=j(s,(e=>G(o,(t=>t!==e)))).getOr(n-1);return{row:r,column:a}},kc=(e,t,o)=>F(o,(o=>o>=e.column&&o<=dr(t[0])+e.column)),_c=(e,t,o,n,r)=>{const s=pr(t),a=Sc(e,t,s),i=mr(o).rows,l=kc(a,i,s),c=gc(a,t,i);return c.map((e=>{const o={...e,colDelta:e.colDelta-l.length},s=wc(t,o,n),c=pr(s),d=kc(a,i,c);return Cc(a,s,i,n,r,d)}))},Oc=(e,t,o,n,r)=>{ic(t,e,r,n.cell);const s=pc(o,t),a=wc(o,s,n),i=pc(t,a),l=wc(t,i,n);return H(l,((t,o)=>nr(t,e,a[o].cells)))},Tc=(e,t,o,n,r)=>{lc(t,e,r,n.cell);const s=pr(t),a=hc(t,o),i={...a,colDelta:a.colDelta-s.length},l=wc(t,i,n),{cols:c,rows:d}=mr(l),m=pr(l),u=hc(o,t),g={...u,colDelta:u.colDelta+m.length},h=yc(o,n,m),p=wc(h,g,n);return[...c,...d.slice(0,e),...p,...d.slice(e,d.length)]},Ec=(e,t,o,n)=>ur(e,(e=>n(e,o)),t),Dc=(e,t,o,n,r)=>{const{rows:s,cols:a}=mr(e),i=s.slice(0,t),l=s.slice(t),c=Ec(s[o],((e,o)=>{const a=t>0&&t<s.length&&n(cr(s[t-1],o),cr(s[t],o)),i=a?lr(s[t],o):Lt(r(e.element,n),!0,e.isLocked);return i}),n,r);return[...a,...i,c,...l]},Ac=(e,t,o,n,r,s,a)=>{if("colgroup"!==o&&n)return lr(e,t);{const t=lr(e,r);return Lt(a(t.element,s),!0,!1)}},Mc=(e,t,o,n,r)=>H(e,(e=>{const s=t>0&&t<dr(e)&&n(cr(e,t-1),cr(e,t)),a=Ac(e,t,e.section,s,o,n,r);return rr(e,t,a)})),Nc=(e,t)=>q(e,(e=>{const o=e.cells,n=V(t,((e,t)=>t>=0&&t<e.length?e.slice(0,t).concat(e.slice(t+1)):e),o);return n.length>0?[Ht(e.element,n,e.section,e.isNew)]:[]})),Rc=(e,t,o)=>{const{rows:n,cols:r}=mr(e);return[...r,...n.slice(0,t),...n.slice(o+1)]},Bc=(e,t,o,n)=>void 0!==cr(e[t],o)&&t>0&&n(cr(e[t-1],o),cr(e[t],o)),Lc=(e,t,o)=>t>0&&o(cr(e,t-1),cr(e,t)),Hc=(e,t,o,n)=>Bc(e,t,o,n)||Lc(e[t],o,n),Ic=(e,t)=>{const o=G(t,w)&&pl(e.cells);return o?T:(e,o,n)=>{const r=xe(e.element);return!("th"===r&&t[n])}},Pc=(e,t)=>{const o=G(t,w)&&pl(e);return o?T:(e,o,n)=>{const r=xe(e.element);return!("th"===r&&t[o])}},zc=(e,t,o,n)=>{const r=e=>"row"===e?Po(t):Io(t),s=e=>r(e)?`${e}group`:e;if(e)return hl(t)?s(o):null;if(n&&hl(t)){const e="row"===o?"col":"row";return s(e)}return null},Fc=(e,t)=>(o,n,r)=>E.some(zc(e,o.element,"col",t[r])),Vc=(e,t)=>(o,n)=>E.some(zc(e,o.element,"row",t[n])),Zc=(e,t,o)=>Lt(o(e.element,t),!0,e.isLocked),Uc=(e,t,o,n,r,s,a)=>{const i=e=>B(t,(t=>o(e.element,t.element)));return H(e,((e,t)=>ir(e,((e,l)=>{if(i(e)){const i=a(e,t,l)?r(e,o,n):e;return s(i,t,l).each((e=>{Re(i.element,{scope:E.from(e)})})),i}return e}))))},jc=(e,t,o)=>q(e,((n,r)=>Hc(e,r,t,o)?[]:[lr(n,t)])),$c=(e,t,o)=>{const n=e[t];return q(n.cells,((n,r)=>Hc(e,t,r,o)?[]:[n]))},Wc=(e,t,o,n,r)=>{const s=mr(e).rows,a=q(t,(e=>jc(s,e,n))),i=H(s,(e=>pl(e.cells))),l=Pc(a,i),c=Vc(o,i);return Uc(e,a,n,r,Zc,c,l)},qc=(e,t,o,n,r,s,a)=>{const{cols:i,rows:l}=mr(e),c=l[t[0]],d=q(t,(e=>$c(l,e,r))),m=H(c.cells,((e,t)=>pl(jc(l,t,r)))),u=[...l];I(t,(e=>{u[e]=a.transformRow(l[e],o)}));const g=[...i,...u],h=Ic(c,m),p=Fc(n,m);return Uc(g,d,r,s,a.transformCell,p,h)},Gc=(e,t,o,n)=>{const r=mr(e).rows,s=H(t,(e=>lr(r[e.row],e.column)));return Uc(e,s,o,n,Zc,E.none,T)},Kc=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 I(e,((n,r)=>{const s=oe(n);if(1!==s.length)throw new Error("one and only one name per case");const a=s[0],i=n[a];if(void 0!==o[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!l(i))throw new Error("case arguments must be an array");t.push(a),o[a]=(...o)=>{const n=o.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+i.length+" ("+i+"), got "+n);const s=e=>{const n=oe(e);if(t.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","));const r=G(t,(e=>R(n,e)));if(!r)throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,o)};return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);const n=t[r];return n.apply(null,o)},match:s,log:e=>{console.log(e,{constructors:t,constructor:a,params:o})}}}})),o},Yc={generate:Kc},Xc=Yc.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),Jc={...Xc},Qc=(e,t)=>0===e.length?Jc.none():1===e.length?Jc.only(0):0===t?Jc.left(0,1):t===e.length-1?Jc.right(t-1,t):t>0&&t<e.length-1?Jc.middle(t-1,t,t+1):Jc.none(),ed=(e,t,o,n,r)=>{const s=e.slice(0),a=Qc(e,t),i=y(H(s,y(0))),l=e=>n.singleColumnWidth(s[e],o),c=(e,t)=>r.calcLeftEdgeDeltas(s,e,t,o,n.minCellWidth(),n.isRelative),d=(e,t,a)=>r.calcMiddleDeltas(s,e,t,a,o,n.minCellWidth(),n.isRelative),m=(e,t)=>r.calcRightEdgeDeltas(s,e,t,o,n.minCellWidth(),n.isRelative);return a.fold(i,l,c,d,m)},td=(e,t,o)=>{let n=0;for(let r=e;r<t;r++)n+=void 0!==o[r]?o[r]:0;return n},od=(e,t)=>{const o=Tr.justCells(e);return H(o,(e=>{const o=td(e.column,e.column+e.colspan,t);return{element:e.element,width:o,colspan:e.colspan}}))},nd=(e,t)=>{const o=Tr.justColumns(e);return H(o,((e,o)=>({element:e.element,width:t[o],colspan:e.colspan})))},rd=(e,t)=>{const o=Tr.justCells(e);return H(o,(e=>{const o=td(e.row,e.row+e.rowspan,t);return{element:e.element,height:o,rowspan:e.rowspan}}))},sd=(e,t)=>H(e.all,((e,o)=>({element:e.element,height:t[o]}))),ad=e=>V(e,((e,t)=>e+t),0),id=(e,t)=>Tr.hasColumns(e)?nd(e,t):od(e,t),ld=(e,t,o)=>{const n=id(e,t);I(n,(e=>{o.setElementWidth(e.element,e.width)}))},cd=(e,t,o,n,r)=>{const s=Tr.fromTable(e),a=r.getCellDelta(t),i=r.getWidths(s,r),l=o===s.grid.columns-1,c=n.clampTableDelta(i,o,a,r.minCellWidth(),l),d=ed(i,o,c,r,n),m=H(d,((e,t)=>e+i[t]));ld(s,m,r),n.resizeTable(r.adjustTableWidth,c,l)},dd=(e,t,o,n)=>{const r=Tr.fromTable(e),s=Gs(r,e,n),a=H(s,((e,n)=>o===n?Math.max(t+e,Vo()):e)),i=rd(r,a),l=sd(r,a);I(l,(e=>{fs(e.element,e.height)})),I(i,(e=>{fs(e.element,e.height)}));const c=ad(a);fs(e,c)},md=(e,t,o,n,r)=>{const s=Tr.generate(t),a=n.getWidths(s,n),i=n.pixelWidth(),{newSizes:l,delta:c}=r.calcRedestributedWidths(a,i,o.pixelDelta,n.isRelative);ld(s,l,n),n.adjustTableWidth(c)},ud=(e,t,o,n)=>{const r=Tr.generate(t),s=n.getWidths(r,n);ld(r,s,n)},gd=e=>{const t=(e,t)=>{const o=B(e,(e=>e.column===t.column));return o?e:e.concat([t])};return Z(e,t,[]).sort(((e,t)=>e.column-t.column))},hd=De("col"),pd=De("colgroup"),fd=e=>"tr"===xe(e)||pd(e),bd=e=>{const t=Lo(e,"colspan",1),o=Lo(e,"rowspan",1);return{element:e,colspan:t,rowspan:o}},vd=(e,t=bd)=>{const o=t=>hd(t.element)?e.col(t):e.cell(t),n=t=>pd(t.element)?e.colgroup(t):e.row(t),r=e=>{if(fd(e))return n({element:e});{const n=e,r=o(t(n));return s=E.some({item:n,replacement:r}),r}};let s=E.none();const a=(e,t)=>s.fold((()=>r(e)),(o=>t(e,o.item)?o.replacement:r(e)));return{getOrInit:a}},yd=e=>t=>{const o=[],n=(e,t)=>j(o,(o=>t(o.item,e))),r=n=>{const r="td"===e?{scope:null}:{},s=t.replace(n,e,r);return o.push({item:n,sub:s}),s},s=(e,t)=>{if(fd(e)||hd(e))return e;{const o=e;return n(o,t).fold((()=>r(o)),(n=>t(e,n.item)?n.sub:r(o)))}};return{replaceOrInit:s}},wd=e=>Le(e,"scope").map((e=>e.substr(0,3))),xd=e=>{const t=t=>{const o=wd(t);return o.each((e=>Me(t,"scope",e))),()=>{const n=e.cell({element:t,colspan:1,rowspan:1});return Ro(n,"width"),Ro(t,"width"),o.each((e=>Me(n,"scope",e))),n}},o=e=>{const t=()=>{const t=ho(H(e,wd));if(0===t.length)return E.none();{const e=t[0],o=["row","col"],n=B(t,(t=>t!==e&&R(o,t)));return n?E.none():E.from(e)}};return Ro(e[0],"width"),t().fold((()=>He(e[0],"scope")),(t=>Me(e[0],"scope",t+"group"))),y(e[0])};return{unmerge:t,merge:o}},Cd={modification:vd,transform:yd,merging:xd},Sd=["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"],kd=(e,t)=>{const o=e.property().name(t);return R(["ol","ul"],o)},_d=(e,t)=>{const o=e.property().name(t);return R(Sd,o)},Od=(e,t)=>R(["br","img","hr","input"],e.property().name(t)),Td=ai(),Ed=e=>_d(Td,e),Dd=e=>kd(Td,e),Ad=e=>Od(Td,e),Md=e=>{const t=De("br"),o=e=>G(e,(e=>t(e)||Oe(e)&&0===ga(e).trim().length)),n=e=>"li"===xe(e)||ro(e,Dd).isSome(),r=e=>st(e).map((e=>!!Ed(e)||!!Ad(e)&&"img"!==xe(e))).getOr(!1),s=e=>xa(e).bind((o=>{const s=r(o);return tt(o).map((r=>!0===s||n(r)||t(o)||Ed(r)&&!Ge(e,r)?[]:[Ue.fromTag("br")]))})).getOr([]),a=()=>{const t=q(e,(e=>{const t=at(e);return o(t)?[]:t.concat(s(e))}));return 0===t.length?[Ue.fromTag("br")]:t},i=a();bt(e[0]),ft(e[0],i)},Nd=e=>Al(e,!0),Rd=e=>{const t=Wo(e);0===t.length&&vt(e)},Bd=(e,t)=>({grid:e,cursor:t}),Ld=e=>te(e,(e=>te(e.cells,(e=>{const t=e.element;return fo(Nd(t),t)})))),Hd=(e,t,o)=>{var n,r;const s=mr(e).rows;return E.from(null===(r=null===(n=s[t])||void 0===n?void 0:n.cells[o])||void 0===r?void 0:r.element).filter(Nd).orThunk((()=>Ld(s)))},Id=(e,t,o)=>{const n=Hd(e,t,o);return Bd(e,n)},Pd=e=>{const t=(e,t)=>{const o=B(e,(e=>e.row===t.row));return o?e:e.concat([t])};return Z(e,t,[]).sort(((e,t)=>e.row-t.row))},zd=(e,t,o,n)=>{const r=t[0].row,s=Pd(t),a=V(s,((e,t)=>{const s=Dc(e.grid,r,t.row+e.delta,o,n.getOrInit);return{grid:s,delta:e.delta+1}}),{grid:e,delta:0}).grid;return Id(a,r,t[0].column)},Fd=(e,t,o,n)=>{const r=Pd(t),s=r[r.length-1],a=s.row+s.rowspan,i=V(r,((e,t)=>Dc(e,a,t.row,o,n.getOrInit)),e);return Id(i,a,t[0].column)},Vd=(e,t,o,n)=>{const r=t.details,s=gd(r),a=s[0].column,i=V(s,((e,t)=>{const r=Mc(e.grid,a,t.column+e.delta,o,n.getOrInit);return{grid:r,delta:e.delta+1}}),{grid:e,delta:0}).grid;return Id(i,r[0].row,a)},Zd=(e,t,o,n)=>{const r=t.details,s=r[r.length-1],a=s.column+s.colspan,i=gd(r),l=V(i,((e,t)=>Mc(e,a,t.column,o,n.getOrInit)),e);return Id(l,r[0].row,a)},Ud=(e,t,o,n)=>{const r=gd(t),s=H(r,(e=>e.column)),a=Wc(e,s,!0,o,n.replaceOrInit);return Id(a,t[0].row,t[0].column)},jd=(e,t,o,n)=>{const r=Gc(e,t,o,n.replaceOrInit);return Id(r,t[0].row,t[0].column)},$d=(e,t,o,n)=>{const r=gd(t),s=H(r,(e=>e.column)),a=Wc(e,s,!1,o,n.replaceOrInit);return Id(a,t[0].row,t[0].column)},Wd=(e,t,o,n)=>{const r=Gc(e,t,o,n.replaceOrInit);return Id(r,t[0].row,t[0].column)},qd=(e,t)=>(o,n,r,s,a)=>{const i=Pd(n),l=H(i,(e=>e.row)),c=qc(o,l,e,t,r,s.replaceOrInit,a);return Id(c,n[0].row,n[0].column)},Gd=qd("thead",!0),Kd=qd("tbody",!1),Yd=qd("tfoot",!1),Xd=(e,t,o,n)=>{const r=gd(t.details),s=Nc(e,H(r,(e=>e.column))),a=s.length>0?s[0].cells.length-1:0;return Id(s,r[0].row,Math.min(r[0].column,a))},Jd=(e,t,o,n)=>{const r=Pd(t),s=Rc(e,r[0].row,r[r.length-1].row),a=s.length>0?s.length-1:0;return Id(s,Math.min(t[0].row,a),t[0].column)},Qd=(e,t,o,n)=>{const r=t.cells;Md(r);const s=rc(e,t.bounds,o,n.merge(r));return Bd(s,E.from(r[0]))},em=(e,t,o,n)=>{const r=(e,t)=>sc(e,t,o,n.unmerge(t)),s=V(t,r,e);return Bd(s,E.from(t[0]))},tm=(e,t,o,n)=>{const r=(e,t)=>{const o=Tr.fromTable(e);return Zl(o,t,!0)},s=r(t.clipboard,t.generators),a=Dt(t.row,t.column),i=_c(a,e,s,t.generators,o);return i.fold((()=>Bd(e,E.some(t.element))),(e=>Id(e,t.row,t.column)))},om=(e,t,o)=>{const n=en(e,o.section),r=Tr.generate(n);return Zl(r,t,!0)},nm=(e,t,o,n)=>{const r=mr(e).rows,s=t.cells[0].column,a=r[t.cells[0].row],i=om(t.clipboard,t.generators,a),l=Oc(s,e,i,t.generators,o);return Id(l,t.cells[0].row,t.cells[0].column)},rm=(e,t,o,n)=>{const r=mr(e).rows,s=t.cells[t.cells.length-1].column+t.cells[t.cells.length-1].colspan,a=r[t.cells[0].row],i=om(t.clipboard,t.generators,a),l=Oc(s,e,i,t.generators,o);return Id(l,t.cells[0].row,t.cells[0].column)},sm=(e,t,o,n)=>{const r=mr(e).rows,s=t.cells[0].row,a=r[s],i=om(t.clipboard,t.generators,a),l=Tc(s,e,i,t.generators,o);return Id(l,t.cells[0].row,t.cells[0].column)},am=(e,t,o,n)=>{const r=mr(e).rows,s=t.cells[t.cells.length-1].row+t.cells[t.cells.length-1].rowspan,a=r[t.cells[0].row],i=om(t.clipboard,t.generators,a),l=Tc(s,e,i,t.generators,o);return Id(l,t.cells[0].row,t.cells[0].column)},im=(e,t)=>{const o=Tr.fromTable(e),n=Jl(o,t);return n.bind((e=>{const t=e[e.length-1],n=e[0].column,r=t.column+t.colspan,s=W(H(o.all,(e=>F(e.cells,(e=>e.column>=n&&e.column<r)))));return vl(s)})).getOr("")},lm=(e,t)=>{const o=Tr.fromTable(e),n=Jl(o,t);return n.bind(vl).getOr("")},cm=(e,t)=>{const o=Tr.fromTable(e),n=Jl(o,t);return n.bind((e=>{const t=e[e.length-1],n=e[0].row,r=t.row+t.rowspan,s=o.all.slice(n,r);return yl(s)})).getOr("")},dm=(e,t,o,n)=>ud(e,t,o,n.sizing),mm=(e,t,o,n)=>md(e,t,o,n.sizing,n.resize),um=(e,t)=>B(t,(e=>0===e.column&&e.isLocked)),gm=(e,t)=>B(t,(t=>t.column+t.colspan>=e.grid.columns&&t.isLocked)),hm=(e,t)=>{const o=Er(e),n=gd(t);return Z(n,((e,t)=>{const n=o[t.column],r=n.map(er).getOr(0);return e+r}),0)},pm=e=>(t,o)=>Jl(t,o).filter((o=>{const n=e?um:gm;return!n(t,o)})).map((e=>({details:e,pixelDelta:hm(t,e)}))),fm=(e,t)=>Ql(e,t).map((t=>({details:t,pixelDelta:-hm(e,t)}))),bm=e=>(t,o)=>Kl(t,o).filter((o=>{const n=e?um:gm;return!n(t,o.cells)})),vm=Cd.transform("th"),ym=Cd.transform("td"),wm=ql(zd,Jl,f,f,Cd.modification),xm=ql(Fd,Jl,f,f,Cd.modification),Cm=ql(Vd,pm(!0),mm,f,Cd.modification),Sm=ql(Zd,pm(!1),mm,f,Cd.modification),km=ql(Xd,fm,mm,Rd,Cd.modification),_m=ql(Jd,Jl,f,Rd,Cd.modification),Om=ql(Ud,Ql,f,f,vm),Tm=ql($d,Ql,f,f,ym),Em=ql(Gd,Ql,f,f,vm),Dm=ql(Kd,Ql,f,f,ym),Am=ql(Yd,Ql,f,f,ym),Mm=ql(jd,Ql,f,f,vm),Nm=ql(Wd,Ql,f,f,ym),Rm=ql(Qd,oc,dm,f,Cd.merging),Bm=ql(em,nc,dm,f,Cd.merging),Lm=ql(tm,Gl,dm,f,Cd.modification),Hm=ql(nm,bm(!0),f,f,Cd.modification),Im=ql(rm,bm(!1),f,f,Cd.modification),Pm=ql(sm,Kl,f,f,Cd.modification),zm=ql(am,Kl,f,f,Cd.modification),Fm=im,Vm=lm,Zm=cm,Um=(e,t)=>e.dispatch("NewRow",{node:t}),jm=(e,t)=>e.dispatch("NewCell",{node:t}),$m=(e,t,o)=>{e.dispatch("TableModified",{...o,table:t})},Wm=(e,t,o,n,r)=>{e.dispatch("TableSelectionChange",{cells:t,start:o,finish:n,otherCells:r})},qm=e=>{e.dispatch("TableSelectionClear")},Gm=(e,t,o,n,r)=>{e.dispatch("ObjectResizeStart",{target:t,width:o,height:n,origin:r})},Km=(e,t,o,n,r)=>{e.dispatch("ObjectResized",{target:t,width:o,height:n,origin:r})},Ym={structure:!1,style:!0},Xm={structure:!0,style:!1},Jm={structure:!0,style:!0},Qm=e=>t=>t.options.get(e),eu="100%",tu=e=>{var t;const o=e.dom,n=null!==(t=o.getParent(e.selection.getStart(),o.isBlock))&&void 0!==t?t:e.getBody();return tr(Ue.fromDom(n))+"px"},ou=(e,t)=>hu(e)||!fu(e)?t:gu(e)?{...t,width:tu(e)}:{...t,width:eu},nu=(e,t)=>hu(e)||fu(e)?t:gu(e)?{...t,width:tu(e)}:{...t,width:eu},ru=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=R(["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=R(["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})},su=e=>E.from(e.options.get("table_clone_elements")),au=e=>{const t=e.options.get("object_resizing");return R(t.split(","),"table")},iu=Qm("table_header_type"),lu=Qm("table_column_resizing"),cu=e=>"preservetable"===lu(e),du=e=>"resizetable"===lu(e),mu=Qm("table_sizing_mode"),uu=e=>"relative"===mu(e),gu=e=>"fixed"===mu(e),hu=e=>"responsive"===mu(e),pu=Qm("table_resize_bars"),fu=Qm("table_style_by_css"),bu=e=>{const t=e.options,o=t.get("table_default_attributes");return t.isSet("table_default_attributes")?o:nu(e,o)},vu=e=>{const t=e.options,o=t.get("table_default_styles");return t.isSet("table_default_styles")?o:ou(e,o)},yu=Qm("table_use_colgroups"),wu=(e,t)=>uu(e)?oa.percentageSize(t):gu(e)?oa.pixelSize(t):oa.getTableSize(t),xu=(e,t,o)=>{const n=e=>"table"===xe(Ha(e)),r=t=>!n(e)||gl(t).rows>1,s=t=>!n(e)||gl(t).columns>1,a=su(e),i=du(e)?f:sl,l=t=>{switch(iu(e)){case"section":return El.section();case"sectionCells":return El.sectionCells();case"cells":return El.cells();default:return El.getTableSectionType(t,"section")}},c=(t,n)=>n.cursor.fold((()=>{const n=Wo(t);return Q(n).filter(Gt).map((n=>{o.clearSelectedCells(t.dom);const r=e.dom.createRng();return r.selectNode(n.dom),e.selection.setRng(r),Me(n,"data-mce-selected","1"),r}))}),(n=>{const r=rl(n),s=e.dom.createRng();return s.setStart(r.element.dom,r.offset),s.setEnd(r.element.dom,r.offset),e.selection.setRng(s),o.clearSelectedCells(t.dom),E.some(s)})),d=(o,n,r,s)=>(i,d,m=!1)=>{Pa(i);const u=Ue.fromDom(e.getDoc()),g=Na(r,u,a),h={sizing:wu(e,i),resize:du(e)?ml():ul(),section:l(i)};return n(i)?o(i,d,g,h).bind((o=>{t.refresh(i.dom),I(o.newRows,(t=>{Um(e,t.dom)})),I(o.newCells,(t=>{jm(e,t.dom)}));const n=c(i,o);return Gt(i)&&(Pa(i),m||$m(e,i.dom,s)),n.map((e=>({rng:e,effect:s})))})):E.none()},m=d(_m,r,f,Xm),u=d(km,s,f,Xm),g=d(wm,T,f,Xm),h=d(xm,T,f,Xm),p=d(Cm,T,i,Xm),b=d(Sm,T,i,Xm),v=d(Rm,T,f,Xm),y=d(Bm,T,f,Xm),w=d(Hm,T,f,Xm),x=d(Im,T,f,Xm),C=d(Pm,T,f,Xm),S=d(zm,T,f,Xm),k=d(Lm,T,f,Jm),_=d(Mm,T,f,Xm),O=d(Nm,T,f,Xm),D=d(Om,T,f,Xm),A=d(Tm,T,f,Xm),M=d(Em,T,f,Xm),N=d(Dm,T,f,Xm),R=d(Am,T,f,Xm),B=Vm,L=Fm,H=Zm;return{deleteRow:m,deleteColumn:u,insertRowsBefore:g,insertRowsAfter:h,insertColumnsBefore:p,insertColumnsAfter:b,mergeCells:v,unmergeCells:y,pasteColsBefore:w,pasteColsAfter:x,pasteRowsBefore:C,pasteRowsAfter:S,pasteCells:k,makeCellsHeader:_,unmakeCellsHeader:O,makeColumnsHeader:D,unmakeColumnsHeader:A,makeRowsHeader:M,makeRowsBody:N,makeRowsFooter:R,getTableRowType:H,getTableCellType:B,getTableColType:L}},Cu=(e,t,o)=>{const n=Lo(e,t,1);1===o||n<=1?He(e,t):Me(e,t,Math.min(o,n))},Su=(e,t)=>o=>{const n=o.column+o.colspan-1,r=o.column;return n>=e&&r<t},ku=(e,t,o)=>{if(Tr.hasColumns(e)){const n=F(Tr.justColumns(e),Su(t,o)),r=H(n,(e=>{const n=Ct(e.element);return Cu(n,"span",o-t),n})),s=Ue.fromTag("colgroup");return ft(s,r),[s]}return[]},_u=(e,t,o)=>H(e.all,(e=>{const n=F(e.cells,Su(t,o)),r=H(n,(e=>{const n=Ct(e.element);return Cu(n,"colspan",o-t),n})),s=Ue.fromTag("tr");return ft(s,r),s})),Ou=(e,t)=>{const o=Tr.fromTable(e),n=Ql(o,t);return n.map((e=>{const t=e[e.length-1],n=e[0].column,r=t.column+t.colspan,s=ku(o,n,r),a=_u(o,n,r);return[...s,...a]}))},Tu=(e,t,o)=>{const n=Tr.fromTable(e),r=Jl(n,t);return r.bind((e=>{const t=Zl(n,o,!1),r=mr(t).rows,s=r.slice(e[0].row,e[e.length-1].row+e[e.length-1].rowspan),a=q(s,(e=>{const t=F(e.cells,(e=>!e.isLocked));return t.length>0?[{...e,cells:t}]:[]})),i=jl(a);return fo(i.length>0,i)})).map((e=>Hl(e)))},Eu=Yc.generate([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),Du=(e,t,o)=>{const n=o.substring(0,o.length-e.length),r=parseFloat(n);return n===r.toString()?t(r):Eu.invalid(o)},Au=e=>wo(e,"%")?Du("%",Eu.percent,e):wo(e,"px")?Du("px",Eu.pixels,e):Eu.invalid(e),Mu={...Eu,from:Au},Nu=(e,t)=>H(e,(e=>{const o=Mu.from(e);return o.fold((()=>e),(e=>{const o=e/t*100;return o+"%"}),(e=>e+"%"))})),Ru=(e,t,o)=>{const n=o/t;return H(e,(e=>{const t=Mu.from(e);return t.fold((()=>e),(e=>e*n+"px"),(e=>e/100*o+"px"))}))},Bu=(e,t)=>{const o=e.fold((()=>y("")),(e=>{const o=e/t;return y(o+"px")}),(()=>{const e=100/t;return y(e+"%")}));return L(t,o)},Lu=(e,t,o)=>e.fold((()=>t),(e=>Ru(t,o,e)),(e=>Nu(t,o))),Hu=(e,t,o)=>{const n=Mu.from(o),r=G(e,(e=>"0px"===e))?Bu(n,e.length):Lu(n,e,t);return Fu(r)},Iu=(e,t)=>0===e.length?t:V(e,((e,t)=>Mu.from(t).fold(y(0),w,w)+e),0),Pu=(e,t)=>{const o=Math.floor(e);return{value:o+t,remainder:e-o}},zu=(e,t)=>Mu.from(e).fold(y(e),(e=>e+t+"px"),(e=>e+t+"%")),Fu=e=>{if(0===e.length)return e;const t=V(e,((e,t)=>{const o=Mu.from(t).fold((()=>({value:t,remainder:0})),(e=>Pu(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([zu(o[o.length-1],Math.round(t.remainder))])},Vu=Mu.from,Zu=(e,t,o)=>{I(t,(t=>{const n=e.slice(t.column,t.colspan+t.column),r=Iu(n,Fo());Eo(t.element,"width",r+o)}))},Uu=(e,t,o)=>{I(t,((t,n)=>{const r=Iu([e[n]],Fo());Eo(t.element,"width",r+o)}))},ju=(e,t,o,n)=>{I(o,(t=>{const o=e.slice(t.row,t.rowspan+t.row),r=Iu(o,Vo());Eo(t.element,"height",r+n)})),I(t,((t,o)=>{Eo(t.element,"height",e[o])}))},$u=e=>Vu(e).fold(y("px"),y("px"),y("%")),Wu=(e,t,o)=>{const n=Tr.fromTable(e),r=n.all,s=Tr.justCells(n),a=Tr.justColumns(n);t.each((t=>{const o=$u(t),r=Qn(e),i=js(n,e),l=Hu(i,r,t);Tr.hasColumns(n)?Uu(l,a,o):Zu(l,s,o),Eo(e,"width",t)})),o.each((t=>{const o=$u(t),a=Lr(e),i=Ks(n,e,ts),l=Hu(i,a,t);ju(l,r,s,o),Eo(e,"height",t)}))},qu=Ns,Gu=Rs,Ku=Bs,Yu=e=>{He(e,"width")},Xu=e=>{const t=Ms(e);Wu(e,E.some(t),E.none()),Yu(e)},Ju=e=>{const t=As(e);Wu(e,E.some(t),E.none()),Yu(e)},Qu=e=>{Ro(e,"width");const t=qo(e),o=t.length>0?t:Wo(e);I(o,(e=>{Ro(e,"width"),Yu(e)})),Yu(e)},eg={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},tg=()=>Ue.fromTag("th"),og=()=>Ue.fromTag("td"),ng=()=>Ue.fromTag("col"),rg=(e,t,o,n)=>{const r=Ue.fromTag("tr");for(let s=0;s<e;s++){const e=n<t||s<o?tg():og();s<o&&Me(e,"scope","row"),n<t&&Me(e,"scope","col"),ut(e,Ue.fromTag("br")),ut(r,e)}return r},sg=e=>{const t=Ue.fromTag("colgroup");return L(e,(()=>ut(t,ng()))),t},ag=(e,t,o,n)=>L(e,(e=>rg(t,o,n,e))),ig=(e,t,o,n,r,s=eg)=>{const a=Ue.fromTag("table"),i="cells"!==r;Do(a,s.styles),Ne(a,s.attributes),s.colGroups&&ut(a,sg(t));const l=Math.min(e,o);if(i&&o>0){const e=Ue.fromTag("thead");ut(a,e);const s="sectionCells"===r?l:0,i=ag(o,t,s,n);ft(e,i)}const c=Ue.fromTag("tbody");ut(a,c);const d=i?e-l:e,m=i?0:o,u=ag(d,t,m,n);return ft(c,u),a},lg=e=>e.dom.innerHTML,cg=e=>{const t=Ue.fromTag("div"),o=Ue.fromDom(e.dom.cloneNode(!0));return ut(t,o),lg(t)},dg=(e,t)=>{e.selection.select(t.dom,!0),e.selection.collapse(!0)},mg=(e,t)=>{mo(t,"td,th").each(C(dg,e))},ug=(e,t)=>{I(oo(t,"tr"),(t=>{Um(e,t.dom),I(oo(t,"th,td"),(t=>{jm(e,t.dom)}))}))},gg=e=>a(e)&&-1!==e.indexOf("%"),hg=(e,t,o,n,r)=>{const s=vu(e),a={styles:s,attributes:bu(e),colGroups:yu(e)};return e.undoManager.ignore((()=>{const s=ig(o,t,r,n,iu(e),a);Me(s,"data-mce-id","__mce");const i=cg(s);e.insertContent(i),e.addVisual()})),mo(Ha(e),'table[data-mce-id="__mce"]').map((t=>(gu(e)?Ju(t):hu(e)?Qu(t):(uu(e)||gg(s.width))&&Xu(t),Pa(t),He(t,"data-mce-id"),ug(e,t),mg(e,t),t.dom))).getOrNull()},pg=(e,t,o,n={})=>{const r=e=>p(e)&&e>0;if(r(t)&&r(o)){const r=n.headerRows||0,s=n.headerColumns||0;return hg(e,o,t,s,r)}return console.error("Invalid values for mceInsertTable - rows and columns values are required to insert a table."),null};var fg=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const bg="x-tinymce/dom-table-",vg=bg+"rows",yg=bg+"columns",wg=e=>{const t=fg.FakeClipboardItem(e);fg.write([t])},xg=e=>{var t;const o=null!==(t=fg.read())&&void 0!==t?t:[];return te(o,(t=>E.from(t.getType(e))))},Cg=e=>{xg(e).isSome()&&fg.clear()},Sg=e=>{e.fold(_g,(e=>wg({[vg]:e})))},kg=()=>xg(vg),_g=()=>Cg(vg),Og=e=>{e.fold(Eg,(e=>wg({[yg]:e})))},Tg=()=>xg(yg),Eg=()=>Cg(yg),Dg=e=>ji(za(e),Ia(e)),Ag=e=>$i(za(e),Ia(e)),Mg=(e,t)=>{const o=Ia(e),n=()=>Dg(e).each((t=>{Go(t,o).filter(S(o)).each((t=>{const o=Ue.fromText("");if(dt(t,o),vt(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()}}))})),r=t=>Dg(e).each((n=>{const r=hu(e)||gu(e)||uu(e);r||Go(n,o).each((o=>{"relative"!==t||qu(o)?"fixed"!==t||Gu(o)?"responsive"!==t||Ku(o)||Qu(o):Ju(o):Xu(o),Pa(o),$m(e,o.dom,Xm)}))})),s=e=>Go(e,o),l=t=>Ag(e).bind((e=>s(e).map((o=>t(o,e))))),c=(t,o)=>{l((t=>{e.formatter.toggle("tableclass",{value:o},t.dom),$m(e,t.dom,Ym)}))},d=(t,o)=>{l((t=>{const n=Wi(e),r=G(n,(t=>e.formatter.match("tablecellclass",{value:o},t.dom))),s=r?e.formatter.remove:e.formatter.apply;I(n,(e=>s("tablecellclass",{value:o},e.dom))),$m(e,t.dom,Ym)}))},m=()=>{Dg(e).each((t=>{Go(t,o).each((o=>{co(o,"caption").fold((()=>{const t=Ue.fromTag("caption");ut(t,Ue.fromText("Caption")),gt(o,t,0),e.selection.setCursorLocation(t.dom,0)}),(n=>{De("caption")(t)&&qe("td",o).each((t=>e.selection.setCursorLocation(t.dom,0))),vt(n)})),$m(e,o.dom,Xm)}))}))},u=t=>{e.focus()},g=(t,o=!1)=>l(((n,r)=>{const s=zi(Wi(e),n,r);t(n,s,o).each(u)})),h=()=>l(((t,o)=>{const n=zi(Wi(e),t,o),r=Na(f,Ue.fromDom(e.getDoc()),E.none());return Tu(t,n,r)})),p=()=>l(((t,o)=>{const n=zi(Wi(e),t,o);return Ou(t,n)})),b=(t,o)=>o().each((o=>{const n=H(o,(e=>Ct(e)));l(((o,r)=>{const s=Ra(Ue.fromDom(e.getDoc())),a=Vi(Wi(e),r,n,s);t(o,a).each(u)}))})),v=e=>(t,o)=>ue(o,"type").each((t=>{g(e(t),o.no_events)}));re({mceTableSplitCells:()=>g(t.unmergeCells),mceTableMergeCells:()=>g(t.mergeCells),mceTableInsertRowBefore:()=>g(t.insertRowsBefore),mceTableInsertRowAfter:()=>g(t.insertRowsAfter),mceTableInsertColBefore:()=>g(t.insertColumnsBefore),mceTableInsertColAfter:()=>g(t.insertColumnsAfter),mceTableDeleteCol:()=>g(t.deleteColumn),mceTableDeleteRow:()=>g(t.deleteRow),mceTableCutCol:()=>p().each((e=>{Og(e),g(t.deleteColumn)})),mceTableCutRow:()=>h().each((e=>{Sg(e),g(t.deleteRow)})),mceTableCopyCol:()=>p().each((e=>Og(e))),mceTableCopyRow:()=>h().each((e=>Sg(e))),mceTablePasteColBefore:()=>b(t.pasteColsBefore,Tg),mceTablePasteColAfter:()=>b(t.pasteColsAfter,Tg),mceTablePasteRowBefore:()=>b(t.pasteRowsBefore,kg),mceTablePasteRowAfter:()=>b(t.pasteRowsAfter,kg),mceTableDelete:n,mceTableCellToggleClass:d,mceTableToggleClass:c,mceTableToggleCaption:m,mceTableSizingMode:(e,t)=>r(t),mceTableCellType:v((e=>"th"===e?t.makeCellsHeader:t.unmakeCellsHeader)),mceTableColType:v((e=>"th"===e?t.makeColumnsHeader:t.unmakeColumnsHeader)),mceTableRowType:v((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)=>{pg(e,o.rows,o.columns,o.options)})),e.addCommand("mceTableApplyCellStyle",((t,o)=>{const n=e=>"tablecell"+e.toLowerCase().replace("-","");if(!i(o))return;const r=Wi(e);if(0===r.length)return;const l=ce(o,((t,o)=>e.formatter.has(n(o))&&a(t)));pe(l)||(re(l,((t,o)=>{const s=n(o);I(r,(o=>{""===t?e.formatter.remove(s,{value:null},o.dom,!0):e.formatter.apply(s,{value:t},o.dom)}))})),s(r[0]).each((t=>$m(e,t.dom,Ym))))}))},Ng=(e,t)=>{const o=Ia(e),n=t=>$i(za(e)).bind((n=>Go(n,o).map((o=>{const r=zi(Wi(e),o,n);return t(o,r)})))).getOr("");re({mceTableRowType:()=>n(t.getTableRowType),mceTableCellType:()=>n(t.getTableCellType),mceTableColType:()=>n(t.getTableColType)},((t,o)=>e.addQueryValueHandler(o,t)))},Rg=Yc.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Bg=(e,t,o,n)=>e.fold(t,o,n),Lg=e=>e.fold(w,w,w),Hg=Rg.before,Ig=Rg.on,Pg=Rg.after,zg={before:Hg,on:Ig,after:Pg,cata:Bg,getStart:Lg},Fg=(e,t)=>({selection:e,kill:t}),Vg={create:Fg},Zg=(e,t)=>{const o=e.document.createRange();return o.selectNode(t.dom),o},Ug=(e,t)=>{const o=e.document.createRange();return jg(o,t),o},jg=(e,t)=>e.selectNodeContents(t.dom),$g=(e,t)=>{t.fold((t=>{e.setStartBefore(t.dom)}),((t,o)=>{e.setStart(t.dom,o)}),(t=>{e.setStartAfter(t.dom)}))},Wg=(e,t)=>{t.fold((t=>{e.setEndBefore(t.dom)}),((t,o)=>{e.setEnd(t.dom,o)}),(t=>{e.setEndAfter(t.dom)}))},qg=(e,t,o)=>{const n=e.document.createRange();return $g(n,t),Wg(n,o),n},Gg=(e,t,o,n,r)=>{const s=e.document.createRange();return s.setStart(t.dom,o),s.setEnd(n.dom,r),s},Kg=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}),Yg=e=>{const t=e.getClientRects(),o=t.length>0?t[0]:e.getBoundingClientRect();return o.width>0||o.height>0?E.some(o).map(Kg):E.none()},Xg=Yc.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Jg=(e,t,o)=>t(Ue.fromDom(o.startContainer),o.startOffset,Ue.fromDom(o.endContainer),o.endOffset),Qg=(e,t)=>t.match({domRange:e=>({ltr:y(e),rtl:E.none}),relative:(t,o)=>({ltr:tn((()=>qg(e,t,o))),rtl:tn((()=>E.some(qg(e,o,t))))}),exact:(t,o,n,r)=>({ltr:tn((()=>Gg(e,t,o,n,r))),rtl:tn((()=>E.some(Gg(e,n,r,t,o))))})}),eh=(e,t)=>{const o=t.ltr();if(o.collapsed){const n=t.rtl().filter((e=>!1===e.collapsed));return n.map((e=>Xg.rtl(Ue.fromDom(e.endContainer),e.endOffset,Ue.fromDom(e.startContainer),e.startOffset))).getOrThunk((()=>Jg(e,Xg.ltr,o)))}return Jg(e,Xg.ltr,o)},th=(e,t)=>{const o=Qg(e,t);return eh(e,o)},oh=(e,t)=>{const o=th(e,t);return o.match({ltr:(t,o,n,r)=>{const s=e.document.createRange();return s.setStart(t.dom,o),s.setEnd(n.dom,r),s},rtl:(t,o,n,r)=>{const s=e.document.createRange();return s.setStart(n.dom,r),s.setEnd(t.dom,o),s}})};Xg.ltr,Xg.rtl;const nh=(e,t,o,n)=>({start:e,soffset:t,finish:o,foffset:n}),rh={create:nh},sh=(e,t,o,n)=>({start:zg.on(e,t),finish:zg.on(o,n)}),ah={create:sh},ih=(e,t)=>{const o=oh(e,t);return rh.create(Ue.fromDom(o.startContainer),o.startOffset,Ue.fromDom(o.endContainer),o.endOffset)},lh=ah.create,ch=(e,t,o,n,r,s,a)=>Ge(o,r)&&n===s?E.none():uo(o,"td,th",t).bind((o=>uo(r,"td,th",t).bind((n=>dh(e,t,o,n,a))))),dh=(e,t,o,n,r)=>Ge(o,n)?E.none():yi(o,n,t).bind((t=>{const n=t.boxes.getOr([]);return n.length>1?(r(e,n,t.start,t.finish),E.some(Vg.create(E.some(lh(o,0,o,fa(o))),!0))):E.none()})),mh=(e,t,o,n,r)=>{const s=e=>(r.clearBeforeUpdate(o),r.selectRange(o,e.boxes,e.start,e.finish),e.boxes);return ki(n,e,t,r.firstSelectedSelector,r.lastSelectedSelector).map(s)},uh=(e,t)=>({item:e,mode:t}),gh=(e,t,o,n=hh)=>e.property().parent(t).map((e=>uh(e,n))),hh=(e,t,o,n=ph)=>o.sibling(e,t).map((e=>uh(e,n))),ph=(e,t,o,n=ph)=>{const r=e.property().children(t),s=o.first(r);return s.map((e=>uh(e,n)))},fh=[{current:gh,next:hh,fallback:E.none()},{current:hh,next:ph,fallback:E.some(gh)},{current:ph,next:ph,fallback:E.some(hh)}],bh=(e,t,o,n,r=fh)=>{const s=j(r,(e=>e.current===o));return s.bind((o=>o.current(e,t,n,o.next).orThunk((()=>o.fallback.bind((o=>bh(e,t,o,n)))))))},vh=()=>{const e=(e,t)=>e.query().prevSibling(t),t=e=>e.length>0?E.some(e[e.length-1]):E.none();return{sibling:e,first:t}},yh=()=>{const e=(e,t)=>e.query().nextSibling(t),t=e=>e.length>0?E.some(e[0]):E.none();return{sibling:e,first:t}},wh={left:vh,right:yh},xh=(e,t,o,n,r,s)=>{const a=bh(e,t,n,r);return a.bind((t=>s(t.item)?E.none():o(t.item)?E.some(t.item):xh(e,t.item,o,t.mode,r,s)))},Ch=(e,t,o,n)=>xh(e,t,o,hh,wh.left(),n),Sh=(e,t,o,n)=>xh(e,t,o,hh,wh.right(),n),kh=e=>t=>0===e.property().children(t).length,_h=(e,t,o)=>Th(e,t,kh(e),o),Oh=(e,t,o)=>Eh(e,t,kh(e),o),Th=Ch,Eh=Sh,Dh=ai(),Ah=(e,t)=>_h(Dh,e,t),Mh=(e,t)=>Oh(Dh,e,t),Nh=(e,t,o)=>Th(Dh,e,t,o),Rh=(e,t,o)=>Eh(Dh,e,t,o),Bh=(e,t,o)=>ro(e,t,o).isSome(),Lh=Yc.generate([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),Hh=(e,t,o)=>{const n=e.getRect(t),r=e.getRect(o);return r.right>n.left&&r.left<n.right},Ih=e=>uo(e,"tr"),Ph=(e,t,o,n,r,s,a)=>uo(n,"td,th",a).bind((o=>uo(t,"td,th",a).map((t=>Ge(o,t)?Ge(n,o)&&fa(o)===r?s(t):Lh.none("in same cell"):fi(Ih,[o,t]).fold((()=>Hh(e,t,o)?Lh.success():s(t)),(e=>s(t))))))).getOr(Lh.none("default")),zh=(e,t,o,n,r)=>e.fold(t,o,n,r),Fh={...Lh,verify:Ph,cata:zh},Vh=(e,t,o,n)=>({parent:e,children:t,element:o,index:n}),Zh=e=>tt(e).bind((t=>{const o=at(t);return Uh(o,e).map((n=>Vh(t,o,e,n)))})),Uh=(e,t)=>$(e,C(Ge,t)),jh=De("br"),$h=(e,t,o)=>t(e,o).bind((e=>Oe(e)&&0===ga(e).trim().length?$h(e,t,o):E.some(e))),Wh=(e,t,o)=>o.traverse(t).orThunk((()=>$h(t,o.gather,e))).map(o.relative),qh=(e,t)=>it(e,t).filter(jh).orThunk((()=>it(e,t-1).filter(jh))),Gh=(e,t,o,n)=>qh(t,o).bind((t=>n.traverse(t).fold((()=>$h(t,n.gather,e).map(n.relative)),(e=>Zh(e).map((e=>zg.on(e.parent,e.index))))))),Kh=(e,t,o,n)=>{const r=jh(t)?Wh(e,t,n):Gh(e,t,o,n);return r.map((e=>({start:e,finish:e})))},Yh=e=>Fh.cata(e,(e=>E.none()),(()=>E.none()),(e=>E.some(Ji(e,0))),(e=>E.some(Ji(e,fa(e))))),Xh=(e,t)=>({left:e.left,top:e.top+t,right:e.right,bottom:e.bottom+t}),Jh=(e,t)=>({left:e.left,top:e.top-t,right:e.right,bottom:e.bottom-t}),Qh=(e,t,o)=>({left:e.left+t,top:e.top+o,right:e.right+t,bottom:e.bottom+o}),ep=e=>e.top,tp=e=>e.bottom,op=(e,t,o)=>o>=0&&o<fa(t)?e.getRangedRect(t,o,t,o+1):o>0?e.getRangedRect(t,o-1,t,o):E.none(),np=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom}),rp=(e,t)=>E.some(e.getRect(t)),sp=(e,t,o)=>_e(t)?rp(e,t).map(np):Oe(t)?op(e,t,o).map(np):E.none(),ap=(e,t)=>_e(t)?rp(e,t).map(np):Oe(t)?e.getRangedRect(t,0,t,fa(t)).map(np):E.none(),ip=5,lp=100,cp=Yc.generate([{none:[]},{retry:["caret"]}]),dp=(e,t)=>e.left<t.left||Math.abs(t.right-e.left)<1||e.left>t.right,mp=(e,t,o)=>so(t,Ed).fold(O,(t=>ap(e,t).exists((e=>dp(o,e))))),up=(e,t,o,n,r)=>{const s=Xh(r,ip);return Math.abs(o.bottom-n.bottom)<1||o.top>r.bottom?cp.retry(s):o.top===r.bottom?cp.retry(Xh(r,1)):mp(e,t,r)?cp.retry(Qh(s,ip,0)):cp.none()},gp=(e,t,o,n,r)=>{const s=Jh(r,ip);return Math.abs(o.top-n.top)<1||o.bottom<r.top?cp.retry(s):o.bottom===r.top?cp.retry(Jh(r,1)):mp(e,t,r)?cp.retry(Qh(s,ip,0)):cp.none()},hp={point:ep,adjuster:gp,move:Jh,gather:Ah},pp={point:tp,adjuster:up,move:Xh,gather:Mh},fp=(e,t,o)=>e.elementFromPoint(t,o).filter((e=>"table"===xe(e))).isSome(),bp=(e,t,o,n,r)=>vp(e,t,o,t.move(n,ip),r),vp=(e,t,o,n,r)=>0===r?E.some(n):fp(e,n.left,t.point(n))?bp(e,t,o,n,r-1):e.situsFromPoint(n.left,t.point(n)).bind((s=>s.start.fold(E.none,(s=>ap(e,s).bind((a=>t.adjuster(e,s,a,o,n).fold(E.none,(n=>vp(e,t,o,n,r-1))))).orThunk((()=>E.some(n)))),E.none))),yp=(e,t,o)=>e.point(t)>o.getInnerHeight()?E.some(e.point(t)-o.getInnerHeight()):e.point(t)<0?E.some(-e.point(t)):E.none(),wp=(e,t,o)=>{const n=e.move(o,ip),r=vp(t,e,o,n,lp).getOr(n);return yp(e,r,t).fold((()=>t.situsFromPoint(r.left,e.point(r))),(o=>(t.scrollBy(0,o),t.situsFromPoint(r.left,e.point(r)-o))))},xp={tryUp:C(wp,hp),tryDown:C(wp,pp),getJumpSize:y(ip)},Cp=20,Sp=(e,t,o)=>e.getSelection().bind((n=>Kh(t,n.finish,n.foffset,o).fold((()=>E.some(Ji(n.finish,n.foffset))),(r=>{const s=e.fromSitus(r),a=Fh.verify(e,n.finish,n.foffset,s.finish,s.foffset,o.failure,t);return Yh(a)})))),kp=(e,t,o,n,r,s)=>0===s?E.none():Tp(e,t,o,n,r).bind((a=>{const i=e.fromSitus(a),l=Fh.verify(e,o,n,i.finish,i.foffset,r.failure,t);return Fh.cata(l,(()=>E.none()),(()=>E.some(a)),(a=>Ge(o,a)&&0===n?_p(e,o,n,Jh,r):kp(e,t,a,0,r,s-1)),(a=>Ge(o,a)&&n===fa(a)?_p(e,o,n,Xh,r):kp(e,t,a,fa(a),r,s-1)))})),_p=(e,t,o,n,r)=>sp(e,t,o).bind((t=>Op(e,r,n(t,xp.getJumpSize())))),Op=(e,t,o)=>{const n=Un().browser;return n.isChromium()||n.isSafari()||n.isFirefox()?t.retry(e,o):E.none()},Tp=(e,t,o,n,r)=>sp(e,o,n).bind((t=>Op(e,r,t))),Ep=(e,t,o)=>Sp(e,t,o).bind((n=>kp(e,t,n.element,n.offset,o,Cp).map(e.fromSitus))),Dp=(e,t)=>Bh(e,(e=>tt(e).exists((e=>Ge(e,t))))),Ap=(e,t,o,n,r)=>uo(n,"td,th",t).bind((n=>uo(n,"table",t).bind((s=>Dp(r,s)?Ep(e,t,o).bind((e=>uo(e.finish,"td,th",t).map((t=>({start:n,finish:t,range:e}))))):E.none())))),Mp=(e,t,o,n,r,s)=>s(n,t).orThunk((()=>Ap(e,t,o,n,r).map((e=>{const t=e.range;return Vg.create(E.some(lh(t.start,t.soffset,t.finish,t.foffset)),!0)})))),Np=(e,t)=>uo(e,"tr",t).bind((e=>uo(e,"table",t).bind((o=>{const n=oo(o,"tr");return Ge(e,n[0])?Nh(o,(e=>xa(e).isSome()),t).map((e=>{const t=fa(e);return Vg.create(E.some(lh(e,t,e,t)),!0)})):E.none()})))),Rp=(e,t)=>uo(e,"tr",t).bind((e=>uo(e,"table",t).bind((o=>{const n=oo(o,"tr");return Ge(e,n[n.length-1])?Rh(o,(e=>wa(e).isSome()),t).map((e=>Vg.create(E.some(lh(e,0,e,0)),!0))):E.none()})))),Bp=(e,t,o,n,r,s,a)=>Ap(e,o,n,r,s).bind((e=>dh(t,o,e.start,e.finish,a))),Lp=e=>{let t=e;const o=()=>t,n=e=>{t=e};return{get:o,set:n}},Hp=e=>{const t=Lp(E.none()),o=()=>t.get().each(e),n=()=>{o(),t.set(E.none())},r=()=>t.get().isSome(),s=()=>t.get(),a=e=>{o(),t.set(E.some(e))};return{clear:n,isSet:r,get:s,set:a}},Ip=()=>{const e=Hp(f),t=t=>e.get().each(t);return{...e,on:t}},Pp=(e,t)=>uo(e,"td,th",t),zp=(e,t,o,n)=>{const r=Ip(),s=r.clear,a=s=>{r.on((r=>{n.clearBeforeUpdate(t),Pp(s.target,o).each((a=>{yi(r,a,o).each((o=>{const r=o.boxes.getOr([]);if(1===r.length){const o=r[0],a="false"===Ml(o),i=go(Dl(s.target),o,Ge);a&&i&&(n.selectRange(t,r,o,o),e.selectContents(o))}else r.length>1&&(n.selectRange(t,r,o.start,o.finish),e.selectContents(a))}))}))}))},i=e=>{n.clear(t),Pp(e.target,o).each(r.set)},l=e=>{a(e)},c=e=>{a(e),s()};return{clearstate:s,mousedown:i,mouseover:l,mouseup:c}},Fp={traverse:st,gather:Mh,relative:zg.before,retry:xp.tryDown,failure:Fh.failedDown},Vp={traverse:rt,gather:Ah,relative:zg.before,retry:xp.tryUp,failure:Fh.failedUp},Zp=e=>t=>t===e,Up=Zp(38),jp=Zp(40),$p=e=>e>=37&&e<=40,Wp={isBackward:Zp(37),isForward:Zp(39)},qp={isBackward:Zp(39),isForward:Zp(37)},Gp=e=>{const t=void 0!==e?e.dom:document,o=t.body.scrollLeft||t.documentElement.scrollLeft,n=t.body.scrollTop||t.documentElement.scrollTop;return zr(o,n)},Kp=(e,t,o)=>{const n=void 0!==o?o.dom:document,r=n.defaultView;r&&r.scrollBy(e,t)},Yp=Yc.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Xp=e=>Yp.exact(e.start,e.soffset,e.finish,e.foffset),Jp=e=>e.match({domRange:e=>Ue.fromDom(e.startContainer),relative:(e,t)=>zg.getStart(e),exact:(e,t,o,n)=>e}),Qp=Yp.domRange,ef=Yp.relative,tf=Yp.exact,of=e=>{const t=Jp(e);return et(t)},nf=rh.create,rf={domRange:Qp,relative:ef,exact:tf,exactFromRange:Xp,getWin:of,range:nf},sf=(e,t,o)=>{var n,r;return E.from(null===(r=(n=e.dom).caretPositionFromPoint)||void 0===r?void 0:r.call(n,t,o)).bind((t=>{if(null===t.offsetNode)return E.none();const o=e.dom.createRange();return o.setStart(t.offsetNode,t.offset),o.collapse(),E.some(o)}))},af=(e,t,o)=>{var n,r;return E.from(null===(r=(n=e.dom).caretRangeFromPoint)||void 0===r?void 0:r.call(n,t,o))},lf=(()=>document.caretPositionFromPoint?sf:document.caretRangeFromPoint?af:E.none)(),cf=(e,t,o)=>{const n=Ue.fromDom(e.document);return lf(n,t,o).map((e=>rh.create(Ue.fromDom(e.startContainer),e.startOffset,Ue.fromDom(e.endContainer),e.endOffset)))},df=(e,t)=>{const o=xe(e);return"input"===o?zg.after(e):R(["br","img"],o)?0===t?zg.before(e):zg.after(e):zg.on(e,t)},mf=(e,t)=>{const o=e.fold(zg.before,df,zg.after),n=t.fold(zg.before,df,zg.after);return rf.relative(o,n)},uf=(e,t,o,n)=>{const r=df(e,t),s=df(o,n);return rf.relative(r,s)},gf=(e,t,o,n)=>{const r=Xe(e),s=r.dom.createRange();return s.setStart(e.dom,t),s.setEnd(o.dom,n),s},hf=(e,t,o,n)=>{const r=gf(e,t,o,n),s=Ge(e,o)&&t===n;return r.collapsed&&!s},pf=e=>E.from(e.getSelection()),ff=(e,t)=>{pf(e).each((e=>{e.removeAllRanges(),e.addRange(t)}))},bf=(e,t,o,n,r)=>{const s=Gg(e,t,o,n,r);ff(e,s)},vf=(e,t,o,n,r,s)=>{t.collapse(o.dom,n),t.extend(r.dom,s)},yf=(e,t)=>th(e,t).match({ltr:(t,o,n,r)=>{bf(e,t,o,n,r)},rtl:(t,o,n,r)=>{pf(e).each((s=>{if(s.setBaseAndExtent)s.setBaseAndExtent(t.dom,o,n.dom,r);else if(s.extend)try{vf(e,s,t,o,n,r)}catch(a){bf(e,n,r,t,o)}else bf(e,n,r,t,o)}))}}),wf=(e,t,o,n,r)=>{const s=uf(t,o,n,r);yf(e,s)},xf=(e,t,o)=>{const n=mf(t,o);yf(e,n)},Cf=e=>{if(e.rangeCount>0){const t=e.getRangeAt(0),o=e.getRangeAt(e.rangeCount-1);return E.some(rh.create(Ue.fromDom(t.startContainer),t.startOffset,Ue.fromDom(o.endContainer),o.endOffset))}return E.none()},Sf=e=>{if(null===e.anchorNode||null===e.focusNode)return Cf(e);{const t=Ue.fromDom(e.anchorNode),o=Ue.fromDom(e.focusNode);return hf(t,e.anchorOffset,o,e.focusOffset)?E.some(rh.create(t,e.anchorOffset,o,e.focusOffset)):Cf(e)}},kf=(e,t,o=!0)=>{const n=o?Ug:Zg,r=n(e,t);ff(e,r)},_f=e=>pf(e).filter((e=>e.rangeCount>0)).bind(Sf),Of=e=>_f(e).map((e=>rf.exact(e.start,e.soffset,e.finish,e.foffset))),Tf=(e,t)=>{const o=oh(e,t);return Yg(o)},Ef=(e,t,o)=>cf(e,t,o),Df=e=>{pf(e).each((e=>e.removeAllRanges()))},Af=e=>{const t=(t,o)=>Ue.fromPoint(Ue.fromDom(e.document),t,o),o=e=>e.dom.getBoundingClientRect(),n=(t,o,n,r)=>{const s=rf.exact(t,o,n,r);return Tf(e,s)},r=()=>Of(e).map((t=>ih(e,t))),s=t=>{const o=rf.relative(t.start,t.finish);return ih(e,o)},a=(t,o)=>Ef(e,t,o).map((e=>ah.create(e.start,e.soffset,e.finish,e.foffset))),i=()=>{Df(e)},l=(t=!1)=>{Of(e).each((o=>o.fold((e=>e.collapse(t)),((o,n)=>{const r=t?o:n;xf(e,r,r)}),((o,n,r,s)=>{const a=t?o:r,i=t?n:s;wf(e,a,i,a,i)}))))},c=t=>{kf(e,t,!1)},d=t=>{kf(e,t)},m=t=>{wf(e,t.start,t.soffset,t.finish,t.foffset)},u=(t,o)=>{xf(e,t,o)},g=()=>e.innerHeight,h=()=>{const t=Gp(Ue.fromDom(e.document));return t.top},p=(t,o)=>{Kp(t,o,Ue.fromDom(e.document))};return{elementFromPoint:t,getRect:o,getRangedRect:n,getSelection:r,fromSitus:s,situsFromPoint:a,clearSelection:i,collapseSelection:l,setSelection:m,setRelativeSelection:u,selectNode:c,selectContents:d,getInnerHeight:g,getScrollY:h,scrollBy:p}},Mf=(e,t)=>({rows:e,cols:t}),Nf=(e,t,o,n)=>{const r=Af(e),s=zp(r,t,o,n);return{clearstate:s.clearstate,mousedown:s.mousedown,mouseover:s.mouseover,mouseup:s.mouseup}},Rf=(e,t,o,n)=>{const r=Af(e),s=()=>(n.clear(t),E.none()),a=(e,a,i,l,c,d)=>{const m=e.raw,u=m.which,g=!0===m.shiftKey,h=wi(t,n.selectedSelector).fold((()=>($p(u)&&!g&&n.clearBeforeUpdate(t),jp(u)&&g?C(Bp,r,t,o,Fp,l,a,n.selectRange):Up(u)&&g?C(Bp,r,t,o,Vp,l,a,n.selectRange):jp(u)?C(Mp,r,o,Fp,l,a,Rp):Up(u)?C(Mp,r,o,Vp,l,a,Np):E.none)),(e=>{const o=o=>()=>{const s=te(o,(o=>mh(o.rows,o.cols,t,e,n)));return s.fold((()=>Ci(t,n.firstSelectedSelector,n.lastSelectedSelector).map((e=>{const o=jp(u)||d.isForward(u)?zg.after:zg.before;return r.setRelativeSelection(zg.on(e.first,0),o(e.table)),n.clear(t),Vg.create(E.none(),!0)}))),(e=>E.some(Vg.create(E.none(),!0))))};return jp(u)&&g?o([Mf(1,0)]):Up(u)&&g?o([Mf(-1,0)]):d.isBackward(u)&&g?o([Mf(0,-1),Mf(-1,0)]):d.isForward(u)&&g?o([Mf(0,1),Mf(1,0)]):$p(u)&&!g?s:E.none}));return h()},i=(e,r,s,a,i)=>wi(t,n.selectedSelector).fold((()=>{const l=e.raw,c=l.which,d=!0===l.shiftKey;return d&&$p(c)?ch(t,o,r,s,a,i,n.selectRange):E.none()}),E.none);return{keydown:a,keyup:i}},Bf=(e,t,o,n)=>{const r=Af(e);return(e,s)=>{n.clearBeforeUpdate(t),yi(e,s,o).each((e=>{const o=e.boxes.getOr([]);n.selectRange(t,o,e.start,e.finish),r.selectContents(s),r.collapseSelection()}))}},Lf=(e,t)=>{const o=Be(e,t);return void 0===o||""===o?[]:o.split(" ")},Hf=(e,t,o)=>{const n=Lf(e,t),r=n.concat([o]);return Me(e,t,r.join(" ")),!0},If=(e,t,o)=>{const n=F(Lf(e,t),(e=>e!==o));return n.length>0?Me(e,t,n.join(" ")):He(e,t),!1},Pf=e=>void 0!==e.dom.classList,zf=e=>Lf(e,"class"),Ff=(e,t)=>Hf(e,"class",t),Vf=(e,t)=>If(e,"class",t),Zf=(e,t)=>{Pf(e)?e.dom.classList.add(t):Ff(e,t)},Uf=e=>{const t=Pf(e)?e.dom.classList:zf(e);0===t.length&&He(e,"class")},jf=(e,t)=>{if(Pf(e)){const o=e.dom.classList;o.remove(t)}else Vf(e,t);Uf(e)},$f=(e,t)=>Pf(e)&&e.dom.classList.contains(t),Wf=(e,t)=>{I(t,(t=>{jf(e,t)}))},qf=e=>t=>{Zf(t,e)},Gf=e=>t=>{Wf(t,e)},Kf=e=>{const t=qf(e.selected),o=Gf([e.selected,e.lastSelected,e.firstSelected]),n=t=>{const n=oo(t,e.selectedSelector);I(n,o)},r=(o,r,s,a)=>{n(o),I(r,t),Zf(s,e.firstSelected),Zf(a,e.lastSelected)};return{clearBeforeUpdate:n,clear:n,selectRange:r,selectedSelector:e.selectedSelector,firstSelectedSelector:e.firstSelectedSelector,lastSelectedSelector:e.lastSelectedSelector}},Yf=(e,t,o)=>{const n=t=>{He(t,e.selected),He(t,e.firstSelected),He(t,e.lastSelected)},r=t=>{Me(t,e.selected,"1")},s=e=>{a(e),o()},a=t=>{const o=oo(t,`${e.selectedSelector},${e.firstSelectedSelector},${e.lastSelectedSelector}`);I(o,n)},i=(o,n,a,i)=>{s(o),I(n,r),Me(a,e.firstSelected,"1"),Me(i,e.lastSelected,"1"),t(n,a,i)};return{clearBeforeUpdate:a,clear:s,selectRange:i,selectedSelector:e.selectedSelector,firstSelectedSelector:e.firstSelectedSelector,lastSelectedSelector:e.lastSelectedSelector}},Xf={byClass:Kf,byAttr:Yf},Jf=(e,t,o,n)=>{switch(e.tag){case"none":return t();case"single":return n(e.element);case"multiple":return o(e.elements)}},Qf=()=>({tag:"none"}),eb=e=>({tag:"multiple",elements:e}),tb=e=>({tag:"single",element:e}),ob=(e,t,o)=>{const n=()=>_i(e(),o).fold((()=>t().fold(Qf,tb)),eb);return{get:n}},nb=(e,t)=>{const o=e.slice(0,t[t.length-1].row+1),n=jl(o);return q(n,(e=>{const o=e.cells.slice(0,t[t.length-1].column+1);return H(o,(e=>e.element))}))},rb=(e,t)=>{const o=e.slice(t[0].row+t[0].rowspan-1,e.length),n=jl(o);return q(n,(e=>{const o=e.cells.slice(t[0].column+t[0].colspan-1,e.cells.length);return H(o,(e=>e.element))}))},sb=(e,t,o)=>{const n=Tr.fromTable(e),r=Jl(n,t);return r.map((e=>{const t=Zl(n,o,!1),{rows:r}=mr(t),s=nb(r,e),a=rb(r,e);return{upOrLeftCells:s,downOrRightCells:a}}))},ab=(e,t,o,n,r,s,a)=>({target:e,x:t,y:o,stop:n,prevent:r,kill:s,raw:a}),ib=e=>{const t=Ue.fromDom(Wt(e).getOr(e.target)),o=()=>e.stopPropagation(),n=()=>e.preventDefault(),r=b(n,o);return ab(t,e.clientX,e.clientY,o,n,r,e)},lb=(e,t)=>o=>{e(o)&&t(ib(o))},cb=(e,t,o,n,r)=>{const s=lb(o,n);return e.dom.addEventListener(t,s,r),{unbind:C(mb,e,t,s,r)}},db=(e,t,o,n)=>cb(e,t,o,n,!1),mb=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)},ub=T,gb=(e,t,o)=>db(e,t,ub,o),hb=ib,pb=e=>!$f(Ue.fromDom(e.target),"ephox-snooker-resizer-bar"),fb=(e,t)=>{const o=ob((()=>Ue.fromDom(e.getBody())),(()=>$i(za(e),Ia(e))),Pi.selectedSelector),n=(t,o,n)=>{const r=Go(o);r.each((r=>{const s=su(e),a=Na(f,Ue.fromDom(e.getDoc()),s),i=Wi(e),l=sb(r,{selection:i},a);Wm(e,t,o,n,l)}))},r=()=>qm(e),s=Xf.byAttr(Pi,n,r);e.on("init",(o=>{const n=e.getWin(),r=Ha(e),a=Ia(e),i=()=>{const t=e.selection,o=Ue.fromDom(t.getStart()),n=Ue.fromDom(t.getEnd()),a=fi(Go,[o,n]);a.fold((()=>s.clear(r)),f)},l=Nf(n,r,a,s),c=Rf(n,r,a,s),d=Bf(n,r,a,s),m=e=>!0===e.raw.shiftKey;e.on("TableSelectorChange",(e=>d(e.start,e.finish)));const u=(t,o)=>{m(t)&&(o.kill&&t.kill(),o.selection.each((t=>{const o=rf.relative(t.start,t.finish),r=oh(n,o);e.selection.setRng(r)})))},g=t=>{const o=hb(t);if(o.raw.shiftKey&&$p(o.raw.which)){const t=e.selection.getRng(),n=Ue.fromDom(t.startContainer),r=Ue.fromDom(t.endContainer);c.keyup(o,n,t.startOffset,r,t.endOffset).each((e=>{u(o,e)}))}},h=o=>{const n=hb(o);t.hide();const r=e.selection.getRng(),s=Ue.fromDom(r.startContainer),a=Ue.fromDom(r.endContainer),i=Nr(Wp,qp)(Ue.fromDom(e.selection.getStart()));c.keydown(n,s,r.startOffset,a,r.endOffset,i).each((e=>{u(n,e)})),t.show()},p=e=>0===e.button,b=e=>void 0===e.buttons||0!==(1&e.buttons),v=e=>{l.clearstate()},y=e=>{p(e)&&pb(e)&&l.mousedown(hb(e))},w=e=>{b(e)&&pb(e)&&l.mouseover(hb(e))},x=e=>{p(e)&&pb(e)&&l.mouseup(hb(e))},C=()=>{const e=Lp(Ue.fromDom(r)),t=Lp(0),o=o=>{const n=Ue.fromDom(o.target);if(De("td")(n)||De("th")(n)){const r=e.get(),s=t.get();Ge(r,n)&&o.timeStamp-s<300&&(o.preventDefault(),d(n,n))}e.set(n),t.set(o.timeStamp)};return{touchEnd:o}},S=C();e.on("dragstart",v),e.on("mousedown",y),e.on("mouseover",w),e.on("mouseup",x),e.on("touchend",S.touchEnd),e.on("keyup",g),e.on("keydown",h),e.on("NodeChange",i)})),e.on("PreInit",(()=>{e.serializer.addTempAttr(Pi.firstSelected),e.serializer.addTempAttr(Pi.lastSelected)}));const a=e=>s.clear(Ue.fromDom(e)),i=()=>Jf(o.get(),y([]),(e=>H(e,(e=>e.dom))),(e=>[e.dom]));return{getSelectedCells:i,clearSelectedCells:a}},bb=e=>{let t=[];const o=e=>{if(void 0===e)throw new Error("Event bind error: undefined handler");t.push(e)},n=e=>{t=F(t,(t=>t!==e))},r=(...o)=>{const n={};I(e,((e,t)=>{n[e]=o[t]})),I(t,(e=>{e(n)}))};return{bind:o,unbind:n,trigger:r}},vb=e=>{const t=se(e,(e=>({bind:e.bind,unbind:e.unbind}))),o=se(e,(e=>e.trigger));return{registry:t,trigger:o}},yb=(e,t)=>{let o=null;const n=()=>{c(o)||(clearTimeout(o),o=null)},r=(...r)=>{n(),o=setTimeout((()=>{o=null,e.apply(null,r)}),t)};return{cancel:n,throttle:r}},wb=e=>e.slice(0).sort(),xb=(e,t)=>{throw new Error("All required keys ("+wb(e).join(", ")+") were not specified. Specified keys were: "+wb(t).join(", ")+".")},Cb=e=>{throw new Error("Unsupported keys for object: "+wb(e).join(", "))},Sb=(e,t)=>{if(!l(t))throw new Error("The "+e+" fields must be an array. Was: "+t+".");I(t,(t=>{if(!a(t))throw new Error("The value "+t+" in the "+e+" fields was not a string.")}))},kb=(e,t)=>{throw new Error("All values need to be of type: "+t+". Keys ("+wb(e).join(", ")+") were not.")},_b=e=>{const t=wb(e),o=j(t,((e,o)=>o<t.length-1&&e===t[o+1]));o.each((e=>{throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+t.join(", ")+"].")}))},Ob=(e,t)=>Tb(e,t,{validate:h,label:"function"}),Tb=(e,t,o)=>{if(0===t.length)throw new Error("You must specify at least one required field.");return Sb("required",t),_b(t),n=>{const r=oe(n),s=G(t,(e=>R(r,e)));s||xb(t,r),e(t,r);const a=F(t,(e=>!o.validate(n[e],e)));return a.length>0&&kb(a,o.label),n}},Eb=(e,t)=>{const o=F(t,(t=>!R(e,t)));o.length>0&&Cb(o)},Db=e=>Ob(Eb,e),Ab=Db(["compare","extract","mutate","sink"]),Mb=Db(["element","start","stop","destroy"]),Nb=Db(["forceDrop","drop","move","delayDrop"]),Rb=()=>{let e=E.none();const t=()=>{e=E.none()},o=(t,o)=>{const n=e.map((e=>t.compare(e,o)));return e=E.some(o),n},n=(e,t)=>{const n=t.extract(e);n.each((e=>{const n=o(t,e);n.each((e=>{r.trigger.move(e)}))}))},r=vb({move:bb(["info"])});return{onEvent:n,reset:t,events:r.registry}},Bb=()=>{const e=vb({move:bb(["info"])});return{onEvent:f,reset:f,events:e.registry}},Lb=()=>{const e=Bb(),t=Rb();let o=e;const n=()=>{o.reset(),o=t},r=()=>{o.reset(),o=e},s=(e,t)=>{o.onEvent(e,t)},a=()=>o===t;return{on:n,off:r,isOn:a,onEvent:s,events:t.events}},Hb=(e,t,o)=>{let n=!1;const r=vb({start:bb([]),stop:bb([])}),s=Lb(),a=()=>{g.stop(),s.isOn()&&(s.off(),r.trigger.stop())},i=yb(a,200),l=e=>{g.start(e),s.on(),r.trigger.start()},c=e=>{i.cancel(),s.onEvent(e,t)};s.events.move.bind((o=>{t.mutate(e,o.info)}));const d=()=>{n=!0},m=()=>{n=!1},u=e=>(...t)=>{n&&e.apply(null,t)},g=t.sink(Nb({forceDrop:a,drop:u(a),move:u(c),delayDrop:u(i.throttle)}),o),h=()=>{g.destroy()};return{element:g.element,go:l,on:d,off:m,destroy:h,events:r.registry}},Ib=e=>{const t=e.replace(/\./g,"-"),o=e=>t+"-"+e;return{resolve:o}},Pb=Ib("ephox-dragster"),zb=Pb.resolve,Fb=e=>{const t={layerClass:zb("blocker"),...e},o=Ue.fromTag("div");Me(o,"role","presentation"),Do(o,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Zf(o,zb("blocker")),Zf(o,t.layerClass);const n=y(o),r=()=>{vt(o)};return{element:n,destroy:r}},Vb=(e,t)=>zr(t.left-e.left,t.top-e.top),Zb=e=>E.some(zr(e.x,e.y)),Ub=(e,t)=>{e.mutate(t.left,t.top)},jb=(e,t)=>{const o=Fb(t),n=gb(o.element(),"mousedown",e.forceDrop),r=gb(o.element(),"mouseup",e.drop),s=gb(o.element(),"mousemove",e.move),a=gb(o.element(),"mouseout",e.delayDrop),i=()=>{o.destroy(),r.unbind(),s.unbind(),a.unbind(),n.unbind()},l=e=>{ut(e,o.element())},c=()=>{vt(o.element())};return Mb({element:o.element,start:l,stop:c,destroy:i})};var $b=Ab({compare:Vb,extract:Zb,sink:jb,mutate:Ub});const Wb=(e,t={})=>{var o;const n=null!==(o=t.mode)&&void 0!==o?o:$b;return Hb(e,n,t)},qb=Ib("ephox-snooker"),Gb=qb.resolve,Kb=()=>{const e=vb({drag:bb(["xDelta","yDelta"])}),t=(t,o)=>{e.trigger.drag(t,o)};return{mutate:t,events:e.registry}},Yb=()=>{const e=vb({drag:bb(["xDelta","yDelta","target"])});let t=E.none();const o=Kb();o.events.drag.bind((o=>{t.each((t=>{e.trigger.drag(o.xDelta,o.yDelta,t)}))}));const n=e=>{t=E.some(e)},r=()=>t;return{assign:n,get:r,mutate:o.mutate,events:e.registry}},Xb=(e,t,o,n,r)=>{const s=Ue.fromTag("div");return Do(s,{position:"absolute",left:t-n/2+"px",top:o+"px",height:r+"px",width:n+"px"}),Ne(s,{"data-column":e,role:"presentation"}),s},Jb=(e,t,o,n,r)=>{const s=Ue.fromTag("div");return Do(s,{position:"absolute",left:t+"px",top:o-r/2+"px",height:r+"px",width:n+"px"}),Ne(s,{"data-row":e,role:"presentation"}),s},Qb=Gb("resizer-bar"),ev=Gb("resizer-rows"),tv=Gb("resizer-cols"),ov=7,nv=(e,t)=>q(e.all,((e,o)=>t(e.element)?[o]:[])),rv=(e,t)=>{const o=[];return L(e.grid.columns,(n=>{const r=Tr.getColumnAt(e,n).map((e=>e.element));r.forall(t)&&o.push(n)})),F(o,(o=>{const n=Tr.filterItems(e,(e=>e.column===o));return G(n,(e=>t(e.element)))}))},sv=e=>{const t=oo(e.parent(),"."+Qb);I(t,vt)},av=(e,t,o)=>{const n=e.origin();I(t,(t=>{t.each((t=>{const r=o(n,t);Zf(r,Qb),ut(e.parent(),r)}))}))},iv=(e,t,o,n)=>{av(e,t,((e,t)=>{const r=Xb(t.col,t.x-e.left,o.top-e.top,ov,n);return Zf(r,tv),r}))},lv=(e,t,o,n)=>{av(e,t,((e,t)=>{const r=Jb(t.row,o.left-e.left,t.y-e.top,n,ov);return Zf(r,ev),r}))},cv=(e,t,o,n,r)=>{const s=Zr(o),a=t.isResizable,i=n.length>0?ts.positions(n,o):[],l=i.length>0?nv(e,a):[],c=F(i,((e,t)=>B(l,(e=>t===e))));lv(t,c,s,er(o));const d=r.length>0?ss.positions(r,o):[],m=d.length>0?rv(e,a):[],u=F(d,((e,t)=>B(m,(e=>t===e))));iv(t,u,s,Hr(o))},dv=(e,t)=>{if(sv(e),e.isResizable(t)){const o=Tr.fromTable(t),n=Ar(o),r=Er(o);cv(o,e,t,n,r)}},mv=(e,t)=>{const o=oo(e.parent(),"."+Qb);I(o,t)},uv=e=>{mv(e,(e=>{Eo(e,"display","none")}))},gv=e=>{mv(e,(e=>{Eo(e,"display","block")}))},hv=e=>$f(e,ev),pv=e=>$f(e,tv),fv=Gb("resizer-bar-dragging"),bv=e=>{const t=Yb(),o=Wb(t,{});let n=E.none();const r=(e,t)=>E.from(Be(e,t));t.events.drag.bind((e=>{r(e.target,"data-row").each((t=>{const o=zo(e.target,"top");Eo(e.target,"top",o+e.yDelta+"px")})),r(e.target,"data-column").each((t=>{const o=zo(e.target,"left");Eo(e.target,"left",o+e.xDelta+"px")}))}));const s=(e,t)=>{const o=zo(e,t),n=Lo(e,"data-initial-"+t,0);return o-n};o.events.stop.bind((()=>{t.get().each((t=>{n.each((o=>{r(t,"data-row").each((e=>{const n=s(t,"top");He(t,"data-initial-top"),g.trigger.adjustHeight(o,n,parseInt(e,10))})),r(t,"data-column").each((e=>{const n=s(t,"left");He(t,"data-initial-left"),g.trigger.adjustWidth(o,n,parseInt(e,10))})),dv(e,o)}))}))}));const a=(n,r)=>{g.trigger.startAdjust(),t.assign(n),Me(n,"data-initial-"+r,zo(n,r)),Zf(n,fv),Eo(n,"opacity","0.2"),o.go(e.parent())},i=gb(e.parent(),"mousedown",(e=>{hv(e.target)&&a(e.target,"top"),pv(e.target)&&a(e.target,"left")})),l=t=>Ge(t,e.view()),c=e=>uo(e,"table",l).filter(Al),d=gb(e.view(),"mouseover",(t=>{c(t.target).fold((()=>{Gt(t.target)&&sv(e)}),(t=>{n=E.some(t),dv(e,t)}))})),m=()=>{i.unbind(),d.unbind(),o.destroy(),sv(e)},u=t=>{dv(e,t)},g=vb({adjustHeight:bb(["table","delta","row"]),adjustWidth:bb(["table","delta","column"]),startAdjust:bb([])});return{destroy:m,refresh:u,on:o.on,off:o.off,hideBars:C(uv,e),showBars:C(gv,e),events:g.registry}},vv=(e,t,o)=>{const n=ts,r=ss,s=bv(e),a=vb({beforeResize:bb(["table","type"]),afterResize:bb(["table","type"]),startDrag:bb([])});return s.events.adjustHeight.bind((e=>{const t=e.table;a.trigger.beforeResize(t,"row");const o=n.delta(e.delta,t);dd(t,o,e.row,n),a.trigger.afterResize(t,"row")})),s.events.startAdjust.bind((e=>{a.trigger.startDrag()})),s.events.adjustWidth.bind((e=>{const n=e.table;a.trigger.beforeResize(n,"col");const s=r.delta(e.delta,n),i=o(n);cd(n,s,e.column,t,i),a.trigger.afterResize(n,"col")})),{on:s.on,off:s.off,refreshBars:s.refresh,hideBars:s.hideBars,showBars:s.showBars,destroy:s.destroy,events:a.registry}},yv={create:vv},wv=(e,t)=>{const o=Te(e)?Qe(e):e;return{parent:y(o),view:y(e),origin:y(zr(0,0)),isResizable:t}},xv=(e,t,o)=>{const n=()=>Zr(t);return{parent:y(t),view:y(e),origin:n,isResizable:o}},Cv=(e,t,o)=>({parent:y(t),view:y(e),origin:y(zr(0,0)),isResizable:o}),Sv={only:wv,detached:xv,body:Cv},kv=()=>{const e=Ue.fromTag("div");return Do(e,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),ut(Kt(),e),e},_v=(e,t)=>e.inline?Sv.body(Ue.fromDom(e.getBody()),kv(),t):Sv.only(Ue.fromDom(e.getDoc()),t),Ov=(e,t)=>{e.inline&&vt(t.parent())},Tv=e=>g(e)&&"TABLE"===e.nodeName,Ev="bar-",Dv=e=>"false"!==Be(e,"data-mce-resize"),Av=e=>{const t=Tr.fromTable(e);Tr.hasColumns(t)||I(Wo(e),(e=>{const t=Ao(e,"width");Eo(e,"width",t),He(e,"width")}))},Mv=e=>{const t=Ip(),o=Ip(),n=Ip();let r,s;const a=t=>wu(e,t),i=()=>cu(e)?ul():ml(),l=e=>gl(e).columns,c=(t,o,n)=>{const c=wo(o,"e");if(""===s&&Xu(t),n!==r&&""!==s){Eo(t,"width",s);const o=i(),d=a(t),m=cu(e)||c?l(t)-1:0;cd(t,n-r,m,o,d)}else if(Ua(s)){const e=parseFloat(s.replace("%","")),o=n*e/r;Eo(t,"width",o+"%")}ja(s)&&Av(t)},d=()=>{o.on((e=>{e.destroy()})),n.on((t=>{Ov(e,t)}))};e.on("init",(()=>{const r=_v(e,Dv);if(n.set(r),au(e)&&pu(e)){const n=i(),s=yv.create(r,n,a);s.on(),s.events.startDrag.bind((o=>{t.set(e.selection.getRng())})),s.events.beforeResize.bind((t=>{const o=t.table.dom;Gm(e,o,Fa(o),Va(o),Ev+t.type)})),s.events.afterResize.bind((o=>{const n=o.table,r=n.dom;Pa(n),t.on((t=>{e.selection.setRng(t),e.focus()})),Km(e,r,Fa(r),Va(r),Ev+o.type),e.undoManager.add()})),o.set(s)}})),e.on("ObjectResizeStart",(t=>{const o=t.target;if(Tv(o)){const n=Ue.fromDom(o);I(e.dom.select(".mce-clonedresizable"),(t=>{e.dom.addClass(t,"mce-"+lu(e)+"-columns")})),!Gu(n)&&gu(e)?Ju(n):!qu(n)&&uu(e)&&Xu(n),Ku(n)&&yo(t.origin,Ev)&&Xu(n),r=t.width,s=hu(e)?"":Za(e,o).getOr("")}})),e.on("ObjectResized",(t=>{const o=t.target;if(Tv(o)){const n=Ue.fromDom(o),r=t.origin;yo(r,"corner-")&&c(n,r,t.width),Pa(n),$m(e,n.dom,Ym)}})),e.on("SwitchMode",(()=>{o.on((t=>{e.mode.isReadOnly()?t.hideBars():t.showBars()}))})),e.on("remove",(()=>{d()}));const m=e=>{o.on((t=>t.refreshBars(Ue.fromDom(e))))},u=()=>{o.on((e=>e.hideBars()))},g=()=>{o.on((e=>e.showBars()))};return{refresh:m,hide:u,show:g}},Nv=e=>{ru(e);const t=Mv(e),o=fb(e,t),n=xu(e,t,o);return Mg(e,n),Ng(e,n),Xi(e,n),{getSelectedCells:o.getSelectedCells,clearSelectedCells:o.clearSelectedCells}},Rv=e=>{const t=Nv(e);return{table:t}};var Bv=()=>{e.add("dom",Rv)};Bv()})()},1627:function(e,t,o){o(9504)},9504:function(){(function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=(e,t,o)=>{const n="UL"===t?"InsertUnorderedList":"InsertOrderedList";e.execCommand(n,!1,!1===o?null:{"list-style-type":o})},o=e=>{e.addCommand("ApplyUnorderedListStyle",((o,n)=>{t(e,"UL",n["list-style-type"])})),e.addCommand("ApplyOrderedListStyle",((o,n)=>{t(e,"OL",n["list-style-type"])}))},n=e=>t=>t.options.get(e),r=e=>{const t=e.options.register;t("advlist_number_styles",{processor:"string[]",default:"default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman".split(",")}),t("advlist_bullet_styles",{processor:"string[]",default:"default,circle,square".split(",")})},s=n("advlist_number_styles"),a=n("advlist_bullet_styles"),i=e=>null===e||void 0===e,l=e=>!i(e);var c=tinymce.util.Tools.resolve("tinymce.util.Tools");class d{constructor(e,t){this.tag=e,this.value=t}static some(e){return new d(!0,e)}static none(){return d.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?d.some(e(this.value)):d.none()}bind(e){return this.tag?e(this.value):d.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:d.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&&void 0!==e?e:"Called getOrDie on None")}static from(e){return l(e)?d.some(e):d.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()"}}d.singletonNone=new d(!1);const m=(e,t)=>e.dom.isChildOf(t,e.getBody()),u=e=>l(e)&&/^(TH|TD)$/.test(e.nodeName),g=e=>t=>l(t)&&/^(OL|UL|DL)$/.test(t.nodeName)&&m(e,t),h=e=>{const t=e.dom.getParent(e.selection.getNode(),"ol,ul"),o=e.dom.getStyle(t,"listStyleType");return d.from(o)},p=(e,t)=>null!==t&&"false"===e.dom.getContentEditableParent(t),f=(e,t)=>{const o=e.dom.getParent(t,"ol,ul,dl");return p(e,o)},b=(e,t)=>{for(let o=0;o<e.length;o++){const n=e[o];if(t(n))return o}return-1},v=e=>e.replace(/\-/g," ").replace(/\b\w/g,(e=>e.toUpperCase())),y=e=>i(e)||"default"===e?"":e,w=(e,t,o)=>{const n=b(t.parents,u),r=-1!==n?t.parents.slice(0,n):t.parents,s=c.grep(r,g(e));return s.length>0&&s[0].nodeName===o},x=(e,t)=>o=>{const n=n=>{o.setActive(w(e,n,t)),o.setEnabled(!f(e,n.element))};return e.on("NodeChange",n),()=>e.off("NodeChange",n)},C=(e,o,n,r,s,a)=>{e.ui.registry.addSplitButton(o,{tooltip:n,icon:"OL"===s?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:e=>{const t=c.map(a,(e=>{const t="OL"===s?"num":"bull",o="disc"===e||"decimal"===e?"default":e,n=y(e),r=v(e);return{type:"choiceitem",value:n,icon:"list-"+t+"-"+o,text:r}}));e(t)},onAction:()=>e.execCommand(r),onItemAction:(o,n)=>{t(e,s,n)},select:t=>{const o=h(e);return o.map((e=>t===e)).getOr(!1)},onSetup:x(e,s)})},S=(e,o,n,r,s,a)=>{e.ui.registry.addToggleButton(o,{active:!1,tooltip:n,icon:"OL"===s?"ordered-list":"unordered-list",onSetup:x(e,s),onAction:()=>e.queryCommandState(r)||""===a?e.execCommand(r):t(e,s,a)})},k=(e,t,o,n,r,s)=>{s.length>1?C(e,t,o,n,r,s):S(e,t,o,n,r,y(s[0]))},_=e=>{k(e,"numlist","Numbered list","InsertOrderedList","OL",s(e)),k(e,"bullist","Bullet list","InsertUnorderedList","UL",a(e))};var O=()=>{e.add("advlist",(e=>{e.hasPlugin("lists")?(r(e),_(e),o(e)):console.error("Please use the Lists plugin together with the Advanced List plugin.")}))};O()})()},3847:function(e,t,o){o(1148)},1148:function(){(function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=(e,t)=>{e.focus(),e.undoManager.transact((()=>{e.setContent(t)})),e.selection.setCursorLocation(),e.nodeChanged()},o=e=>e.getContent({source_view:!0}),n=e=>{const n=o(e);e.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:n},onSubmit:o=>{t(e,o.getData().code),o.close()}})},r=e=>{e.addCommand("mceCodeEditor",(()=>{n(e)}))},s=e=>{const t=()=>e.execCommand("mceCodeEditor");e.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:t}),e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:t})};var a=()=>{e.add("code",(e=>(r(e),s(e),{})))};a()})()},5791:function(e,t,o){o(2564)},2564:function(){(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=>{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},r=e=>t=>n(t)===e,s=e=>t=>typeof t===e,a=e=>t=>e===t,i=(e,n)=>c(e)&&o(e,n,((e,o)=>t(e)===o)),l=r("string"),c=r("object"),d=e=>i(e,Object),m=r("array"),u=a(null),g=s("boolean"),h=e=>null===e||void 0===e,p=e=>!h(e),f=s("function"),b=s("number"),v=(e,t)=>{if(m(e)){for(let o=0,n=e.length;o<n;++o)if(!t(e[o]))return!1;return!0}return!1},y=()=>{};class w{constructor(e,t){this.tag=e,this.value=t}static some(e){return new w(!0,e)}static none(){return w.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?w.some(e(this.value)):w.none()}bind(e){return this.tag?e(this.value):w.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:w.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&&void 0!==e?e:"Called getOrDie on None")}static from(e){return p(e)?w.some(e):w.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()"}}w.singletonNone=new w(!1);const x=Object.keys,C=Object.hasOwnProperty,S=(e,t)=>{const o=x(e);for(let n=0,r=o.length;n<r;n++){const r=o[n],s=e[r];t(s,r)}},k=e=>(t,o)=>{e[o]=t},_=(e,t,o,n)=>{S(e,((e,r)=>{(t(e,r)?o:n)(e,r)}))},O=(e,t)=>{const o={};return _(e,t,k(o),y),o},T=(e,t)=>C.call(e,t),E=(e,t)=>T(e,t)&&void 0!==e[t]&&null!==e[t],D=Array.prototype.push,A=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!m(e[o]))throw new Error("Arr.flatten item "+o+" was not an array, input: "+e);D.apply(t,e[o])}return t},M=(e,t)=>t>=0&&t<e.length?w.some(e[t]):w.none(),N=e=>M(e,0),R=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome())return n}return w.none()};"undefined"!==typeof window?window:Function("return this;")();const B=(e,t,o)=>{if(!(l(o)||g(o)||b(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+"")},L=(e,t,o)=>{B(e.dom,t,o)},H=(e,t)=>{e.dom.removeAttribute(t)},I=(e,t)=>{const o=t||document,n=o.createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return F(n.childNodes[0])},P=(e,t)=>{const o=t||document,n=o.createElement(e);return F(n)},z=(e,t)=>{const o=t||document,n=o.createTextNode(e);return F(n)},F=e=>{if(null===e||void 0===e)throw new Error("Node cannot be null or undefined");return{dom:e}},V=(e,t,o)=>w.from(e.dom.elementFromPoint(t,o)).map(F),Z={fromHtml:I,fromTag:P,fromText:z,fromDom:F,fromPoint:V};var U=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),j=tinymce.util.Tools.resolve("tinymce.util.URI");const $=e=>e.length>0,W=e=>t=>t.options.get(e),q=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||l(e)||v(e,c)||f(e);return t?{value:e,valid:t}:{valid:!1,message:"Must be false, a string, an array or a function."}},default:!1})},G=W("image_dimensions"),K=W("image_advtab"),Y=W("image_uploadtab"),X=W("image_prepend_url"),J=W("image_class_list"),Q=W("image_description"),ee=W("image_title"),te=W("image_caption"),oe=W("image_list"),ne=W("a11y_advanced_options"),re=W("automatic_uploads"),se=e=>$(e.options.get("images_upload_url")),ae=e=>p(e.options.get("images_upload_handler")),ie=(e,t)=>Math.max(parseInt(e,10),parseInt(t,10)),le=e=>new Promise((t=>{const o=document.createElement("img"),n=e=>{o.onload=o.onerror=null,o.parentNode&&o.parentNode.removeChild(o),t(e)};o.onload=()=>{const e=ie(o.width,o.clientWidth),t=ie(o.height,o.clientHeight),r={width:e,height:t};n(Promise.resolve(r))},o.onerror=()=>{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})),ce=e=>(e&&(e=e.replace(/px$/,"")),e),de=e=>(e.length>0&&/^[0-9]+$/.test(e)&&(e+="px"),e),me=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},ue=(e,t)=>{const o=oe(e);l(o)?fetch(o).then((e=>{e.ok&&e.json().then(t)})):f(o)?o(t):t(o)},ge=(e,t,o)=>{const n=()=>{o.onload=o.onerror=null,e.selection&&(e.selection.select(o),e.nodeChanged())};o.onload=()=>{t.width||t.height||!G(e)||e.dom.setAttribs(o,{width:String(o.clientWidth),height:String(o.clientHeight)}),n()},o.onerror=n},he=e=>new Promise(((t,o)=>{const n=new FileReader;n.onload=()=>{t(n.result)},n.onerror=()=>{var e;o(null===(e=n.error)||void 0===e?void 0:e.message)},n.readAsDataURL(e)})),pe=e=>"IMG"===e.nodeName&&(e.hasAttribute("data-mce-object")||e.hasAttribute("data-mce-placeholder")),fe=(e,t)=>{const o=e.options.get;return j.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")})},be=U.DOM,ve=e=>e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight?ce(e.style.marginLeft):"",ye=e=>e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom?ce(e.style.marginTop):"",we=e=>e.style.borderWidth?ce(e.style.borderWidth):"",xe=(e,t)=>{var o;return e.hasAttribute(t)&&null!==(o=e.getAttribute(t))&&void 0!==o?o:""},Ce=e=>null!==e.parentNode&&"FIGURE"===e.parentNode.nodeName,Se=(e,t,o)=>{""===o||null===o?e.removeAttribute(t):e.setAttribute(t,o)},ke=e=>{const t=be.create("figure",{class:"image"});be.insertAfter(t,e),t.appendChild(e),t.appendChild(be.create("figcaption",{contentEditable:"true"},"Caption")),t.contentEditable="false"},_e=e=>{const t=e.parentNode;p(t)&&(be.insertAfter(e,t),be.remove(t))},Oe=e=>{Ce(e)?_e(e):ke(e)},Te=(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")},Ee=(e,t)=>(e,o,n)=>{const r=e.style;r[o]?(r[o]=de(n),Te(e,t)):Se(e,o,n)},De=(e,t)=>e.style[t]?ce(e.style[t]):xe(e,t),Ae=(e,t)=>{const o=de(t);e.style.marginLeft=o,e.style.marginRight=o},Me=(e,t)=>{const o=de(t);e.style.marginTop=o,e.style.marginBottom=o},Ne=(e,t)=>{const o=de(t);e.style.borderWidth=o},Re=(e,t)=>{e.style.borderStyle=t},Be=e=>{var t;return null!==(t=e.style.borderStyle)&&void 0!==t?t:""},Le=e=>p(e)&&"FIGURE"===e.nodeName,He=e=>"IMG"===e.nodeName,Ie=e=>0===be.getAttrib(e,"alt").length&&"presentation"===be.getAttrib(e,"role"),Pe=e=>Ie(e)?"":xe(e,"alt"),ze=()=>({src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}),Fe=(e,t)=>{var o;const n=document.createElement("img");return Se(n,"style",t.style),(ve(n)||""!==t.hspace)&&Ae(n,t.hspace),(ye(n)||""!==t.vspace)&&Me(n,t.vspace),(we(n)||""!==t.border)&&Ne(n,t.border),(Be(n)||""!==t.borderStyle)&&Re(n,t.borderStyle),e(null!==(o=n.getAttribute("style"))&&void 0!==o?o:"")},Ve=(e,t)=>{const o=document.createElement("img");if(qe(e,{...t,caption:!1},o),je(o,t.alt,t.isDecorative),t.caption){const e=be.create("figure",{class:"image"});return e.appendChild(o),e.appendChild(be.create("figcaption",{contentEditable:"true"},"Caption")),e.contentEditable="false",e}return o},Ze=(e,t)=>({src:xe(t,"src"),alt:Pe(t),title:xe(t,"title"),width:De(t,"width"),height:De(t,"height"),class:xe(t,"class"),style:e(xe(t,"style")),caption:Ce(t),hspace:ve(t),vspace:ye(t),border:we(t),borderStyle:Be(t),isDecorative:Ie(t)}),Ue=(e,t,o,n,r)=>{o[n]!==t[n]&&r(e,n,String(o[n]))},je=(e,t,o)=>{if(o){be.setAttrib(e,"role","presentation");const t=Z.fromDom(e);L(t,"alt","")}else{if(u(t)){const t=Z.fromDom(e);H(t,"alt")}else{const o=Z.fromDom(e);L(o,"alt",t)}"presentation"===be.getAttrib(e,"role")&&be.setAttrib(e,"role","")}},$e=(e,t,o)=>{o.alt===t.alt&&o.isDecorative===t.isDecorative||je(e,o.alt,o.isDecorative)},We=(e,t)=>(o,n,r)=>{e(o,r),Te(o,t)},qe=(e,t,o)=>{const n=Ze(e,o);Ue(o,n,t,"caption",((e,t,o)=>Oe(e))),Ue(o,n,t,"src",Se),Ue(o,n,t,"title",Se),Ue(o,n,t,"width",Ee("width",e)),Ue(o,n,t,"height",Ee("height",e)),Ue(o,n,t,"class",Se),Ue(o,n,t,"style",We(((e,t)=>Se(e,"style",t)),e)),Ue(o,n,t,"hspace",We(Ae,e)),Ue(o,n,t,"vspace",We(Me,e)),Ue(o,n,t,"border",We(Ne,e)),Ue(o,n,t,"borderStyle",We(Re,e)),$e(o,n,t)},Ge=(e,t)=>{const o=e.dom.styles.parse(t),n=me(o),r=e.dom.styles.parse(e.dom.styles.serialize(n));return e.dom.styles.serialize(r)},Ke=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||pe(t))?null:t},Ye=(e,t)=>{var o;const n=e.dom,r=O(e.schema.getTextBlockElements(),((t,o)=>!e.schema.isValidChild(o,"figure"))),s=n.getParent(t.parentNode,(e=>E(r,e.nodeName)),e.getBody());return s&&null!==(o=n.split(s,t))&&void 0!==o?o:t},Xe=e=>{const t=Ke(e);return t?Ze((t=>Ge(e,t)),t):ze()},Je=(e,t)=>{const o=Ve((t=>Ge(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),Le(n)){const t=Ye(e,n);e.selection.select(t)}else e.selection.select(n)},Qe=(e,t)=>{e.dom.setAttrib(t,"src",t.getAttribute("src"))},et=(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())}},tt=(e,t)=>{const o=Ke(e);if(o)if(qe((t=>Ge(e,t)),t,o),Qe(e,o),Le(o.parentNode)){const t=o.parentNode;Ye(e,t),e.selection.select(o.parentNode)}else e.selection.select(o),ge(e,t,o)},ot=(e,t)=>{const o=t.src;return{...t,src:fe(e,o)?o:""}},nt=(e,t)=>{const o=Ke(e);if(o){const n=Ze((t=>Ge(e,t)),o),r={...n,...t},s=ot(e,r);r.src?tt(e,s):et(e,o)}else t.src&&Je(e,{...ze(),...t})},rt=(e,t)=>{const o=d(e)&&d(t);return o?at(e,t):t},st=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)T(r,t)&&(o[t]=e(o[t],r[t]))}return o},at=st(rt);var it=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),lt=tinymce.util.Tools.resolve("tinymce.util.Tools");const ct=e=>l(e.value)?e.value:"",dt=e=>l(e.text)?e.text:l(e.title)?e.title:"",mt=(e,t)=>{const o=[];return lt.each(e,(e=>{const n=dt(e);if(void 0!==e.menu){const r=mt(e.menu,t);o.push({text:n,items:r})}else{const r=t(e);o.push({text:n,value:r})}})),o},ut=(e=ct)=>t=>t?w.from(t).map((t=>mt(t,e))):w.none(),gt=e=>ut(ct)(e),ht=e=>T(e,"items"),pt=(e,t)=>R(e,(e=>ht(e)?pt(e.items,t):e.value===t?w.some(e):w.none())),ft=(e,t)=>e.bind((e=>pt(e,t))),bt={sanitizer:ut,sanitize:gt,findEntry:ft},vt=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"}]}]}]}),yt={makeTab:vt},wt=e=>{const t=bt.sanitizer((t=>e.convertURL(t.value||t.url||"","src"))),o=new Promise((o=>{ue(e,(e=>{o(t(e).map((e=>A([[{text:"None",value:""}],e]))))}))})),n=bt.sanitize(J(e)),r=K(e),s=Y(e),a=se(e),i=ae(e),c=Xe(e),d=Q(e),m=ee(e),u=G(e),g=te(e),h=ne(e),p=re(e),f=w.some(X(e)).filter((e=>l(e)&&e.length>0));return o.then((e=>({image:c,imageList:e,classList:n,hasAdvTab:r,hasUploadTab:s,hasUploadUrl:a,hasUploadHandler:i,hasDescription:d,hasImageTitle:m,hasDimensions:u,hasImageCaption:g,prependURL:f,hasAccessibilityOptions:h,automaticUploads:p})))},xt=e=>{const t={name:"src",type:"urlinput",filetype:"image",label:"Source"},o=e.imageList.map((e=>({name:"images",type:"listbox",label:"Image list",items:e}))),n={name:"alt",type:"input",label:"Alternative description",enabled:!(e.hasAccessibilityOptions&&e.image.isDecorative)},r={name:"title",type:"input",label:"Image title"},s={name:"dimensions",type:"sizeinput"},a={type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]},i=e.classList.map((e=>({name:"classes",type:"listbox",label:"Class",items:e}))),l={type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]},c=e=>e?{type:"grid",columns:2}:{type:"panel"};return A([[t],o.toArray(),e.hasAccessibilityOptions&&e.hasDescription?[a]:[],e.hasDescription?[n]:[],e.hasImageTitle?[r]:[],e.hasDimensions?[s]:[],[{...c(e.classList.isSome()&&e.hasImageCaption),items:A([i.toArray(),e.hasImageCaption?[l]:[]])}]])},Ct=e=>({title:"General",name:"general",items:xt(e)}),St={makeTab:Ct,makeItems:xt},kt=e=>{const t=[{type:"dropzone",name:"fileinput"}];return{title:"Upload",name:"upload",items:t}},_t={makeTab:kt},Ot=e=>({prevImage:bt.findEntry(e.imageList,e.image.src),prevAlt:e.image.alt,open:!0}),Tt=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}),Et=(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}),Dt=(e,t)=>/^(?:[a-zA-Z]+:)?\/\//.test(t)?w.none():e.prependURL.bind((e=>t.substring(0,e.length)!==e?w.some(e+t):w.none())),At=(e,t)=>{const o=t.getData();Dt(e,o.src.value).each((e=>{t.setData({src:{value:e,meta:o.src.meta}})}))},Mt=(e,t,o)=>{e.hasDescription&&l(o.alt)&&(t.alt=o.alt),e.hasAccessibilityOptions&&(t.isDecorative=o.isDecorative||t.isDecorative||!1),e.hasImageTitle&&l(o.title)&&(t.title=o.title),e.hasDimensions&&(l(o.width)&&(t.dimensions.width=o.width),l(o.height)&&(t.dimensions.height=o.height)),l(o.class)&&bt.findEntry(e.classList,o.class).each((e=>{t.classes=e.value})),e.hasImageCaption&&g(o.caption)&&(t.caption=o.caption),e.hasAdvTab&&(l(o.style)&&(t.style=o.style),l(o.vspace)&&(t.vspace=o.vspace),l(o.border)&&(t.border=o.border),l(o.hspace)&&(t.hspace=o.hspace),l(o.borderstyle)&&(t.borderstyle=o.borderstyle))},Nt=(e,t)=>{const o=t.getData(),n=o.src.meta;if(void 0!==n){const r=at({},o);Mt(e,r,n),t.setData(r)}},Rt=(e,t,o,n)=>{const r=n.getData(),s=r.src.value,a=r.src.meta||{};a.width||a.height||!t.hasDimensions||($(s)?e.imageSize(s).then((e=>{o.open&&n.setData({dimensions:e})})).catch((e=>console.error(e))):n.setData({dimensions:{width:"",height:""}}))},Bt=(e,t,o)=>{const n=o.getData(),r=bt.findEntry(e.imageList,n.src.value);t.prevImage=r,o.setData({images:r.map((e=>e.value)).getOr("")})},Lt=(e,t,o,n)=>{At(t,n),Nt(t,n),Rt(e,t,o,n),Bt(t,o,n)},Ht=(e,t,o,n)=>{const r=n.getData(),s=bt.findEntry(t.imageList,r.images);s.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=s,Lt(e,t,o,n)},It=(e,t,o,n)=>{const r=n.getData();n.block("Uploading image"),N(r.fileinput).fold((()=>{n.unblock()}),(r=>{const s=URL.createObjectURL(r),a=()=>{n.unblock(),URL.revokeObjectURL(s)},i=r=>{n.setData({src:{value:r,meta:{}}}),n.showTab("general"),Lt(e,t,o,n)};he(r).then((o=>{const l=e.createBlobCache(r,s,o);t.automaticUploads?e.uploadImage(l).then((e=>{i(e.url),a()})).catch((t=>{a(),e.alertErr(t)})):(e.addToBlobCache(l),i(l.blobUri()),n.unblock())}))}))},Pt=(e,t,o)=>(n,r)=>{"src"===r.name?Lt(e,t,o,n):"images"===r.name?Ht(e,t,o,n):"alt"===r.name?o.prevAlt=n.getData().alt:"fileinput"===r.name?It(e,t,o,n):"isDecorative"===r.name&&n.setEnabled("alt",!n.getData().isDecorative)},zt=e=>()=>{e.open=!1},Ft=e=>{if(e.hasAdvTab||e.hasUploadUrl||e.hasUploadHandler){const t={type:"tabpanel",tabs:A([[St.makeTab(e)],e.hasAdvTab?[yt.makeTab(e)]:[],e.hasUploadTab&&(e.hasUploadUrl||e.hasUploadHandler)?[_t.makeTab(e)]:[]])};return t}{const t={type:"panel",items:St.makeItems(e)};return t}},Vt=(e,t,o)=>n=>{const r=at(Tt(t.image),n.getData()),s={...r,style:Fe(o.normalizeCss,Et(r,!1))};e.execCommand("mceUpdateImage",!1,Et(s,t.hasAccessibilityOptions)),e.editorUpload.uploadImagesAuto(),n.close()},Zt=e=>t=>fe(e,t)?le(e.documentBaseURI.toAbsolute(t)).then((e=>({width:String(e.width),height:String(e.height)}))):Promise.resolve({width:"",height:""}),Ut=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]})},jt=e=>t=>{e.editorUpload.blobCache.add(t)},$t=e=>t=>{e.windowManager.alert(t)},Wt=e=>t=>Ge(e,t),qt=e=>t=>e.dom.parseStyle(t),Gt=e=>(t,o)=>e.dom.serializeStyle(t,o),Kt=e=>t=>it(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]})),Yt=e=>{const t={imageSize:Zt(e),addToBlobCache:jt(e),createBlobCache:Ut(e),alertErr:$t(e),normalizeCss:Wt(e),parseStyle:qt(e),serializeStyle:Gt(e),uploadImage:Kt(e)},o=()=>{wt(e).then((o=>{const n=Ot(o);return{title:"Insert/Edit Image",size:"normal",body:Ft(o),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Tt(o.image),onSubmit:Vt(e,o,t),onChange:Pt(t,o,n),onClose:zt(n)}})).then(e.windowManager.open)};return{open:o}},Xt=e=>{e.addCommand("mceImage",Yt(e).open),e.addCommand("mceUpdateImage",((t,o)=>{e.undoManager.transact((()=>nt(e,o)))}))},Jt=e=>{const t=e.attr("class");return p(t)&&/\bimage\b/.test(t)},Qt=e=>t=>{let o=t.length;const n=t=>{t.attr("contenteditable",e?"true":null)};while(o--){const r=t[o];Jt(r)&&(r.attr("contenteditable",e?"false":null),lt.each(r.getAll("figcaption"),n))}},eo=e=>{e.on("PreInit",(()=>{e.parser.addNodeFilter("figure",Qt(!0)),e.serializer.addNodeFilter("figure",Qt(!1))}))},to=e=>{e.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:Yt(e).open,onSetup:t=>(t.setActive(p(Ke(e))),e.selection.selectorChangedWithUnbind("img:not([data-mce-object]):not([data-mce-placeholder]),figure.image",t.setActive).unbind)}),e.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:Yt(e).open}),e.ui.registry.addContextMenu("image",{update:e=>Le(e)||He(e)&&!pe(e)?["image"]:[]})};var oo=()=>{e.add("image",(e=>{q(e),eo(e),to(e),Xt(e)}))};oo()})()},378:function(e,t,o){o(95)},95:function(){(function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const 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=>{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},n=e=>t=>o(t)===e,r=e=>t=>typeof t===e,s=e=>t=>e===t,a=n("string"),i=n("object"),l=n("array"),c=s(null),d=r("boolean"),m=e=>null===e||void 0===e,u=e=>!m(e),g=r("function"),h=(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},p=()=>{},f=e=>()=>e,b=(e,t)=>e===t;class v{constructor(e,t){this.tag=e,this.value=t}static some(e){return new v(!0,e)}static none(){return v.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?v.some(e(this.value)):v.none()}bind(e){return this.tag?e(this.value):v.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:v.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&&void 0!==e?e:"Called getOrDie on None")}static from(e){return u(e)?v.some(e):v.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()"}}v.singletonNone=new v(!1);const y=Array.prototype.indexOf,w=Array.prototype.push,x=(e,t)=>y.call(e,t),C=(e,t)=>x(e,t)>-1,S=(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},k=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];t(n,o)}},_=(e,t,o)=>(k(e,((e,n)=>{o=t(o,e,n)})),o),O=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);w.apply(t,e[o])}return t},T=(e,t)=>O(S(e,t)),E=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome())return n}return v.none()},D=(e,t,o=b)=>e.exists((e=>o(e,t))),A=e=>{const t=[],o=e=>{t.push(e)};for(let n=0;n<e.length;n++)e[n].each(o);return t},M=(e,t)=>e?v.some(t):v.none(),N=e=>t=>t.options.get(e),R=e=>{const t=e.options.register;t("link_assume_external_targets",{processor:e=>{const t=a(e)||d(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=>a(e)||g(e)||h(e,i)}),t("link_default_target",{processor:"string"}),t("link_default_protocol",{processor:"string",default:"https"}),t("link_target_list",{processor:e=>d(e)||h(e,i),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})},B=N("link_assume_external_targets"),L=N("link_context_toolbar"),H=N("link_list"),I=N("link_default_target"),P=N("link_default_protocol"),z=N("link_target_list"),F=N("link_rel_list"),V=N("link_class_list"),Z=N("link_title"),U=N("allow_unsafe_link_target"),j=N("link_quicklink");var $=tinymce.util.Tools.resolve("tinymce.util.Tools");const W=e=>a(e.value)?e.value:"",q=e=>a(e.text)?e.text:a(e.title)?e.title:"",G=(e,t)=>{const o=[];return $.each(e,(e=>{const n=q(e);if(void 0!==e.menu){const r=G(e.menu,t);o.push({text:n,items:r})}else{const r=t(e);o.push({text:n,value:r})}})),o},K=(e=W)=>t=>v.from(t).map((t=>G(t,e))),Y=e=>K(W)(e),X=(e,t)=>o=>({name:e,type:"listbox",label:t,items:o}),J={sanitize:Y,sanitizeWith:K,createUi:X,getValue:W},Q=Object.keys,ee=Object.hasOwnProperty,te=(e,t)=>{const o=Q(e);for(let n=0,r=o.length;n<r;n++){const r=o[n],s=e[r];t(s,r)}},oe=e=>(t,o)=>{e[o]=t},ne=(e,t,o,n)=>{te(e,((e,r)=>{(t(e,r)?o:n)(e,r)}))},re=(e,t)=>{const o={};return ne(e,t,oe(o),p),o},se=(e,t)=>ee.call(e,t),ae=(e,t)=>se(e,t)&&void 0!==e[t]&&null!==e[t];var ie=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),le=tinymce.util.Tools.resolve("tinymce.util.URI");const ce=e=>u(e)&&"a"===e.nodeName.toLowerCase(),de=e=>ce(e)&&!!ge(e),me=(e,t)=>{if(e.collapsed)return[];{const o=e.cloneContents(),n=o.firstChild,r=new ie(n,o),s=[];let a=n;do{t(a)&&s.push(a)}while(a=r.next());return s}},ue=e=>/^\w+:/i.test(e),ge=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:""},he=(e,t)=>{const o=["noopener"],n=e?e.split(/\s+/):[],r=e=>$.trim(e.sort().join(" ")),s=e=>(e=a(e),e.length>0?e.concat(o):o),a=e=>e.filter((e=>-1===$.inArray(o,e))),i=t?s(n):a(n);return i.length>0?r(i):""},pe=e=>e.replace(/\uFEFF/g,""),fe=(e,t)=>(t=t||e.selection.getNode(),Ce(t)?v.from(e.dom.select("a[href]",t)[0]):v.from(e.dom.getParent(t,"a[href]"))),be=(e,t)=>fe(e,t).isSome(),ve=(e,t)=>{const o=t.fold((()=>e.getContent({format:"text"})),(e=>e.innerText||e.textContent||""));return pe(o)},ye=e=>$.grep(e,de).length>0,we=e=>me(e,de).length>0,xe=e=>{const t=e.schema.getTextInlineElements(),o=e=>1===e.nodeType&&!ce(e)&&!se(t,e.nodeName.toLowerCase()),n=fe(e).exists((e=>e.hasAttribute("data-mce-block")));if(n)return!1;const r=e.selection.getRng();if(r.collapsed)return!0;{const e=me(r,o);return 0===e.length}},Ce=e=>u(e)&&"FIGURE"===e.nodeName&&/\bimage\b/i.test(e.className),Se=e=>{const t=["title","rel","class","target"];return _(t,((t,o)=>(e[o].each((e=>{t[o]=e.length>0?e:null})),t)),{href:e.href})},ke=(e,t)=>"http"!==t&&"https"!==t||ue(e)?e:t+"://"+e,_e=(e,t)=>{const o={...t};if(0===F(e).length&&!U(e)){const e=he(o.rel,"_blank"===o.target);o.rel=e||null}return v.from(o.target).isNone()&&!1===z(e)&&(o.target=I(e)),o.href=ke(o.href,B(e)),o},Oe=(e,t,o,n)=>{o.each((e=>{se(t,"innerText")?t.innerText=e:t.textContent=e})),e.dom.setAttribs(t,n),e.selection.select(t)},Te=(e,t,o,n)=>{const r=e.dom;Ce(t)?He(r,t,n):o.fold((()=>{e.execCommand("mceInsertLink",!1,n)}),(t=>{e.insertContent(r.createHTML("a",n,r.encode(t)))}))},Ee=(e,t,o)=>{const n=e.selection.getNode(),r=fe(e,n),s=_e(e,Se(o));e.undoManager.transact((()=>{o.href===t.href&&t.attach(),r.fold((()=>{Te(e,n,o.text,s)}),(t=>{e.focus(),Oe(e,t,o.text,s)}))}))},De=e=>{const t=e.dom,o=e.selection,n=o.getBookmark(),r=o.getRng().cloneRange(),s=t.getParent(r.startContainer,"a[href]",e.getBody()),a=t.getParent(r.endContainer,"a[href]",e.getBody());s&&r.setStartBefore(s),a&&r.setEndAfter(a),o.setRng(r),e.execCommand("unlink"),o.moveToBookmark(n)},Ae=e=>{e.undoManager.transact((()=>{const t=e.selection.getNode();Ce(t)?Le(e,t):De(e),e.focus()}))},Me=e=>{const{class:t,href:o,rel:n,target:r,text:s,title:a}=e;return re({class:t.getOrNull(),href:o,rel:n.getOrNull(),target:r.getOrNull(),text:s.getOrNull(),title:a.getOrNull()},((e,t)=>!1===c(e)))},Ne=(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:le.isDomSafe(r,"a",n)?r:""}},Re=(e,t,o)=>{const n=Ne(e,o);e.hasPlugin("rtc",!0)?e.execCommand("createlink",!1,Me(n)):Ee(e,t,n)},Be=e=>{e.hasPlugin("rtc",!0)?e.execCommand("unlink"):Ae(e)},Le=(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))}},He=(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)}},Ie=e=>ae(e,"items"),Pe=(e,t)=>E(t,(t=>Ie(t)?Pe(e,t.items):M(t.value===e,t))),ze=(e,t,o,n)=>{const r=n[t],s=e.length>0;return void 0!==r?Pe(r,o).map((t=>({url:{value:t.value,meta:{text:s?e:t.text,attach:p}},text:s?e:t.text}))):v.none()},Fe=(e,t)=>"link"===t?e.link:"anchor"===t?e.anchor:v.none(),Ve=(e,t)=>{const o={text:e.text,title:e.title},n=e=>{var t;return M(o.title.length<=0,v.from(null===(t=e.meta)||void 0===t?void 0:t.title).getOr(""))},r=e=>{var t;return M(o.text.length<=0,v.from(null===(t=e.meta)||void 0===t?void 0:t.text).getOr(e.value))},s=e=>{const t=r(e.url),o=n(e.url);return t.isSome()||o.isSome()?v.some({...t.map((e=>({text:e}))).getOr({}),...o.map((e=>({title:e}))).getOr({})}):v.none()},a=(e,n)=>{const r=Fe(t,n).getOr([]);return ze(o.text,n,r,e)},i=(e,t)=>{const n=t.name;return"url"===n?s(e()):C(["anchor","link"],n)?a(e(),n):"text"===n||"title"===n?(o[n]=e()[n],v.none()):v.none()};return{onChange:i}},Ze={init:Ve,getDelta:ze};var Ue=tinymce.util.Tools.resolve("tinymce.util.Delay");const je=(e,t,o)=>{const n=e.selection.getRng();Ue.setEditorTimeout(e,(()=>{e.windowManager.confirm(t,(t=>{e.selection.setRng(n),o(t)}))}))},$e=e=>{const t=e.href,o=t.indexOf("@")>0&&-1===t.indexOf("/")&&-1===t.indexOf("mailto:");return o?v.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})}):v.none()},We=(e,t)=>o=>{const n=o.href,r=1===e&&!ue(n)||0===e&&/^\s*www(\.|\d\.)/i.test(n);return r?v.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})}):v.none()},qe=(e,t)=>E([$e,We(B(e),P(e))],(e=>e(t))).fold((()=>Promise.resolve(t)),(o=>new Promise((n=>{je(e,o.message,(e=>{n(e?o.preprocess(t):t)}))})))),Ge={preprocess:qe},Ke=e=>{const t=e.dom.select("a:not([href])"),o=T(t,(e=>{const t=e.name||e.id;return t?[{text:t,value:"#"+t}]:[]}));return o.length>0?v.some([{text:"None",value:""}].concat(o)):v.none()},Ye={getAnchors:Ke},Xe=e=>{const t=V(e);return t.length>0?J.sanitize(t):v.none()},Je={getClasses:Xe},Qe=e=>{try{return v.some(JSON.parse(e))}catch(t){return v.none()}},et=e=>{const t=t=>e.convertURL(t.value||t.url||"","href"),o=H(e);return new Promise((e=>{a(o)?fetch(o).then((e=>e.ok?e.text().then(Qe):Promise.reject())).then(e,(()=>e(v.none()))):g(o)?o((t=>e(v.some(t)))):e(v.from(o))})).then((e=>e.bind(J.sanitizeWith(t)).map((e=>{if(e.length>0){const t=[{text:"None",value:""}];return t.concat(e)}return e}))))},tt={getLinks:et},ot=(e,t)=>{const o=F(e);if(o.length>0){const n=D(t,"_blank"),r=!1===U(e),s=e=>he(J.getValue(e),n),a=r?J.sanitizeWith(s):J.sanitize;return a(o)}return v.none()},nt={getRels:ot},rt=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],st=e=>{const t=z(e);return l(t)?J.sanitize(t).orThunk((()=>v.some(rt))):!1===t?v.none():v.some(rt)},at={getTargets:st},it=(e,t,o)=>{const n=e.getAttrib(t,o);return null!==n&&n.length>0?v.some(n):v.none()},lt=(e,t)=>{const o=e.dom,n=xe(e),r=n?v.some(ve(e.selection,t)):v.none(),s=t.bind((e=>v.from(o.getAttrib(e,"href")))),a=t.bind((e=>v.from(o.getAttrib(e,"target")))),i=t.bind((e=>it(o,e,"rel"))),l=t.bind((e=>it(o,e,"class"))),c=t.bind((e=>it(o,e,"title")));return{url:s,text:r,title:c,target:a,rel:i,linkClass:l}},ct=(e,t)=>tt.getLinks(e).then((o=>{const n=lt(e,t);return{anchor:n,catalogs:{targets:at.getTargets(e),rels:nt.getRels(e,n.target),classes:Je.getClasses(e),anchor:Ye.getAnchors(e),link:o},optNode:t,flags:{titleEnabled:Z(e)}}})),dt={collect:ct},mt=(e,t)=>o=>{const n=o.getData();if(!n.url.value)return Be(e),void o.close();const r=e=>v.from(n[e]).filter((o=>!D(t.anchor[e],o))),s={href:n.url.value,text:r("text"),target:r("target"),rel:r("rel"),class:r("linkClass"),title:r("title")},a={href:n.url.value,attach:void 0!==n.url.meta&&n.url.meta.attach?n.url.meta.attach:p};Ge.preprocess(e,s).then((t=>{Re(e,a,t)})),o.close()},ut=e=>{const t=fe(e);return dt.collect(e,t)},gt=(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("")}},ht=(e,t,o)=>{const n=[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],r=e.anchor.text.map((()=>({name:"text",type:"input",label:"Text to display"}))).toArray(),s=e.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],a=v.from(I(o)),i=gt(e,a),l=e.catalogs,c=Ze.init(i,l),d={type:"panel",items:O([n,r,s,A([l.anchor.map(J.createUi("anchor","Anchors")),l.rels.map(J.createUi("rel","Rel")),l.targets.map(J.createUi("target","Open link in...")),l.link.map(J.createUi("link","Link list")),l.classes.map(J.createUi("linkClass","Class"))])])};return{title:"Insert/Edit Link",size:"normal",body:d,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i,onChange:(e,{name:t})=>{c.onChange(e.getData,{name:t}).each((t=>{e.setData(t)}))},onSubmit:t}},pt=e=>{const t=ut(e);t.then((t=>{const o=mt(e,t);return ht(t,o,e)})).then((t=>{e.windowManager.open(t)}))},ft=e=>{e.addCommand("mceLink",((t,o)=>{!0!==(null===o||void 0===o?void 0:o.dialog)&&j(e)?e.dispatch("contexttoolbar-show",{toolbarKey:"quicklink"}):pt(e)}))};var bt=tinymce.util.Tools.resolve("tinymce.util.VK");const vt=(e,t)=>{document.body.appendChild(e),e.dispatchEvent(t),document.body.removeChild(e)},yt=e=>{const t=document.createElement("a");t.target="_blank",t.href=e,t.rel="noreferrer noopener";const o=document.createEvent("MouseEvents");o.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),vt(t,o)},wt=(e,t)=>e.dom.getParent(t,"a[href]"),xt=e=>wt(e,e.selection.getStart()),Ct=e=>!0===e.altKey&&!1===e.shiftKey&&!1===e.ctrlKey&&!1===e.metaKey,St=(e,t)=>{if(t){const o=ge(t);if(/^#/.test(o)){const t=e.dom.select(o);t.length&&e.selection.scrollIntoView(t[0],!0)}else yt(t.href)}},kt=e=>()=>{e.execCommand("mceLink",!1,{dialog:!0})},_t=e=>()=>{St(e,xt(e))},Ot=e=>{e.on("click",(t=>{const o=wt(e,t.target);o&&bt.metaKeyPressed(t)&&(t.preventDefault(),St(e,o))})),e.on("keydown",(t=>{if(!t.isDefaultPrevented()&&13===t.keyCode&&Ct(t)){const o=xt(e);o&&(t.preventDefault(),St(e,o))}}))},Tt=(e,t)=>(e.on("NodeChange",t),()=>e.off("NodeChange",t)),Et=e=>t=>{const o=()=>t.setActive(!e.mode.isReadOnly()&&be(e,e.selection.getNode()));return o(),Tt(e,o)},Dt=e=>t=>{const o=()=>t.setEnabled(be(e,e.selection.getNode()));return o(),Tt(e,o)},At=e=>t=>{const o=t=>ye(t)||we(e.selection.getRng()),n=e.dom.getParents(e.selection.getStart());return t.setEnabled(o(n)),Tt(e,(e=>t.setEnabled(o(e.parents))))},Mt=e=>{e.addShortcut("Meta+K","",(()=>{e.execCommand("mceLink")}))},Nt=e=>{e.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:kt(e),onSetup:Et(e)}),e.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:_t(e),onSetup:Dt(e)}),e.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:()=>Be(e),onSetup:At(e)})},Rt=e=>{e.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:_t(e),onSetup:Dt(e)}),e.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:kt(e)}),e.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:()=>Be(e),onSetup:At(e)})},Bt=e=>{const t="link unlink openlink",o="link";e.ui.registry.addContextMenu("link",{update:n=>ye(e.dom.getParents(n,"a"))?t:o})},Lt=e=>{const t=e=>{e.selection.collapse(!1)},o=t=>{const o=e.selection.getNode();return t.setEnabled(be(e,o)),p},n=t=>{const o=fe(e),n=xe(e);if(o.isNone()&&n){const n=ve(e.selection,o);return v.some(n.length>0?n:t)}return v.none()};e.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Et(e)},label:"Link",predicate:t=>L(e)&&be(e,t),initValue:()=>{const t=fe(e);return t.fold(f(""),ge)},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:t=>{const o=e.selection.getNode();return t.setActive(be(e,o)),Et(e)(t)},onAction:o=>{const r=o.getValue(),s=n(r),a={href:r,attach:p};Re(e,a,{href:r,text:s,title:v.none(),rel:v.none(),target:v.none(),class:v.none()}),t(e),o.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:o,onAction:t=>{Be(e),t.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:o,onAction:t=>{_t(e)(),t.hide()}}]})};var Ht=()=>{e.add("link",(e=>{R(e),Nt(e),Rt(e),Bt(e),Lt(e),Ot(e),ft(e),Mt(e)}))};Ht()})()},5775:function(e,t,o){o(7524)},7524:function(){(function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const 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=>{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},n=e=>t=>o(t)===e,r=e=>t=>typeof t===e,s=n("string"),a=n("object"),i=n("array"),l=r("boolean"),c=e=>null===e||void 0===e,d=e=>!c(e),m=r("function"),u=r("number"),g=()=>{},h=e=>()=>e,p=(e,t)=>e===t,f=e=>t=>!e(t),b=h(!1);class v{constructor(e,t){this.tag=e,this.value=t}static some(e){return new v(!0,e)}static none(){return v.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?v.some(e(this.value)):v.none()}bind(e){return this.tag?e(this.value):v.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:v.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&&void 0!==e?e:"Called getOrDie on None")}static from(e){return d(e)?v.some(e):v.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()"}}v.singletonNone=new v(!1);const y=Array.prototype.slice,w=Array.prototype.indexOf,x=Array.prototype.push,C=(e,t)=>w.call(e,t),S=(e,t)=>C(e,t)>-1,k=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];if(t(n,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},O=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];t(n,o)}},T=(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},E=(e,t)=>{if(0===e.length)return[];{let o=t(e[0]);const n=[];let r=[];for(let s=0,a=e.length;s<a;s++){const a=e[s],i=t(a);i!==o&&(n.push(r),r=[]),o=i,r.push(a)}return 0!==r.length&&n.push(r),n}},D=(e,t,o)=>(O(e,((e,n)=>{o=t(o,e,n)})),o),A=(e,t,o)=>{for(let n=0,r=e.length;n<r;n++){const r=e[n];if(t(r,n))return v.some(r);if(o(r,n))break}return v.none()},M=(e,t)=>A(e,t,b),N=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!i(e[o]))throw new Error("Arr.flatten item "+o+" was not an array, input: "+e);x.apply(t,e[o])}return t},R=(e,t)=>N(_(e,t)),B=e=>{const t=y.call(e,0);return t.reverse(),t},L=(e,t)=>t>=0&&t<e.length?v.some(e[t]):v.none(),H=e=>L(e,0),I=e=>L(e,e.length-1),P=(e,t)=>{const o=[],n=m(t)?e=>k(o,(o=>t(o,e))):e=>S(o,e);for(let r=0,s=e.length;r<s;r++){const t=e[r];n(t)||o.push(t)}return o},z=(e,t,o=p)=>e.exists((e=>o(e,t))),F=(e,t,o=p)=>V(e,t,o).getOr(e.isNone()&&t.isNone()),V=(e,t,o)=>e.isSome()&&t.isSome()?v.some(o(e.getOrDie(),t.getOrDie())):v.none(),Z=1,U=(e,t)=>{const o=t||document,n=o.createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return W(n.childNodes[0])},j=(e,t)=>{const o=t||document,n=o.createElement(e);return W(n)},$=(e,t)=>{const o=t||document,n=o.createTextNode(e);return W(n)},W=e=>{if(null===e||void 0===e)throw new Error("Node cannot be null or undefined");return{dom:e}},q=(e,t,o)=>v.from(e.dom.elementFromPoint(t,o)).map(W),G={fromHtml:U,fromTag:j,fromText:$,fromDom:W,fromPoint:q},K=(e,t)=>{const o=e.dom;if(o.nodeType!==Z)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")}},Y=(e,t)=>e.dom===t.dom,X=(e,t)=>{const o=e.dom,n=t.dom;return o!==n&&o.contains(n)},J=K;var Q=(e,t,o,n,r)=>e(o,n)?v.some(o):m(r)&&r(o)?v.none():t(o,n,r);"undefined"!==typeof window?window:Function("return this;")();const ee=e=>{const t=e.dom.nodeName;return t.toLowerCase()},te=e=>e.dom.nodeType,oe=e=>t=>te(t)===e,ne=oe(Z),re=e=>t=>ne(t)&&ee(t)===e,se=e=>v.from(e.dom.parentNode).map(G.fromDom),ae=e=>v.from(e.dom.parentElement).map(G.fromDom),ie=e=>v.from(e.dom.nextSibling).map(G.fromDom),le=e=>_(e.dom.childNodes,G.fromDom),ce=(e,t)=>{const o=e.dom.childNodes;return v.from(o[t]).map(G.fromDom)},de=e=>ce(e,0),me=e=>ce(e,e.dom.childNodes.length-1),ue=(e,t,o)=>{let n=e.dom;const r=m(o)?o:b;while(n.parentNode){n=n.parentNode;const e=G.fromDom(n);if(t(e))return v.some(e);if(r(e))break}return v.none()},ge=(e,t,o)=>{const n=(e,t)=>t(e);return Q(n,ue,e,t,o)},he=(e,t)=>{const o=se(e);o.each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},pe=(e,t)=>{const o=ie(e);o.fold((()=>{const o=se(e);o.each((e=>{fe(e,t)}))}),(e=>{he(e,t)}))},fe=(e,t)=>{e.dom.appendChild(t.dom)},be=(e,t)=>{O(t,(t=>{he(e,t)}))},ve=(e,t)=>{O(t,(t=>{fe(e,t)}))},ye=e=>{e.dom.textContent="",O(le(e),(e=>{we(e)}))},we=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)};var xe=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Ce=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),Se=tinymce.util.Tools.resolve("tinymce.util.VK");const ke=e=>_(e,G.fromDom),_e=Object.keys,Oe=(e,t)=>{const o=_e(e);for(let n=0,r=o.length;n<r;n++){const r=o[n],s=e[r];t(s,r)}},Te=e=>(t,o)=>{e[o]=t},Ee=(e,t,o,n)=>{Oe(e,((e,r)=>{(t(e,r)?o:n)(e,r)}))},De=(e,t)=>{const o={};return Ee(e,t,Te(o),g),o},Ae=(e,t,o)=>{if(!(s(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+"")},Me=(e,t)=>{const o=e.dom;Oe(t,((e,t)=>{Ae(o,t,e)}))},Ne=e=>D(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}),Re=(e,t)=>G.fromDom(e.dom.cloneNode(t)),Be=e=>Re(e,!0),Le=(e,t)=>{const o=G.fromTag(t),n=Ne(e);return Me(o,n),o},He=(e,t)=>{const o=Le(e,t);pe(e,o);const n=le(e);return ve(o,n),we(e),o};var Ie=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Pe=tinymce.util.Tools.resolve("tinymce.util.Tools");const ze=e=>t=>d(t)&&t.nodeName.toLowerCase()===e,Fe=e=>t=>d(t)&&e.test(t.nodeName),Ve=e=>d(e)&&3===e.nodeType,Ze=e=>d(e)&&1===e.nodeType,Ue=Fe(/^(OL|UL|DL)$/),je=Fe(/^(OL|UL)$/),$e=ze("ol"),We=Fe(/^(LI|DT|DD)$/),qe=Fe(/^(DT|DD)$/),Ge=Fe(/^(TH|TD)$/),Ke=ze("br"),Ye=e=>{var t;return(null===(t=e.parentNode)||void 0===t?void 0:t.firstChild)===e},Xe=(e,t)=>d(t)&&t.nodeName in e.schema.getTextBlockElements(),Je=(e,t)=>d(e)&&e.nodeName in t,Qe=(e,t)=>!!Ke(t)&&(e.isBlock(t.nextSibling)&&!Ke(t.previousSibling)),et=(e,t,o)=>{const n=e.isEmpty(t);return!(o&&e.select("span[data-mce-type=bookmark]",t).length>0)&&n},tt=(e,t)=>e.isChildOf(t,e.getRoot()),ot=e=>t=>t.options.get(e),nt=e=>{const t=e.options.register;t("lists_indent_on_tab",{processor:"boolean",default:!0})},rt=ot("lists_indent_on_tab"),st=ot("forced_root_block"),at=ot("forced_root_block_attrs"),it=(e,t)=>{const o=e.dom,n=e.schema.getBlockElements(),r=o.createFragment(),s=st(e),a=at(e);let i,l,c=!1;l=o.create(s,a),Je(t.firstChild,n)||r.appendChild(l);while(i=t.firstChild){const e=i.nodeName;c||"SPAN"===e&&"bookmark"===i.getAttribute("data-mce-type")||(c=!0),Je(i,n)?(r.appendChild(i),l=null):(l||(l=o.create(s,a),r.appendChild(l)),l.appendChild(i))}return!c&&l&&l.appendChild(o.create("br",{"data-mce-bogus":"1"})),r},lt=Ie.DOM,ct=(e,t,o)=>{const n=e=>{const t=e.parentNode;t&&Pe.each(r,(e=>{t.insertBefore(e,o.parentNode)})),lt.remove(e)},r=lt.select('span[data-mce-type="bookmark"]',t),s=it(e,o),a=lt.createRng();a.setStartAfter(o),a.setEndAfter(t);const i=a.extractContents();for(let c=i.firstChild;c;c=c.firstChild)if("LI"===c.nodeName&&e.dom.isEmpty(c)){lt.remove(c);break}e.dom.isEmpty(i)||lt.insertAfter(i,t),lt.insertAfter(s,t);const l=o.parentElement;l&&et(e.dom,l)&&n(l),lt.remove(o),et(e.dom,t)&&lt.remove(t)},dt=re("dd"),mt=re("dt"),ut=(e,t)=>{dt(t)?He(t,"dt"):mt(t)&&ae(t).each((o=>ct(e,o.dom,t.dom)))},gt=e=>{mt(e)&&He(e,"dd")},ht=(e,t,o)=>{O(o,"Indent"===t?gt:t=>ut(e,t))},pt=(e,t)=>{if(Ve(e))return{container:e,offset:t};const o=xe.getNode(e,t);return Ve(o)?{container:o,offset:t>=e.childNodes.length?o.data.length:0}:o.previousSibling&&Ve(o.previousSibling)?{container:o.previousSibling,offset:o.previousSibling.data.length}:o.nextSibling&&Ve(o.nextSibling)?{container:o.nextSibling,offset:0}:{container:e,offset:t}},ft=e=>{const t=e.cloneRange(),o=pt(e.startContainer,e.startOffset);t.setStart(o.container,o.offset);const n=pt(e.endContainer,e.endOffset);return t.setEnd(n.container,n.offset),t},bt=["OL","UL","DL"],vt=bt.join(","),yt=(e,t)=>{const o=t||e.selection.getStart(!0);return e.dom.getParent(o,vt,Et(e,o))},wt=(e,t)=>d(e)&&1===t.length&&t[0]===e,xt=e=>T(e.querySelectorAll(vt),Ue),Ct=e=>{const t=yt(e),o=e.selection.getSelectedBlocks();return wt(t,o)?xt(t):T(o,(e=>Ue(e)&&t!==e))},St=(e,t)=>{const o=Pe.map(t,(t=>{const o=e.dom.getParent(t,"li,dd,dt",Et(e,t));return o||t}));return P(o)},kt=e=>{const t=e.selection.getSelectedBlocks();return T(St(e,t),We)},_t=e=>T(kt(e),qe),Ot=(e,t)=>{const o=e.dom.getParents(t,"TD,TH");return o.length>0?o[0]:e.getBody()},Tt=(e,t)=>!Ue(t)&&!We(t)&&k(bt,(o=>e.isValidChild(t.nodeName,o))),Et=(e,t)=>{const o=e.dom.getParents(t,e.dom.isBlock),n=M(o,(t=>Tt(e.schema,t)));return n.getOr(e.getBody())},Dt=(e,t)=>{const o=e.dom.getParents(t,"ol,ul",Et(e,t));return I(o)},At=e=>{const t=Dt(e,e.selection.getStart()),o=T(e.selection.getSelectedBlocks(),je);return t.toArray().concat(o)},Mt=e=>{const t=At(e);return Nt(e,t)},Nt=(e,t)=>{const o=_(t,(t=>Dt(e,t).getOr(t)));return P(o)},Rt=e=>/\btox\-/.test(e.className),Bt=(e,t)=>A(e,Ue,Ge).exists((e=>e.nodeName===t&&!Rt(e))),Lt=(e,t)=>null!==t&&"false"===e.dom.getContentEditableParent(t),Ht=e=>{const t=yt(e);return Lt(e,t)},It=(e,t)=>{const o=e.dom.getParent(t,"ol,ul,dl");return Lt(e,o)},Pt=(e,t)=>{const o=e.selection.getNode();return t({parents:e.dom.getParents(o),element:o}),e.on("NodeChange",t),()=>e.off("NodeChange",t)},zt=(e,t)=>{const o=t||document,n=o.createDocumentFragment();return O(e,(e=>{n.appendChild(e.dom)})),G.fromDom(n)},Ft=(e,t,o)=>e.dispatch("ListMutation",{action:t,element:o}),Vt=e=>t=>t.replace(e,""),Zt=Vt(/^\s+|\s+$/g),Ut=e=>e.length>0,jt=e=>!Ut(e),$t=e=>void 0!==e.style&&m(e.style.getPropertyValue),Wt=(e,t,o)=>{if(!s(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);$t(e)&&e.style.setProperty(t,o)},qt=(e,t,o)=>{const n=e.dom;Wt(n,t,o)},Gt=(e,t)=>{fe(e.item,t.list)},Kt=e=>{for(let t=1;t<e.length;t++)Gt(e[t-1],e[t])},Yt=(e,t)=>{V(I(e),H(t),Gt)},Xt=(e,t)=>{const o={list:G.fromTag(t,e),item:G.fromTag("li",e)};return fe(o.list,o.item),o},Jt=(e,t,o)=>{const n=[];for(let r=0;r<o;r++)n.push(Xt(e,t.listType));return n},Qt=(e,t)=>{for(let o=0;o<e.length-1;o++)qt(e[o].item,"list-style-type","none");I(e).each((e=>{Me(e.list,t.listAttributes),Me(e.item,t.itemAttributes),ve(e.item,t.content)}))},eo=(e,t)=>{ee(e.list)!==t.listType&&(e.list=He(e.list,t.listType)),Me(e.list,t.listAttributes)},to=(e,t,o)=>{const n=G.fromTag("li",e);return Me(n,t),ve(n,o),n},oo=(e,t)=>{fe(e.list,t),e.item=t},no=(e,t,o)=>{const n=t.slice(0,o.depth);return I(n).each((t=>{const n=to(e,o.itemAttributes,o.content);oo(t,n),eo(t,o)})),n},ro=(e,t,o)=>{const n=Jt(e,o,o.depth-t.length);return Kt(n),Qt(n,o),Yt(t,n),t.concat(n)},so=(e,t)=>{const o=D(t,((t,o)=>o.depth>t.length?ro(e,t,o):no(e,t,o)),[]);return H(o).map((e=>e.list))},ao=e=>J(e,"OL,UL"),io=e=>de(e).exists(ao),lo=e=>me(e).exists(ao),co=e=>e.depth>0,mo=e=>e.isSelected,uo=e=>{const t=le(e),o=lo(e)?t.slice(0,-1):t;return _(o,Be)},go=(e,t,o)=>se(e).filter(ne).map((n=>({depth:t,dirty:!1,isSelected:o,content:uo(e),itemAttributes:Ne(e),listAttributes:Ne(n),listType:ee(n)}))),ho=(e,t)=>{switch(e){case"Indent":t.depth++;break;case"Outdent":t.depth--;break;case"Flatten":t.depth=0}t.dirty=!0},po=(e,t)=>{e.listType=t.listType,e.listAttributes={...t.listAttributes}},fo=e=>{e.listAttributes=De(e.listAttributes,((e,t)=>"start"!==t))},bo=(e,t)=>{const o=e[t].depth,n=e=>e.depth===o&&!e.dirty,r=e=>e.depth<o;return A(B(e.slice(0,t)),n,r).orThunk((()=>A(e.slice(t+1),n,r)))},vo=e=>(O(e,((t,o)=>{bo(e,o).fold((()=>{t.dirty&&fo(t)}),(e=>po(t,e)))})),e),yo=e=>{let t=e;const o=()=>t,n=e=>{t=e};return{get:o,set:n}},wo=(e,t,o,n)=>de(n).filter(ao).fold((()=>{t.each((e=>{Y(e.start,n)&&o.set(!0)}));const r=go(n,e,o.get());t.each((e=>{Y(e.end,n)&&o.set(!1)}));const s=me(n).filter(ao).map((n=>xo(e,t,o,n))).getOr([]);return r.toArray().concat(s)}),(n=>xo(e,t,o,n))),xo=(e,t,o,n)=>R(le(n),(n=>{const r=ao(n)?xo:wo,s=e+1;return r(s,t,o,n)})),Co=(e,t)=>{const o=yo(!1),n=0;return _(e,(e=>({sourceList:e,entries:xo(n,t,o,e)})))},So=(e,t)=>{const o=vo(t);return _(o,(t=>{const o=zt(t.content);return G.fromDom(it(e,o.dom))}))},ko=(e,t)=>{const o=vo(t);return so(e.contentDocument,o).toArray()},_o=(e,t)=>R(E(t,co),(t=>{const o=H(t).exists(co);return o?ko(e,t):So(e,t)})),Oo=(e,t)=>{O(T(e,mo),(e=>ho(t,e)))},To=e=>{const t=_(kt(e),G.fromDom);return V(M(t,f(io)),M(B(t),f(io)),((e,t)=>({start:e,end:t})))},Eo=(e,t,o)=>{const n=Co(t,To(e));O(n,(t=>{Oo(t.entries,o);const n=_o(e,t.entries);O(n,(t=>{Ft(e,"Indent"===o?"IndentList":"OutdentList",t.dom)})),be(t.sourceList,n),we(t.sourceList)}))},Do=(e,t)=>{const o=ke(Mt(e)),n=ke(_t(e));let r=!1;if(o.length||n.length){const s=e.selection.getBookmark();Eo(e,o,t),ht(e,t,n),e.selection.moveToBookmark(s),e.selection.setRng(ft(e.selection.getRng())),e.nodeChanged(),r=!0}return r},Ao=(e,t)=>!Ht(e)&&Do(e,t),Mo=e=>Ao(e,"Indent"),No=e=>Ao(e,"Outdent"),Ro=e=>Ao(e,"Flatten");var Bo=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager");const Lo=Ie.DOM,Ho=e=>{const t={},o=o=>{let n=e[o?"startContainer":"endContainer"],r=e[o?"startOffset":"endOffset"];if(Ze(n)){const e=Lo.create("span",{"data-mce-type":"bookmark"});n.hasChildNodes()?(r=Math.min(r,n.childNodes.length-1),o?n.insertBefore(e,n.childNodes[r]):Lo.insertAfter(e,n.childNodes[r])):n.appendChild(e),n=e,r=0}t[o?"startContainer":"endContainer"]=n,t[o?"startOffset":"endOffset"]=r};return o(!0),e.collapsed||o(),t},Io=e=>{const t=t=>{const o=e=>{var t;let o=null===(t=e.parentNode)||void 0===t?void 0:t.firstChild,n=0;while(o){if(o===e)return n;Ze(o)&&"bookmark"===o.getAttribute("data-mce-type")||n++,o=o.nextSibling}return-1};let n=e[t?"startContainer":"endContainer"],r=e[t?"startOffset":"endOffset"];if(n){if(Ze(n)&&n.parentNode){const e=n;r=o(n),n=n.parentNode,Lo.remove(e),!n.hasChildNodes()&&Lo.isBlock(n)&&n.appendChild(Lo.create("br"))}e[t?"startContainer":"endContainer"]=n,e[t?"startOffset":"endOffset"]=r}};t(!0),t();const o=Lo.createRng();return o.setStart(e.startContainer,e.startOffset),e.endContainer&&o.setEnd(e.endContainer,e.endOffset),ft(o)},Po=e=>{switch(e){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},zo=(e,t,o)=>{const n=o["list-style-type"]?o["list-style-type"]:null;e.setStyle(t,"list-style-type",n)},Fo=(e,t)=>{Pe.each(t,((t,o)=>{e.setAttribute(o,t)}))},Vo=(e,t,o)=>{Fo(t,o["list-attributes"]),Pe.each(e.select("li",t),(e=>{Fo(e,o["list-item-attributes"])}))},Zo=(e,t,o)=>{zo(e,t,o),Vo(e,t,o)},Uo=(e,t,o)=>{Pe.each(o,(o=>e.setStyle(t,o,"")))},jo=(e,t,o,n)=>{let r=t[o?"startContainer":"endContainer"];const s=t[o?"startOffset":"endOffset"];Ze(r)&&(r=r.childNodes[Math.min(s,r.childNodes.length-1)]||r),!o&&Ke(r.nextSibling)&&(r=r.nextSibling);while(r.parentNode!==n){const t=r.parentNode;if(Xe(e,r))return r;if(/^(TD|TH)$/.test(t.nodeName))return r;r=t}return r},$o=(e,t,o)=>{const n=[],r=e.dom,s=jo(e,t,!0,o),a=jo(e,t,!1,o);let i;const l=[];for(let c=s;c;c=c.nextSibling)if(l.push(c),c===a)break;return Pe.each(l,(t=>{var s;if(Xe(e,t))return n.push(t),void(i=null);if(r.isBlock(t)||Ke(t))return Ke(t)&&r.remove(t),void(i=null);const a=t.nextSibling;Bo.isBookmarkNode(t)&&(Ue(a)||Xe(e,a)||!a&&t.parentNode===o)?i=null:(i||(i=r.create("p"),null===(s=t.parentNode)||void 0===s||s.insertBefore(i,t),n.push(i)),i.appendChild(t))})),n},Wo=(e,t,o)=>{const n=e.getStyle(t,"list-style-type");let r=o?o["list-style-type"]:"";return r=null===r?"":r,n===r},qo=(e,t,o)=>{const n=e.selection.getRng();let r="LI";const s=Et(e,e.selection.getStart(!0)),a=e.dom;if("false"===a.getContentEditable(e.selection.getNode()))return;t=t.toUpperCase(),"DL"===t&&(r="DT");const i=Ho(n),l=$o(e,n,s);Pe.each(l,(n=>{let s;const i=n.previousSibling,l=n.parentNode;We(l)||(i&&Ue(i)&&i.nodeName===t&&Wo(a,i,o)?(s=i,n=a.rename(n,r),i.appendChild(n)):(s=a.create(t),l.insertBefore(s,n),s.appendChild(n),n=a.rename(n,r)),Uo(a,n,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),Zo(a,s,o),Jo(e.dom,s))})),e.selection.setRng(Io(i))},Go=(e,t)=>Ue(e)&&e.nodeName===(null===t||void 0===t?void 0:t.nodeName),Ko=(e,t,o)=>{const n=e.getStyle(t,"list-style-type",!0),r=e.getStyle(o,"list-style-type",!0);return n===r},Yo=(e,t)=>e.className===t.className,Xo=(e,t,o)=>Go(t,o)&&Ko(e,t,o)&&Yo(t,o),Jo=(e,t)=>{let o,n=t.nextSibling;if(Xo(e,t,n)){const r=n;while(o=r.firstChild)t.appendChild(o);e.remove(r)}if(n=t.previousSibling,Xo(e,t,n)){const r=n;while(o=r.lastChild)t.insertBefore(o,t.firstChild);e.remove(r)}},Qo=(e,t,o,n)=>{if(t.nodeName!==o){const r=e.dom.rename(t,o);Zo(e.dom,r,n),Ft(e,Po(o),r)}else Zo(e.dom,t,n),Ft(e,Po(o),t)},en=(e,t,o,n,r)=>{const s=Ue(t);if(s&&t.nodeName===n&&!tn(r))Ro(e);else{qo(e,n,r);const a=Ho(e.selection.getRng()),i=s?[t,...o]:o;Pe.each(i,(t=>{Qo(e,t,n,r)})),e.selection.setRng(Io(a))}},tn=e=>"list-style-type"in e,on=(e,t,o,n)=>{if(t!==e.getBody())if(t)if(t.nodeName!==o||tn(n)||Rt(t)){const r=Ho(e.selection.getRng());Zo(e.dom,t,n);const s=e.dom.rename(t,o);Jo(e.dom,s),e.selection.setRng(Io(r)),qo(e,o,n),Ft(e,Po(o),s)}else Ro(e);else qo(e,o,n),Ft(e,Po(o),t)},nn=(e,t,o)=>{const n=yt(e);if(It(e,n))return;const r=Ct(e),s=a(o)?o:{};r.length>0?en(e,n,r,t,s):on(e,n,t,s)},rn=Ie.DOM,sn=(e,t)=>{const o=t.parentElement;if(o&&"LI"===o.nodeName&&o.firstChild===t){const n=o.previousSibling;n&&"LI"===n.nodeName?(n.appendChild(t),et(e,o)&&rn.remove(o)):rn.setStyle(o,"listStyleType","none")}if(Ue(o)){const e=o.previousSibling;e&&"LI"===e.nodeName&&e.appendChild(t)}},an=(e,t)=>{const o=Pe.grep(e.select("ol,ul",t));Pe.each(o,(t=>{sn(e,t)}))},ln=(e,t,o,n)=>{let r=t.startContainer;const s=t.startOffset;if(Ve(r)&&(o?s<r.data.length:s>0))return r;const a=e.schema.getNonEmptyElements();Ze(r)&&(r=xe.getNode(r,s));const i=new Ce(r,n);o&&Qe(e.dom,r)&&i.next();const l=o?i.next.bind(i):i.prev2.bind(i);while(r=l()){if("LI"===r.nodeName&&!r.hasChildNodes())return r;if(a[r.nodeName])return r;if(Ve(r)&&r.data.length>0)return r}return null},cn=(e,t)=>{const o=t.childNodes;return 1===o.length&&!Ue(o[0])&&e.isBlock(o[0])},dn=(e,t)=>{cn(e,t)&&e.remove(t.firstChild,!0)},mn=(e,t,o)=>{let n;const r=cn(e,o)?o.firstChild:o;if(dn(e,t),!et(e,t,!0))while(n=t.firstChild)r.appendChild(n)},un=(e,t,o)=>{let n;const r=t.parentNode;if(!tt(e,t)||!tt(e,o))return;Ue(o.lastChild)&&(n=o.lastChild),r===o.lastChild&&Ke(r.previousSibling)&&e.remove(r.previousSibling);const s=o.lastChild;s&&Ke(s)&&t.hasChildNodes()&&e.remove(s),et(e,o,!0)&&ye(G.fromDom(o)),mn(e,t,o),n&&o.appendChild(n);const a=X(G.fromDom(o),G.fromDom(t)),i=a?e.getParents(t,Ue,o):[];e.remove(t),O(i,(t=>{et(e,t)&&t!==e.getRoot()&&e.remove(t)}))},gn=(e,t,o)=>{ye(G.fromDom(o)),un(e.dom,t,o),e.selection.setCursorLocation(o,0)},hn=(e,t,o,n)=>{const r=e.dom;if(r.isEmpty(n))gn(e,o,n);else{const s=Ho(t);un(r,o,n),e.selection.setRng(Io(s))}},pn=(e,t,o,n)=>{const r=Ho(t);un(e.dom,o,n);const s=Io(r);e.selection.setRng(s)},fn=(e,t)=>{const o=e.dom,n=e.selection,r=n.getStart(),s=Ot(e,r),a=o.getParent(n.getStart(),"LI",s);if(a){const r=a.parentElement;if(r===e.getBody()&&et(o,r))return!0;const i=ft(n.getRng()),l=o.getParent(ln(e,i,t,s),"LI",s);if(l&&l!==a)return e.undoManager.transact((()=>{t?hn(e,i,l,a):Ye(a)?No(e):pn(e,i,a,l)})),!0;if(!l&&!t&&0===i.startOffset&&0===i.endOffset)return e.undoManager.transact((()=>{Ro(e)})),!0}return!1},bn=(e,t,o)=>{const n=e.getParent(t.parentNode,e.isBlock,o);e.remove(t),n&&e.isEmpty(n)&&e.remove(n)},vn=(e,t)=>{const o=e.dom,n=e.selection.getStart(),r=Ot(e,n),s=o.getParent(n,o.isBlock,r);if(s&&o.isEmpty(s)){const n=ft(e.selection.getRng()),a=o.getParent(ln(e,n,t,r),"LI",r);if(a){const i=e=>S(["td","th","caption"],ee(e)),l=e=>e.dom===r,c=ge(G.fromDom(a),i,l),d=ge(G.fromDom(n.startContainer),i,l);return!!F(c,d,Y)&&(e.undoManager.transact((()=>{bn(o,s,r),Jo(o,a.parentNode),e.selection.select(a,!0),e.selection.collapse(t)})),!0)}}return!1},yn=(e,t)=>fn(e,t)||vn(e,t),wn=e=>{const t=e.selection.getStart(),o=Ot(e,t),n=e.dom.getParent(t,"LI,DT,DD",o);return n||kt(e).length>0},xn=e=>!!wn(e)&&(e.undoManager.transact((()=>{e.execCommand("Delete"),an(e.dom,e.getBody())})),!0),Cn=(e,t)=>{const o=e.selection;return!It(e,o.getNode())&&(o.isCollapsed()?yn(e,t):xn(e))},Sn=e=>{e.on("ExecCommand",(t=>{const o=t.command.toLowerCase();"delete"!==o&&"forwarddelete"!==o||!wn(e)||an(e.dom,e.getBody())})),e.on("keydown",(t=>{t.keyCode===Se.BACKSPACE?Cn(e,!1)&&t.preventDefault():t.keyCode===Se.DELETE&&Cn(e,!0)&&t.preventDefault()}))},kn=e=>({backspaceDelete:t=>{Cn(e,t)}}),_n=(e,t)=>{const o=yt(e);null===o||It(e,o)||e.undoManager.transact((()=>{a(t.styles)&&e.dom.setStyles(o,t.styles),a(t.attrs)&&Oe(t.attrs,((t,n)=>e.dom.setAttrib(o,n,t)))}))},On=e=>{const t=B(Zt(e).split("")),o=_(t,((e,t)=>{const o=e.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,t)*o}));return D(o,((e,t)=>e+t),0)},Tn=e=>{if(e--,e<0)return"";{const t=e%26,o=Math.floor(e/26),n=Tn(o),r=String.fromCharCode("A".charCodeAt(0)+t);return n+r}},En=e=>/^[A-Z]+$/.test(e),Dn=e=>/^[a-z]+$/.test(e),An=e=>/^[0-9]+$/.test(e),Mn=e=>An(e)?2:En(e)?0:Dn(e)?1:jt(e)?3:4,Nn=e=>{switch(Mn(e)){case 2:return v.some({listStyleType:v.none(),start:e});case 0:return v.some({listStyleType:v.some("upper-alpha"),start:On(e).toString()});case 1:return v.some({listStyleType:v.some("lower-alpha"),start:On(e).toString()});case 3:return v.some({listStyleType:v.none(),start:""});case 4:return v.none()}},Rn=e=>{const t=parseInt(e.start,10);return z(e.listStyleType,"upper-alpha")?Tn(t):z(e.listStyleType,"lower-alpha")?Tn(t).toLowerCase():e.start},Bn=e=>{const t=yt(e);$e(t)&&!It(e,t)&&e.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:Rn({start:e.dom.getAttrib(t,"start","1"),listStyleType:v.from(e.dom.getStyle(t,"list-style-type"))})},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:t=>{const o=t.getData();Nn(o.start).each((t=>{e.execCommand("mceListUpdate",!1,{attrs:{start:"1"===t.start?"":t.start},styles:{"list-style-type":t.listStyleType.getOr("")}})})),t.close()}})},Ln=(e,t)=>()=>{const o=yt(e);return d(o)&&o.nodeName===t},Hn=e=>{e.addCommand("mceListProps",(()=>{Bn(e)}))},In=e=>{e.on("BeforeExecCommand",(t=>{const o=t.command.toLowerCase();"indent"===o?Mo(e):"outdent"===o&&No(e)})),e.addCommand("InsertUnorderedList",((t,o)=>{nn(e,"UL",o)})),e.addCommand("InsertOrderedList",((t,o)=>{nn(e,"OL",o)})),e.addCommand("InsertDefinitionList",((t,o)=>{nn(e,"DL",o)})),e.addCommand("RemoveList",(()=>{Ro(e)})),Hn(e),e.addCommand("mceListUpdate",((t,o)=>{a(o)&&_n(e,o)})),e.addQueryStateHandler("InsertUnorderedList",Ln(e,"UL")),e.addQueryStateHandler("InsertOrderedList",Ln(e,"OL")),e.addQueryStateHandler("InsertDefinitionList",Ln(e,"DL"))},Pn=e=>{e.on("keydown",(t=>{t.keyCode!==Se.TAB||Se.metaKeyPressed(t)||e.undoManager.transact((()=>{(t.shiftKey?No(e):Mo(e))&&t.preventDefault()}))}))},zn=e=>{rt(e)&&Pn(e),Sn(e)},Fn=(e,t)=>o=>{const n=n=>{o.setActive(Bt(n.parents,t)),o.setEnabled(!It(e,n.element))};return Pt(e,n)},Vn=e=>{const t=t=>()=>e.execCommand(t);e.hasPlugin("advlist")||(e.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:t("InsertOrderedList"),onSetup:Fn(e,"OL")}),e.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:t("InsertUnorderedList"),onSetup:Fn(e,"UL")}))},Zn=(e,t)=>o=>{const n=n=>o.setEnabled(Bt(n.parents,t)&&!It(e,n.element));return Pt(e,n)},Un=e=>{const t={text:"List properties...",icon:"ordered-list",onAction:()=>e.execCommand("mceListProps"),onSetup:Zn(e,"OL")};e.ui.registry.addMenuItem("listprops",t),e.ui.registry.addContextMenu("lists",{update:t=>{const o=yt(e,t);return $e(o)?["listprops"]:[]}})};var jn=()=>{e.add("lists",(e=>(nt(e),e.hasPlugin("rtc",!0)?Hn(e):(zn(e),In(e)),Vn(e),Un(e),kn(e))))};jn()})()},7426:function(e,t,o){o(4855)},4855:function(){(function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const 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=>{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},n=e=>t=>o(t)===e,r=n("string"),s=n("object"),a=n("array"),i=e=>null===e||void 0===e,l=e=>!i(e);class c{constructor(e,t){this.tag=e,this.value=t}static some(e){return new c(!0,e)}static none(){return c.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?c.some(e(this.value)):c.none()}bind(e){return this.tag?e(this.value):c.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:c.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&&void 0!==e?e:"Called getOrDie on None")}static from(e){return l(e)?c.some(e):c.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()"}}c.singletonNone=new c(!1);const d=Array.prototype.push,m=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];t(n,o)}},u=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);d.apply(t,e[o])}return t},g=e=>{let t=e;const o=()=>t,n=e=>{t=e};return{get:o,set:n}},h=Object.keys,p=Object.hasOwnProperty,f=(e,t)=>{const o=h(e);for(let n=0,r=o.length;n<r;n++){const r=o[n],s=e[r];t(s,r)}},b=(e,t)=>v(e,t)?c.from(e[t]):c.none(),v=(e,t)=>p.call(e,t),y=e=>t=>t.options.get(e),w=e=>{const t=e.options.register;t("audio_template_callback",{processor:"function"}),t("video_template_callback",{processor:"function"}),t("iframe_template_callback",{processor:"function"}),t("media_live_embeds",{processor:"boolean",default:!0}),t("media_filter_html",{processor:"boolean",default:!0}),t("media_url_resolver",{processor:"function"}),t("media_alt_source",{processor:"boolean",default:!0}),t("media_poster",{processor:"boolean",default:!0}),t("media_dimensions",{processor:"boolean",default:!0})},x=y("audio_template_callback"),C=y("video_template_callback"),S=y("iframe_template_callback"),k=y("media_live_embeds"),_=y("media_filter_html"),O=y("media_url_resolver"),T=y("media_alt_source"),E=y("media_poster"),D=y("media_dimensions");var A=tinymce.util.Tools.resolve("tinymce.util.Tools"),M=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),N=tinymce.util.Tools.resolve("tinymce.html.DomParser");const R=M.DOM,B=e=>e.replace(/px$/,""),L=e=>{const t=e.attr("style"),o=t?R.parseStyle(t):{};return{type:"ephox-embed-iri",source:e.attr("data-ephox-embed-iri"),altsource:"",poster:"",width:b(o,"max-width").map(B).getOr(""),height:b(o,"max-height").map(B).getOr("")}},H=(e,t)=>{let o={};const n=N({validate:!1,forced_root_block:!1},t),r=n.parse(e);for(let s=r;s;s=s.walk())if(1===s.type){const e=s.name;if(s.attr("data-ephox-embed-iri")){o=L(s);break}o.source||"param"!==e||(o.source=s.attr("movie")),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(o.type||(o.type=e),o=A.extend(s.attributes.map,o)),"script"===e&&(o={type:"script",source:s.attr("src")}),"source"===e&&(o.source?o.altsource||(o.altsource=s.attr("src")):o.source=s.attr("src")),"img"!==e||o.poster||(o.poster=s.attr("src"))}return o.source=o.source||o.src||"",o.altsource=o.altsource||"",o.poster=o.poster||"",o},I=e=>{var t;const o={mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"},n=null!==(t=e.toLowerCase().split(".").pop())&&void 0!==t?t:"";return b(o,n).getOr("")};var P=tinymce.util.Tools.resolve("tinymce.html.Node"),z=tinymce.util.Tools.resolve("tinymce.html.Serializer");const F=(e,t={})=>N({forced_root_block:!1,validate:!1,allow_conditional_comments:!0,...t},e),V=M.DOM,Z=e=>/^[0-9.]+$/.test(e)?e+"px":e,U=(e,t)=>{const o=t.attr("style"),n=o?V.parseStyle(o):{};l(e.width)&&(n["max-width"]=Z(e.width)),l(e.height)&&(n["max-height"]=Z(e.height)),t.attr("style",V.serializeStyle(n))},j=["source","altsource"],$=(e,t,o,n)=>{let r=0,s=0;const a=F(n);a.addNodeFilter("source",(e=>r=e.length));const i=a.parse(e);for(let l=i;l;l=l.walk())if(1===l.type){const e=l.name;if(l.attr("data-ephox-embed-iri")){U(t,l);break}switch(e){case"video":case"object":case"embed":case"img":case"iframe":void 0!==t.height&&void 0!==t.width&&(l.attr("width",t.width),l.attr("height",t.height));break}if(o)switch(e){case"video":l.attr("poster",t.poster),l.attr("src",null);for(let o=r;o<2;o++)if(t[j[o]]){const e=new P("source",1);e.attr("src",t[j[o]]),e.attr("type",t[j[o]+"mime"]||null),l.append(e)}break;case"iframe":l.attr("src",t.source);break;case"object":const e=l.getAll("img").length>0;if(t.poster&&!e){l.attr("src",t.poster);const e=new P("img",1);e.attr("src",t.poster),e.attr("width",t.width),e.attr("height",t.height),l.append(e)}break;case"source":if(s<2&&(l.attr("src",t[j[s]]),l.attr("type",t[j[s]+"mime"]||null),!t[j[s]])){l.remove();continue}s++;break;case"img":t.poster||l.remove();break}}return z({},n).serialize(i)},W=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$2?$4",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?title=0&amp;byline=0",allowFullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0},{regex:/dai\.ly\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],q=e=>{const t=e.match(/^(https?:\/\/|www\.)(.+)$/i);return t&&t.length>1?"www."===t[1]?"https://":t[1]:"https://"},G=(e,t)=>{const o=q(t),n=e.regex.exec(t);let r=o+e.url;if(l(n))for(let s=0;s<n.length;s++)r=r.replace("$"+s,(()=>n[s]?n[s]:""));return r.replace(/\?$/,"")},K=e=>{const t=W.filter((t=>t.regex.test(e)));return t.length>0?A.extend({},t[0],{url:G(t[0],e)}):null},Y=(e,t)=>{if(t)return t(e);{const t=e.allowfullscreen?' allowFullscreen="1"':"";return'<iframe src="'+e.source+'" width="'+e.width+'" height="'+e.height+'"'+t+"></iframe>"}},X=e=>{let t='<object data="'+e.source+'" width="'+e.width+'" height="'+e.height+'" type="application/x-shockwave-flash">';return e.poster&&(t+='<img src="'+e.poster+'" width="'+e.width+'" height="'+e.height+'" />'),t+="</object>",t},J=(e,t)=>t?t(e):'<audio controls="controls" src="'+e.source+'">'+(e.altsource?'\n<source src="'+e.altsource+'"'+(e.altsourcemime?' type="'+e.altsourcemime+'"':"")+" />\n":"")+"</audio>",Q=(e,t)=>t?t(e):'<video width="'+e.width+'" height="'+e.height+'"'+(e.poster?' poster="'+e.poster+'"':"")+' controls="controls">\n<source src="'+e.source+'"'+(e.sourcemime?' type="'+e.sourcemime+'"':"")+" />\n"+(e.altsource?'<source src="'+e.altsource+'"'+(e.altsourcemime?' type="'+e.altsourcemime+'"':"")+" />\n":"")+"</video>",ee=e=>'<script src="'+e.source+'"><\/script>',te=(e,t)=>{var o;const n=A.extend({},t);if(!n.source&&(A.extend(n,H(null!==(o=n.embed)&&void 0!==o?o:"",e.schema)),!n.source))return"";n.altsource||(n.altsource=""),n.poster||(n.poster=""),n.source=e.convertURL(n.source,"source"),n.altsource=e.convertURL(n.altsource,"source"),n.sourcemime=I(n.source),n.altsourcemime=I(n.altsource),n.poster=e.convertURL(n.poster,"poster");const r=K(n.source);if(r&&(n.source=r.url,n.type=r.type,n.allowfullscreen=r.allowFullscreen,n.width=n.width||String(r.w),n.height=n.height||String(r.h)),n.embed)return $(n.embed,n,!0,e.schema);{const t=x(e),o=C(e),r=S(e);return n.width=n.width||"300",n.height=n.height||"150",A.each(n,((t,o)=>{n[o]=e.dom.encode(""+t)})),"iframe"===n.type?Y(n,r):"application/x-shockwave-flash"===n.sourcemime?X(n):-1!==n.sourcemime.indexOf("audio")?J(n,t):"script"===n.type?ee(n):Q(n,o)}},oe=e=>e.hasAttribute("data-mce-object")||e.hasAttribute("data-ephox-embed-iri"),ne=e=>{e.on("click keyup touchend",(()=>{const t=e.selection.getNode();t&&e.dom.hasClass(t,"mce-preview-object")&&e.dom.getAttrib(t,"data-mce-selected")&&t.setAttribute("data-mce-selected","2")})),e.on("ObjectSelected",(e=>{const t=e.target.getAttribute("data-mce-object");"script"===t&&e.preventDefault()})),e.on("ObjectResized",(t=>{const o=t.target;if(o.getAttribute("data-mce-object")){let n=o.getAttribute("data-mce-html");n&&(n=unescape(n),o.setAttribute("data-mce-html",escape($(n,{width:String(t.width),height:String(t.height)},!1,e.schema))))}}))},re={},se=(e,t,o)=>new Promise(((n,r)=>{const s=o=>(o.html&&(re[e.source]=o),n({url:e.source,html:o.html?o.html:t(e)}));re[e.source]?s(re[e.source]):o({url:e.source},s,r)})),ae=(e,t)=>Promise.resolve({html:t(e),url:e.source}),ie=e=>t=>te(e,t),le=(e,t)=>{const o=O(e);return o?se(t,ie(e),o):ae(t,ie(e))},ce=e=>v(re,e),de=(e,t)=>b(t,e).bind((e=>b(e,"meta"))),me=(e,t,o)=>n=>{const r=()=>b(e,n),a=()=>b(t,n),i=e=>b(e,"value").bind((e=>e.length>0?c.some(e):c.none())),l=()=>r().bind((e=>s(e)?i(e).orThunk(a):a().orThunk((()=>c.from(e))))),d=()=>a().orThunk((()=>r().bind((e=>s(e)?i(e):c.from(e)))));return{[n]:(n===o?l():d()).getOr("")}},ue=(e,t)=>{const o={};return b(e,"dimensions").each((e=>{m(["width","height"],(n=>{b(t,n).orThunk((()=>b(e,n))).each((e=>o[n]=e))}))})),o},ge=(e,t)=>{const o=t&&"dimensions"!==t?de(t,e).getOr({}):{},n=me(e,o,t);return{...n("source"),...n("altsource"),...n("poster"),...n("embed"),...ue(e,o)}},he=e=>{const t={...e,source:{value:b(e,"source").getOr("")},altsource:{value:b(e,"altsource").getOr("")},poster:{value:b(e,"poster").getOr("")}};return m(["width","height"],(o=>{b(e,o).each((e=>{const n=t.dimensions||{};n[o]=e,t.dimensions=n}))})),t},pe=e=>t=>{const o=t&&t.msg?"Media embed handler error: "+t.msg:"Media embed handler threw unknown error.";e.notificationManager.open({type:"error",text:o})},fe=e=>{const t=e.selection.getNode(),o=oe(t)?e.serializer.serialize(t,{selection:!0}):"";return{embed:o,...H(o,e.schema)}},be=(e,t)=>o=>{if(r(o.url)&&o.url.trim().length>0){const n=o.html,r=H(n,t.schema),s={...r,source:o.url,embed:n};e.setData(he(s))}},ve=(e,t)=>{const o=e.dom.select("*[data-mce-object]");for(let n=0;n<t.length;n++)for(let e=o.length-1;e>=0;e--)t[n]===o[e]&&o.splice(e,1);e.selection.select(o[0])},ye=(e,t)=>{const o=e.dom.select("*[data-mce-object]");e.insertContent(t),ve(e,o),e.nodeChanged()},we=(e,t,o)=>{var n;t.embed=$(null!==(n=t.embed)&&void 0!==n?n:"",t,!1,o.schema),t.embed&&(e.source===t.source||ce(t.source))?ye(o,t.embed):le(o,t).then((e=>{ye(o,e.html)})).catch(pe(o))},xe=e=>{const t=fe(e),o=g(t),n=he(t),r=(t,o)=>{const n=ge(o.getData(),"source");t.source!==n.source&&(be(v,e)({url:n.source,html:""}),le(e,n).then(be(v,e)).catch(pe(e)))},s=t=>{var o;const n=ge(t.getData()),r=H(null!==(o=n.embed)&&void 0!==o?o:"",e.schema);t.setData(he(r))},a=(t,o)=>{const n=ge(t.getData(),o),r=te(e,n);t.setData(he({...n,embed:r}))},i=[{name:"source",type:"urlinput",filetype:"media",label:"Source"}],l=D(e)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],c={title:"General",name:"general",items:u([i,l])},d={type:"textarea",name:"embed",label:"Paste your embed code below:"},m={title:"Embed",items:[d]},h=[];T(e)&&h.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),E(e)&&h.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});const p={title:"Advanced",name:"advanced",items:h},f=[c,m];h.length>0&&f.push(p);const b={type:"tabpanel",tabs:f},v=e.windowManager.open({title:"Insert/Edit Media",size:"normal",body:b,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:t=>{const n=ge(t.getData());we(o.get(),n,e),t.close()},onChange:(e,t)=>{switch(t.name){case"source":r(o.get(),e);break;case"embed":s(e);break;case"dimensions":case"altsource":case"poster":a(e,t.name);break}o.set(ge(e.getData()))},initialData:n})},Ce=e=>{const t=()=>{xe(e)};return{showDialog:t}},Se=e=>{const t=()=>{xe(e)};e.addCommand("mceMedia",t)},ke=(e,t,o)=>""===t||e.length>=t.length&&e.substr(o,o+t.length)===t,_e=(e,t)=>ke(e,t,0);var Oe=tinymce.util.Tools.resolve("tinymce.Env");const Te=e=>{const t=e.name;return"iframe"===t||"video"===t||"audio"===t},Ee=(e,t,o,n=null)=>{const r=e.attr(o);return l(r)?r:v(t,o)?null:n},De=(e,t,o)=>{const n="img"===t.name||"video"===e.name,r=n?"300":null,s="audio"===e.name?"30":"150",a=n?s:null;t.attr({width:Ee(e,o,"width",r),height:Ee(e,o,"height",a)})},Ae=(e,t,o,n)=>{const r=F(e.schema).parse(n,{context:t});while(r.firstChild)o.append(r.firstChild)},Me=(e,t)=>{const o=t.name,n=new P("img",1);return Re(e,t,n),De(t,n,{}),n.attr({style:t.attr("style"),src:Oe.transparentSrc,"data-mce-object":o,class:"mce-object mce-object-"+o}),n},Ne=(e,t)=>{var o;const n=t.name,r=new P("span",1);r.attr({contentEditable:"false",style:t.attr("style"),"data-mce-object":n,class:"mce-preview-object mce-object-"+n}),Re(e,t,r);const s=e.dom.parseStyle(null!==(o=t.attr("style"))&&void 0!==o?o:""),a=new P(n,1);if(De(t,a,s),a.attr({src:t.attr("src"),style:t.attr("style"),class:t.attr("class")}),"iframe"===n)a.attr({allowfullscreen:t.attr("allowfullscreen"),frameborder:"0"});else{const o=["controls","crossorigin","currentTime","loop","muted","poster","preload"];m(o,(e=>{a.attr(e,t.attr(e))}));const s=r.attr("data-mce-html");l(s)&&Ae(e,n,a,unescape(s))}const i=new P("span",1);return i.attr("class","mce-shim"),r.append(a),r.append(i),r},Re=(e,t,o)=>{var n;const r=null!==(n=t.attributes)&&void 0!==n?n:[];let s=r.length;while(s--){const t=r[s].name;let n=r[s].value;"width"===t||"height"===t||"style"===t||_e(t,"data-mce-")||("data"!==t&&"src"!==t||(n=e.convertURL(n,t)),o.attr("data-mce-p-"+t,n))}const a=z({inner:!0},e.schema),i=new P("div",1);m(t.children(),(e=>i.append(e)));const l=a.serialize(i);l&&(o.attr("data-mce-html",escape(l)),o.empty())},Be=e=>{const t=e.attr("class");return r(t)&&/\btiny-pageembed\b/.test(t)},Le=e=>{let t=e;while(t=t.parent)if(t.attr("data-ephox-embed-iri")||Be(t))return!0;return!1},He=e=>t=>{let o,n=t.length;while(n--)o=t[n],o.parent&&(o.parent.attr("data-mce-object")||(Te(o)&&k(e)?Le(o)||o.replace(Ne(e,o)):Le(o)||o.replace(Me(e,o))))},Ie=(e,t,o)=>{const n=_(e);return F(e.schema,{validate:n}).parse(o,{context:t})},Pe=e=>{e.on("PreInit",(()=>{const{schema:t,serializer:o,parser:n}=e,r=t.getBoolAttrs();m("webkitallowfullscreen mozallowfullscreen".split(" "),(e=>{r[e]={}})),f({embed:["wmode"]},((e,o)=>{const n=t.getElementRule(o);n&&m(e,(e=>{n.attributes[e]={},n.attributesOrder.push(e)}))})),n.addNodeFilter("iframe,video,audio,object,embed,script",He(e)),o.addAttributeFilter("data-mce-object",((t,o)=>{var n;let r=t.length;while(r--){const s=t[r];if(!s.parent)continue;const a=s.attr(o),i=new P(a,1);if("audio"!==a&&"script"!==a){const e=s.attr("class");e&&-1!==e.indexOf("mce-preview-object")&&s.firstChild?i.attr({width:s.firstChild.attr("width"),height:s.firstChild.attr("height")}):i.attr({width:s.attr("width"),height:s.attr("height")})}i.attr({style:s.attr("style")});const l=null!==(n=s.attributes)&&void 0!==n?n:[];let c=l.length;while(c--){const e=l[c].name;0===e.indexOf("data-mce-p-")&&i.attr(e.substr(11),l[c].value)}"script"===a&&i.attr("type","text/javascript");const d=s.attr("data-mce-html");if(d){const t=Ie(e,a,unescape(d));m(t.children(),(e=>i.append(e)))}s.replace(i)}}))})),e.on("SetContent",(()=>{const t=e.dom;m(t.select("span.mce-preview-object"),(e=>{0===t.select("span.mce-shim",e).length&&t.add(e,"span",{class:"mce-shim"})}))}))},ze=e=>{e.on("ResolveName",(e=>{let t;1===e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)}))},Fe=e=>{const t=()=>e.execCommand("mceMedia");e.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:t,onSetup:t=>{const o=e.selection;return t.setActive(oe(o.getNode())),o.selectorChangedWithUnbind("img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]",t.setActive).unbind}}),e.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:t})};var Ve=()=>{e.add("media",(e=>(w(e),Se(e),Fe(e),ze(e),Pe(e),ne(e),Ce(e))))};Ve()})()},6912:function(e,t,o){o(5645)},5645:function(){(function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env");const o=e=>t=>t.options.get(e),n=e=>{const t=e.options.register;t("pagebreak_separator",{processor:"string",default:"\x3c!-- pagebreak --\x3e"}),t("pagebreak_split_block",{processor:"boolean",default:!1})},r=o("pagebreak_separator"),s=o("pagebreak_split_block"),a="mce-pagebreak",i=e=>{const o=`<img src="${t.transparentSrc}" class="${a}" data-mce-resize="false" data-mce-placeholder />`;return e?`<p>${o}</p>`:o},l=e=>{const t=r(e),o=()=>s(e),n=new RegExp(t.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,(e=>"\\"+e)),"gi");e.on("BeforeSetContent",(e=>{e.content=e.content.replace(n,i(o()))})),e.on("PreInit",(()=>{e.serializer.addNodeFilter("img",(n=>{let r,s,i=n.length;while(i--)if(r=n[i],s=r.attr("class"),s&&-1!==s.indexOf(a)){const n=r.parent;if(n&&e.schema.getBlockElements()[n.name]&&o()){n.type=3,n.value=t,n.raw=!0,r.remove();continue}r.type=3,r.value=t,r.raw=!0}}))}))},c=e=>{e.addCommand("mcePageBreak",(()=>{e.insertContent(i(s(e)))}))},d=e=>{e.on("ResolveName",(t=>{"IMG"===t.target.nodeName&&e.dom.hasClass(t.target,a)&&(t.name="pagebreak")}))},m=e=>{const t=()=>e.execCommand("mcePageBreak");e.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:t}),e.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:t})};var u=()=>{e.add("pagebreak",(e=>{n(e),c(e),m(e),l(e),d(e)}))};u()})()},9638:function(e,t,o){o(2171)},2171:function(){(function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),o=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=e=>t=>t.options.get(e),r=n("content_style"),s=n("content_css_cors"),a=n("body_class"),i=n("body_id"),l=e=>{var n;let l="";const c=e.dom.encode,d=null!==(n=r(e))&&void 0!==n?n:"";l+='<base href="'+c(e.documentBaseURI.getURI())+'">';const m=s(e)?' crossorigin="anonymous"':"";o.each(e.contentCSS,(t=>{l+='<link type="text/css" rel="stylesheet" href="'+c(e.documentBaseURI.toAbsolute(t))+'"'+m+">"})),d&&(l+='<style type="text/css">'+d+"</style>");const u=i(e),g=a(e),h=t.os.isMacOS()||t.os.isiOS()?"e.metaKey":"e.ctrlKey && !e.altKey",p='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+h+")) {e.preventDefault();}}}, false);<\/script> ",f=e.getBody().dir,b=f?' dir="'+c(f)+'"':"",v="<!DOCTYPE html><html><head>"+l+'</head><body id="'+c(u)+'" class="mce-content-body '+c(g)+'"'+b+">"+e.getContent()+p+"</body></html>";return v},c=e=>{const t=l(e),o=e.windowManager.open({title:"Preview",size:"large",body:{type:"panel",items:[{name:"preview",type:"iframe",sandboxed:!0,transparent:!1}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{preview:t}});o.focus("close")},d=e=>{e.addCommand("mcePreview",(()=>{c(e)}))},m=e=>{const t=()=>e.execCommand("mcePreview");e.ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:t}),e.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:t})};var u=()=>{e.add("preview",(e=>{d(e),m(e)}))};u()})()},987:function(e,t,o){o(4176)},4176:function(){(function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const 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=>{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},n=e=>t=>o(t)===e,r=e=>t=>typeof t===e,s=n("string"),a=r("boolean"),i=e=>null===e||void 0===e,l=e=>!i(e),c=r("function"),d=e=>t=>t.options.get(e),m=e=>{const t=e.options.register,o=e=>t=>{const o=a(t)||s(t);return o?a(t)?{value:t?e:"",valid:o}:{value:t.trim(),valid:o}:{valid:!1,message:"Must be a boolean or string."}},n="bold italic | quicklink h2 h3 blockquote";t("quickbars_selection_toolbar",{processor:o(n),default:n});const r="quickimage quicktable";t("quickbars_insert_toolbar",{processor:o(r),default:r});const i="alignleft aligncenter alignright";t("quickbars_image_toolbar",{processor:o(i),default:i})},u=d("quickbars_selection_toolbar"),g=d("quickbars_insert_toolbar"),h=d("quickbars_image_toolbar");let p=0;const f=e=>{const t=new Date,o=t.getTime(),n=Math.floor(1e9*Math.random());return p++,e+"_"+n+p+String(o)},b=(e,t,o)=>{e.execCommand("mceInsertTable",!1,{rows:o,columns:t})},v=(e,t,o)=>{const n=e.editorUpload.blobCache,r=n.create(f("mceu"),o,t);n.add(r),e.insertContent(e.dom.createHTML("img",{src:r.blobUri()}))},y=e=>new Promise((t=>{const o=new FileReader;o.onloadend=()=>{t(o.result.split(",")[1])},o.readAsDataURL(e)}));var w=tinymce.util.Tools.resolve("tinymce.Env"),x=tinymce.util.Tools.resolve("tinymce.util.Delay");const C=e=>new Promise((t=>{const o=document.createElement("input");o.type="file",o.accept="image/*",o.style.position="fixed",o.style.left="0",o.style.top="0",o.style.opacity="0.001",document.body.appendChild(o);const n=e=>{t(Array.prototype.slice.call(e.target.files))};o.addEventListener("change",n);const r=n=>{const s=()=>{var e;t([]),null===(e=o.parentNode)||void 0===e||e.removeChild(o)};w.os.isAndroid()&&"remove"!==n.type?x.setEditorTimeout(e,s,0):s(),e.off("focusin remove",r)};e.on("focusin remove",r),o.click()})),S=e=>{e.ui.registry.addButton("quickimage",{icon:"image",tooltip:"Insert image",onAction:()=>{C(e).then((t=>{if(t.length>0){const o=t[0];y(o).then((t=>{v(e,t,o)}))}}))}}),e.ui.registry.addButton("quicktable",{icon:"table",tooltip:"Insert table",onAction:()=>{b(e,2,2)}})},k=e=>()=>e,_=k(!1);class O{constructor(e,t){this.tag=e,this.value=t}static some(e){return new O(!0,e)}static none(){return O.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?O.some(e(this.value)):O.none()}bind(e){return this.tag?e(this.value):O.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:O.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&&void 0!==e?e:"Called getOrDie on None")}static from(e){return l(e)?O.some(e):O.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()"}}O.singletonNone=new O(!1),"undefined"!==typeof window?window:Function("return this;")();const T=1,E=e=>{const t=e.dom.nodeName;return t.toLowerCase()},D=(e,t)=>{const o=e.dom;return!(!o||!o.hasAttribute)&&o.hasAttribute(t)};var A=(e,t,o,n,r)=>e(o,n)?O.some(o):c(r)&&r(o)?O.none():t(o,n,r);const M=(e,t)=>{const o=t||document,n=o.createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return B(n.childNodes[0])},N=(e,t)=>{const o=t||document,n=o.createElement(e);return B(n)},R=(e,t)=>{const o=t||document,n=o.createTextNode(e);return B(n)},B=e=>{if(null===e||void 0===e)throw new Error("Node cannot be null or undefined");return{dom:e}},L=(e,t,o)=>O.from(e.dom.elementFromPoint(t,o)).map(B),H={fromHtml:M,fromTag:N,fromText:R,fromDom:B,fromPoint:L},I=(e,t)=>{const o=e.dom;if(o.nodeType!==T)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")}},P=(e,t,o)=>{let n=e.dom;const r=c(o)?o:_;while(n.parentNode){n=n.parentNode;const e=H.fromDom(n);if(t(e))return O.some(e);if(r(e))break}return O.none()},z=(e,t,o)=>{const n=(e,t)=>t(e);return A(n,P,e,t,o)},F=(e,t,o)=>z(e,t,o).isSome(),V=(e,t,o)=>P(e,(e=>I(e,t)),o),Z=(e,t,o)=>{const n=(e,t)=>I(e,t);return A(n,V,e,t,o)},U=e=>{const t=g(e);t.length>0&&e.ui.registry.addContextToolbar("quickblock",{predicate:t=>{const o=H.fromDom(t),n=e.schema.getTextBlockElements(),r=t=>t.dom===e.getBody();return!D(o,"data-mce-bogus")&&Z(o,'table,[data-mce-bogus="all"]',r).fold((()=>F(o,(t=>E(t)in n&&e.dom.isEmpty(t.dom)),r)),_)},items:t,position:"line",scope:"editor"})},j=e=>{const t=t=>"false"!==e.dom.getContentEditableParent(t),o=e=>"IMG"===e.nodeName||"FIGURE"===e.nodeName&&/image/i.test(e.className),n=h(e);n.length>0&&e.ui.registry.addContextToolbar("imageselection",{predicate:o,items:n,position:"node"});const r=u(e);r.length>0&&e.ui.registry.addContextToolbar("textselection",{predicate:n=>!o(n)&&!e.selection.isCollapsed()&&t(n),items:r,position:"selection",scope:"editor"})};var $=()=>{e.add("quickbars",(e=>{m(e),S(e),U(e),j(e)}))};$()})()},1694:function(e,t,o){o(7235)},7235:function(){(function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const 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=>{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},n=e=>t=>o(t)===e,r=e=>t=>typeof t===e,s=e=>t=>e===t,a=n("string"),i=n("array"),l=r("boolean"),c=s(void 0),d=e=>null===e||void 0===e,m=e=>!d(e),u=r("function"),g=r("number"),h=()=>{},p=(e,t)=>o=>e(t(o)),f=e=>()=>e,b=e=>e,v=(e,t)=>e===t;function y(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const w=e=>{e()},x=f(!1),C=f(!0);class S{constructor(e,t){this.tag=e,this.value=t}static some(e){return new S(!0,e)}static none(){return S.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?S.some(e(this.value)):S.none()}bind(e){return this.tag?e(this.value):S.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:S.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&&void 0!==e?e:"Called getOrDie on None")}static from(e){return m(e)?S.some(e):S.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()"}}S.singletonNone=new S(!1);const k=Object.keys,_=Object.hasOwnProperty,O=(e,t)=>{const o=k(e);for(let n=0,r=o.length;n<r;n++){const r=o[n],s=e[r];t(s,r)}},T=e=>(t,o)=>{e[o]=t},E=(e,t,o,n)=>{O(e,((e,r)=>{(t(e,r)?o:n)(e,r)}))},D=(e,t)=>{const o={};return E(e,t,T(o),h),o},A=(e,t)=>{const o=[];return O(e,((e,n)=>{o.push(t(e,n))})),o},M=e=>A(e,b),N=e=>k(e).length,R=(e,t)=>B(e,t)?S.from(e[t]):S.none(),B=(e,t)=>_.call(e,t),L=(e,t)=>B(e,t)&&void 0!==e[t]&&null!==e[t],H=Array.prototype.indexOf,I=Array.prototype.push,P=(e,t)=>H.call(e,t),z=(e,t)=>P(e,t)>-1,F=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];if(t(n,o))return!0}return!1},V=(e,t)=>{const o=[];for(let n=0;n<e;n++)o.push(t(n));return o},Z=(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},U=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];t(n,o)}},j=(e,t)=>{for(let o=e.length-1;o>=0;o--){const n=e[o];t(n,o)}},$=(e,t)=>{const o=[],n=[];for(let r=0,s=e.length;r<s;r++){const s=e[r],a=t(s,r)?o:n;a.push(s)}return{pass:o,fail:n}},W=(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},q=(e,t,o)=>(j(e,((e,n)=>{o=t(o,e,n)})),o),G=(e,t,o)=>(U(e,((e,n)=>{o=t(o,e,n)})),o),K=(e,t,o)=>{for(let n=0,r=e.length;n<r;n++){const r=e[n];if(t(r,n))return S.some(r);if(o(r,n))break}return S.none()},Y=(e,t)=>K(e,t,x),X=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!i(e[o]))throw new Error("Arr.flatten item "+o+" was not an array, input: "+e);I.apply(t,e[o])}return t},J=(e,t)=>X(Z(e,t)),Q=(e,t)=>{for(let o=0,n=e.length;o<n;++o){const n=e[o];if(!0!==t(n,o))return!1}return!0},ee=(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},te=(e,t)=>t>=0&&t<e.length?S.some(e[t]):S.none(),oe=e=>te(e,0),ne=e=>te(e,e.length-1),re=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome())return n}return S.none()},se=(e,t)=>{const o=t||document,n=o.createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return le(n.childNodes[0])},ae=(e,t)=>{const o=t||document,n=o.createElement(e);return le(n)},ie=(e,t)=>{const o=t||document,n=o.createTextNode(e);return le(n)},le=e=>{if(null===e||void 0===e)throw new Error("Node cannot be null or undefined");return{dom:e}},ce=(e,t,o)=>S.from(e.dom.elementFromPoint(t,o)).map(le),de={fromHtml:se,fromTag:ae,fromText:ie,fromDom:le,fromPoint:ce};"undefined"!==typeof window?window:Function("return this;")();const me=8,ue=9,ge=11,he=1,pe=3,fe=e=>{const t=e.dom.nodeName;return t.toLowerCase()},be=e=>e.dom.nodeType,ve=e=>t=>be(t)===e,ye=e=>be(e)===me||"#comment"===fe(e),we=ve(he),xe=ve(pe),Ce=ve(ue),Se=ve(ge),ke=e=>t=>we(t)&&fe(t)===e,_e=(e,t)=>{const o=e.dom;if(o.nodeType!==he)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")}},Oe=e=>e.nodeType!==he&&e.nodeType!==ue&&e.nodeType!==ge||0===e.childElementCount,Te=(e,t)=>{const o=void 0===t?document:t.dom;return Oe(o)?[]:Z(o.querySelectorAll(e),de.fromDom)},Ee=(e,t)=>{const o=void 0===t?document:t.dom;return Oe(o)?S.none():S.from(o.querySelector(e)).map(de.fromDom)},De=(e,t)=>e.dom===t.dom,Ae=_e,Me=e=>de.fromDom(e.dom.ownerDocument),Ne=e=>Ce(e)?e:Me(e),Re=e=>S.from(e.dom.parentNode).map(de.fromDom),Be=(e,t)=>{const o=u(t)?t:x;let n=e.dom;const r=[];while(null!==n.parentNode&&void 0!==n.parentNode){const e=n.parentNode,t=de.fromDom(e);if(r.push(t),!0===o(t))break;n=e}return r},Le=e=>S.from(e.dom.previousSibling).map(de.fromDom),He=e=>S.from(e.dom.nextSibling).map(de.fromDom),Ie=e=>Z(e.dom.childNodes,de.fromDom),Pe=(e,t)=>{const o=e.dom.childNodes;return S.from(o[t]).map(de.fromDom)},ze=e=>Pe(e,0),Fe=e=>Se(e)&&m(e.dom.host),Ve=u(Element.prototype.attachShadow)&&u(Node.prototype.getRootNode),Ze=Ve?e=>de.fromDom(e.dom.getRootNode()):Ne,Ue=e=>{const t=Ze(e);return Fe(t)?S.some(t):S.none()},je=e=>de.fromDom(e.dom.host),$e=e=>{const t=xe(e)?e.dom.parentNode:e.dom;if(void 0===t||null===t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return Ue(de.fromDom(t)).fold((()=>o.body.contains(t)),p($e,je))},We=(e,t)=>W(Ie(e),t),qe=(e,t)=>{let o=[];return U(Ie(e),(e=>{t(e)&&(o=o.concat([e])),o=o.concat(qe(e,t))})),o},Ge=(e,t)=>We(e,(e=>_e(e,t))),Ke=(e,t)=>Te(t,e);var Ye=(e,t,o,n,r)=>e(o,n)?S.some(o):u(r)&&r(o)?S.none():t(o,n,r);const Xe=(e,t,o)=>{let n=e.dom;const r=u(o)?o:x;while(n.parentNode){n=n.parentNode;const e=de.fromDom(n);if(t(e))return S.some(e);if(r(e))break}return S.none()},Je=(e,t)=>{const o=e=>t(de.fromDom(e)),n=Y(e.dom.childNodes,o);return n.map(de.fromDom)},Qe=(e,t,o)=>Xe(e,(e=>_e(e,t)),o),et=(e,t)=>Je(e,(e=>_e(e,t))),tt=(e,t)=>Ee(t,e),ot=(e,t,o)=>{const n=(e,t)=>_e(e,t);return Ye(n,Qe,e,t,o)},nt=(e,t,o)=>{if(!(a(o)||l(o)||g(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+"")},rt=(e,t,o)=>{nt(e.dom,t,o)},st=(e,t)=>{const o=e.dom;O(t,((e,t)=>{nt(o,t,e)}))},at=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},it=(e,t)=>S.from(at(e,t)),lt=(e,t)=>{e.dom.removeAttribute(t)},ct=e=>G(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}),dt=(e,t,o=v)=>e.exists((e=>o(e,t))),mt=e=>{const t=[],o=e=>{t.push(e)};for(let n=0;n<e.length;n++)e[n].each(o);return t},ut=(e,t,o)=>e.isSome()&&t.isSome()?S.some(o(e.getOrDie(),t.getOrDie())):S.none(),gt=e=>e.bind(b),ht=(e,t)=>e?S.some(t):S.none(),pt=(e,t)=>e.substring(t),ft=(e,t,o)=>""===t||e.length>=t.length&&e.substr(o,o+t.length)===t,bt=(e,t)=>vt(e,t)?pt(e,t.length):e,vt=(e,t)=>ft(e,t,0),yt=e=>t=>t.replace(e,""),wt=yt(/^\s+|\s+$/g),xt=e=>e.length>0,Ct=e=>!xt(e),St=(e,t=10)=>{const o=parseInt(e,t);return isNaN(o)?S.none():S.some(o)},kt=e=>{const t=parseFloat(e);return isNaN(t)?S.none():S.some(t)},_t=e=>void 0!==e.style&&u(e.style.getPropertyValue),Ot=(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);_t(e)&&e.style.setProperty(t,o)},Tt=(e,t)=>{_t(e)&&e.style.removeProperty(t)},Et=(e,t,o)=>{const n=e.dom;Ot(n,t,o)},Dt=(e,t)=>{const o=e.dom,n=window.getComputedStyle(o),r=n.getPropertyValue(t);return""!==r||$e(e)?r:At(o,t)},At=(e,t)=>_t(e)?e.style.getPropertyValue(t):"",Mt=(e,t)=>{const o=e.dom,n=At(o,t);return S.from(n).filter((e=>e.length>0))},Nt=(e,t)=>{const o=e.dom;Tt(o,t),dt(it(e,"style").map(wt),"")&&lt(e,"style")},Rt=(e,t,o=0)=>it(e,t).map((e=>parseInt(e,10))).getOr(o),Bt=(e,t)=>Lt(e,t,C),Lt=(e,t,o)=>J(Ie(e),(e=>_e(e,t)?o(e)?[e]:[]:Lt(e,t,o))),Ht=["tfoot","thead","tbody","colgroup"],It=e=>z(Ht,e),Pt=(e,t)=>({rows:e,columns:t}),zt=(e,t,o)=>({element:e,rowspan:t,colspan:o}),Ft=(e,t,o,n,r,s)=>({element:e,rowspan:t,colspan:o,row:n,column:r,isLocked:s}),Vt=(e,t,o)=>({element:e,cells:t,section:o}),Zt=(e,t,o,n)=>({startRow:e,startCol:t,finishRow:o,finishCol:n}),Ut=(e,t,o)=>({element:e,colspan:t,column:o}),jt=(e,t)=>({element:e,columns:t}),$t=(e,t,o=x)=>{if(o(t))return S.none();if(z(e,fe(t)))return S.some(t);const n=e=>_e(e,"table")||o(e);return Qe(t,e.join(","),n)},Wt=(e,t)=>$t(["td","th"],e,t),qt=e=>Bt(e,"th,td"),Gt=e=>_e(e,"colgroup")?Ge(e,"col"):J(Xt(e),(e=>Ge(e,"col"))),Kt=(e,t)=>ot(e,"table",t),Yt=e=>Bt(e,"tr"),Xt=e=>Kt(e).fold(f([]),(e=>Ge(e,"colgroup"))),Jt=(e,t)=>Z(e,(e=>{if("colgroup"===fe(e)){const t=Z(Gt(e),(e=>{const t=Rt(e,"span",1);return zt(e,1,t)}));return Vt(e,t,"colgroup")}{const o=Z(qt(e),(e=>{const t=Rt(e,"rowspan",1),o=Rt(e,"colspan",1);return zt(e,t,o)}));return Vt(e,o,t(e))}})),Qt=e=>Re(e).map((e=>{const t=fe(e);return It(t)?t:"tbody"})).getOr("tbody"),eo=e=>{const t=Yt(e),o=Xt(e),n=[...o,...t];return Jt(n,Qt)},to="data-snooker-locked-cols",oo=e=>it(e,to).bind((e=>S.from(e.match(/\d+/g)))).map((e=>ee(e,C))),no=(e,t)=>e+","+t,ro=(e,t,o)=>S.from(e.access[no(t,o)]),so=(e,t,o)=>{const n=ao(e,(e=>o(t,e.element)));return n.length>0?S.some(n[0]):S.none()},ao=(e,t)=>{const o=J(e.all,(e=>e.cells));return W(o,t)},io=e=>{const t={};let o=0;return U(e.cells,(e=>{const n=e.colspan;V(n,(r=>{const s=o+r;t[s]=Ut(e.element,n,s)})),o+=n})),t},lo=e=>{const t={},o=[],n=oe(e).map((e=>e.element)).bind(Kt),r=n.bind(oo).getOr({});let s=0,a=0,i=0;const{pass:l,fail:c}=$(e,(e=>"colgroup"===e.section));U(c,(e=>{const n=[];U(e.cells,(e=>{let o=0;while(void 0!==t[no(i,o)])o++;const s=L(r,o.toString()),l=Ft(e.element,e.rowspan,e.colspan,i,o,s);for(let n=0;n<e.colspan;n++)for(let r=0;r<e.rowspan;r++){const e=i+r,s=o+n,c=no(e,s);t[c]=l,a=Math.max(a,s+1)}n.push(l)})),s++,o.push(Vt(e.element,n,e.section)),i++}));const{columns:d,colgroups:m}=ne(l).map((e=>{const t=io(e),o=jt(e.element,M(t));return{colgroups:[o],columns:t}})).getOrThunk((()=>({colgroups:[],columns:{}}))),u=Pt(s,a);return{grid:u,access:t,all:o,columns:d,colgroups:m}},co=e=>{const t=eo(e);return lo(t)},mo=e=>J(e.all,(e=>e.cells)),uo=e=>M(e.columns),go=e=>k(e.columns).length>0,ho=(e,t)=>S.from(e.columns[t]),po={fromTable:co,generate:lo,getAt:ro,findItem:so,filterItems:ao,justCells:mo,justColumns:uo,hasColumns:go,getColumnAt:ho};var fo=tinymce.util.Tools.resolve("tinymce.util.Tools");const bo=(e,t,o)=>{const n=e.select("td,th",t);let r;for(let s=0;s<n.length;s++){const t=e.getStyle(n[s],o);if(c(r)&&(r=t),r!==t)return""}return r},vo=(e,t,o)=>{fo.each("left center right".split(" "),(n=>{n!==o&&e.formatter.remove("align"+n,{},t)})),o&&e.formatter.apply("align"+o,{},t)},yo=(e,t,o)=>{fo.each("top middle bottom".split(" "),(n=>{n!==o&&e.formatter.remove("valign"+n,{},t)})),o&&e.formatter.apply("valign"+o,{},t)},wo=(e,t,o)=>{e.dispatch("TableModified",{...o,table:t})},xo=(e,t)=>kt(e).getOr(t),Co=(e,t,o)=>xo(Dt(e,t),o),So=(e,t,o,n)=>{const r=Co(e,`padding-${o}`,0),s=Co(e,`padding-${n}`,0),a=Co(e,`border-${o}-width`,0),i=Co(e,`border-${n}-width`,0);return t-r-s-a-i},ko=(e,t)=>{const o=e.dom,n=o.getBoundingClientRect().width||o.offsetWidth;return"border-box"===t?n:So(e,n,"left","right")},_o=e=>ko(e,"content-box"),Oo=_o;var To=tinymce.util.Tools.resolve("tinymce.Env");const Eo="tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol",Do=V(5,(e=>{const t=`${e+1}px`;return{title:t,value:t}})),Ao=Z(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],(e=>({title:e,value:e.toLowerCase()}))),Mo="100%",No=e=>{var t;const o=e.dom,n=null!==(t=o.getParent(e.selection.getStart(),o.isBlock))&&void 0!==t?t:e.getBody();return Oo(de.fromDom(n))+"px"},Ro=(e,t)=>Qo(e)||!$o(e)?t:Jo(e)?{...t,width:No(e)}:{...t,width:Mo},Bo=(e,t)=>Qo(e)||$o(e)?t:Jo(e)?{...t,width:No(e)}:{...t,width:Mo},Lo=e=>t=>t.options.get(e),Ho=e=>{const t=e.options.register;t("table_border_widths",{processor:"object[]",default:Do}),t("table_border_styles",{processor:"object[]",default:Ao}),t("table_cell_advtab",{processor:"boolean",default:!0}),t("table_row_advtab",{processor:"boolean",default:!0}),t("table_advtab",{processor:"boolean",default:!0}),t("table_appearance_options",{processor:"boolean",default:!0}),t("table_grid",{processor:"boolean",default:!To.deviceType.isTouch()}),t("table_cell_class_list",{processor:"object[]",default:[]}),t("table_row_class_list",{processor:"object[]",default:[]}),t("table_class_list",{processor:"object[]",default:[]}),t("table_toolbar",{processor:"string",default:Eo}),t("table_background_color_map",{processor:"object[]",default:[]}),t("table_border_color_map",{processor:"object[]",default:[]})},Io=Lo("table_sizing_mode"),Po=Lo("table_border_widths"),zo=Lo("table_border_styles"),Fo=Lo("table_cell_advtab"),Vo=Lo("table_row_advtab"),Zo=Lo("table_advtab"),Uo=Lo("table_appearance_options"),jo=Lo("table_grid"),$o=Lo("table_style_by_css"),Wo=Lo("table_cell_class_list"),qo=Lo("table_row_class_list"),Go=Lo("table_class_list"),Ko=Lo("table_toolbar"),Yo=Lo("table_background_color_map"),Xo=Lo("table_border_color_map"),Jo=e=>"fixed"===Io(e),Qo=e=>"responsive"===Io(e),en=e=>{const t=e.options,o=t.get("table_default_styles");return t.isSet("table_default_styles")?o:Ro(e,o)},tn=e=>{const t=e.options,o=t.get("table_default_attributes");return t.isSet("table_default_attributes")?o:Bo(e,o)},on=e=>e.nodeName.toLowerCase(),nn=e=>de.fromDom(e.getBody()),rn=e=>t=>De(t,nn(e)),sn=e=>e?e.replace(/px$/,""):"",an=e=>/^\d+(\.\d+)?$/.test(e)?e+"px":e,ln=e=>de.fromDom(e.selection.getStart()),cn=e=>de.fromDom(e.selection.getEnd()),dn=(e,t)=>t.column>=e.startCol&&t.column+t.colspan-1<=e.finishCol&&t.row>=e.startRow&&t.row+t.rowspan-1<=e.finishRow,mn=(e,t)=>{let o=!0;const n=y(dn,t);for(let r=t.startRow;r<=t.finishRow;r++)for(let s=t.startCol;s<=t.finishCol;s++)o=o&&po.getAt(e,r,s).exists(n);return o?S.some(t):S.none()},un=(e,t)=>Zt(Math.min(e.row,t.row),Math.min(e.column,t.column),Math.max(e.row+e.rowspan-1,t.row+t.rowspan-1),Math.max(e.column+e.colspan-1,t.column+t.colspan-1)),gn=(e,t,o)=>{const n=po.findItem(e,t,De),r=po.findItem(e,o,De);return n.bind((e=>r.map((t=>un(e,t)))))},hn=(e,t,o)=>gn(e,t,o).bind((t=>mn(e,t))),pn=(e,t,o)=>{const n=fn(e);return hn(n,t,o)},fn=po.fromTable,bn=(e,t)=>{const o=Re(e);o.each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},vn=(e,t)=>{const o=He(e);o.fold((()=>{const o=Re(e);o.each((e=>{wn(e,t)}))}),(e=>{bn(e,t)}))},yn=(e,t)=>{const o=ze(e);o.fold((()=>{wn(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))},wn=(e,t)=>{e.dom.appendChild(t.dom)},xn=(e,t)=>{bn(e,t),wn(t,e)},Cn=(e,t)=>{U(t,((o,n)=>{const r=0===n?e:t[n-1];vn(r,o)}))},Sn=(e,t)=>{U(t,(t=>{wn(e,t)}))},kn=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},_n=e=>{const t=Ie(e);t.length>0&&Cn(e,t),kn(e)},On=(e,t)=>{const o=o=>{if(!e(o))throw new Error("Can only get "+t+" value of a "+t+" node");return n(o).getOr("")},n=t=>e(t)?S.from(t.dom.nodeValue):S.none(),r=(o,n)=>{if(!e(o))throw new Error("Can only set raw "+t+" value of a "+t+" node");o.dom.nodeValue=n};return{get:o,getOption:n,set:r}},Tn=On(xe,"text"),En=e=>Tn.get(e),Dn=(e,t)=>Tn.set(e,t);var An=["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"],Mn=()=>{const e=e=>de.fromDom(e.dom.cloneNode(!1)),t=e=>Ne(e).dom,o=e=>!!we(e)&&("body"===fe(e)||z(An,fe(e))),n=e=>!!we(e)&&z(["br","img","hr","input"],fe(e)),r=e=>we(e)&&"false"===at(e,"contenteditable"),s=(e,t)=>e.dom.compareDocumentPosition(t.dom),a=(e,t)=>{const o=ct(e);st(t,o)},i=e=>{const t=fe(e);return z(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],t)},l=e=>we(e)?it(e,"lang"):S.none();return{up:f({selector:Qe,closest:ot,predicate:Xe,all:Be}),down:f({selector:Ke,predicate:qe}),styles:f({get:Dt,getRaw:Mt,set:Et,remove:Nt}),attrs:f({get:at,set:rt,remove:lt,copyTo:a}),insert:f({before:bn,after:vn,afterAll:Cn,append:wn,appendAll:Sn,prepend:yn,wrap:xn}),remove:f({unwrap:_n,remove:kn}),create:f({nu:de.fromTag,clone:e,text:de.fromText}),query:f({comparePosition:s,prevSibling:Le,nextSibling:He}),property:f({children:Ie,name:fe,parent:Re,document:t,isText:xe,isComment:ye,isElement:we,isSpecial:i,getLanguage:l,getText:En,setText:Dn,isBoundary:o,isEmptyTag:n,isNonEditable:r}),eq:De,is:Ae}};const Nn=(e,t,o,n)=>{const r=o[0],s=o.slice(1);return n(e,t,r,s)},Rn=(e,t,o)=>o.length>0?Nn(e,t,o,Bn):S.none(),Bn=(e,t,o,n)=>{const r=t(e,o);return q(n,((o,n)=>{const r=t(e,n);return Ln(e,o,r)}),r)},Ln=(e,t,o)=>t.bind((t=>o.filter(y(e.eq,t)))),Hn=Rn,In=Mn(),Pn=(e,t)=>Hn(In,((t,o)=>e(o)),t),zn=e=>Qe(e,"table"),Fn=(e,t)=>{const o=Ke(e,t);return o.length>0?S.some(o):S.none()},Vn=(e,t,o)=>tt(e,t).bind((t=>tt(e,o).bind((e=>Pn(zn,[t,e]).map((o=>({first:t,last:e,table:o}))))))),Zn=(e,t)=>Fn(e,t),Un=(e,t,o)=>Vn(e,t,o).bind((t=>{const o=t=>De(e,t),n="thead,tfoot,tbody,table",r=Qe(t.first,n,o),s=Qe(t.last,n,o);return r.bind((e=>s.bind((o=>De(e,o)?pn(t.table,t.first,t.last):S.none()))))})),jn=e=>Z(e,de.fromDom),$n="data-mce-selected",Wn="td["+$n+"],th["+$n+"]",qn="data-mce-first-selected",Gn="td["+qn+"],th["+qn+"]",Kn="data-mce-last-selected",Yn="td["+Kn+"],th["+Kn+"]",Xn={selected:$n,selectedSelector:Wn,firstSelected:qn,firstSelectedSelector:Gn,lastSelected:Kn,lastSelectedSelector:Yn},Jn=e=>Kt(e).bind((e=>Zn(e,Xn.firstSelectedSelector))).fold(f(e),(e=>e[0])),Qn=e=>(t,o)=>{const n=fe(t),r="col"===n||"colgroup"===n?Jn(t):t;return ot(r,e,o)},er=Qn("th,td,caption"),tr=Qn("th,td"),or=e=>jn(e.model.table.getSelectedCells()),nr=(e,t)=>{const o=tr(e),n=o.bind((e=>Kt(e))).map((e=>Yt(e)));return ut(o,n,((e,o)=>W(o,(o=>F(jn(o.dom.cells),(o=>"1"===at(o,t)||De(o,e))))))).getOr([])},rr=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],sr=e=>({value:e}),ar=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,ir=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,lr=e=>ar.test(e)||ir.test(e),cr=e=>bt(e,"#").toUpperCase(),dr=e=>lr(e)?S.some({value:cr(e)}):S.none(),mr=e=>{const t=e.toString(16);return(1===t.length?"0"+t:t).toUpperCase()},ur=e=>{const t=mr(e.red)+mr(e.green)+mr(e.blue);return sr(t)},gr=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,hr=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,pr=(e,t,o,n)=>({red:e,green:t,blue:o,alpha:n}),fr=(e,t,o,n)=>{const r=parseInt(e,10),s=parseInt(t,10),a=parseInt(o,10),i=parseFloat(n);return pr(r,s,a,i)},br=e=>{if("transparent"===e)return S.some(pr(0,0,0,0));const t=gr.exec(e);if(null!==t)return S.some(fr(t[1],t[2],t[3],"1"));const o=hr.exec(e);return null!==o?S.some(fr(o[1],o[2],o[3],o[4])):S.none()},vr=e=>dr(e).orThunk((()=>br(e).map(ur))).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],s=n[1],a=n[2],i=n[3];return ur(pr(r,s,a,i))})),yr=e=>br(e).map(ur).map((e=>"#"+e.value)).getOr(e),wr=e=>{let t=e;const o=()=>t,n=e=>{t=e};return{get:o,set:n}},xr=e=>{const t=wr(S.none()),o=()=>t.get().each(e),n=()=>{o(),t.set(S.none())},r=()=>t.get().isSome(),s=()=>t.get(),a=e=>{o(),t.set(S.some(e))};return{clear:n,isSet:r,get:s,set:a}},Cr=()=>xr((e=>e.unbind())),Sr=(e,t,o)=>n=>{const r=Cr(),s=Ct(o),a=()=>{const a=or(e),i=n=>e.formatter.match(t,{value:o},n.dom,s);s?(n.setActive(!F(a,i)),r.set(e.formatter.formatChanged(t,(e=>n.setActive(!e)),!0))):(n.setActive(Q(a,i)),r.set(e.formatter.formatChanged(t,n.setActive,!1,{value:o})))};return e.initialized?a():e.on("init",a),r.clear},kr=e=>L(e,"menu"),_r=e=>Z(e,(e=>{const t=e.text||e.title||"";return kr(e)?{text:t,items:_r(e.menu)}:{text:t,value:e.value}})),Or=(e,t,o,n)=>Z(t,(t=>{const r=t.text||t.title;return kr(t)?{type:"nestedmenuitem",text:r,getSubmenuItems:()=>Or(e,t.menu,o,n)}:{text:r,type:"togglemenuitem",onAction:()=>n(t.value),onSetup:Sr(e,o,t.value)}})),Tr=(e,t)=>o=>{e.execCommand("mceTableApplyCellStyle",!1,{[t]:o})},Er=e=>J(e,(e=>kr(e)?[{...e,menu:Er(e.menu)}]:xt(e.value)?[e]:[])),Dr=(e,t,o,n)=>r=>r(Or(e,t,o,n)),Ar=(e,t,o)=>{const n=Z(t,(e=>({text:e.title,value:"#"+vr(e.value).value,type:"choiceitem"})));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:n.length>0?n:void 0,allowCustomColors:!1},onAction:t=>{const n="remove"===t.value?"":t.value;e.execCommand("mceTableApplyCellStyle",!1,{[o]:n})}}]},Mr=e=>()=>{const t=e.queryCommandValue("mceTableRowType"),o="header"===t?"body":"header";e.execCommand("mceTableRowType",!1,{type:o})},Nr=e=>()=>{const t=e.queryCommandValue("mceTableColType"),o="th"===t?"td":"th";e.execCommand("mceTableColType",!1,{type:o})},Rr=e=>{const t=_r(Wo(e));return t.length>0?S.some({name:"class",type:"listbox",label:"Class",items:t}):S.none()},Br=[{name:"width",type:"input",label:"Width"},{name:"height",type:"input",label:"Height"},{name:"celltype",type:"listbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"listbox",label:"Scope",items:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{name:"halign",type:"listbox",label:"Horizontal align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"Vertical align",items:rr}],Lr=e=>Br.concat(Rr(e).toArray()),Hr=(e,t)=>{const o=[{text:"Select...",value:""}],n=[{name:"borderstyle",type:"listbox",label:"Border style",items:o.concat(_r(zo(e)))},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}],r={name:"borderwidth",type:"input",label:"Border width"},s="cell"===t?[r].concat(n):n;return{title:"Advanced",name:"advanced",items:s}},Ir=(e,t)=>{const o=e.dom,n=(e,n)=>{o.setAttrib(t,e,n)},r=(e,n)=>{o.setStyle(t,e,n)},s=(o,n)=>{""===n?e.formatter.remove(o,{value:null},t,!0):e.formatter.apply(o,{value:n},t)};return{setAttrib:n,setStyle:r,setFormat:s}},Pr={normal:Ir},zr=ke("th"),Fr=(e,t)=>e&&t?"sectionCells":e?"section":"cells",Vr=e=>{const t="thead"===e.section,o=dt(Zr(e.cells),"th");return"tfoot"===e.section?{type:"footer"}:t||o?{type:"header",subType:Fr(t,o)}:{type:"body"}},Zr=e=>{const t=W(e,(e=>zr(e.element)));return 0===t.length?S.some("td"):t.length===e.length?S.some("th"):S.none()},Ur=e=>{const t=Z(e,(e=>Vr(e).type)),o=z(t,"header"),n=z(t,"footer");if(o||n){const e=z(t,"body");return!o||e||n?o||e||!n?S.none():S.some("footer"):S.some("header")}return S.some("body")},jr=e=>{let t,o=!1;return(...n)=>(o||(o=!0,t=e.apply(null,n)),t)},$r=(e,t)=>re(e.all,(e=>Y(e.cells,(e=>De(t,e.element))))),Wr=(e,t,o)=>{const n=Z(t.selection,(t=>Wt(t).bind((t=>$r(e,t))).filter(o))),r=mt(n);return ht(r.length>0,r)},qr=(e,t)=>t.mergable,Gr=(e,t)=>t.unmergable,Kr=(e,t)=>Wr(e,t,C),Yr=(e,t)=>$r(e,t).exists((e=>!e.isLocked)),Xr=(e,t)=>Q(t,(t=>Yr(e,t))),Jr=(e,t)=>qr(e,t).filter((t=>Xr(e,t.cells))),Qr=(e,t)=>Gr(e,t).filter((t=>Xr(e,t))),es=e=>{if(!i(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 U(e,((n,r)=>{const s=k(n);if(1!==s.length)throw new Error("one and only one name per case");const a=s[0],l=n[a];if(void 0!==o[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!i(l))throw new Error("case arguments must be an array");t.push(a),o[a]=(...o)=>{const n=o.length;if(n!==l.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+l.length+" ("+l+"), got "+n);const s=e=>{const n=k(e);if(t.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","));const r=Q(t,(e=>z(n,e)));if(!r)throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,o)};return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);const n=t[r];return n.apply(null,o)},match:s,log:e=>{console.log(e,{constructors:t,constructor:a,params:o})}}}})),o},ts={generate:es},os=(ts.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),(e,t)=>{const o=po.fromTable(e),n=Kr(o,t);return n.bind((e=>{const t=e[e.length-1],n=e[0].row,r=t.row+t.rowspan,s=o.all.slice(n,r);return Ur(s)})).getOr("")}),ns=os,rs=e=>vt(e,"rgb")?yr(e):e,ss=e=>{const t=de.fromDom(e);return{borderwidth:Mt(t,"border-width").getOr(""),borderstyle:Mt(t,"border-style").getOr(""),bordercolor:Mt(t,"border-color").map(rs).getOr(""),backgroundcolor:Mt(t,"background-color").map(rs).getOr("")}},as=e=>{const t=e[0],o=e.slice(1);return U(o,(e=>{U(k(t),(o=>{O(e,((e,n)=>{const r=t[o];""!==r&&o===n&&r!==e&&(t[o]="")}))}))})),t},is=(e,t,o,n)=>Y(e,(e=>!c(o.formatter.matchNode(n,t+e)))).getOr(""),ls=y(is,["left","center","right"],"align"),cs=y(is,["top","middle","bottom"],"valign"),ds=(e,t)=>{const o=en(e),n=tn(e),r=()=>({borderstyle:R(o,"border-style").getOr(""),bordercolor:rs(R(o,"border-color").getOr("")),backgroundcolor:rs(R(o,"background-color").getOr(""))}),s={height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""},a=()=>{const t=o["border-width"];return $o(e)&&t?{border:t}:R(n,"border").fold((()=>({})),(e=>({border:e})))},i=t?r():{},l=()=>{const e=R(o,"border-spacing").or(R(n,"cellspacing")).fold((()=>({})),(e=>({cellspacing:e}))),t=R(o,"border-padding").or(R(n,"cellpadding")).fold((()=>({})),(e=>({cellpadding:e})));return{...e,...t}},c={...s,...o,...n,...i,...a(),...l()};return c},ms=e=>Kt(de.fromDom(e)).map((t=>{const o={selection:jn(e.cells)};return ns(t,o)})).getOr(""),us=(e,t,o)=>{const n=(t,o)=>{const n=Mt(de.fromDom(o),"border-width");return $o(e)&&n.isSome()?n.getOr(""):t.getAttrib(o,"border")||bo(e.dom,o,"border-width")||bo(e.dom,o,"border")||""},r=e.dom,s=$o(e)?r.getStyle(t,"border-spacing")||r.getAttrib(t,"cellspacing"):r.getAttrib(t,"cellspacing")||r.getStyle(t,"border-spacing"),a=$o(e)?bo(r,t,"padding")||r.getAttrib(t,"cellpadding"):r.getAttrib(t,"cellpadding")||bo(r,t,"padding");return{width:r.getStyle(t,"width")||r.getAttrib(t,"width"),height:r.getStyle(t,"height")||r.getAttrib(t,"height"),cellspacing:null!==s&&void 0!==s?s:"",cellpadding:null!==a&&void 0!==a?a:"",border:n(r,t),caption:!!r.select("caption",t)[0],class:r.getAttrib(t,"class",""),align:ls(e,t),...o?ss(t):{}}},gs=(e,t,o)=>{const n=e.dom;return{height:n.getStyle(t,"height")||n.getAttrib(t,"height"),class:n.getAttrib(t,"class",""),type:ms(t),align:ls(e,t),...o?ss(t):{}}},hs=(e,t,o,n)=>{const r=e.dom,s=n.getOr(t),a=(e,t)=>r.getStyle(e,t)||r.getAttrib(e,t);return{width:a(s,"width"),height:a(t,"height"),scope:r.getAttrib(t,"scope"),celltype:on(t),class:r.getAttrib(t,"class",""),halign:ls(e,t),valign:cs(e,t),...o?ss(t):{}}},ps=(e,t)=>{const o=po.fromTable(e),n=po.justCells(o),r=W(n,(e=>F(t,(t=>De(e.element,t)))));return Z(r,(e=>({element:e.element.dom,column:po.getColumnAt(o,e.column).map((e=>e.element.dom))})))},fs=(e,t,o,n)=>{n("scope")&&e.setAttrib("scope",o.scope),n("class")&&e.setAttrib("class",o.class),n("height")&&e.setStyle("height",an(o.height)),n("width")&&t.setStyle("width",an(o.width))},bs=(e,t,o)=>{o("backgroundcolor")&&e.setFormat("tablecellbackgroundcolor",t.backgroundcolor),o("bordercolor")&&e.setFormat("tablecellbordercolor",t.bordercolor),o("borderstyle")&&e.setFormat("tablecellborderstyle",t.borderstyle),o("borderwidth")&&e.setFormat("tablecellborderwidth",an(t.borderwidth))},vs=(e,t,o,n)=>{const r=1===t.length;U(t,(t=>{const s=t.element,a=r?C:n,i=Pr.normal(e,s),l=t.column.map((t=>Pr.normal(e,t))).getOr(i);fs(i,l,o,a),Fo(e)&&bs(i,o,a),n("halign")&&vo(e,s,o.halign),n("valign")&&yo(e,s,o.valign)}))},ys=(e,t)=>{e.execCommand("mceTableCellType",!1,{type:t.celltype,no_events:!0})},ws=(e,t,o,n)=>{const r=D(n,((e,t)=>o[t]!==e));N(r)>0&&t.length>=1&&Kt(t[0]).each((o=>{const s=ps(o,t),a=N(D(r,((e,t)=>"scope"!==t&&"celltype"!==t)))>0,i=B(r,"celltype");(a||B(r,"scope"))&&vs(e,s,n,y(B,r)),i&&ys(e,n),wo(e,o.dom,{structure:i,style:a})}))},xs=(e,t,o,n)=>{const r=n.getData();n.close(),e.undoManager.transact((()=>{ws(e,t,o,r),e.focus()}))},Cs=(e,t)=>{const o=Kt(t[0]).map((o=>Z(ps(o,t),(t=>hs(e,t.element,Fo(e),t.column)))));return as(o.getOrDie())},Ss=e=>{const t=or(e);if(0===t.length)return;const o=Cs(e,t),n={type:"tabpanel",tabs:[{title:"General",name:"general",items:Lr(e)},Hr(e,"cell")]},r={type:"panel",items:[{type:"grid",columns:2,items:Lr(e)}]};e.windowManager.open({title:"Cell Properties",size:"normal",body:Fo(e)?n:r,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onSubmit:y(xs,e,t,o)})},ks=e=>{const t=_r(qo(e));return t.length>0?S.some({name:"class",type:"listbox",label:"Class",items:t}):S.none()},_s=[{type:"listbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],Os=e=>_s.concat(ks(e).toArray()),Ts=(e,t,o)=>{o("class")&&e.setAttrib("class",t.class),o("height")&&e.setStyle("height",an(t.height))},Es=(e,t,o)=>{o("backgroundcolor")&&e.setStyle("background-color",t.backgroundcolor),o("bordercolor")&&e.setStyle("border-color",t.bordercolor),o("borderstyle")&&e.setStyle("border-style",t.borderstyle)},Ds=(e,t,o,n)=>{const r=1===t.length,s=r?C:n;U(t,(t=>{const r=Pr.normal(e,t);Ts(r,o,s),Vo(e)&&Es(r,o,s),n("align")&&vo(e,t,o.align)}))},As=(e,t)=>{e.execCommand("mceTableRowType",!1,{type:t.type,no_events:!0})},Ms=(e,t,o,n)=>{const r=D(n,((e,t)=>o[t]!==e));if(N(r)>0){const o=B(r,"type"),s=!o||N(r)>1;s&&Ds(e,t,n,y(B,r)),o&&As(e,n),Kt(de.fromDom(t[0])).each((t=>wo(e,t.dom,{structure:o,style:s})))}},Ns=(e,t,o,n)=>{const r=n.getData();n.close(),e.undoManager.transact((()=>{Ms(e,t,o,r),e.focus()}))},Rs=e=>{const t=nr(ln(e),Xn.selected);if(0===t.length)return;const o=Z(t,(t=>gs(e,t.dom,Vo(e)))),n=as(o),r={type:"tabpanel",tabs:[{title:"General",name:"general",items:Os(e)},Hr(e,"row")]},s={type:"panel",items:[{type:"grid",columns:2,items:Os(e)}]};e.windowManager.open({title:"Row Properties",size:"normal",body:Vo(e)?r:s,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:n,onSubmit:y(Ns,e,Z(t,(e=>e.dom)),n)})},Bs=(e,t,o)=>{const n=o?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],r=[{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}],s=Uo(e)?[{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric"},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],a=[{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}],i=t.length>0?[{type:"listbox",name:"class",label:"Class",items:t}]:[];return n.concat(r).concat(s).concat(a).concat(i)},Ls=(e,t,o,n)=>{if("TD"===t.tagName||"TH"===t.tagName)a(o)&&m(n)?e.setStyle(t,o,n):e.setStyles(t,o);else if(t.children)for(let r=0;r<t.children.length;r++)Ls(e,t.children[r],o,n)},Hs=(e,t,o)=>{const n=e.dom,r={},s={};if(c(o.class)||(r.class=o.class),s.height=an(o.height),$o(e)?s.width=an(o.width):n.getAttrib(t,"width")&&(r.width=sn(o.width)),$o(e)?(s["border-width"]=an(o.border),s["border-spacing"]=an(o.cellspacing)):(r.border=o.border,r.cellpadding=o.cellpadding,r.cellspacing=o.cellspacing),$o(e)&&t.children)for(let a=0;a<t.children.length;a++)Ls(n,t.children[a],{"border-width":an(o.border),padding:an(o.cellpadding)}),Zo(e)&&Ls(n,t.children[a],{"border-color":o.bordercolor});if(Zo(e)){const e=o;s["background-color"]=e.backgroundcolor,s["border-color"]=e.bordercolor,s["border-style"]=e.borderstyle}r.style=n.serializeStyle({...en(e),...s}),n.setAttribs(t,{...tn(e),...r})},Is=(e,t,o,n)=>{const r=e.dom,s=n.getData(),a=D(s,((e,t)=>o[t]!==e));n.close(),""===s.class&&delete s.class,e.undoManager.transact((()=>{if(!t){const o=St(s.cols).getOr(1),n=St(s.rows).getOr(1);e.execCommand("mceInsertTable",!1,{rows:n,columns:o}),t=tr(ln(e),rn(e)).bind((t=>Kt(t,rn(e)))).map((e=>e.dom)).getOrDie()}if(N(a)>0){Hs(e,t,s);const o=r.select("caption",t)[0];(o&&!s.caption||!o&&s.caption)&&e.execCommand("mceTableToggleCaption"),vo(e,t,s.align)}if(e.focus(),e.addVisual(),N(a)>0){const o=B(a,"caption"),n=!o||N(a)>1;wo(e,t,{structure:o,style:n})}}))},Ps=(e,t)=>{const o=e.dom;let n,r=ds(e,Zo(e));t?(r.cols="1",r.rows="1",Zo(e)&&(r.borderstyle="",r.bordercolor="",r.backgroundcolor="")):(n=o.getParent(e.selection.getStart(),"table",e.getBody()),n?r=us(e,n,Zo(e)):Zo(e)&&(r.borderstyle="",r.bordercolor="",r.backgroundcolor=""));const s=_r(Go(e));s.length>0&&r.class&&(r.class=r.class.replace(/\s*mce\-item\-table\s*/g,""));const a={type:"grid",columns:2,items:Bs(e,s,t)},i=()=>({type:"panel",items:[a]}),l=()=>({type:"tabpanel",tabs:[{title:"General",name:"general",items:[a]},Hr(e,"table")]}),c=Zo(e)?l():i();e.windowManager.open({title:"Table Properties",size:"normal",body:c,onSubmit:y(Is,e,n,r),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r})},zs=e=>{O({mceTableProps:y(Ps,e,!1),mceTableRowProps:y(Rs,e),mceTableCellProps:y(Ss,e)},((t,o)=>e.addCommand(o,(()=>t())))),e.addCommand("mceInsertTableDialog",(t=>{Ps(e,!0)}))},Fs=(e,t)=>et(e,t).isSome(),Vs=b,Zs=e=>{const t=(e,t)=>it(e,t).exists((e=>parseInt(e,10)>1)),o=e=>t(e,"rowspan")||t(e,"colspan");return e.length>0&&Q(e,o)?S.some(e):S.none()},Us=(e,t,o)=>t.length<=1?S.none():Un(e,o.firstSelectedSelector,o.lastSelectedSelector).map((e=>({bounds:e,cells:t}))),js=e=>({element:e,mergable:S.none(),unmergable:S.none(),selection:[e]}),$s=(e,t,o)=>({element:o,mergable:Us(t,e,Xn),unmergable:Zs(e),selection:Vs(e)}),Ws=e=>{const t=wr(S.none()),o=wr([]);let n=S.none();const r=ke("caption"),s=e=>n.forall((t=>!t[e])),a=()=>er(ln(e),rn(e)),i=()=>er(cn(e),rn(e)),l=()=>a().bind((t=>gt(ut(Kt(t),i().bind(Kt),((o,n)=>De(o,n)?r(t)?S.some(js(t)):S.some($s(or(e),o,t)):S.none()))))),c=e=>{const t=Kt(e.element);return t.map((t=>{const o=po.fromTable(t),n=Kr(o,e).getOr([]),r=G(n,((e,t)=>(t.isLocked&&(e.onAny=!0,0===t.column?e.onFirst=!0:t.column+t.colspan>=o.grid.columns&&(e.onLast=!0)),e)),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:Jr(o,e).isSome(),unmergeable:Qr(o,e).isSome(),locked:r}}))},d=()=>{t.set(jr(l)()),n=t.get().bind(c),U(o.get(),w)},m=e=>(e(),o.set(o.get().concat([e])),()=>{o.set(W(o.get(),(t=>t!==e)))}),u=(e,o)=>m((()=>t.get().fold((()=>{e.setEnabled(!1)}),(t=>{e.setEnabled(!o(t))})))),g=(e,o,n)=>m((()=>t.get().fold((()=>{e.setEnabled(!1),e.setActive(!1)}),(t=>{e.setEnabled(!o(t)),e.setActive(n(t))})))),h=e=>n.exists((t=>t.locked[e])),p=e=>u(e,(e=>!1)),f=e=>u(e,(e=>r(e.element))),b=e=>t=>u(t,(t=>r(t.element)||h(e))),v=e=>t=>u(t,(t=>r(t.element)||e().isNone())),y=(e,t)=>o=>u(o,(o=>r(o.element)||e().isNone()||h(t))),C=e=>u(e,(e=>s("mergeable"))),k=e=>u(e,(e=>s("unmergeable"))),_=t=>g(t,x,(t=>{const o=Kt(t.element,rn(e));return o.exists((e=>Fs(e,"caption")))})),O=(t,o)=>n=>g(n,(e=>r(e.element)),(()=>e.queryCommandValue(t)===o)),T=O("mceTableRowType","header"),E=O("mceTableColType","th");return e.on("NodeChange ExecCommand TableSelectorChange",d),{onSetupTable:p,onSetupCellOrRow:f,onSetupColumn:b,onSetupPasteable:v,onSetupPasteableColumn:y,onSetupMergeable:C,onSetupUnmergeable:k,resetTargets:d,onSetupTableWithCaption:_,onSetupTableRowHeaders:T,onSetupTableColumnHeaders:E,targets:t.get}};var qs=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const Gs="x-tinymce/dom-table-",Ks=Gs+"rows",Ys=Gs+"columns",Xs=e=>{var t;const o=null!==(t=qs.read())&&void 0!==t?t:[];return re(o,(t=>S.from(t.getType(e))))},Js=()=>Xs(Ks),Qs=()=>Xs(Ys),ea=(e,t)=>{e.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",fetch:e=>e("inserttable | cell row column | advtablesort | tableprops deletetable")});const o=t=>()=>e.execCommand(t),n=(t,n)=>{e.queryCommandSupported(n.command)&&e.ui.registry.addButton(t,{...n,onAction:u(n.onAction)?n.onAction:o(n.command)})},r=(t,n)=>{e.queryCommandSupported(n.command)&&e.ui.registry.addToggleButton(t,{...n,onAction:u(n.onAction)?n.onAction:o(n.command)})};n("tableprops",{tooltip:"Table properties",command:"mceTableProps",icon:"table",onSetup:t.onSetupTable}),n("tabledelete",{tooltip:"Delete table",command:"mceTableDelete",icon:"table-delete-table",onSetup:t.onSetupTable}),n("tablecellprops",{tooltip:"Cell properties",command:"mceTableCellProps",icon:"table-cell-properties",onSetup:t.onSetupCellOrRow}),n("tablemergecells",{tooltip:"Merge cells",command:"mceTableMergeCells",icon:"table-merge-cells",onSetup:t.onSetupMergeable}),n("tablesplitcells",{tooltip:"Split cell",command:"mceTableSplitCells",icon:"table-split-cells",onSetup:t.onSetupUnmergeable}),n("tableinsertrowbefore",{tooltip:"Insert row before",command:"mceTableInsertRowBefore",icon:"table-insert-row-above",onSetup:t.onSetupCellOrRow}),n("tableinsertrowafter",{tooltip:"Insert row after",command:"mceTableInsertRowAfter",icon:"table-insert-row-after",onSetup:t.onSetupCellOrRow}),n("tabledeleterow",{tooltip:"Delete row",command:"mceTableDeleteRow",icon:"table-delete-row",onSetup:t.onSetupCellOrRow}),n("tablerowprops",{tooltip:"Row properties",command:"mceTableRowProps",icon:"table-row-properties",onSetup:t.onSetupCellOrRow}),n("tableinsertcolbefore",{tooltip:"Insert column before",command:"mceTableInsertColBefore",icon:"table-insert-column-before",onSetup:t.onSetupColumn("onFirst")}),n("tableinsertcolafter",{tooltip:"Insert column after",command:"mceTableInsertColAfter",icon:"table-insert-column-after",onSetup:t.onSetupColumn("onLast")}),n("tabledeletecol",{tooltip:"Delete column",command:"mceTableDeleteCol",icon:"table-delete-column",onSetup:t.onSetupColumn("onAny")}),n("tablecutrow",{tooltip:"Cut row",command:"mceTableCutRow",icon:"cut-row",onSetup:t.onSetupCellOrRow}),n("tablecopyrow",{tooltip:"Copy row",command:"mceTableCopyRow",icon:"duplicate-row",onSetup:t.onSetupCellOrRow}),n("tablepasterowbefore",{tooltip:"Paste row before",command:"mceTablePasteRowBefore",icon:"paste-row-before",onSetup:t.onSetupPasteable(Js)}),n("tablepasterowafter",{tooltip:"Paste row after",command:"mceTablePasteRowAfter",icon:"paste-row-after",onSetup:t.onSetupPasteable(Js)}),n("tablecutcol",{tooltip:"Cut column",command:"mceTableCutCol",icon:"cut-column",onSetup:t.onSetupColumn("onAny")}),n("tablecopycol",{tooltip:"Copy column",command:"mceTableCopyCol",icon:"duplicate-column",onSetup:t.onSetupColumn("onAny")}),n("tablepastecolbefore",{tooltip:"Paste column before",command:"mceTablePasteColBefore",icon:"paste-column-before",onSetup:t.onSetupPasteableColumn(Qs,"onFirst")}),n("tablepastecolafter",{tooltip:"Paste column after",command:"mceTablePasteColAfter",icon:"paste-column-after",onSetup:t.onSetupPasteableColumn(Qs,"onLast")}),n("tableinsertdialog",{tooltip:"Insert table",command:"mceInsertTableDialog",icon:"table"});const s=Er(Go(e));0!==s.length&&e.queryCommandSupported("mceTableToggleClass")&&e.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:Dr(e,s,"tableclass",(t=>e.execCommand("mceTableToggleClass",!1,t))),onSetup:t.onSetupTable});const a=Er(Wo(e));0!==a.length&&e.queryCommandSupported("mceTableCellToggleClass")&&e.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:Dr(e,a,"tablecellclass",(t=>e.execCommand("mceTableCellToggleClass",!1,t))),onSetup:t.onSetupCellOrRow}),e.queryCommandSupported("mceTableApplyCellStyle")&&(e.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:Dr(e,rr,"tablecellverticalalign",Tr(e,"vertical-align")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:Dr(e,Po(e),"tablecellborderwidth",Tr(e,"border-width")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:Dr(e,zo(e),"tablecellborderstyle",Tr(e,"border-style")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:t=>t(Ar(e,Yo(e),"background-color")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:t=>t(Ar(e,Xo(e),"border-color")),onSetup:t.onSetupCellOrRow})),r("tablecaption",{tooltip:"Table caption",icon:"table-caption",command:"mceTableToggleCaption",onSetup:t.onSetupTableWithCaption}),r("tablerowheader",{tooltip:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:Mr(e),onSetup:t.onSetupTableRowHeaders}),r("tablecolheader",{tooltip:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:Nr(e),onSetup:t.onSetupTableColumnHeaders})},ta=e=>{const t=t=>e.dom.is(t,"table")&&e.getBody().contains(t),o=Ko(e);o.length>0&&e.ui.registry.addContextToolbar("table",{predicate:t,items:o,scope:"node",position:"node"})},oa=(e,t)=>{const o=t=>()=>e.execCommand(t),n=(t,n)=>!!e.queryCommandSupported(n.command)&&(e.ui.registry.addMenuItem(t,{...n,onAction:u(n.onAction)?n.onAction:o(n.command)}),!0),r=(t,n)=>{e.queryCommandSupported(n.command)&&e.ui.registry.addToggleMenuItem(t,{...n,onAction:u(n.onAction)?n.onAction:o(n.command)})},s=t=>{e.execCommand("mceInsertTable",!1,{rows:t.numRows,columns:t.numColumns})},a=[n("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",command:"mceTableInsertRowBefore",onSetup:t.onSetupCellOrRow}),n("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",command:"mceTableInsertRowAfter",onSetup:t.onSetupCellOrRow}),n("tabledeleterow",{text:"Delete row",icon:"table-delete-row",command:"mceTableDeleteRow",onSetup:t.onSetupCellOrRow}),n("tablerowprops",{text:"Row properties",icon:"table-row-properties",command:"mceTableRowProps",onSetup:t.onSetupCellOrRow}),n("tablecutrow",{text:"Cut row",icon:"cut-row",command:"mceTableCutRow",onSetup:t.onSetupCellOrRow}),n("tablecopyrow",{text:"Copy row",icon:"duplicate-row",command:"mceTableCopyRow",onSetup:t.onSetupCellOrRow}),n("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",command:"mceTablePasteRowBefore",onSetup:t.onSetupPasteable(Js)}),n("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",command:"mceTablePasteRowAfter",onSetup:t.onSetupPasteable(Js)})],i=[n("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",command:"mceTableInsertColBefore",onSetup:t.onSetupColumn("onFirst")}),n("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",command:"mceTableInsertColAfter",onSetup:t.onSetupColumn("onLast")}),n("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",command:"mceTableDeleteCol",onSetup:t.onSetupColumn("onAny")}),n("tablecutcolumn",{text:"Cut column",icon:"cut-column",command:"mceTableCutCol",onSetup:t.onSetupColumn("onAny")}),n("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",command:"mceTableCopyCol",onSetup:t.onSetupColumn("onAny")}),n("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",command:"mceTablePasteColBefore",onSetup:t.onSetupPasteableColumn(Qs,"onFirst")}),n("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",command:"mceTablePasteColAfter",onSetup:t.onSetupPasteableColumn(Qs,"onLast")})],l=[n("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",command:"mceTableCellProps",onSetup:t.onSetupCellOrRow}),n("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",command:"mceTableMergeCells",onSetup:t.onSetupMergeable}),n("tablesplitcells",{text:"Split cell",icon:"table-split-cells",command:"mceTableSplitCells",onSetup:t.onSetupUnmergeable})];jo(e)?e.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"inserttable",onAction:s}]}):e.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:o("mceInsertTableDialog")}),e.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:o("mceInsertTableDialog")}),n("tableprops",{text:"Table properties",onSetup:t.onSetupTable,command:"mceTableProps"}),n("deletetable",{text:"Delete table",icon:"table-delete-table",onSetup:t.onSetupTable,command:"mceTableDelete"}),z(a,!0)&&e.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:f("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")}),z(i,!0)&&e.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:f("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")}),z(l,!0)&&e.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:f("tablecellprops tablemergecells tablesplitcells")}),e.ui.registry.addContextMenu("table",{update:()=>(t.resetTargets(),t.targets().fold(f(""),(e=>"caption"===fe(e.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable")))});const c=Er(Go(e));0!==c.length&&e.queryCommandSupported("mceTableToggleClass")&&e.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:()=>Or(e,c,"tableclass",(t=>e.execCommand("mceTableToggleClass",!1,t))),onSetup:t.onSetupTable});const d=Er(Wo(e));0!==d.length&&e.queryCommandSupported("mceTableCellToggleClass")&&e.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:()=>Or(e,d,"tablecellclass",(t=>e.execCommand("mceTableCellToggleClass",!1,t))),onSetup:t.onSetupCellOrRow}),e.queryCommandSupported("mceTableApplyCellStyle")&&(e.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:()=>Or(e,rr,"tablecellverticalalign",Tr(e,"vertical-align")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:()=>Or(e,Po(e),"tablecellborderwidth",Tr(e,"border-width")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:()=>Or(e,zo(e),"tablecellborderstyle",Tr(e,"border-style")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:()=>Ar(e,Yo(e),"background-color"),onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:()=>Ar(e,Xo(e),"border-color"),onSetup:t.onSetupCellOrRow})),r("tablecaption",{icon:"table-caption",text:"Table caption",command:"mceTableToggleCaption",onSetup:t.onSetupTableWithCaption}),r("tablerowheader",{text:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:Mr(e),onSetup:t.onSetupTableRowHeaders}),r("tablecolheader",{text:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:Nr(e),onSetup:t.onSetupTableRowHeaders})},na=e=>{const t=Ws(e);Ho(e),zs(e),oa(e,t),ea(e,t),ta(e)};var ra=()=>{e.add("table",na)};ra()})()},2440:function(e,t,o){o(7829)},7829:function(){(function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const 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=>{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},n=e=>t=>o(t)===e,r=e=>t=>typeof t===e,s=n("string"),a=n("object"),i=n("array"),l=e=>null===e||void 0===e,c=e=>!l(e),d=r("function"),m=(e,t)=>{if(i(e)){for(let o=0,n=e.length;o<n;++o)if(!t(e[o]))return!1;return!0}return!1},u=e=>()=>e;function g(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const h=u(!1),p=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");var f=tinymce.util.Tools.resolve("tinymce.util.Tools");const b=e=>t=>t.options.get(e),v=e=>{const t=e.options.register;t("template_cdate_classes",{processor:"string",default:"cdate"}),t("template_mdate_classes",{processor:"string",default:"mdate"}),t("template_selected_content_classes",{processor:"string",default:"selcontent"}),t("template_preview_replace_values",{processor:"object"}),t("template_replace_values",{processor:"object"}),t("templates",{processor:e=>s(e)||m(e,a)||d(e),default:[]}),t("template_cdate_format",{processor:"string",default:e.translate("%Y-%m-%d")}),t("template_mdate_format",{processor:"string",default:e.translate("%Y-%m-%d")})},y=b("template_cdate_classes"),w=b("template_mdate_classes"),x=b("template_selected_content_classes"),C=b("template_preview_replace_values"),S=b("template_replace_values"),k=b("templates"),_=b("template_cdate_format"),O=b("template_mdate_format"),T=b("content_style"),E=b("content_css_cors"),D=b("body_class"),A=(e,t)=>{if(e=""+e,e.length<t)for(let o=0;o<t-e.length;o++)e="0"+e;return e},M=(e,t,o=new Date)=>{const n="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),r="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),s="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),a="January February March April May June July August September October November December".split(" ");return t=t.replace("%D","%m/%d/%Y"),t=t.replace("%r","%I:%M:%S %p"),t=t.replace("%Y",""+o.getFullYear()),t=t.replace("%y",""+o.getYear()),t=t.replace("%m",A(o.getMonth()+1,2)),t=t.replace("%d",A(o.getDate(),2)),t=t.replace("%H",""+A(o.getHours(),2)),t=t.replace("%M",""+A(o.getMinutes(),2)),t=t.replace("%S",""+A(o.getSeconds(),2)),t=t.replace("%I",""+((o.getHours()+11)%12+1)),t=t.replace("%p",o.getHours()<12?"AM":"PM"),t=t.replace("%B",""+e.translate(a[o.getMonth()])),t=t.replace("%b",""+e.translate(s[o.getMonth()])),t=t.replace("%A",""+e.translate(r[o.getDay()])),t=t.replace("%a",""+e.translate(n[o.getDay()])),t=t.replace("%%","%"),t};class N{constructor(e,t){this.tag=e,this.value=t}static some(e){return new N(!0,e)}static none(){return N.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?N.some(e(this.value)):N.none()}bind(e){return this.tag?e(this.value):N.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:N.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&&void 0!==e?e:"Called getOrDie on None")}static from(e){return c(e)?N.some(e):N.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()"}}N.singletonNone=new N(!1);const R=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];if(t(n,o))return!0}return!1},B=(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},L=(e,t,o)=>{for(let n=0,r=e.length;n<r;n++){const r=e[n];if(t(r,n))return N.some(r);if(o(r,n))break}return N.none()},H=(e,t)=>L(e,t,h),I=Object.hasOwnProperty,P=(e,t)=>z(e,t)?N.from(e[t]):N.none(),z=(e,t)=>I.call(e,t),F={'"':"&quot;","<":"&lt;",">":"&gt;","&":"&amp;","'":"&#039;"},V=e=>e.replace(/["'<>&]/g,(e=>P(F,e).getOr(e))),Z=(e,t,o)=>R(o.split(/\s+/),(o=>e.hasClass(t,o))),U=(e,t)=>()=>{const o=k(e);d(o)?o(t):s(o)?fetch(o).then((e=>{e.ok&&e.json().then(t)})):t(o)},j=(e,t)=>(f.each(t,((t,o)=>{d(t)&&(t=t(o)),e=e.replace(new RegExp("\\{\\$"+p(o)+"\\}","g"),t)})),e),$=(e,t)=>{const o=e.dom,n=S(e);f.each(o.select("*",t),(e=>{f.each(n,((t,n)=>{o.hasClass(e,n)&&d(t)&&t(e)}))}))},W=(e,t,o)=>{const n=e.dom,r=e.selection.getContent();o=j(o,S(e));let s=n.create("div",{},o);const a=n.select(".mceTmpl",s);a&&a.length>0&&(s=n.create("div"),s.appendChild(a[0].cloneNode(!0))),f.each(n.select("*",s),(t=>{Z(n,t,y(e))&&(t.innerHTML=M(e,_(e))),Z(n,t,w(e))&&(t.innerHTML=M(e,O(e))),Z(n,t,x(e))&&(t.innerHTML=r)})),$(e,s),e.execCommand("mceInsertContent",!1,s.innerHTML),e.addVisual()};var q=tinymce.util.Tools.resolve("tinymce.Env");const G=(e,t)=>{var o;if(-1===t.indexOf("<html>")){let n="";const r=null!==(o=T(e))&&void 0!==o?o:"",s=E(e)?' crossorigin="anonymous"':"";f.each(e.contentCSS,(t=>{n+='<link type="text/css" rel="stylesheet" href="'+e.documentBaseURI.toAbsolute(t)+'"'+s+">"})),r&&(n+='<style type="text/css">'+r+"</style>");const a=D(e),i=e.dom.encode,l=q.os.isMacOS()||q.os.isiOS()?"e.metaKey":"e.ctrlKey && !e.altKey",c='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+l+")) {e.preventDefault();}}}, false);<\/script> ",d=e.getBody().dir,m=d?' dir="'+i(d)+'"':"";t='<!DOCTYPE html><html><head><base href="'+i(e.documentBaseURI.getURI())+'">'+n+c+'</head><body class="'+i(a)+'"'+m+">"+t+"</body></html>"}return j(t,C(e))},K=(e,t)=>{const o=()=>{if(!t||0===t.length){const t=e.translate("No templates defined.");return e.notificationManager.open({text:t,type:"info"}),N.none()}return N.from(f.map(t,((e,t)=>{const o=e=>void 0!==e.url;return{selected:0===t,text:e.title,value:{url:o(e)?N.from(e.url):N.none(),content:o(e)?N.none():N.from(e.content),description:e.description}}})))},n=e=>B(e,(e=>({text:e.text,value:e.text}))),r=(e,t)=>H(e,(e=>e.text===t)),s=t=>{e.windowManager.alert("Could not load the specified template.",(()=>t.focus("template")))},a=e=>e.value.url.fold((()=>Promise.resolve(e.value.content.getOr(""))),(e=>fetch(e).then((e=>e.ok?e.text():Promise.reject())))),i=(e,t)=>(o,n)=>{if("template"===n.name){const n=o.getData().template;r(e,n).each((e=>{o.block("Loading..."),a(e).then((n=>{t(o,e,n)})).catch((()=>{t(o,e,""),o.setEnabled("save",!1),s(o)}))}))}},l=t=>o=>{const n=o.getData();r(t,n.template).each((t=>{a(t).then((t=>{e.execCommand("mceInsertTemplate",!1,t),o.close()})).catch((()=>{o.setEnabled("save",!1),s(o)}))}))},c=t=>{const o=n(t),r=(e,o)=>({title:"Insert Template",size:"large",body:{type:"panel",items:e},initialData:o,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:l(t),onChange:i(t,c)}),c=(t,n,s)=>{const a=G(e,s),i=[{type:"selectbox",name:"template",label:"Templates",items:o},{type:"htmlpanel",html:`<p aria-live="polite">${V(n.value.description)}</p>`},{label:"Preview",type:"iframe",name:"preview",sandboxed:!1,transparent:!1}],l={template:n.text,preview:a};t.unblock(),t.redial(r(i,l)),t.focus("template")},d=e.windowManager.open(r([],{template:"",preview:""}));d.block("Loading..."),a(t[0]).then((e=>{c(d,t[0],e)})).catch((()=>{c(d,t[0],""),d.setEnabled("save",!1),s(d)}))},d=o();d.each(c)},Y=e=>t=>{K(e,t)},X=e=>{e.addCommand("mceInsertTemplate",g(W,e)),e.addCommand("mceTemplate",U(e,Y(e)))},J=e=>{e.on("PreProcess",(t=>{const o=e.dom,n=O(e);f.each(o.select("div",t.node),(t=>{o.hasClass(t,"mceTmpl")&&(f.each(o.select("*",t),(t=>{Z(o,t,w(e))&&(t.innerHTML=M(e,n))})),$(e,t))}))}))},Q=e=>{const t=()=>e.execCommand("mceTemplate");e.ui.registry.addButton("template",{icon:"template",tooltip:"Insert template",onAction:t}),e.ui.registry.addMenuItem("template",{icon:"template",text:"Insert template...",onAction:t})};var ee=()=>{e.add("template",(e=>{v(e),Q(e),X(e),J(e)}))};ee()})()},6075:function(e,t,o){o(4934)},4934:function(){(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=>{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},n=e=>t=>o(t)===e,r=e=>t=>typeof t===e,s=e=>t=>e===t,a=(o,n)=>l(o)&&t(o,n,((t,o)=>e(t)===o)),i=n("string"),l=n("object"),c=e=>a(e,Object),d=n("array"),m=s(null),u=r("boolean"),g=s(void 0),h=e=>null===e||void 0===e,p=e=>!h(e),f=r("function"),b=r("number"),v=(e,t)=>{if(d(e)){for(let o=0,n=e.length;o<n;++o)if(!t(e[o]))return!1;return!0}return!1},y=()=>{},w=e=>()=>e(),x=(e,t)=>(...o)=>e(t.apply(null,o)),C=(e,t)=>o=>e(t(o)),S=e=>()=>e,k=e=>e,_=(e,t)=>e===t;function O(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const T=e=>t=>!e(t),E=e=>()=>{throw new Error(e)},D=e=>e(),A=S(!1),M=S(!0);var N=tinymce.util.Tools.resolve("tinymce.ThemeManager");class R{constructor(e,t){this.tag=e,this.value=t}static some(e){return new R(!0,e)}static none(){return R.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?R.some(e(this.value)):R.none()}bind(e){return this.tag?e(this.value):R.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:R.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&&void 0!==e?e:"Called getOrDie on None")}static from(e){return p(e)?R.some(e):R.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()"}}R.singletonNone=new R(!1);const B=Array.prototype.slice,L=Array.prototype.indexOf,H=Array.prototype.push,I=(e,t)=>L.call(e,t),P=(e,t)=>{const o=I(e,t);return-1===o?R.none():R.some(o)},z=(e,t)=>I(e,t)>-1,F=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];if(t(n,o))return!0}return!1},V=(e,t)=>{const o=[];for(let n=0;n<e;n++)o.push(t(n));return o},Z=(e,t)=>{const o=[];for(let n=0;n<e.length;n+=t){const r=B.call(e,n,n+t);o.push(r)}return o},U=(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},j=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];t(n,o)}},$=(e,t)=>{for(let o=e.length-1;o>=0;o--){const n=e[o];t(n,o)}},W=(e,t)=>{const o=[],n=[];for(let r=0,s=e.length;r<s;r++){const s=e[r],a=t(s,r)?o:n;a.push(s)}return{pass:o,fail:n}},q=(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},G=(e,t,o)=>($(e,((e,n)=>{o=t(o,e,n)})),o),K=(e,t,o)=>(j(e,((e,n)=>{o=t(o,e,n)})),o),Y=(e,t,o)=>{for(let n=0,r=e.length;n<r;n++){const r=e[n];if(t(r,n))return R.some(r);if(o(r,n))break}return R.none()},X=(e,t)=>Y(e,t,A),J=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];if(t(n,o))return R.some(o)}return R.none()},Q=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!d(e[o]))throw new Error("Arr.flatten item "+o+" was not an array, input: "+e);H.apply(t,e[o])}return t},ee=(e,t)=>Q(U(e,t)),te=(e,t)=>{for(let o=0,n=e.length;o<n;++o){const n=e[o];if(!0!==t(n,o))return!1}return!0},oe=e=>{const t=B.call(e,0);return t.reverse(),t},ne=(e,t)=>q(e,(e=>!z(t,e))),re=(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},se=e=>[e],ae=(e,t)=>{const o=B.call(e,0);return o.sort(t),o},ie=(e,t)=>t>=0&&t<e.length?R.some(e[t]):R.none(),le=e=>ie(e,0),ce=e=>ie(e,e.length-1),de=f(Array.from)?Array.from:e=>B.call(e),me=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome())return n}return R.none()},ue=Object.keys,ge=Object.hasOwnProperty,he=(e,t)=>{const o=ue(e);for(let n=0,r=o.length;n<r;n++){const r=o[n],s=e[r];t(s,r)}},pe=(e,t)=>fe(e,((e,o)=>({k:o,v:t(e,o)}))),fe=(e,t)=>{const o={};return he(e,((e,n)=>{const r=t(e,n);o[r.k]=r.v})),o},be=e=>(t,o)=>{e[o]=t},ve=(e,t,o,n)=>{he(e,((e,r)=>{(t(e,r)?o:n)(e,r)}))},ye=(e,t)=>{const o={},n={};return ve(e,t,be(o),be(n)),{t:o,f:n}},we=(e,t)=>{const o={};return ve(e,t,be(o),y),o},xe=(e,t)=>{const o=[];return he(e,((e,n)=>{o.push(t(e,n))})),o},Ce=(e,t)=>{const o=ue(e);for(let n=0,r=o.length;n<r;n++){const r=o[n],s=e[r];if(t(s,r,e))return R.some(s)}return R.none()},Se=e=>xe(e,k),ke=(e,t)=>_e(e,t)?R.from(e[t]):R.none(),_e=(e,t)=>ge.call(e,t),Oe=(e,t)=>_e(e,t)&&void 0!==e[t]&&null!==e[t],Te=(e,t,o=_)=>e.exists((e=>o(e,t))),Ee=(e,t,o=_)=>Me(e,t,o).getOr(e.isNone()&&t.isNone()),De=e=>{const t=[],o=e=>{t.push(e)};for(let n=0;n<e.length;n++)e[n].each(o);return t},Ae=e=>{const t=[];for(let o=0;o<e.length;o++){const n=e[o];if(!n.isSome())return R.none();t.push(n.getOrDie())}return R.some(t)},Me=(e,t,o)=>e.isSome()&&t.isSome()?R.some(o(e.getOrDie(),t.getOrDie())):R.none(),Ne=(e,t,o,n)=>e.isSome()&&t.isSome()&&o.isSome()?R.some(n(e.getOrDie(),t.getOrDie(),o.getOrDie())):R.none(),Re=(e,t)=>void 0!==e&&null!==e?R.some(t(e)):R.none(),Be=(e,t)=>e?R.some(t):R.none(),Le=(e,t)=>e+t,He=(e,t)=>e.substring(t),Ie=(e,t,o)=>""===t||e.length>=t.length&&e.substr(o,o+t.length)===t,Pe=(e,t)=>Ve(e,t)?He(e,t.length):e,ze=(e,t)=>Ze(e,t)?e:Le(e,t),Fe=(e,t,o=0,n)=>{const r=e.indexOf(t,o);return-1!==r&&(!!g(n)||r+t.length<=n)},Ve=(e,t)=>Ie(e,t,0),Ze=(e,t)=>Ie(e,t,e.length-t.length),Ue=e=>t=>t.replace(e,""),je=Ue(/^\s+|\s+$/g),$e=e=>e.length>0,We=e=>!$e(e),qe=e=>void 0!==e.style&&f(e.style.getPropertyValue),Ge=(e,t)=>{const o=t||document,n=o.createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return Xe(n.childNodes[0])},Ke=(e,t)=>{const o=t||document,n=o.createElement(e);return Xe(n)},Ye=(e,t)=>{const o=t||document,n=o.createTextNode(e);return Xe(n)},Xe=e=>{if(null===e||void 0===e)throw new Error("Node cannot be null or undefined");return{dom:e}},Je=(e,t,o)=>R.from(e.dom.elementFromPoint(t,o)).map(Xe),Qe={fromHtml:Ge,fromTag:Ke,fromText:Ye,fromDom:Xe,fromPoint:Je},et="undefined"!==typeof window?window:Function("return this;")(),tt=(e,t)=>{let o=void 0!==t&&null!==t?t:et;for(let n=0;n<e.length&&void 0!==o&&null!==o;++n)o=o[e[n]];return o},ot=(e,t)=>{const o=e.split(".");return tt(o,t)},nt=(e,t)=>ot(e,t),rt=(e,t)=>{const o=nt(e,t);if(void 0===o||null===o)throw new Error(e+" not available on this browser");return o},st=Object.getPrototypeOf,at=e=>rt("HTMLElement",e),it=e=>{const t=ot("ownerDocument.defaultView",e);return l(e)&&(at(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(st(e).constructor.name))},lt=9,ct=11,dt=1,mt=3,ut=e=>{const t=e.dom.nodeName;return t.toLowerCase()},gt=e=>e.dom.nodeType,ht=e=>t=>gt(t)===e,pt=e=>ft(e)&&it(e.dom),ft=ht(dt),bt=ht(mt),vt=ht(lt),yt=ht(ct),wt=e=>t=>ft(t)&&ut(t)===e,xt=(e,t)=>{const o=e.dom;if(o.nodeType!==dt)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")}},Ct=e=>e.nodeType!==dt&&e.nodeType!==lt&&e.nodeType!==ct||0===e.childElementCount,St=(e,t)=>{const o=void 0===t?document:t.dom;return Ct(o)?[]:U(o.querySelectorAll(e),Qe.fromDom)},kt=(e,t)=>{const o=void 0===t?document:t.dom;return Ct(o)?R.none():R.from(o.querySelector(e)).map(Qe.fromDom)},_t=(e,t)=>e.dom===t.dom,Ot=(e,t)=>{const o=e.dom,n=t.dom;return o!==n&&o.contains(n)},Tt=e=>Qe.fromDom(e.dom.ownerDocument),Et=e=>vt(e)?e:Tt(e),Dt=e=>Qe.fromDom(Et(e).dom.documentElement),At=e=>Qe.fromDom(Et(e).dom.defaultView),Mt=e=>R.from(e.dom.parentNode).map(Qe.fromDom),Nt=e=>R.from(e.dom.parentElement).map(Qe.fromDom),Rt=e=>R.from(e.dom.offsetParent).map(Qe.fromDom),Bt=e=>R.from(e.dom.nextSibling).map(Qe.fromDom),Lt=e=>U(e.dom.childNodes,Qe.fromDom),Ht=(e,t)=>{const o=e.dom.childNodes;return R.from(o[t]).map(Qe.fromDom)},It=e=>Ht(e,0),Pt=(e,t)=>({element:e,offset:t}),zt=(e,t)=>{const o=Lt(e);return o.length>0&&t<o.length?Pt(o[t],0):Pt(e,t)},Ft=e=>yt(e)&&p(e.dom.host),Vt=f(Element.prototype.attachShadow)&&f(Node.prototype.getRootNode),Zt=S(Vt),Ut=Vt?e=>Qe.fromDom(e.dom.getRootNode()):Et,jt=e=>Ft(e)?e:Qe.fromDom(Et(e).dom.body),$t=e=>Wt(e).isSome(),Wt=e=>{const t=Ut(e);return Ft(t)?R.some(t):R.none()},qt=e=>Qe.fromDom(e.dom.host),Gt=e=>{if(Zt()&&p(e.target)){const t=Qe.fromDom(e.target);if(ft(t)&&Kt(t)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return le(t)}}return R.from(e.target)},Kt=e=>p(e.dom.shadowRoot),Yt=e=>{const t=bt(e)?e.dom.parentNode:e.dom;if(void 0===t||null===t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return Wt(Qe.fromDom(t)).fold((()=>o.body.contains(t)),C(Yt,qt))},Xt=()=>Jt(Qe.fromDom(document)),Jt=e=>{const t=e.dom.body;if(null===t||void 0===t)throw new Error("Body is not available yet");return Qe.fromDom(t)},Qt=(e,t,o)=>{if(!(i(o)||u(o)||b(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+"")},eo=(e,t,o)=>{Qt(e.dom,t,o)},to=(e,t)=>{const o=e.dom;he(t,((e,t)=>{Qt(o,t,e)}))},oo=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},no=(e,t)=>R.from(oo(e,t)),ro=(e,t)=>{const o=e.dom;return!(!o||!o.hasAttribute)&&o.hasAttribute(t)},so=(e,t)=>{e.dom.removeAttribute(t)},ao=e=>K(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}),io=(e,t,o)=>{if(!i(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);qe(e)&&e.style.setProperty(t,o)},lo=(e,t)=>{qe(e)&&e.style.removeProperty(t)},co=(e,t,o)=>{const n=e.dom;io(n,t,o)},mo=(e,t)=>{const o=e.dom;he(t,((e,t)=>{io(o,t,e)}))},uo=(e,t)=>{const o=e.dom;he(t,((e,t)=>{e.fold((()=>{lo(o,t)}),(e=>{io(o,t,e)}))}))},go=(e,t)=>{const o=e.dom,n=window.getComputedStyle(o),r=n.getPropertyValue(t);return""!==r||Yt(e)?r:ho(o,t)},ho=(e,t)=>qe(e)?e.style.getPropertyValue(t):"",po=(e,t)=>{const o=e.dom,n=ho(o,t);return R.from(n).filter((e=>e.length>0))},fo=e=>{const t={},o=e.dom;if(qe(o))for(let n=0;n<o.style.length;n++){const e=o.style.item(n);t[e]=o.style[e]}return t},bo=(e,t,o)=>{const n=Qe.fromTag(e);co(n,t,o);const r=po(n,t);return r.isSome()},vo=(e,t)=>{const o=e.dom;lo(o,t),Te(no(e,"style").map(je),"")&&so(e,"style")},yo=e=>e.dom.offsetWidth,wo=(e,t)=>{const o=(t,o)=>{if(!b(o)&&!o.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+o);const n=t.dom;qe(n)&&(n.style[e]=o+"px")},n=o=>{const n=t(o);if(n<=0||null===n){const t=go(o,e);return parseFloat(t)||0}return n},r=n,s=(e,t)=>K(t,((t,o)=>{const n=go(e,o),r=void 0===n?0:parseInt(n,10);return isNaN(r)?t:t+r}),0),a=(e,t,o)=>{const n=s(e,o),r=t>n?t-n:0;return r};return{set:o,get:n,getOuter:r,aggregate:s,max:a}},xo=wo("height",(e=>{const t=e.dom;return Yt(e)?t.getBoundingClientRect().height:t.offsetHeight})),Co=e=>xo.get(e),So=e=>xo.getOuter(e),ko=(e,t)=>{const o=["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"],n=xo.max(e,t,o);co(e,"max-height",n+"px")},_o=(e,t)=>{const o=(o,n)=>_o(e+o,t+n);return{left:e,top:t,translate:o}},Oo=_o,To=e=>{const t=e.getBoundingClientRect();return Oo(t.left,t.top)},Eo=(e,t)=>void 0!==e?e:void 0!==t?t:0,Do=e=>{const t=e.dom.ownerDocument,o=t.body,n=t.defaultView,r=t.documentElement;if(o===e.dom)return Oo(o.offsetLeft,o.offsetTop);const s=Eo(null===n||void 0===n?void 0:n.pageYOffset,r.scrollTop),a=Eo(null===n||void 0===n?void 0:n.pageXOffset,r.scrollLeft),i=Eo(r.clientTop,o.clientTop),l=Eo(r.clientLeft,o.clientLeft);return Ao(e).translate(a-l,s-i)},Ao=e=>{const t=e.dom,o=t.ownerDocument,n=o.body;return n===t?Oo(n.offsetLeft,n.offsetTop):Yt(e)?To(t):Oo(0,0)},Mo=wo("width",(e=>e.dom.offsetWidth)),No=(e,t)=>Mo.set(e,t),Ro=e=>Mo.get(e),Bo=e=>Mo.getOuter(e),Lo=(e,t)=>{const o=["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"],n=Mo.max(e,t,o);co(e,"max-width",n+"px")},Ho=e=>{let t,o=!1;return(...n)=>(o||(o=!0,t=e.apply(null,n)),t)},Io=(e,t,o,n)=>{const r=e.isiOS()&&!0===/ipad/i.test(o),s=e.isiOS()&&!r,a=e.isiOS()||e.isAndroid(),i=a||n("(pointer:coarse)"),l=r||!s&&a&&n("(min-device-width:768px)"),c=s||a&&!l,d=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),m=!c&&!l&&!d;return{isiPad:S(r),isiPhone:S(s),isTablet:S(l),isPhone:S(c),isTouch:S(i),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:S(d),isDesktop:S(m)}},Po=(e,t)=>{for(let o=0;o<e.length;o++){const n=e[o];if(n.test(t))return n}},zo=(e,t)=>{const o=Po(e,t);if(!o)return{major:0,minor:0};const n=e=>Number(t.replace(o,"$"+e));return Zo(n(1),n(2))},Fo=(e,t)=>{const o=String(t).toLowerCase();return 0===e.length?Vo():zo(e,o)},Vo=()=>Zo(0,0),Zo=(e,t)=>({major:e,minor:t}),Uo={nu:Zo,detect:Fo,unknown:Vo},jo=(e,t)=>me(t.brands,(t=>{const o=t.brand.toLowerCase();return X(e,(e=>{var t;return o===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((e=>({current:e.name,version:Uo.nu(parseInt(t.version,10),0)})))})),$o=(e,t)=>{const o=String(t).toLowerCase();return X(e,(e=>e.search(o)))},Wo=(e,t)=>$o(e,t).map((e=>{const o=Uo.detect(e.versionRegexes,t);return{current:e.name,version:o}})),qo=(e,t)=>$o(e,t).map((e=>{const o=Uo.detect(e.versionRegexes,t);return{current:e.name,version:o}})),Go=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Ko=e=>t=>Fe(t,e),Yo=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>Fe(e,"edge/")&&Fe(e,"chrome")&&Fe(e,"safari")&&Fe(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Go],search:e=>Fe(e,"chrome")&&!Fe(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>Fe(e,"msie")||Fe(e,"trident")},{name:"Opera",versionRegexes:[Go,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Ko("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Ko("firefox")},{name:"Safari",versionRegexes:[Go,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(Fe(e,"safari")||Fe(e,"mobile/"))&&Fe(e,"applewebkit")}],Xo=[{name:"Windows",search:Ko("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>Fe(e,"iphone")||Fe(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Ko("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:Ko("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Ko("linux"),versionRegexes:[]},{name:"Solaris",search:Ko("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Ko("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Ko("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Jo={browsers:S(Yo),oses:S(Xo)},Qo="Edge",en="Chromium",tn="IE",on="Opera",nn="Firefox",rn="Safari",sn=()=>an({current:void 0,version:Uo.unknown()}),an=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isEdge:n(Qo),isChromium:n(en),isIE:n(tn),isOpera:n(on),isFirefox:n(nn),isSafari:n(rn)}},ln={unknown:sn,nu:an,edge:S(Qo),chromium:S(en),ie:S(tn),opera:S(on),firefox:S(nn),safari:S(rn)},cn="Windows",dn="iOS",mn="Android",un="Linux",gn="macOS",hn="Solaris",pn="FreeBSD",fn="ChromeOS",bn=()=>vn({current:void 0,version:Uo.unknown()}),vn=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isWindows:n(cn),isiOS:n(dn),isAndroid:n(mn),isMacOS:n(gn),isLinux:n(un),isSolaris:n(hn),isFreeBSD:n(pn),isChromeOS:n(fn)}},yn={unknown:bn,nu:vn,windows:S(cn),ios:S(dn),android:S(mn),linux:S(un),macos:S(gn),solaris:S(hn),freebsd:S(pn),chromeos:S(fn)},wn=(e,t,o)=>{const n=Jo.browsers(),r=Jo.oses(),s=t.bind((e=>jo(n,e))).orThunk((()=>Wo(n,e))).fold(ln.unknown,ln.nu),a=qo(r,e).fold(yn.unknown,yn.nu),i=Io(a,s,e,o);return{browser:s,os:a,deviceType:i}},xn={detect:wn},Cn=e=>window.matchMedia(e).matches;let Sn=Ho((()=>xn.detect(navigator.userAgent,R.from(navigator.userAgentData),Cn)));const kn=()=>Sn(),_n=(e,t,o,n,r,s,a)=>({target:e,x:t,y:o,stop:n,prevent:r,kill:s,raw:a}),On=e=>{const t=Qe.fromDom(Gt(e).getOr(e.target)),o=()=>e.stopPropagation(),n=()=>e.preventDefault(),r=x(n,o);return _n(t,e.clientX,e.clientY,o,n,r,e)},Tn=(e,t)=>o=>{e(o)&&t(On(o))},En=(e,t,o,n,r)=>{const s=Tn(o,n);return e.dom.addEventListener(t,s,r),{unbind:O(Mn,e,t,s,r)}},Dn=(e,t,o,n)=>En(e,t,o,n,!1),An=(e,t,o,n)=>En(e,t,o,n,!0),Mn=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)},Nn=(e,t)=>{const o=Mt(e);o.each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},Rn=(e,t)=>{const o=Bt(e);o.fold((()=>{const o=Mt(e);o.each((e=>{Ln(e,t)}))}),(e=>{Nn(e,t)}))},Bn=(e,t)=>{const o=It(e);o.fold((()=>{Ln(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))},Ln=(e,t)=>{e.dom.appendChild(t.dom)},Hn=(e,t,o)=>{Ht(e,o).fold((()=>{Ln(e,t)}),(e=>{Nn(e,t)}))},In=(e,t)=>{j(t,(t=>{Ln(e,t)}))},Pn=e=>{e.dom.textContent="",j(Lt(e),(e=>{zn(e)}))},zn=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},Fn=e=>{const t=void 0!==e?e.dom:document,o=t.body.scrollLeft||t.documentElement.scrollLeft,n=t.body.scrollTop||t.documentElement.scrollTop;return Oo(o,n)},Vn=(e,t,o)=>{const n=void 0!==o?o.dom:document,r=n.defaultView;r&&r.scrollTo(e,t)},Zn=e=>{const t=void 0===e?window:e;return kn().browser.isFirefox()?R.none():R.from(t.visualViewport)},Un=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n}),jn=e=>{const t=void 0===e?window:e,o=t.document,n=Fn(Qe.fromDom(o));return Zn(t).fold((()=>{const e=t.document.documentElement,o=e.clientWidth,r=e.clientHeight;return Un(n.left,n.top,o,r)}),(e=>Un(Math.max(e.pageLeft,n.left),Math.max(e.pageTop,n.top),e.width,e.height)))},$n=()=>Qe.fromDom(document),Wn=(e,t)=>{const o=e.view(t);return o.fold(S([]),(t=>{const o=e.owner(t),n=Wn(e,o);return[t].concat(n)}))},qn=(e,t)=>{const o=t.owner(e),n=Wn(t,o);return R.some(n)},Gn=e=>{var t;const o=e.dom===document?R.none():R.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement);return o.map(Qe.fromDom)},Kn=e=>Tt(e);var Yn=Object.freeze({__proto__:null,view:Gn,owner:Kn});const Xn=e=>{const t=$n(),o=Fn(t),n=qn(e,Yn);return n.fold(O(Do,e),(t=>{const n=Ao(e),r=G(t,((e,t)=>{const o=Ao(t);return{left:e.left+o.left,top:e.top+o.top}}),{left:0,top:0});return Oo(r.left+n.left+o.left,r.top+n.top+o.top)}))},Jn=(e,t,o)=>({point:e,width:t,height:o}),Qn=(e,t,o,n)=>({x:e,y:t,width:o,height:n}),er=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n}),tr=e=>{const t=Do(e),o=Bo(e),n=So(e);return er(t.left,t.top,o,n)},or=e=>{const t=Xn(e),o=Bo(e),n=So(e);return er(t.left,t.top,o,n)},nr=()=>jn(window),rr=e=>{const t=t=>t(e),o=S(e),n=()=>r,r={tag:!0,inner:e,fold:(t,o)=>o(e),isValue:M,isError:A,map:t=>ir.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:()=>R.some(e)};return r},sr=e=>{const t=()=>o,o={tag:!1,inner:e,fold:(t,o)=>t(e),isValue:A,isError:M,map:t,mapError:t=>ir.error(t(e)),bind:t,exists:A,forall:M,getOr:k,or:k,getOrThunk:D,orThunk:D,getOrDie:E(String(e)),each:y,toOptional:R.none};return o},ar=(e,t)=>e.fold((()=>sr(t)),rr),ir={value:rr,error:sr,fromOption:ar};var lr;(function(e){e[e["Error"]=0]="Error",e[e["Value"]=1]="Value"})(lr||(lr={}));const cr=(e,t,o)=>e.stype===lr.Error?t(e.serror):o(e.svalue),dr=e=>{const t=[],o=[];return j(e,(e=>{cr(e,(e=>o.push(e)),(e=>t.push(e)))})),{values:t,errors:o}},mr=(e,t)=>e.stype===lr.Error?{stype:lr.Error,serror:t(e.serror)}:e,ur=(e,t)=>e.stype===lr.Value?{stype:lr.Value,svalue:t(e.svalue)}:e,gr=(e,t)=>e.stype===lr.Value?t(e.svalue):e,hr=(e,t)=>e.stype===lr.Error?t(e.serror):e,pr=e=>({stype:lr.Value,svalue:e}),fr=e=>({stype:lr.Error,serror:e}),br=e=>cr(e,ir.error,ir.value),vr=e=>e.fold(fr,pr),yr={fromResult:vr,toResult:br,svalue:pr,partition:dr,serror:fr,bind:gr,bindError:hr,map:ur,mapError:mr,fold:cr},wr=(e,t,o,n)=>({tag:"field",key:e,newKey:t,presence:o,prop:n}),xr=(e,t)=>({tag:"custom",newKey:e,instantiator:t}),Cr=(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)}},Sr=(e,t)=>t,kr=(e,t)=>{const o=c(e)&&c(t);return o?Or(e,t):t},_r=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)_e(r,t)&&(o[t]=e(o[t],r[t]))}return o},Or=_r(kr),Tr=_r(Sr),Er=()=>({tag:"required",process:{}}),Dr=e=>({tag:"defaultedThunk",process:e}),Ar=e=>Dr(S(e)),Mr=()=>({tag:"option",process:{}}),Nr=e=>({tag:"mergeWithThunk",process:e}),Rr=e=>Nr(S(e)),Br=(e,t)=>e.length>0?yr.svalue(Or(t,Tr.apply(void 0,e))):yr.svalue(t),Lr=e=>x(yr.serror,Q)(e),Hr=(e,t)=>{const o=yr.partition(e);return o.errors.length>0?Lr(o.errors):Br(o.values,t)},Ir=e=>{const t=yr.partition(e);return t.errors.length>0?Lr(t.errors):yr.svalue(t.values)},Pr={consolidateObj:Hr,consolidateArr:Ir},zr=e=>l(e)&&ue(e).length>100?" removed due to size":JSON.stringify(e,null,2),Fr=e=>{const t=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:S("... (only showing first ten failures)")}]):e;return U(t,(e=>"Failed path: ("+e.path.join(" > ")+")\n"+e.getErrorInfo()))},Vr=(e,t)=>yr.serror([{path:e,getErrorInfo:t}]),Zr=(e,t,o)=>Vr(e,(()=>'Could not find valid *required* value for "'+t+'" in '+zr(o))),Ur=(e,t)=>Vr(e,(()=>'Choice schema did not contain choice key: "'+t+'"')),jr=(e,t,o)=>Vr(e,(()=>'The chosen schema: "'+o+'" did not exist in branches: '+zr(t))),$r=(e,t)=>Vr(e,(()=>"There are unsupported fields: ["+t.join(", ")+"] specified")),Wr=(e,t)=>Vr(e,S(t)),qr=e=>{const t=(t,o)=>yr.bindError(e(o),(e=>Wr(t,e))),o=S("val");return{extract:t,toString:o}},Gr=qr(yr.svalue),Kr=(e,t,o,n)=>ke(t,o).fold((()=>Zr(e,o,t)),n),Yr=(e,t,o,n)=>{const r=ke(e,t).getOrThunk((()=>o(e)));return n(r)},Xr=(e,t,o)=>o(ke(e,t)),Jr=(e,t,o,n)=>{const r=ke(e,t).map((t=>!0===t?o(e):t));return n(r)},Qr=(e,t,o,n,r)=>{const s=e=>r.extract(t.concat([n]),e),a=e=>e.fold((()=>yr.svalue(R.none())),(e=>{const o=r.extract(t.concat([n]),e);return yr.map(o,R.some)}));switch(e.tag){case"required":return Kr(t,o,n,s);case"defaultedThunk":return Yr(o,n,e.process,s);case"option":return Xr(o,n,a);case"defaultedOptionThunk":return Jr(o,n,e.process,a);case"mergeWithThunk":return Yr(o,n,S({}),(t=>{const n=Or(e.process(o),t);return s(n)}))}},es=(e,t,o)=>{const n={},r=[];for(const s of o)Cr(s,((o,s,a,i)=>{const l=Qr(a,e,t,o,i);yr.fold(l,(e=>{r.push(...e)}),(e=>{n[s]=e}))}),((e,o)=>{n[e]=o(t)}));return r.length>0?yr.serror(r):yr.svalue(n)},ts=e=>{const t=(t,o)=>e().extract(t,o),o=()=>e().toString();return{extract:t,toString:o}},os=e=>ue(we(e,p)),ns=e=>{const t=rs(e),o=G(e,((e,t)=>Cr(t,(t=>Or(e,{[t]:!0})),S(e))),{}),n=(e,n)=>{const r=u(n)?[]:os(n),s=q(r,(e=>!Oe(o,e)));return 0===s.length?t.extract(e,n):$r(e,s)};return{extract:n,toString:t.toString}},rs=e=>{const t=(t,o)=>es(t,o,e),o=()=>{const t=U(e,(e=>Cr(e,((e,t,o,n)=>e+" -> "+n.toString()),((e,t)=>"state("+e+")"))));return"obj{\n"+t.join("\n")+"}"};return{extract:t,toString:o}},ss=e=>{const t=(t,o)=>{const n=U(o,((o,n)=>e.extract(t.concat(["["+n+"]"]),o)));return Pr.consolidateArr(n)},o=()=>"array("+e.toString()+")";return{extract:t,toString:o}},as=(e,t)=>{const o=void 0!==t?t:k,n=(t,n)=>{const r=[];for(const s of e){const e=s.extract(t,n);if(e.stype===lr.Value)return{stype:lr.Value,svalue:o(e.svalue)};r.push(e)}return Pr.consolidateArr(r)},r=()=>"oneOf("+U(e,(e=>e.toString())).join(", ")+")";return{extract:n,toString:r}},is=(e,t)=>{const o=(t,o)=>ss(qr(e)).extract(t,o),n=(e,n)=>{const r=ue(n),s=o(e,r);return yr.bind(s,(o=>{const r=U(o,(e=>wr(e,e,Er(),t)));return rs(r).extract(e,n)}))},r=()=>"setOf("+t.toString()+")";return{extract:n,toString:r}},ls=(e,t)=>{const o=Ho(t),n=(e,t)=>o().extract(e,t),r=()=>o().toString();return{extract:n,toString:r}},cs=x(ss,rs),ds=S(Gr),ms=(e,t)=>qr((o=>{const n=typeof o;return e(o)?yr.svalue(o):yr.serror(`Expected type: ${t} but got: ${n}`)})),us=ms(b,"number"),gs=ms(i,"string"),hs=ms(u,"boolean"),ps=ms(f,"function"),fs=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=>fs(e[t])));default:return!1}},bs=qr((e=>fs(e)?yr.svalue(e):yr.serror("Expected value to be acceptable for sending via postMessage"))),vs=(e,t,o,n)=>{const r=ke(o,n);return r.fold((()=>jr(e,o,n)),(o=>o.extract(e.concat(["branch: "+n]),t)))},ys=(e,t)=>{const o=(o,n)=>{const r=ke(n,e);return r.fold((()=>Ur(o,e)),(e=>vs(o,n,t,e)))},n=()=>"chooseOn("+e+"). Possible values: "+ue(t);return{extract:o,toString:n}},ws=()=>ss(Gr),xs=e=>qr((t=>e(t).fold(yr.serror,yr.svalue))),Cs=(e,t)=>is((t=>yr.fromResult(e(t))),t),Ss=(e,t,o)=>{const n=t.extract([e],o);return yr.mapError(n,(e=>({input:o,errors:e})))},ks=(e,t,o)=>yr.toResult(Ss(e,t,o)),_s=e=>e.fold((e=>{throw new Error(Ts(e))}),k),Os=(e,t,o)=>_s(ks(e,t,o)),Ts=e=>"Errors: \n"+Fr(e.errors).join("\n")+"\n\nInput object: "+zr(e.input),Es=(e,t)=>ys(e,pe(t,rs)),Ds=(e,t)=>ls(e,t),As=wr,Ms=xr,Ns=e=>xs((t=>z(e,t)?ir.value(t):ir.error(`Unsupported value: "${t}", choose one of "${e.join(", ")}".`))),Rs=e=>As(e,e,Er(),ds()),Bs=(e,t)=>As(e,e,Er(),t),Ls=e=>Bs(e,us),Hs=e=>Bs(e,gs),Is=(e,t)=>As(e,e,Er(),Ns(t)),Ps=e=>Bs(e,hs),zs=e=>Bs(e,ps),Fs=(e,t)=>As(e,e,Mr(),qr((o=>yr.serror("The field: "+e+" is forbidden. "+t)))),Vs=(e,t)=>As(e,e,Er(),rs(t)),Zs=(e,t)=>As(e,e,Er(),cs(t)),Us=(e,t)=>As(e,e,Er(),ss(t)),js=e=>As(e,e,Mr(),ds()),$s=(e,t)=>As(e,e,Mr(),t),Ws=e=>$s(e,us),qs=e=>$s(e,gs),Gs=(e,t)=>$s(e,Ns(t)),Ks=e=>$s(e,ps),Ys=(e,t)=>$s(e,ss(t)),Xs=(e,t)=>$s(e,rs(t)),Js=(e,t)=>$s(e,ns(t)),Qs=(e,t)=>As(e,e,Ar(t),ds()),ea=(e,t,o)=>As(e,e,Ar(t),o),ta=(e,t)=>ea(e,t,us),oa=(e,t)=>ea(e,t,gs),na=(e,t,o)=>ea(e,t,Ns(o)),ra=(e,t)=>ea(e,t,hs),sa=(e,t)=>ea(e,t,ps),aa=(e,t)=>ea(e,t,bs),ia=(e,t,o)=>ea(e,t,ss(o)),la=(e,t,o)=>ea(e,t,rs(o)),ca=e=>{let t=e;const o=()=>t,n=e=>{t=e};return{get:o,set:n}},da=e=>{if(!d(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 j(e,((n,r)=>{const s=ue(n);if(1!==s.length)throw new Error("one and only one name per case");const a=s[0],i=n[a];if(void 0!==o[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!d(i))throw new Error("case arguments must be an array");t.push(a),o[a]=(...o)=>{const n=o.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+i.length+" ("+i+"), got "+n);const s=e=>{const n=ue(e);if(t.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","));const r=te(t,(e=>z(n,e)));if(!r)throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,o)};return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);const n=t[r];return n.apply(null,o)},match:s,log:e=>{console.log(e,{constructors:t,constructor:a,params:o})}}}})),o},ma={generate:da};ma.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const ua=e=>{const t=[],o=[];return j(e,(e=>{e.fold((e=>{t.push(e)}),(e=>{o.push(e)}))})),{errors:t,values:o}},ga=(e,t)=>{const o={};return he(e,((e,n)=>{z(t,n)||(o[n]=e)})),o},ha=(e,t)=>({[e]:t}),pa=e=>{const t={};return j(e,(e=>{t[e.key]=e.value})),t},fa=(e,t)=>ga(e,t),ba=(e,t)=>ha(e,t),va=e=>pa(e),ya=(e,t)=>0===e.length?ir.value(t):ir.value(Or(t,Tr.apply(void 0,e))),wa=e=>ir.error(Q(e)),xa=(e,t)=>{const o=ua(e);return o.errors.length>0?wa(o.errors):ya(o.values,t)},Ca=e=>f(e)?e:A,Sa=(e,t,o)=>{let n=e.dom;const r=Ca(o);while(n.parentNode){n=n.parentNode;const e=Qe.fromDom(n),o=t(e);if(o.isSome())return o;if(r(e))break}return R.none()},ka=(e,t,o)=>{const n=t(e),r=Ca(o);return n.orThunk((()=>r(e)?R.none():Sa(e,t,r)))},_a=(e,t)=>_t(e.element,t.event.target),Oa={can:M,abort:A,run:y},Ta=e=>{if(!Oe(e,"can")&&!Oe(e,"abort")&&!Oe(e,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(e,null,2)+" does not have can, abort, or run!");return{...Oa,...e}},Ea=(e,t)=>(...o)=>K(e,((e,n)=>e&&t(n).apply(void 0,o)),!0),Da=(e,t)=>(...o)=>K(e,((e,n)=>e||t(n).apply(void 0,o)),!1),Aa=e=>f(e)?{can:M,abort:A,run:e}:e,Ma=e=>{const t=Ea(e,(e=>e.can)),o=Da(e,(e=>e.abort)),n=(...t)=>{j(e,(e=>{e.run.apply(void 0,t)}))};return{can:t,abort:o,run:n}},Na=S,Ra=Na("touchstart"),Ba=Na("touchmove"),La=Na("touchend"),Ha=Na("touchcancel"),Ia=Na("mousedown"),Pa=Na("mousemove"),za=Na("mouseout"),Fa=Na("mouseup"),Va=Na("mouseover"),Za=Na("focusin"),Ua=Na("focusout"),ja=Na("keydown"),$a=Na("keyup"),Wa=Na("input"),qa=Na("change"),Ga=Na("click"),Ka=Na("transitioncancel"),Ya=Na("transitionend"),Xa=Na("transitionstart"),Ja=Na("selectstart"),Qa=e=>S("alloy."+e),ei={tap:Qa("tap")},ti=Qa("focus"),oi=Qa("blur.post"),ni=Qa("paste.post"),ri=Qa("receive"),si=Qa("execute"),ai=Qa("focus.item"),ii=ei.tap,li=Qa("longpress"),ci=Qa("sandbox.close"),di=Qa("typeahead.cancel"),mi=Qa("system.init"),ui=Qa("system.touchmove"),gi=Qa("system.touchend"),hi=Qa("system.scroll"),pi=Qa("system.resize"),fi=Qa("system.attached"),bi=Qa("system.detached"),vi=Qa("system.dismissRequested"),yi=Qa("system.repositionRequested"),wi=Qa("focusmanager.shifted"),xi=Qa("slotcontainer.visibility"),Ci=Qa("change.tab"),Si=Qa("dismiss.tab"),ki=Qa("highlight"),_i=Qa("dehighlight"),Oi=(e,t)=>{Ai(e,e.element,t,{})},Ti=(e,t,o)=>{Ai(e,e.element,t,o)},Ei=e=>{Oi(e,si())},Di=(e,t,o)=>{Ai(e,t,o,{})},Ai=(e,t,o,n)=>{const r={target:t,...n};e.getSystem().triggerEvent(o,t,r)},Mi=(e,t,o,n)=>{const r={...n,target:t};e.getSystem().triggerEvent(o,t,r)},Ni=(e,t,o,n)=>{e.getSystem().triggerEvent(o,t,n.event)},Ri=e=>va(e),Bi=(e,t)=>({key:e,value:Ta({abort:t})}),Li=(e,t)=>({key:e,value:Ta({can:t})}),Hi=e=>({key:e,value:Ta({run:(e,t)=>{t.event.prevent()}})}),Ii=(e,t)=>({key:e,value:Ta({run:t})}),Pi=(e,t,o)=>({key:e,value:Ta({run:(e,n)=>{t.apply(void 0,[e,n].concat(o))}})}),zi=e=>t=>Ii(e,t),Fi=e=>t=>({key:e,value:Ta({run:(e,o)=>{_a(e,o)&&t(e,o)}})}),Vi=(e,t)=>Ii(e,((o,n)=>{o.getSystem().getByUid(t).each((t=>{Ni(t,t.element,e,n)}))})),Zi=(e,t,o)=>{const n=t.partUids[o];return Vi(e,n)},Ui=(e,t)=>Ii(e,((e,o)=>{const n=o.event,r=e.getSystem().getByDom(n.target).getOrThunk((()=>{const t=ka(n.target,(t=>e.getSystem().getByDom(t).toOptional()),A);return t.getOr(e)}));t(e,r,o)})),ji=e=>Ii(e,((e,t)=>{t.cut()})),$i=e=>Ii(e,((e,t)=>{t.stop()})),Wi=(e,t)=>Fi(e)(t),qi=Fi(fi()),Gi=Fi(bi()),Ki=Fi(mi()),Yi=zi(si()),Xi=(e,t)=>{const o=t||document,n=o.createElement("div");return n.innerHTML=e,Lt(Qe.fromDom(n))},Ji=e=>e.dom.innerHTML,Qi=(e,t)=>{const o=Tt(e),n=o.dom,r=Qe.fromDom(n.createDocumentFragment()),s=Xi(t,n);In(r,s),Pn(e),Ln(e,r)},el=e=>{const t=Qe.fromTag("div"),o=Qe.fromDom(e.dom.cloneNode(!0));return Ln(t,o),Ji(t)},tl=(e,t)=>Qe.fromDom(e.dom.cloneNode(t)),ol=e=>tl(e,!1),nl=e=>{if(Ft(e))return"#shadow-root";{const t=ol(e);return el(t)}},rl=e=>nl(e),sl=(e,t,o)=>_t(t,e.element)&&!_t(t,o),al=Ri([Li(ti(),((e,t)=>{const o=t.event,n=o.originator,r=o.target;return!sl(e,n,r)||(console.warn(ti()+" did not get interpreted by the desired target. \nOriginator: "+rl(n)+"\nTarget: "+rl(r)+"\nCheck the "+ti()+" event handlers"),!1)}))]);var il=Object.freeze({__proto__:null,events:al});let ll=0;const cl=e=>{const t=new Date,o=t.getTime(),n=Math.floor(1e9*Math.random());return ll++,e+"_"+n+ll+String(o)},dl=S("alloy-id-"),ml=S("data-alloy-id"),ul=dl(),gl=ml(),hl=(e,t)=>{const o=cl(ul+e);return pl(t,o),o},pl=(e,t)=>{Object.defineProperty(e.dom,gl,{value:t,writable:!0})},fl=e=>{const t=ft(e)?e.dom[gl]:null;return R.from(t)},bl=e=>cl(e),vl=k,yl=e=>{const t=t=>`The component must be in a context to execute: ${t}`+(e?"\n"+rl(e().element)+" is not in context.":""),o=e=>()=>{throw new Error(t(e))},n=e=>()=>{console.warn(t(e))};return{debugInfo:S("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:A}},wl=yl(),xl=(e,t,o)=>{const n=o.toString(),r=n.indexOf(")")+1,s=n.indexOf("("),a=n.substring(s+1,r-1).split(/,\s*/);return e.toFunctionAnnotation=()=>({name:t,parameters:Cl(a.slice(0,1).concat(a.slice(3)))}),e},Cl=e=>U(e,(e=>Ze(e,"/*")?e.substring(0,e.length-2):e)),Sl=(e,t)=>{const o=e.toString(),n=o.indexOf(")")+1,r=o.indexOf("("),s=o.substring(r+1,n-1).split(/,\s*/);return e.toFunctionAnnotation=()=>({name:t,parameters:Cl(s)}),e},kl=(e,t)=>{const o=t.toString(),n=o.indexOf(")")+1,r=o.indexOf("("),s=o.substring(r+1,n-1).split(/,\s*/);return e.toFunctionAnnotation=()=>({name:"OVERRIDE",parameters:Cl(s.slice(1))}),e},_l=cl("alloy-premade"),Ol=e=>(Object.defineProperty(e.element.dom,_l,{value:e.uid,writable:!0}),ba(_l,e)),Tl=e=>_e(e.dom,_l),El=e=>ke(e,_l),Dl=e=>kl(((t,...o)=>e(t.getApis(),t,...o)),e),Al={init:()=>Ml({readState:S("No State required")})},Ml=e=>e,Nl=(e,t)=>{const o=U(t,(e=>Xs(e.name(),[Rs("config"),Qs("state",Al)]))),n=ks("component.behaviours",rs(o),e.behaviours).fold((t=>{throw new Error(Ts(t)+"\nComplete spec:\n"+JSON.stringify(e,null,2))}),k);return{list:t,data:pe(n,(e=>{const t=e.map((e=>({config:e.config,state:e.state.init(e.config)})));return S(t)}))}},Rl=e=>e.list,Bl=e=>e.data,Ll=(e,t)=>{const o={};return he(e,((e,n)=>{he(e,((e,r)=>{const s=ke(o,r).getOr([]);o[r]=s.concat([t(n,e)])}))})),o},Hl=e=>({classes:g(e.classes)?[]:e.classes,attributes:g(e.attributes)?{}:e.attributes,styles:g(e.styles)?{}:e.styles}),Il=(e,t)=>({...e,attributes:{...e.attributes,...t.attributes},styles:{...e.styles,...t.styles},classes:e.classes.concat(t.classes)}),Pl=(e,t,o,n)=>{const r={...t};j(o,(t=>{r[t.name()]=t.exhibit(e,n)}));const s=Ll(r,((e,t)=>({name:e,modification:t}))),a=e=>G(e,((e,t)=>({...t.modification,...e})),{}),i=G(s.classes,((e,t)=>t.modification.concat(e)),[]),l=a(s.attributes),c=a(s.styles);return Hl({classes:i,attributes:l,styles:c})},zl=(e,t,o,n)=>{try{const r=ae(o,((o,r)=>{const s=o[t],a=r[t],i=n.indexOf(s),l=n.indexOf(a);if(-1===i)throw new Error("The ordering for "+e+" does not have an entry for "+s+".\nOrder specified: "+JSON.stringify(n,null,2));if(-1===l)throw new Error("The ordering for "+e+" does not have an entry for "+a+".\nOrder specified: "+JSON.stringify(n,null,2));return i<l?-1:l<i?1:0}));return ir.value(r)}catch(r){return ir.error([r])}},Fl=(e,t)=>({handler:e,purpose:t}),Vl=(e,t)=>({cHandler:e,purpose:t}),Zl=(e,t)=>Vl(O.apply(void 0,[e.handler].concat(t)),e.purpose),Ul=e=>e.cHandler,jl=(e,t)=>({name:e,handler:t}),$l=(e,t)=>{const o={};return j(e,(e=>{o[e.name()]=e.handlers(t)})),o},Wl=(e,t,o)=>{const n={...o,...$l(t,e)};return Ll(n,jl)},ql=(e,t,o,n)=>{const r=Wl(e,o,n);return Xl(r,t)},Gl=e=>{const t=Aa(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)}},Kl=(e,t)=>ir.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(U(t,(e=>e.name)),null,2)]),Yl=(e,t,o)=>{const n=t[o];return n?zl("Event: "+o,"name",e,n).map((e=>{const t=U(e,(e=>e.handler));return Ma(t)})):Kl(o,e)},Xl=(e,t)=>{const o=xe(e,((e,o)=>{const n=1===e.length?ir.value(e[0].handler):Yl(e,t,o);return n.map((n=>{const r=Gl(n),s=e.length>1?q(t[o],(t=>F(e,(e=>e.name===t)))).join(" > "):e[0].name;return ba(o,Fl(r,s))}))}));return xa(o,{})},Jl="alloy.base.behaviour",Ql=rs([As("dom","dom",Er(),rs([Rs("tag"),Qs("styles",{}),Qs("classes",[]),Qs("attributes",{}),js("value"),js("innerHtml")])),Rs("components"),Rs("uid"),Qs("events",{}),Qs("apis",{}),As("eventOrder","eventOrder",Rr({[si()]:["disabling",Jl,"toggling","typeaheadevents"],[ti()]:[Jl,"focusing","keying"],[mi()]:[Jl,"disabling","toggling","representing"],[Wa()]:[Jl,"representing","streaming","invalidating"],[bi()]:[Jl,"representing","item-events","tooltipping"],[Ia()]:["focusing",Jl,"item-type-events"],[Ra()]:["focusing",Jl,"item-type-events"],[Va()]:["item-type-events","tooltipping"],[ri()]:["receiving","reflecting","tooltipping"]}),ds()),js("domModification")]),ec=e=>ks("custom.definition",Ql,e),tc=e=>({...e.dom,uid:e.uid,domChildren:U(e.components,(e=>e.element))}),oc=e=>e.domModification.fold((()=>Hl({})),Hl),nc=e=>e.events,rc=(e,t)=>{const o=oo(e,t);return void 0===o||""===o?[]:o.split(" ")},sc=(e,t,o)=>{const n=rc(e,t),r=n.concat([o]);return eo(e,t,r.join(" ")),!0},ac=(e,t,o)=>{const n=q(rc(e,t),(e=>e!==o));return n.length>0?eo(e,t,n.join(" ")):so(e,t),!1},ic=e=>void 0!==e.dom.classList,lc=e=>rc(e,"class"),cc=(e,t)=>sc(e,"class",t),dc=(e,t)=>ac(e,"class",t),mc=(e,t)=>{ic(e)?e.dom.classList.add(t):cc(e,t)},uc=e=>{const t=ic(e)?e.dom.classList:lc(e);0===t.length&&so(e,"class")},gc=(e,t)=>{if(ic(e)){const o=e.dom.classList;o.remove(t)}else dc(e,t);uc(e)},hc=(e,t)=>ic(e)&&e.dom.classList.contains(t),pc=(e,t)=>{j(t,(t=>{mc(e,t)}))},fc=(e,t)=>{j(t,(t=>{gc(e,t)}))},bc=(e,t)=>te(t,(t=>hc(e,t))),vc=e=>{const t=e.dom.classList,o=new Array(t.length);for(let n=0;n<t.length;n++){const e=t.item(n);null!==e&&(o[n]=e)}return o},yc=e=>ic(e)?vc(e):lc(e),wc=e=>e.dom.value,xc=(e,t)=>{if(void 0===t)throw new Error("Value.set was undefined");e.dom.value=t},Cc=(e,t,o)=>{const n=Ht(e,t);return n.map((e=>{const t=o.exists((t=>!_t(t,e)));if(t){const t=o.map(ut).getOr("span"),n=Qe.fromTag(t);return Nn(e,n),n}return e}))},Sc=(e,t,o)=>{o.fold((()=>Ln(e,t)),(e=>{_t(e,t)||(Nn(e,t),zn(e))}))},kc=(e,t,o)=>{const n=U(t,o),r=Lt(e);return j(r.slice(n.length),zn),n},_c=(e,t,o,n)=>{const r=Ht(e,t),s=n(o,r),a=Cc(e,t,r);return Sc(e,s.element,a),s},Oc=(e,t,o)=>kc(e,t,((t,n)=>_c(e,n,t,o))),Tc=(e,t)=>kc(e,t,((t,o)=>{const n=Ht(e,o);return Sc(e,t,n),t})),Ec=(e,t)=>{const o=ue(e),n=ue(t),r=ne(n,o),s=ye(e,((e,o)=>!_e(t,o)||e!==t[o])).t;return{toRemove:r,toSet:s}},Dc=(e,t)=>{const{class:o,style:n,...r}=ao(t),{toSet:s,toRemove:a}=Ec(e.attributes,r),i=()=>{j(a,(e=>so(t,e))),to(t,s)},l=fo(t),{toSet:c,toRemove:d}=Ec(e.styles,l),m=()=>{j(d,(e=>vo(t,e))),mo(t,c)},u=yc(t),g=ne(u,e.classes),h=ne(e.classes,u),p=()=>{pc(t,h),fc(t,g)},f=e=>{Qi(t,e)},b=()=>{const o=e.domChildren;Tc(t,o)},v=()=>{const o=t,n=e.value.getOrUndefined();n!==wc(o)&&xc(o,null!==n&&void 0!==n?n:"")};return i(),p(),m(),e.innerHtml.fold(b,f),v(),t},Ac=e=>{const t=Qe.fromTag(e.tag);to(t,e.attributes),pc(t,e.classes),mo(t,e.styles),e.innerHtml.each((e=>Qi(t,e)));const o=e.domChildren;return In(t,o),e.value.each((e=>{xc(t,e)})),t},Mc=(e,t)=>{try{const o=Dc(e,t);return R.some(o)}catch(o){return R.none()}},Nc=e=>e.innerHtml.isSome()&&e.domChildren.length>0,Rc=(e,t)=>{const o=t=>ut(t)===e.tag&&!Nc(e)&&!Tl(t),n=t.filter(o).bind((t=>Mc(e,t))).getOrThunk((()=>Ac(e)));return pl(n,e.uid),n},Bc=e=>{const t=ke(e,"behaviours").getOr({});return ee(ue(t),(e=>{const o=t[e];return p(o)?[o.me]:[]}))},Lc=(e,t)=>Nl(e,t),Hc=e=>{const t=Bc(e);return Lc(e,t)},Ic=(e,t,o)=>{const n=tc(e),r=oc(e),s={"alloy.base.modification":r},a=t.length>0?Pl(o,s,t,n):r;return Il(n,a)},Pc=(e,t,o)=>{const n={"alloy.base.behaviour":nc(e)};return ql(o,e.eventOrder,t,n).getOrDie()},zc=(e,t)=>{const o=()=>w,n=ca(wl),r=_s(ec(e)),s=Hc(e),a=Rl(s),i=Bl(s),l=Ic(r,a,i),c=Rc(l,t),d=Pc(r,a,i),m=ca(r.components),u=e=>{n.set(e)},g=()=>{n.set(yl(o))},h=()=>{const e=Lt(c),t=ee(e,(e=>n.get().getByDom(e).fold((()=>[]),se)));m.set(t)},p=t=>{const o=i,n=f(o[t.name()])?o[t.name()]:()=>{throw new Error("Could not find "+t.name()+" in "+JSON.stringify(e,null,2))};return n()},b=e=>f(i[e.name()]),v=()=>r.apis,y=e=>i[e]().map((e=>e.state.readState())).getOr("not enabled"),w={uid:e.uid,getSystem:n.get,config:p,hasConfigured:b,spec:e,readState:y,getApis:v,connect:u,disconnect:g,element:c,syncComponents:h,components:m.get,events:d};return w},Fc=(e,t)=>{const o=ke(e,"components").getOr([]);return t.fold((()=>U(o,qc)),(e=>U(o,((t,o)=>Wc(t,Ht(e,o))))))},Vc=(e,t)=>{const{events:o,...n}=vl(e),r=Fc(n,t),s={...n,events:{...il,...o},components:r};return ir.value(zc(s,t))},Zc=e=>{const t=Qe.fromText(e);return Uc({element:t})},Uc=e=>{const t=Os("external.component",ns([Rs("element"),js("uid")]),e),o=ca(yl()),n=e=>{o.set(e)},r=()=>{o.set(yl((()=>a)))},s=t.uid.getOrThunk((()=>bl("external")));pl(t.element,s);const a={uid:s,getSystem:o.get,config:R.none,hasConfigured:A,connect:n,disconnect:r,getApis:()=>({}),element:t.element,spec:e,readState:S("No state"),syncComponents:y,components:S([]),events:{}};return Ol(a)},jc=bl,$c=e=>_e(e,"uid"),Wc=(e,t)=>El(e).getOrThunk((()=>{const o=$c(e)?e:{uid:jc(""),...e};return Vc(o,t).getOrDie()})),qc=e=>Wc(e,R.none()),Gc=Ol;var Kc=(e,t,o,n,r)=>e(o,n)?R.some(o):f(r)&&r(o)?R.none():t(o,n,r);const Yc=(e,t,o)=>{let n=e.dom;const r=f(o)?o:A;while(n.parentNode){n=n.parentNode;const e=Qe.fromDom(n);if(t(e))return R.some(e);if(r(e))break}return R.none()},Xc=(e,t,o)=>{const n=(e,t)=>t(e);return Kc(n,Yc,e,t,o)},Jc=(e,t)=>{const o=e=>t(Qe.fromDom(e)),n=X(e.dom.childNodes,o);return n.map(Qe.fromDom)},Qc=(e,t)=>{const o=e=>{for(let n=0;n<e.childNodes.length;n++){const r=Qe.fromDom(e.childNodes[n]);if(t(r))return R.some(r);const s=o(e.childNodes[n]);if(s.isSome())return s}return R.none()};return o(e.dom)},ed=(e,t,o)=>Xc(e,t,o).isSome(),td=(e,t,o)=>Yc(e,(e=>xt(e,t)),o),od=(e,t)=>Jc(e,(e=>xt(e,t))),nd=(e,t)=>kt(t,e),rd=(e,t,o)=>{const n=(e,t)=>xt(e,t);return Kc(n,td,e,t,o)},sd="aria-controls",ad=e=>{const t=Xc(e,(e=>{if(!ft(e))return!1;const t=oo(e,"id");return void 0!==t&&t.indexOf(sd)>-1}));return t.bind((e=>{const t=oo(e,"id"),o=Ut(e);return nd(o,`[${sd}="${t}"]`)}))},id=()=>{const e=cl(sd),t=t=>{eo(t,sd,e)},o=e=>{so(e,sd)};return{id:e,link:t,unlink:o}},ld=(e,t)=>ad(t).exists((t=>cd(e,t))),cd=(e,t)=>ed(t,(t=>_t(t,e.element)),A)||ld(e,t),dd="unknown";var md;(function(e){e[e["STOP"]=0]="STOP",e[e["NORMAL"]=1]="NORMAL",e[e["LOGGING"]=2]="LOGGING"})(md||(md={}));const ud=ca({}),gd=(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();z(["mousemove","mouseover","mouseout",mi()],e)||console.log(e,{event:e,time:r-n,target:t.dom,sequence:U(o,(e=>z(["cut","stopped","response"],e.outcome)?"{"+e.purpose+"} "+e.outcome+" at ("+rl(e.target)+")":e.outcome))})}}},hd=(e,t,o)=>{const n=ke(ud.get(),e).orThunk((()=>{const t=ue(ud.get());return me(t,(t=>e.indexOf(t)>-1?R.some(ud.get()[t]):R.none()))})).getOr(md.NORMAL);switch(n){case md.NORMAL:return o(yd());case md.LOGGING:{const n=gd(e,t),r=o(n);return n.write(),r}case md.STOP:return!0}},pd=["alloy/data/Fields","alloy/debugging/Debugging"],fd=()=>{const e=new Error;if(void 0!==e.stack){const t=e.stack.split("\n");return X(t,(e=>e.indexOf("alloy")>0&&!F(pd,(t=>e.indexOf(t)>-1)))).getOr(dd)}return dd},bd={logEventCut:y,logEventStopped:y,logNoParent:y,logEventNoHandlers:y,logEventResponse:y,write:y},vd=(e,t,o)=>hd(e,t,o),yd=S(bd),wd=S([Rs("menu"),Rs("selectedMenu")]),xd=S([Rs("item"),Rs("selectedItem")]);S(rs(xd().concat(wd())));const Cd=S(rs(xd())),Sd=Vs("initSize",[Rs("numColumns"),Rs("numRows")]),kd=()=>Bs("markers",Cd()),_d=()=>Vs("markers",[Rs("backgroundMenu")].concat(wd()).concat(xd())),Od=e=>Vs("markers",U(e,Rs)),Td=(e,t,o)=>(fd(),As(t,t,o,xs((e=>ir.value(((...t)=>e.apply(void 0,t))))))),Ed=e=>Td("onHandler",e,Ar(y)),Dd=e=>Td("onKeyboardHandler",e,Ar(R.none)),Ad=e=>Td("onHandler",e,Er()),Md=e=>Td("onKeyboardHandler",e,Er()),Nd=(e,t)=>Ms(e,S(t)),Rd=e=>Ms(e,k),Bd=S(Sd),Ld=(e,t,o,n,r,s,a,i=!1)=>({x:e,y:t,bubble:o,direction:n,placement:r,restriction:s,label:`${a}-${r}`,alwaysFit:i}),Hd=ma.generate([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Id=(e,t,o,n,r,s,a,i,l)=>e.fold(t,o,n,r,s,a,i,l),Pd=(e,t,o,n)=>e.fold(t,t,n,n,t,n,o,o),zd=(e,t,o,n)=>e.fold(t,n,t,n,o,o,t,n),Fd=Hd.southeast,Vd=Hd.southwest,Zd=Hd.northeast,Ud=Hd.northwest,jd=Hd.south,$d=Hd.north,Wd=Hd.east,qd=Hd.west,Gd=(e,t,o,n)=>{const r=e+t;return r>n?o:r<o?n:r},Kd=(e,t,o)=>Math.min(Math.max(e,t),o),Yd=(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}},Xd=(e,t)=>re(["left","right","top","bottom"],(o=>ke(t,o).map((t=>Yd(e,t))))),Jd=(e,t,o)=>{const n=(n,r)=>t[n].map((t=>{const s="top"===n||"bottom"===n,a=s?o.top:o.left,i="left"===n||"top"===n?Math.max:Math.min,l=i(t,r)+a;return s?Kd(l,e.y,e.bottom):Kd(l,e.x,e.right)})).getOr(r),r=n("left",e.x),s=n("top",e.y),a=n("right",e.right),i=n("bottom",e.bottom);return er(r,s,a-r,i-s)},Qd="layout",em=e=>e.x,tm=(e,t)=>e.x+e.width/2-t.width/2,om=(e,t)=>e.x+e.width-t.width,nm=(e,t)=>e.y-t.height,rm=e=>e.y+e.height,sm=(e,t)=>e.y+e.height/2-t.height/2,am=e=>e.x+e.width,im=(e,t)=>e.x-t.width,lm=(e,t,o)=>Ld(em(e),rm(e),o.southeast(),Fd(),"southeast",Xd(e,{left:1,top:3}),Qd),cm=(e,t,o)=>Ld(om(e,t),rm(e),o.southwest(),Vd(),"southwest",Xd(e,{right:0,top:3}),Qd),dm=(e,t,o)=>Ld(em(e),nm(e,t),o.northeast(),Zd(),"northeast",Xd(e,{left:1,bottom:2}),Qd),mm=(e,t,o)=>Ld(om(e,t),nm(e,t),o.northwest(),Ud(),"northwest",Xd(e,{right:0,bottom:2}),Qd),um=(e,t,o)=>Ld(tm(e,t),nm(e,t),o.north(),$d(),"north",Xd(e,{bottom:2}),Qd),gm=(e,t,o)=>Ld(tm(e,t),rm(e),o.south(),jd(),"south",Xd(e,{top:3}),Qd),hm=(e,t,o)=>Ld(am(e),sm(e,t),o.east(),Wd(),"east",Xd(e,{left:0}),Qd),pm=(e,t,o)=>Ld(im(e,t),sm(e,t),o.west(),qd(),"west",Xd(e,{right:1}),Qd),fm=()=>[lm,cm,dm,mm,gm,um,hm,pm],bm=()=>[cm,lm,mm,dm,gm,um,hm,pm],vm=()=>[dm,mm,lm,cm,um,gm],ym=()=>[mm,dm,cm,lm,um,gm],wm=()=>[lm,cm,dm,mm,gm,um],xm=()=>[cm,lm,mm,dm,gm,um],Cm=(e,t)=>t.universal?e:q(e,(e=>z(t.channels,e))),Sm=e=>Ri([Ii(ri(),((t,o)=>{const n=e.channels,r=ue(n),s=o,a=Cm(r,s);j(a,(e=>{const o=n[e],r=o.schema,a=Os("channel["+e+"] data\nReceiver: "+rl(t.element),r,s.data);o.onReceive(t,a)}))}))]);var km=Object.freeze({__proto__:null,events:Sm}),_m=[Bs("channels",Cs(ir.value,ns([Ad("onReceive"),Qs("schema",ds())])))];const Om=(e,t,o)=>Yi((n=>{o(n,e,t)})),Tm=(e,t,o)=>Ki(((n,r)=>{o(n,e,t)})),Em=(e,t,o,n,r,s)=>{const a=ns(e),i=Xs(t,[Js("config",e)]);return Nm(a,i,t,o,n,r,s)},Dm=(e,t,o,n,r,s)=>{const a=e,i=Xs(t,[$s("config",e)]);return Nm(a,i,t,o,n,r,s)},Am=(e,t,o)=>{const n=(n,...r)=>{const s=[n].concat(r);return n.config({name:S(e)}).fold((()=>{throw new Error("We could not find any behaviour configuration for: "+e+". Using API: "+o)}),(e=>{const o=Array.prototype.slice.call(s,1);return t.apply(void 0,[n,e.config,e.state].concat(o))}))};return xl(n,o,t)},Mm=e=>({key:e,value:void 0}),Nm=(e,t,o,n,r,s,a)=>{const i=e=>Oe(e,o)?e[o]():R.none(),l=pe(r,((e,t)=>Am(o,e,t))),c=pe(s,((e,t)=>Sl(e,t))),d={...c,...l,revoke:O(Mm,o),config:t=>{const n=Os(o+"-config",e,t);return{key:o,value:{config:n,me:d,configAsRaw:Ho((()=>Os(o+"-config",e,t))),initialConfig:t,state:a}}},schema:S(t),exhibit:(e,t)=>Me(i(e),ke(n,"exhibit"),((e,o)=>o(t,e.config,e.state))).getOrThunk((()=>Hl({}))),name:S(o),handlers:e=>i(e).map((e=>{const t=ke(n,"events").getOr((()=>({})));return t(e.config,e.state)})).getOr({})};return d},Rm=e=>va(e),Bm=ns([Rs("fields"),Rs("name"),Qs("active",{}),Qs("apis",{}),Qs("state",Al),Qs("extra",{})]),Lm=e=>{const t=Os("Creating behaviour: "+e.name,Bm,e);return Em(t.fields,t.name,t.active,t.apis,t.extra,t.state)},Hm=ns([Rs("branchKey"),Rs("branches"),Rs("name"),Qs("active",{}),Qs("apis",{}),Qs("state",Al),Qs("extra",{})]),Im=e=>{const t=Os("Creating behaviour: "+e.name,Hm,e);return Dm(Es(t.branchKey,t.branches),t.name,t.active,t.apis,t.extra,t.state)},Pm=S(void 0),zm=Lm({fields:_m,name:"receiving",active:km}),Fm=(e,t)=>Hl({classes:[],styles:t.useFixed()?{}:{position:"relative"}});var Vm=Object.freeze({__proto__:null,exhibit:Fm});const Zm=e=>e.dom.focus(),Um=e=>e.dom.blur(),jm=e=>{const t=Ut(e).dom;return e.dom===t.activeElement},$m=(e=$n())=>R.from(e.dom.activeElement).map(Qe.fromDom),Wm=e=>$m(Ut(e)).filter((t=>e.dom.contains(t.dom))),qm=(e,t)=>{const o=Ut(t),n=$m(o).bind((e=>{const o=t=>_t(e,t);return o(t)?R.some(t):Qc(t,o)})),r=e(t);return n.each((e=>{$m(o).filter((t=>_t(t,e))).fold((()=>{Zm(e)}),y)})),r},Gm=(e,t,o,n,r)=>{const s=e=>e+"px";return{position:e,left:t.map(s),top:o.map(s),right:n.map(s),bottom:r.map(s)}},Km=e=>({...e,position:R.some(e.position)}),Ym=(e,t)=>{uo(e,Km(t))},Xm=ma.generate([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Jm=(e,t,o,n,r,s)=>{const a=t.rect,i=a.x-o,l=a.y-n,c=a.width,d=a.height,m=r-(i+c),u=s-(l+d),g=R.some(i),h=R.some(l),p=R.some(m),f=R.some(u),b=R.none();return Id(t.direction,(()=>Gm(e,g,h,b,b)),(()=>Gm(e,b,h,p,b)),(()=>Gm(e,g,b,b,f)),(()=>Gm(e,b,b,p,f)),(()=>Gm(e,g,h,b,b)),(()=>Gm(e,g,b,b,f)),(()=>Gm(e,g,h,b,b)),(()=>Gm(e,b,h,p,b)))},Qm=(e,t)=>e.fold((()=>{const e=t.rect;return Gm("absolute",R.some(e.x),R.some(e.y),R.none(),R.none())}),((e,o,n,r)=>Jm("absolute",t,e,o,n,r)),((e,o,n,r)=>Jm("fixed",t,e,o,n,r))),eu=(e,t)=>{const o=O(Xn,t),n=e.fold(o,o,(()=>{const e=Fn();return Xn(t).translate(-e.left,-e.top)})),r=Bo(t),s=So(t);return er(n.left,n.top,r,s)},tu=(e,t)=>t.fold((()=>e.fold(nr,nr,er)),(t=>e.fold(t,t,(()=>{const o=t(),n=ou(e,o.x,o.y);return er(n.left,n.top,o.width,o.height)})))),ou=(e,t,o)=>{const n=Oo(t,o),r=()=>{const e=Fn();return n.translate(-e.left,-e.top)};return e.fold(S(n),S(n),r)},nu=(e,t,o,n)=>e.fold(t,o,n);Xm.none;const ru=Xm.relative,su=Xm.fixed,au=(e,t)=>({anchorBox:e,origin:t}),iu=(e,t)=>au(e,t),lu="data-alloy-placement",cu=(e,t)=>{eo(e,lu,t)},du=e=>no(e,lu),mu=e=>so(e,lu),uu=ma.generate([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),gu=(e,t)=>{const{x:o,y:n,right:r,bottom:s}=t,{x:a,y:i,right:l,bottom:c,width:d,height:m}=e,u=a>=o&&a<=r,g=i>=n&&i<=s,h=u&&g,p=l<=r&&l>=o,f=c<=s&&c>=n,b=p&&f,v=Math.min(d,a>=o?r-a:l-o),y=Math.min(m,i>=n?s-i:c-n);return{originInBounds:h,sizeInBounds:b,visibleW:v,visibleH:y}},hu=(e,t)=>{const{x:o,y:n,right:r,bottom:s}=t,{x:a,y:i,width:l,height:c}=e,d=Math.max(o,r-l),m=Math.max(n,s-c),u=Kd(a,o,d),g=Kd(i,n,m),h=Math.min(u+l,r)-u,p=Math.min(g+c,s)-g;return er(u,g,h,p)},pu=(e,t,o)=>{const n=S(t.bottom-o.y),r=S(o.bottom-t.y),s=Pd(e,r,r,n),a=S(t.right-o.x),i=S(o.right-t.x),l=zd(e,i,i,a);return{maxWidth:l,maxHeight:s}},fu=(e,t,o,n)=>{const r=e.bubble,s=r.offset,a=Jd(n,e.restriction,s),i=e.x+s.left,l=e.y+s.top,c=er(i,l,t,o),{originInBounds:d,sizeInBounds:m,visibleW:u,visibleH:g}=gu(c,a),h=d&&m,p=h?c:hu(c,a),f=p.width>0&&p.height>0,{maxWidth:b,maxHeight:v}=pu(e.direction,p,n),y={rect:p,maxHeight:v,maxWidth:b,direction:e.direction,placement:e.placement,classes:{on:r.classesOn,off:r.classesOff},layout:e.label,testY:l};return h||e.alwaysFit?uu.fit(y):uu.nofit(y,u,g,f)},bu=(e,t,o,n,r,s)=>{const a=n.width,i=n.height,l=(t,l,c,d,m)=>{const u=t(o,n,r,e,s),g=fu(u,a,i,s);return g.fold(S(g),((e,t,o,n)=>{const r=m===n?o>d||t>c:!m&&n;return r?g:uu.nofit(l,c,d,m)}))},c=K(t,((e,t)=>{const o=O(l,t);return e.fold(S(e),o)}),uu.nofit({rect:o,maxHeight:n.height,maxWidth:n.width,direction:Fd(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:o.y},-1,-1,!1));return c.fold(k,k)},vu=e=>{const t=ca(R.none()),o=()=>t.get().each(e),n=()=>{o(),t.set(R.none())},r=()=>t.get().isSome(),s=()=>t.get(),a=e=>{o(),t.set(R.some(e))};return{clear:n,isSet:r,get:s,set:a}},yu=()=>vu((e=>e.destroy())),wu=()=>vu((e=>e.unbind())),xu=()=>{const e=vu(y),t=t=>e.get().each(t);return{...e,on:t}},Cu=M,Su=(e,t,o)=>Dn(e,t,Cu,o),ku=(e,t,o)=>An(e,t,Cu,o),_u=On,Ou=["top","bottom","right","left"],Tu="data-alloy-transition-timer",Eu=(e,t)=>bc(e,t.classes),Du=(e,t,o)=>o.exists((o=>{const n=e.mode;return"all"===n||o[n]!==t[n]})),Au=(e,t)=>{const o=e=>parseFloat(e).toFixed(3);return Ce(t,((t,n)=>{const r=e[n].map(o),s=t.map(o);return!Ee(r,s)})).isSome()},Mu=e=>{const t=t=>{const o=go(e,t),n=o.split(/\s*,\s*/);return q(n,$e)},o=e=>{if(i(e)&&/^[\d.]+/.test(e)){const t=parseFloat(e);return Ze(e,"ms")?t:1e3*t}return 0},n=t("transition-delay"),r=t("transition-duration");return K(r,((e,t,r)=>{const s=o(n[r])+o(t);return Math.max(e,s)}),0)},Nu=(e,t)=>{const o=wu(),n=wu();let r;const s=t=>{var o;const n=null!==(o=t.raw.pseudoElement)&&void 0!==o?o:"";return _t(t.target,e)&&We(n)&&z(Ou,t.raw.propertyName)},a=a=>{if(h(a)||s(a)){o.clear(),n.clear();const s=null===a||void 0===a?void 0:a.raw.type;(h(s)||s===Ya())&&(clearTimeout(r),so(e,Tu),fc(e,t.classes))}},i=Su(e,Xa(),(t=>{s(t)&&(i.unbind(),o.set(Su(e,Ya(),a)),n.set(Su(e,Ka(),a)))})),l=Mu(e);requestAnimationFrame((()=>{r=setTimeout(a,l+17),eo(e,Tu,r)}))},Ru=(e,t)=>{pc(e,t.classes),no(e,Tu).each((t=>{clearTimeout(parseInt(t,10)),so(e,Tu)})),Nu(e,t)},Bu=(e,t,o,n,r,s)=>{const a=Du(n,r,s);if(a||Eu(e,n)){co(e,"position",o.position);const s=eu(t,e),i=Qm(t,{...r,rect:s}),l=re(Ou,(e=>i[e]));Au(o,l)&&(uo(e,l),a&&Ru(e,n),yo(e))}else fc(e,n.classes)},Lu=e=>({width:Bo(e),height:So(e)}),Hu=(e,t,o,n)=>{vo(t,"max-height"),vo(t,"max-width");const r=Lu(t);return bu(t,n.preference,e,r,o,n.bounds)},Iu=(e,t)=>{const o=t.classes;fc(e,o.off),pc(e,o.on)},Pu=(e,t,o)=>{const n=o.maxHeightFunction;n(e,t.maxHeight)},zu=(e,t,o)=>{const n=o.maxWidthFunction;n(e,t.maxWidth)},Fu=(e,t,o)=>{const n=Qm(o.origin,t);o.transition.each((r=>{Bu(e,o.origin,n,r,t,o.lastPlacement)})),Ym(e,n)},Vu=(e,t)=>{cu(e,t.placement)},Zu=(e,t)=>{ko(e,Math.floor(t))},Uu=S(((e,t)=>{Zu(e,t),mo(e,{"overflow-x":"hidden","overflow-y":"auto"})})),ju=S(((e,t)=>{Zu(e,t)})),$u=(e,t,o)=>void 0===e[t]?o:e[t],Wu=(e,t,o,n,r,s,a,i)=>{const l=$u(a,"maxHeightFunction",Uu()),c=$u(a,"maxWidthFunction",y),d=e.anchorBox,m=e.origin,u={bounds:tu(m,s),origin:m,preference:n,maxHeightFunction:l,maxWidthFunction:c,lastPlacement:r,transition:i};return qu(d,t,o,u)},qu=(e,t,o,n)=>{const r=Hu(e,t,o,n);return Fu(t,r,n),Vu(t,r),Iu(t,r),Pu(t,r,n),zu(t,r,n),{layout:r.layout,placement:r.placement}},Gu=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],Ku=(e,t,o,n=1)=>{const r=e*n,s=t*n,a=e=>ke(o,e).getOr([]),i=(e,t,o)=>{const n=ne(Gu,o);return{offset:Oo(e,t),classesOn:ee(o,a),classesOff:ee(n,a)}};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,s,["top","alignLeft","inset"]),insetNorthwest:()=>i(-r,s,["top","alignRight","inset"]),insetNorth:()=>i(-r/2,s,["top","alignCentre","inset"]),insetSoutheast:()=>i(r,-s,["bottom","alignLeft","inset"]),insetSouthwest:()=>i(-r,-s,["bottom","alignRight","inset"]),insetSouth:()=>i(-r/2,-s,["bottom","alignCentre","inset"]),insetEast:()=>i(-r,-s/2,["valignCentre","right","inset"]),insetWest:()=>i(r,-s/2,["valignCentre","left","inset"])}},Yu=()=>Ku(0,0,{}),Xu=k,Ju=(e,t)=>o=>"rtl"===Qu(o)?t:e,Qu=e=>"rtl"===go(e,"direction")?"rtl":"ltr";var eg;(function(e){e["TopToBottom"]="toptobottom",e["BottomToTop"]="bottomtotop"})(eg||(eg={}));const tg="data-alloy-vertical-dir",og=e=>ed(e,(e=>ft(e)&&oo(e,"data-alloy-vertical-dir")===eg.BottomToTop)),ng=()=>Xs("layouts",[Rs("onLtr"),Rs("onRtl"),js("onBottomLtr"),js("onBottomRtl")]),rg=(e,t,o,n,r,s,a)=>{const i=a.map(og).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(s):c.getOr(n),u=Ju(d,m);return u(e)},sg=(e,t,o)=>{const n=t.hotspot,r=eu(o,n.element),s=rg(e.element,t,wm(),xm(),vm(),ym(),R.some(t.hotspot.element));return R.some(Xu({anchorBox:r,bubble:t.bubble.getOr(Yu()),overrides:t.overrides,layouts:s,placer:R.none()}))};var ag=[Rs("hotspot"),js("bubble"),Qs("overrides",{}),ng(),Nd("placement",sg)];const ig=(e,t,o)=>{const n=ou(o,t.x,t.y),r=er(n.left,n.top,t.width,t.height),s=rg(e.element,t,fm(),bm(),fm(),bm(),R.none());return R.some(Xu({anchorBox:r,bubble:t.bubble,overrides:t.overrides,layouts:s,placer:R.none()}))};var lg=[Rs("x"),Rs("y"),Qs("height",0),Qs("width",0),Qs("bubble",Yu()),Qs("overrides",{}),ng(),Nd("placement",ig)];const cg=ma.generate([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),dg=e=>e.fold(k,((e,t,o)=>e.translate(-t,-o))),mg=e=>e.fold(k,k),ug=e=>K(e,((e,t)=>e.translate(t.left,t.top)),Oo(0,0)),gg=e=>{const t=U(e,dg);return ug(t)},hg=e=>{const t=U(e,mg);return ug(t)},pg=cg.screen,fg=cg.absolute,bg=(e,t,o)=>{const n=At(o.root).dom,r=t=>{const o=Tt(t),n=Tt(e.element);return _t(o,n)};return R.from(n.frameElement).map(Qe.fromDom).filter(r).map(Do)},vg=(e,t,o)=>{const n=Tt(e.element),r=Fn(n),s=bg(e,t,o).getOr(r);return fg(s,r.left,r.top)},yg=(e,t,o,n)=>{const r=pg(Oo(e,t));return R.some(Jn(r,o,n))},wg=(e,t,o,n,r)=>e.map((e=>{const s=[t,e.point],a=nu(n,(()=>hg(s)),(()=>hg(s)),(()=>gg(s))),i=Qn(a.left,a.top,e.width,e.height),l=o.showAbove?vm():wm(),c=o.showAbove?ym():xm(),d=rg(r,o,l,c,l,c,R.none());return Xu({anchorBox:i,bubble:o.bubble.getOr(Yu()),overrides:o.overrides,layouts:d,placer:R.none()})})),xg=(e,t,o)=>{const n=vg(e,o,t);return t.node.filter(Yt).bind((r=>{const s=r.dom.getBoundingClientRect(),a=yg(s.left,s.top,s.width,s.height),i=t.node.getOr(e.element);return wg(a,n,t,o,i)}))};var Cg=[Rs("node"),Rs("root"),js("bubble"),ng(),Qs("overrides",{}),Qs("showAbove",!1),Nd("placement",xg)];const Sg="\ufeff",kg=" ",_g=(e,t,o,n)=>({start:e,soffset:t,finish:o,foffset:n}),Og={create:_g},Tg=ma.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Eg=(e,t,o,n)=>e.fold(t,o,n),Dg=e=>e.fold(k,k,k),Ag=Tg.before,Mg=Tg.on,Ng=Tg.after,Rg={before:Ag,on:Mg,after:Ng,cata:Eg,getStart:Dg},Bg=ma.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Lg=e=>Bg.exact(e.start,e.soffset,e.finish,e.foffset),Hg=e=>e.match({domRange:e=>Qe.fromDom(e.startContainer),relative:(e,t)=>Rg.getStart(e),exact:(e,t,o,n)=>e}),Ig=Bg.domRange,Pg=Bg.relative,zg=Bg.exact,Fg=e=>{const t=Hg(e);return At(t)},Vg=Og.create,Zg={domRange:Ig,relative:Pg,exact:zg,exactFromRange:Lg,getWin:Fg,range:Vg},Ug=(e,t)=>{t.fold((t=>{e.setStartBefore(t.dom)}),((t,o)=>{e.setStart(t.dom,o)}),(t=>{e.setStartAfter(t.dom)}))},jg=(e,t)=>{t.fold((t=>{e.setEndBefore(t.dom)}),((t,o)=>{e.setEnd(t.dom,o)}),(t=>{e.setEndAfter(t.dom)}))},$g=(e,t,o)=>{const n=e.document.createRange();return Ug(n,t),jg(n,o),n},Wg=(e,t,o,n,r)=>{const s=e.document.createRange();return s.setStart(t.dom,o),s.setEnd(n.dom,r),s},qg=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}),Gg=e=>{const t=e.getClientRects(),o=t.length>0?t[0]:e.getBoundingClientRect();return o.width>0||o.height>0?R.some(o).map(qg):R.none()},Kg=e=>{const t=e.getBoundingClientRect();return t.width>0||t.height>0?R.some(t).map(qg):R.none()},Yg=ma.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Xg=(e,t,o)=>t(Qe.fromDom(o.startContainer),o.startOffset,Qe.fromDom(o.endContainer),o.endOffset),Jg=(e,t)=>t.match({domRange:e=>({ltr:S(e),rtl:R.none}),relative:(t,o)=>({ltr:Ho((()=>$g(e,t,o))),rtl:Ho((()=>R.some($g(e,o,t))))}),exact:(t,o,n,r)=>({ltr:Ho((()=>Wg(e,t,o,n,r))),rtl:Ho((()=>R.some(Wg(e,n,r,t,o))))})}),Qg=(e,t)=>{const o=t.ltr();if(o.collapsed){const n=t.rtl().filter((e=>!1===e.collapsed));return n.map((e=>Yg.rtl(Qe.fromDom(e.endContainer),e.endOffset,Qe.fromDom(e.startContainer),e.startOffset))).getOrThunk((()=>Xg(e,Yg.ltr,o)))}return Xg(e,Yg.ltr,o)},eh=(e,t)=>{const o=Jg(e,t);return Qg(e,o)},th=(e,t)=>{const o=eh(e,t);return o.match({ltr:(t,o,n,r)=>{const s=e.document.createRange();return s.setStart(t.dom,o),s.setEnd(n.dom,r),s},rtl:(t,o,n,r)=>{const s=e.document.createRange();return s.setStart(n.dom,r),s.setEnd(t.dom,o),s}})};Yg.ltr,Yg.rtl;const oh=(e,t)=>St(t,e),nh=(e,t,o,n)=>{const r=Tt(e),s=r.dom.createRange();return s.setStart(e.dom,t),s.setEnd(o.dom,n),s},rh=(e,t,o,n)=>{const r=nh(e,t,o,n),s=_t(e,o)&&t===n;return r.collapsed&&!s},sh=e=>R.from(e.getSelection()),ah=e=>{if(e.rangeCount>0){const t=e.getRangeAt(0),o=e.getRangeAt(e.rangeCount-1);return R.some(Og.create(Qe.fromDom(t.startContainer),t.startOffset,Qe.fromDom(o.endContainer),o.endOffset))}return R.none()},ih=e=>{if(null===e.anchorNode||null===e.focusNode)return ah(e);{const t=Qe.fromDom(e.anchorNode),o=Qe.fromDom(e.focusNode);return rh(t,e.anchorOffset,o,e.focusOffset)?R.some(Og.create(t,e.anchorOffset,o,e.focusOffset)):ah(e)}},lh=e=>sh(e).filter((e=>e.rangeCount>0)).bind(ih),ch=(e,t)=>{const o=th(e,t);return Gg(o)},dh=(e,t)=>{const o=th(e,t);return Kg(o)},mh=(e,t)=>{const o=o=>{if(!e(o))throw new Error("Can only get "+t+" value of a "+t+" node");return n(o).getOr("")},n=t=>e(t)?R.from(t.dom.nodeValue):R.none(),r=(o,n)=>{if(!e(o))throw new Error("Can only set raw "+t+" value of a "+t+" node");o.dom.nodeValue=n};return{get:o,getOption:n,set:r}},uh=mh(bt,"text"),gh=e=>uh.get(e),hh=(e,t)=>({element:e,offset:t}),ph=(e,t)=>{const o=Lt(e);if(0===o.length)return hh(e,t);if(t<o.length)return hh(o[t],0);{const e=o[o.length-1],t=bt(e)?gh(e).length:Lt(e).length;return hh(e,t)}},fh=(e,t)=>bt(e)?hh(e,t):ph(e,t),bh=(e,t)=>{const o=t.getSelection.getOrThunk((()=>()=>lh(e)));return o().map((e=>{const t=fh(e.start,e.soffset),o=fh(e.finish,e.foffset);return Zg.range(t.element,t.offset,o.element,o.offset)}))},vh=(e,t,o)=>{const n=At(t.root).dom,r=vg(e,o,t),s=bh(n,t).bind((e=>{const t=dh(n,Zg.exactFromRange(e)).orThunk((()=>{const t=Qe.fromText(Sg);Nn(e.start,t);const o=ch(n,Zg.exact(t,0,t,1));return zn(t),o}));return t.bind((e=>yg(e.left,e.top,e.width,e.height)))})),a=bh(n,t).bind((e=>ft(e.start)?R.some(e.start):Nt(e.start))),i=a.getOr(e.element);return wg(s,r,t,o,i)};var yh=[js("getSelection"),Rs("root"),js("bubble"),ng(),Qs("overrides",{}),Qs("showAbove",!1),Nd("placement",vh)];const wh="link-layout",xh=e=>e.x+e.width,Ch=(e,t)=>e.x-t.width,Sh=(e,t)=>e.y-t.height+e.height,kh=e=>e.y,_h=(e,t,o)=>Ld(xh(e),kh(e),o.southeast(),Fd(),"southeast",Xd(e,{left:0,top:2}),wh),Oh=(e,t,o)=>Ld(Ch(e,t),kh(e),o.southwest(),Vd(),"southwest",Xd(e,{right:1,top:2}),wh),Th=(e,t,o)=>Ld(xh(e),Sh(e,t),o.northeast(),Zd(),"northeast",Xd(e,{left:0,bottom:3}),wh),Eh=(e,t,o)=>Ld(Ch(e,t),Sh(e,t),o.northwest(),Ud(),"northwest",Xd(e,{right:1,bottom:3}),wh),Dh=()=>[_h,Oh,Th,Eh],Ah=()=>[Oh,_h,Eh,Th],Mh=(e,t,o)=>{const n=eu(o,t.item.element),r=rg(e.element,t,Dh(),Ah(),Dh(),Ah(),R.none());return R.some(Xu({anchorBox:n,bubble:Yu(),overrides:t.overrides,layouts:r,placer:R.none()}))};var Nh=[Rs("item"),ng(),Qs("overrides",{}),Nd("placement",Mh)],Rh=Es("type",{selection:yh,node:Cg,hotspot:ag,submenu:Nh,makeshift:lg});const Bh=[Us("classes",gs),na("mode","all",["all","layout","placement"])],Lh=[Qs("useFixed",A),js("getBounds")],Hh=[Bs("anchor",Rh),Xs("transition",Bh)],Ih=()=>{const e=document.documentElement;return su(0,0,e.clientWidth,e.clientHeight)},Ph=e=>{const t=Do(e.element),o=e.element.dom.getBoundingClientRect();return ru(t.left,t.top,o.width,o.height)},zh=(e,t,o,n,r,s,a)=>{const i=iu(o.anchorBox,t);return Wu(i,r.element,o.bubble,o.layouts,s,n,o.overrides,a)},Fh=(e,t,o,n,r)=>{Vh(e,t,o,n,r,R.none())},Vh=(e,t,o,n,r,s)=>{const a=s.map(tr);return Zh(e,t,o,n,r,a)},Zh=(e,t,o,n,r,s)=>{const a=Os("placement.info",rs(Hh),r),i=a.anchor,l=n.element,c=o.get(n.uid);qm((()=>{co(l,"position","fixed");const r=po(l,"visibility");co(l,"visibility","hidden");const d=t.useFixed()?Ih():Ph(e),m=i.placement,u=s.map(S).or(t.getBounds);m(e,i,d).each((t=>{const r=t.placer.getOr(zh),s=r(e,d,t,u,n,c,a.transition);o.set(n.uid,s)})),r.fold((()=>{vo(l,"visibility")}),(e=>{co(l,"visibility",e)})),po(l,"left").isNone()&&po(l,"top").isNone()&&po(l,"right").isNone()&&po(l,"bottom").isNone()&&Te(po(l,"position"),"fixed")&&vo(l,"position")}),l)},Uh=(e,t,o)=>t.useFixed()?"fixed":"absolute",jh=(e,t,o,n)=>{const r=n.element;j(["position","left","right","top","bottom"],(e=>vo(r,e))),mu(r),o.clear(n.uid)};var $h=Object.freeze({__proto__:null,position:Fh,positionWithin:Vh,positionWithinBounds:Zh,getMode:Uh,reset:jh});const Wh=()=>{let e={};const t=(t,o)=>{e[t]=o},o=t=>ke(e,t),n=t=>{p(t)?delete e[t]:e={}};return Ml({readState:()=>e,clear:n,set:t,get:o})};var qh=Object.freeze({__proto__:null,init:Wh});const Gh=Lm({fields:Lh,name:"positioning",active:Vm,apis:$h,state:qh}),Kh=e=>e.getSystem().isConnected(),Yh=e=>{Oi(e,bi());const t=e.components();j(t,Yh)},Xh=e=>{const t=e.components();j(t,Xh),Oi(e,fi())},Jh=(e,t)=>{e.getSystem().addToWorld(t),Yt(e.element)&&Xh(t)},Qh=e=>{Yh(e),e.getSystem().removeFromWorld(e)},ep=(e,t)=>{Ln(e.element,t.element)},tp=e=>{j(e.components(),(e=>zn(e.element))),Pn(e.element),e.syncComponents()},op=(e,t,o)=>{const n=e.components();tp(e);const r=o(t),s=ne(n,r);j(s,(t=>{Yh(t),e.getSystem().removeFromWorld(t)})),j(r,(t=>{Kh(t)?ep(e,t):(e.getSystem().addToWorld(t),ep(e,t),Yt(e.element)&&Xh(t))})),e.syncComponents()},np=(e,t,o)=>{const n=e.components(),r=ee(t,(e=>El(e).toArray()));j(n,(e=>{z(r,e)||Qh(e)}));const s=o(t),a=ne(n,s);j(a,(e=>{Kh(e)&&Qh(e)})),j(s,(t=>{Kh(t)||Jh(e,t)})),e.syncComponents()},rp=(e,t)=>{sp(e,t,Ln)},sp=(e,t,o)=>{e.getSystem().addToWorld(t),o(e.element,t.element),Yt(e.element)&&Xh(t),e.syncComponents()},ap=e=>{Yh(e),zn(e.element),e.getSystem().removeFromWorld(e)},ip=e=>{const t=Mt(e.element).bind((t=>e.getSystem().getByDom(t).toOptional()));ap(e),t.each((e=>{e.syncComponents()}))},lp=e=>{const t=e.components();j(t,ap),Pn(e.element),e.syncComponents()},cp=(e,t)=>{mp(e,t,Ln)},dp=(e,t)=>{mp(e,t,Rn)},mp=(e,t,o)=>{o(e,t.element);const n=Lt(t.element);j(n,(e=>{t.getByDom(e).each(Xh)}))},up=e=>{const t=Lt(e.element);j(t,(t=>{e.getByDom(t).each(Yh)})),zn(e.element)},gp=(e,t,o,n)=>{o.get().each((t=>{lp(e)}));const r=t.getAttachPoint(e);rp(r,e);const s=e.getSystem().build(n);return rp(e,s),o.set(s),s},hp=(e,t,o,n)=>{const r=gp(e,t,o,n);return t.onOpen(e,r),r},pp=(e,t,o,n)=>o.get().map((()=>gp(e,t,o,n))),fp=(e,t,o,n,r)=>{Sp(e,t),hp(e,t,o,n),r(),_p(e,t)},bp=(e,t,o)=>{o.get().each((n=>{lp(e),ip(e),t.onClose(e,n),o.clear()}))},vp=(e,t,o)=>o.isOpen(),yp=(e,t,o,n)=>vp(e,t,o)&&o.get().exists((o=>t.isPartOf(e,o,n))),wp=(e,t,o)=>o.get(),xp=(e,t,o,n)=>{po(e.element,t).fold((()=>{so(e.element,o)}),(t=>{eo(e.element,o,t)})),co(e.element,t,n)},Cp=(e,t,o)=>{no(e.element,o).fold((()=>vo(e.element,t)),(o=>co(e.element,t,o)))},Sp=(e,t,o)=>{const n=t.getAttachPoint(e);co(e.element,"position",Gh.getMode(n)),xp(e,"visibility",t.cloakVisibilityAttr,"hidden")},kp=e=>F(["top","left","right","bottom"],(t=>po(e,t).isSome())),_p=(e,t,o)=>{kp(e.element)||vo(e.element,"position"),Cp(e,"visibility",t.cloakVisibilityAttr)};var Op=Object.freeze({__proto__:null,cloak:Sp,decloak:_p,open:hp,openWhileCloaked:fp,close:bp,isOpen:vp,isPartOf:yp,getState:wp,setContent:pp});const Tp=(e,t)=>Ri([Ii(ci(),((o,n)=>{bp(o,e,t)}))]);var Ep=Object.freeze({__proto__:null,events:Tp}),Dp=[Ed("onOpen"),Ed("onClose"),Rs("isPartOf"),Rs("getAttachPoint"),Qs("cloakVisibilityAttr","data-precloak-visibility")];const Ap=()=>{const e=xu(),t=S("not-implemented");return Ml({readState:t,isOpen:e.isSet,clear:e.clear,set:e.set,get:e.get})};var Mp=Object.freeze({__proto__:null,init:Ap});const Np=Lm({fields:Dp,name:"sandboxing",active:Ep,apis:Op,state:Mp}),Rp=S("dismiss.popups"),Bp=S("reposition.popups"),Lp=S("mouse.released"),Hp=ns([Qs("isExtraPart",A),Xs("fireEventInstead",[Qs("event",vi())])]),Ip=e=>{const t=Os("Dismissal",Hp,e);return{[Rp()]:{schema:ns([Rs("target")]),onReceive:(e,o)=>{if(Np.isOpen(e)){const n=Np.isPartOf(e,o.target)||t.isExtraPart(e,o.target);n||t.fireEventInstead.fold((()=>Np.close(e)),(t=>Oi(e,t.event)))}}}}},Pp=ns([Xs("fireEventInstead",[Qs("event",yi())]),zs("doReposition")]),zp=e=>{const t=Os("Reposition",Pp,e);return{[Bp()]:{onReceive:e=>{Np.isOpen(e)&&t.fireEventInstead.fold((()=>t.doReposition(e)),(t=>Oi(e,t.event)))}}}},Fp=(e,t,o)=>{t.store.manager.onLoad(e,t,o)},Vp=(e,t,o)=>{t.store.manager.onUnload(e,t,o)},Zp=(e,t,o,n)=>{t.store.manager.setValue(e,t,o,n)},Up=(e,t,o)=>t.store.manager.getValue(e,t,o),jp=(e,t,o)=>o;var $p=Object.freeze({__proto__:null,onLoad:Fp,onUnload:Vp,setValue:Zp,getValue:Up,getState:jp});const Wp=(e,t)=>{const o=e.resetOnDom?[qi(((o,n)=>{Fp(o,e,t)})),Gi(((o,n)=>{Vp(o,e,t)}))]:[Tm(e,t,Fp)];return Ri(o)};var qp=Object.freeze({__proto__:null,events:Wp});const Gp=()=>{const e=ca(null),t=()=>({mode:"memory",value:e.get()}),o=()=>null===e.get(),n=()=>{e.set(null)};return Ml({set:e.set,get:e.get,isNotSet:o,clear:n,readState:t})},Kp=()=>{const e=y;return Ml({readState:e})},Yp=()=>{const e=ca({}),t=ca({}),o=()=>({mode:"dataset",dataByValue:e.get(),dataByText:t.get()}),n=()=>{e.set({}),t.set({})},r=o=>ke(e.get(),o).orThunk((()=>ke(t.get(),o))),s=o=>{const n=e.get(),r=t.get(),s={},a={};j(o,(e=>{s[e.value]=e,ke(e,"meta").each((t=>{ke(t,"text").each((t=>{a[t]=e}))}))})),e.set({...n,...s}),t.set({...r,...a})};return Ml({readState:o,lookup:r,update:s,clear:n})},Xp=e=>e.store.manager.state(e);var Jp=Object.freeze({__proto__:null,memory:Gp,dataset:Yp,manual:Kp,init:Xp});const Qp=(e,t,o,n)=>{const r=t.store;o.update([n]),r.setValue(e,n),t.onSetValue(e,n)},ef=(e,t,o)=>{const n=t.store,r=n.getDataKey(e);return o.lookup(r).getOrThunk((()=>n.getFallbackEntry(r)))},tf=(e,t,o)=>{const n=t.store;n.initialValue.each((n=>{Qp(e,t,o,n)}))},of=(e,t,o)=>{o.clear()};var nf=[js("initialValue"),Rs("getFallbackEntry"),Rs("getDataKey"),Rs("setValue"),Nd("manager",{setValue:Qp,getValue:ef,onLoad:tf,onUnload:of,state:Yp})];const rf=(e,t,o)=>t.store.getValue(e),sf=(e,t,o,n)=>{t.store.setValue(e,n),t.onSetValue(e,n)},af=(e,t,o)=>{t.store.initialValue.each((o=>{t.store.setValue(e,o)}))};var lf=[Rs("getValue"),Qs("setValue",y),js("initialValue"),Nd("manager",{setValue:sf,getValue:rf,onLoad:af,onUnload:y,state:Al.init})];const cf=(e,t,o,n)=>{o.set(n),t.onSetValue(e,n)},df=(e,t,o)=>o.get(),mf=(e,t,o)=>{t.store.initialValue.each((e=>{o.isNotSet()&&o.set(e)}))},uf=(e,t,o)=>{o.clear()};var gf=[js("initialValue"),Nd("manager",{setValue:cf,getValue:df,onLoad:mf,onUnload:uf,state:Gp})],hf=[ea("store",{mode:"memory"},Es("mode",{memory:gf,manual:lf,dataset:nf})),Ed("onSetValue"),Qs("resetOnDom",!1)];const pf=Lm({fields:hf,name:"representing",active:qp,apis:$p,extra:{setValueFrom:(e,t)=>{const o=pf.getValue(t);pf.setValue(e,o)}},state:Jp}),ff=(e,t)=>la(e,{},U(t,(t=>Fs(t.name(),"Cannot configure "+t.name()+" for "+e))).concat([Ms("dump",k)])),bf=e=>e.dump,vf=(e,t)=>({...Rm(t),...e.dump}),yf={field:ff,augment:vf,get:bf},wf="placeholder",xf=ma.generate([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Cf=e=>_e(e,"uiType"),Sf=(e,t,o,n)=>e.exists((e=>e!==o.owner))?xf.single(!0,S(o)):ke(n,o.name).fold((()=>{throw new Error("Unknown placeholder component: "+o.name+"\nKnown: ["+ue(n)+"]\nNamespace: "+e.getOr("none")+"\nSpec: "+JSON.stringify(o,null,2))}),(e=>e.replace())),kf=(e,t,o,n)=>Cf(o)&&o.uiType===wf?Sf(e,t,o,n):xf.single(!1,S(o)),_f=(e,t,o,n)=>{const r=kf(e,t,o,n);return r.fold(((r,s)=>{const a=Cf(o)?s(t,o.config,o.validated):s(t),i=ke(a,"components").getOr([]),l=ee(i,(o=>_f(e,t,o,n)));return[{...a,components:l}]}),((e,n)=>{if(Cf(o)){const e=n(t,o.config,o.validated),r=o.validated.preprocess.getOr(k);return r(e)}return n(t)}))},Of=(e,t,o,n)=>ee(o,(o=>_f(e,t,o,n))),Tf=(e,t)=>{let o=!1;const n=()=>o,r=()=>{if(o)throw new Error("Trying to use the same placeholder more than once: "+e);return o=!0,t},s=()=>t.fold(((e,t)=>e),((e,t)=>e));return{name:S(e),required:s,used:n,replace:r}},Ef=(e,t,o,n)=>{const r=pe(n,((e,t)=>Tf(t,e))),s=Of(e,t,o,r);return he(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))})),s},Df=xf.single,Af=xf.multiple,Mf=S(wf),Nf=ma.generate([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Rf=Qs("factory",{sketch:k}),Bf=Qs("schema",[]),Lf=Rs("name"),Hf=As("pname","pname",Dr((e=>"<alloy."+cl(e.name)+">")),ds()),If=Ms("schema",(()=>[js("preprocess")])),Pf=Qs("defaults",S({})),zf=Qs("overrides",S({})),Ff=rs([Rf,Bf,Lf,Hf,Pf,zf]),Vf=rs([Rf,Bf,Lf,Pf,zf]),Zf=rs([Rf,Bf,Lf,Hf,Pf,zf]),Uf=rs([Rf,If,Lf,Rs("unit"),Hf,Pf,zf]),jf=e=>e.fold(R.some,R.none,R.some,R.some),$f=e=>{const t=e=>e.name;return e.fold(t,t,t,t)},Wf=e=>e.fold(k,k,k,k),qf=(e,t)=>o=>{const n=Os("Converting part type",t,o);return e(n)},Gf=qf(Nf.required,Ff),Kf=qf(Nf.external,Vf),Yf=qf(Nf.optional,Zf),Xf=qf(Nf.group,Uf),Jf=S("entirety");var Qf=Object.freeze({__proto__:null,required:Gf,external:Kf,optional:Yf,group:Xf,asNamedPart:jf,name:$f,asCommon:Wf,original:Jf});const eb=(e,t,o,n)=>Or(t.defaults(e,o,n),o,{uid:e.partUids[t.name]},t.overrides(e,o,n)),tb=(e,t,o)=>{const n={},r={};return j(o,(e=>{e.fold((e=>{n[e.pname]=Df(!0,((t,o,n)=>e.factory.sketch(eb(t,e,o,n))))}),(e=>{const o=t.parts[e.name];r[e.name]=S(e.factory.sketch(eb(t,e,o[Jf()]),o))}),(e=>{n[e.pname]=Df(!1,((t,o,n)=>e.factory.sketch(eb(t,e,o,n))))}),(e=>{n[e.pname]=Af(!0,((t,o,n)=>{const r=t[e.name];return U(r,(o=>e.factory.sketch(Or(e.defaults(t,o,n),o,e.overrides(t,o)))))}))}))})),{internals:S(n),externals:S(r)}},ob=(e,t)=>{const o={};return j(t,(t=>{jf(t).each((t=>{const n=nb(e,t.pname);o[t.name]=o=>{const r=Os("Part: "+t.name+" in "+e,rs(t.schema),o);return{...n,config:o,validated:r}}}))})),o},nb=(e,t)=>({uiType:Mf(),owner:e,name:t}),rb=(e,t,o)=>({uiType:Mf(),owner:e,name:t,config:o,validated:{}}),sb=e=>ee(e,(e=>e.fold(R.none,R.some,R.none,R.none).map((e=>Vs(e.name,e.schema.concat([Rd(Jf())])))).toArray())),ab=e=>U(e,$f),ib=(e,t,o)=>tb(e,t,o),lb=(e,t,o)=>Ef(R.some(e),t,t.components,o),cb=(e,t,o)=>{const n=t.partUids[o];return e.getSystem().getByUid(n).toOptional()},db=(e,t,o)=>cb(e,t,o).getOrDie("Could not find part: "+o),mb=(e,t,o)=>{const n={},r=t.partUids,s=e.getSystem();return j(o,(e=>{n[e]=S(s.getByUid(r[e]))})),n},ub=(e,t)=>{const o=e.getSystem();return pe(t.partUids,((e,t)=>S(o.getByUid(e))))},gb=e=>ue(e.partUids),hb=(e,t,o)=>{const n={},r=t.partUids,s=e.getSystem();return j(o,(e=>{n[e]=S(s.getByUid(r[e]).getOrDie())})),n},pb=(e,t)=>{const o=ab(t);return va(U(o,(t=>({key:t,value:e+"-"+t}))))},fb=e=>As("partUids","partUids",Nr((t=>pb(t.uid,e))),ds());var bb=Object.freeze({__proto__:null,generate:ob,generateOne:rb,schemas:sb,names:ab,substitutes:ib,components:lb,defaultUids:pb,defaultUidsSchema:fb,getAllParts:ub,getAllPartNames:gb,getPart:cb,getPartOrDie:db,getParts:mb,getPartsOrDie:hb});const vb=(e,t)=>{const o=e.length>0?[Vs("parts",e)]:[];return o.concat([Rs("uid"),Qs("dom",{}),Qs("components",[]),Rd("originalSpec"),Qs("debug.sketcher",{})]).concat(t)},yb=(e,t,o,n,r)=>{const s=vb(n,r);return Os(e+" [SpecSchema]",ns(s.concat(t)),o)},wb=(e,t,o,n)=>{const r=Sb(n),s=yb(e,t,r,[],[]);return o(s,r)},xb=(e,t,o,n,r)=>{const s=Sb(r),a=sb(o),i=fb(o),l=yb(e,t,s,a,[i]),c=ib(e,l,o),d=lb(e,l,c.internals());return n(l,d,s,c.externals())},Cb=e=>_e(e,"uid"),Sb=e=>Cb(e)?e:{...e,uid:bl("uid")},kb=e=>void 0!==e.uid,_b=ns([Rs("name"),Rs("factory"),Rs("configFields"),Qs("apis",{}),Qs("extraApis",{})]),Ob=ns([Rs("name"),Rs("factory"),Rs("configFields"),Rs("partFields"),Qs("apis",{}),Qs("extraApis",{})]),Tb=e=>{const t=Os("Sketcher for "+e.name,_b,e),o=e=>wb(t.name,t.configFields,t.factory,e),n=pe(t.apis,Dl),r=pe(t.extraApis,((e,t)=>Sl(e,t)));return{name:t.name,configFields:t.configFields,sketch:o,...n,...r}},Eb=e=>{const t=Os("Sketcher for "+e.name,Ob,e),o=e=>xb(t.name,t.configFields,t.partFields,t.factory,e),n=ob(t.name,t.partFields),r=pe(t.apis,Dl),s=pe(t.extraApis,((e,t)=>Sl(e,t)));return{name:t.name,partFields:t.partFields,configFields:t.configFields,sketch:o,parts:n,...r,...s}},Db=e=>wt("input")(e)&&"radio"!==oo(e,"type")||wt("textarea")(e),Ab=(e,t,o)=>t.find(e);var Mb=Object.freeze({__proto__:null,getCurrent:Ab});const Nb=[Rs("find")],Rb=Lm({fields:Nb,name:"composing",apis:Mb}),Bb=["input","button","textarea","select"],Lb=(e,t,o)=>{const n=t.disabled()?Ub:jb;n(e,t)},Hb=(e,t)=>!0===t.useNative&&z(Bb,ut(e.element)),Ib=e=>ro(e.element,"disabled"),Pb=e=>{eo(e.element,"disabled","disabled")},zb=e=>{so(e.element,"disabled")},Fb=e=>"true"===oo(e.element,"aria-disabled"),Vb=e=>{eo(e.element,"aria-disabled","true")},Zb=e=>{eo(e.element,"aria-disabled","false")},Ub=(e,t,o)=>{t.disableClass.each((t=>{mc(e.element,t)}));const n=Hb(e,t)?Pb:Vb;n(e),t.onDisabled(e)},jb=(e,t,o)=>{t.disableClass.each((t=>{gc(e.element,t)}));const n=Hb(e,t)?zb:Zb;n(e),t.onEnabled(e)},$b=(e,t)=>Hb(e,t)?Ib(e):Fb(e),Wb=(e,t,o,n)=>{const r=n?Ub:jb;r(e,t)};var qb=Object.freeze({__proto__:null,enable:jb,disable:Ub,isDisabled:$b,onLoad:Lb,set:Wb});const Gb=(e,t)=>Hl({classes:t.disabled()?t.disableClass.toArray():[]}),Kb=(e,t)=>Ri([Bi(si(),((t,o)=>$b(t,e))),Tm(e,t,Lb)]);var Yb=Object.freeze({__proto__:null,exhibit:Gb,events:Kb}),Xb=[sa("disabled",A),Qs("useNative",!0),js("disableClass"),Ed("onDisabled"),Ed("onEnabled")];const Jb=Lm({fields:Xb,name:"disabling",active:Yb,apis:qb}),Qb=(e,t,o,n)=>{const r=oh(e.element,"."+t.highlightClass);j(r,(o=>{const r=F(n,(e=>_t(e.element,o)));r||(gc(o,t.highlightClass),e.getSystem().getByDom(o).each((o=>{t.onDehighlight(e,o),Oi(o,_i())})))}))},ev=(e,t,o)=>Qb(e,t,o,[]),tv=(e,t,o,n)=>{iv(e,t,o,n)&&(gc(n.element,t.highlightClass),t.onDehighlight(e,n),Oi(n,_i()))},ov=(e,t,o,n)=>{Qb(e,t,o,[n]),iv(e,t,o,n)||(mc(n.element,t.highlightClass),t.onHighlight(e,n),Oi(n,ki()))},nv=(e,t,o)=>{dv(e,t).each((n=>{ov(e,t,o,n)}))},rv=(e,t,o)=>{mv(e,t).each((n=>{ov(e,t,o,n)}))},sv=(e,t,o,n)=>{cv(e,t,o,n).fold((e=>{throw e}),(n=>{ov(e,t,o,n)}))},av=(e,t,o,n)=>{const r=pv(e,t),s=X(r,n);s.each((n=>{ov(e,t,o,n)}))},iv=(e,t,o,n)=>hc(n.element,t.highlightClass),lv=(e,t,o)=>nd(e.element,"."+t.highlightClass).bind((t=>e.getSystem().getByDom(t).toOptional())),cv=(e,t,o,n)=>{const r=oh(e.element,"."+t.itemClass);return R.from(r[n]).fold((()=>ir.error(new Error("No element found with index "+n))),e.getSystem().getByDom)},dv=(e,t,o)=>nd(e.element,"."+t.itemClass).bind((t=>e.getSystem().getByDom(t).toOptional())),mv=(e,t,o)=>{const n=oh(e.element,"."+t.itemClass),r=n.length>0?R.some(n[n.length-1]):R.none();return r.bind((t=>e.getSystem().getByDom(t).toOptional()))},uv=(e,t,o,n)=>{const r=oh(e.element,"."+t.itemClass),s=J(r,(e=>hc(e,t.highlightClass)));return s.bind((t=>{const o=Gd(t,n,0,r.length-1);return e.getSystem().getByDom(r[o]).toOptional()}))},gv=(e,t,o)=>uv(e,t,o,-1),hv=(e,t,o)=>uv(e,t,o,1),pv=(e,t,o)=>{const n=oh(e.element,"."+t.itemClass);return De(U(n,(t=>e.getSystem().getByDom(t).toOptional())))};var fv=Object.freeze({__proto__:null,dehighlightAll:ev,dehighlight:tv,highlight:ov,highlightFirst:nv,highlightLast:rv,highlightAt:sv,highlightBy:av,isHighlighted:iv,getHighlighted:lv,getFirst:dv,getLast:mv,getPrevious:gv,getNext:hv,getCandidates:pv}),bv=[Rs("highlightClass"),Rs("itemClass"),Ed("onHighlight"),Ed("onDehighlight")];const vv=Lm({fields:bv,name:"highlighting",apis:fv}),yv=[8],wv=[9],xv=[13],Cv=[27],Sv=[32],kv=[37],_v=[38],Ov=[39],Tv=[40],Ev=(e,t,o)=>{const n=oe(e.slice(0,t)),r=oe(e.slice(t+1));return X(n.concat(r),o)},Dv=(e,t,o)=>{const n=oe(e.slice(0,t));return X(n,o)},Av=(e,t,o)=>{const n=e.slice(0,t),r=e.slice(t+1);return X(r.concat(n),o)},Mv=(e,t,o)=>{const n=e.slice(t+1);return X(n,o)},Nv=e=>t=>{const o=t.raw;return z(e,o.which)},Rv=e=>t=>te(e,(e=>e(t))),Bv=e=>{const t=e.raw;return!0===t.shiftKey},Lv=e=>{const t=e.raw;return!0===t.ctrlKey},Hv=T(Bv),Iv=(e,t)=>({matches:e,classification:t}),Pv=(e,t)=>{const o=X(e,(e=>e.matches(t)));return o.map((e=>e.classification))},zv=(e,t,o)=>{const n=t.exists((e=>o.exists((t=>_t(t,e)))));n||Ti(e,wi(),{prevFocus:t,newFocus:o})},Fv=()=>{const e=e=>Wm(e.element),t=(t,o)=>{const n=e(t);t.getSystem().triggerFocus(o,t.element);const r=e(t);zv(t,n,r)};return{get:e,set:t}},Vv=()=>{const e=e=>vv.getHighlighted(e).map((e=>e.element)),t=(t,o)=>{const n=e(t);t.getSystem().getByDom(o).fold(y,(e=>{vv.highlight(t,e)}));const r=e(t);zv(t,n,r)};return{get:e,set:t}};var Zv;(function(e){e["OnFocusMode"]="onFocus",e["OnEnterOrSpaceMode"]="onEnterOrSpace",e["OnApiMode"]="onApi"})(Zv||(Zv={}));const Uv=(e,t,o,n,r)=>{const s=()=>e.concat([Qs("focusManager",Fv()),ea("focusInside","onFocus",xs((e=>z(["onFocus","onEnterOrSpace","onApi"],e)?ir.value(e):ir.error("Invalid value for focusInside")))),Nd("handler",l),Nd("state",t),Nd("sendFocusIn",r)]),a=(e,t,o,n,r)=>{const s=o(e,t,n,r);return Pv(s,t.event).bind((o=>o(e,t,n,r)))},i=(e,t)=>{const s=e.focusInside!==Zv.OnFocusMode?R.none():r(e).map((o=>Ii(ti(),((n,r)=>{o(n,e,t),r.stop()})))),i=(o,n)=>{const s=Nv(Sv.concat(xv))(n.event);e.focusInside===Zv.OnEnterOrSpaceMode&&s&&_a(o,n)&&r(e).each((r=>{r(o,e,t),n.stop()}))},l=[Ii(ja(),((n,r)=>{a(n,r,o,e,t).fold((()=>{i(n,r)}),(e=>{r.stop()}))})),Ii($a(),((o,r)=>{a(o,r,n,e,t).each((e=>{r.stop()}))}))];return Ri(s.toArray().concat(l))},l={schema:s,processKey:a,toEvents:i};return l},jv=e=>{const t=[js("onEscape"),js("onEnter"),Qs("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Qs("firstTabstop",0),Qs("useTabstopAt",M),js("visibilitySelector")].concat([e]),o=(e,t)=>{const o=e.visibilitySelector.bind((e=>rd(t,e))).getOr(t);return Co(o)>0},n=(e,t)=>{const n=oh(e.element,t.selector),r=q(n,(e=>o(t,e)));return R.from(r[t.firstTabstop])},r=(e,t)=>t.focusManager.get(e).bind((e=>rd(e,t.selector))),s=(e,t)=>o(e,t)&&e.useTabstopAt(t),a=(e,t,o)=>{n(e,t).each((o=>{t.focusManager.set(e,o)}))},i=(e,t,o,n,r)=>r(t,o,(e=>s(n,e))).fold((()=>n.cyclic?R.some(!0):R.none()),(t=>(n.focusManager.set(e,t),R.some(!0)))),l=(e,t,o,n)=>{const s=oh(e.element,o.selector);return r(e,o).bind((t=>{const r=J(s,O(_t,t));return r.bind((t=>i(e,s,t,o,n)))}))},c=(e,t,o)=>{const n=o.cyclic?Ev:Dv;return l(e,t,o,n)},d=(e,t,o)=>{const n=o.cyclic?Av:Mv;return l(e,t,o,n)},m=(e,t,o)=>o.onEnter.bind((o=>o(e,t))),u=(e,t,o)=>o.onEscape.bind((o=>o(e,t))),g=S([Iv(Rv([Bv,Nv(wv)]),c),Iv(Nv(wv),d),Iv(Rv([Hv,Nv(xv)]),m)]),h=S([Iv(Nv(Cv),u)]);return Uv(t,Al.init,g,h,(()=>R.some(a)))};var $v=jv(Ms("cyclic",A)),Wv=jv(Ms("cyclic",M));const qv=(e,t,o)=>(Di(e,o,si()),R.some(!0)),Gv=(e,t,o)=>{const n=Db(o)&&Nv(Sv)(t.event);return n?R.none():qv(e,t,o)},Kv=(e,t)=>R.some(!0),Yv=[Qs("execute",Gv),Qs("useSpace",!1),Qs("useEnter",!0),Qs("useControlEnter",!1),Qs("useDown",!1)],Xv=(e,t,o)=>o.execute(e,t,e.element),Jv=(e,t,o,n)=>{const r=o.useSpace&&!Db(e.element)?Sv:[],s=o.useEnter?xv:[],a=o.useDown?Tv:[],i=r.concat(s).concat(a);return[Iv(Nv(i),Xv)].concat(o.useControlEnter?[Iv(Rv([Lv,Nv(xv)]),Xv)]:[])},Qv=(e,t,o,n)=>o.useSpace&&!Db(e.element)?[Iv(Nv(Sv),Kv)]:[];var ey=Uv(Yv,Al.init,Jv,Qv,(()=>R.none()));const ty=()=>{const e=xu(),t=(t,o)=>{e.set({numRows:t,numColumns:o})},o=()=>e.get().map((e=>e.numRows)),n=()=>e.get().map((e=>e.numColumns));return Ml({readState:()=>e.get().map((e=>({numRows:String(e.numRows),numColumns:String(e.numColumns)}))).getOr({numRows:"?",numColumns:"?"}),setGridSize:t,getNumRows:o,getNumColumns:n})},oy=e=>e.state(e);var ny=Object.freeze({__proto__:null,flatgrid:ty,init:oy});const ry=e=>(t,o,n,r)=>{const s=e(t.element);return ly(s,t,o,n,r)},sy=(e,t)=>{const o=Ju(e,t);return ry(o)},ay=(e,t)=>{const o=Ju(t,e);return ry(o)},iy=e=>(t,o,n,r)=>ly(e,t,o,n,r),ly=(e,t,o,n,r)=>{const s=n.focusManager.get(t).bind((o=>e(t.element,o,n,r)));return s.map((e=>(n.focusManager.set(t,e),!0)))},cy=iy,dy=iy,my=iy,uy=e=>e.offsetWidth<=0&&e.offsetHeight<=0,gy=e=>!uy(e.dom),hy=(e,t)=>J(e,t).map((t=>({index:t,candidates:e}))),py=(e,t,o)=>{const n=e=>_t(e,t),r=oh(e,o),s=q(r,gy);return hy(s,n)},fy=(e,t)=>J(e,(e=>_t(t,e))),by=(e,t,o,n)=>{const r=Math.floor(t/o),s=t%o;return n(r,s).bind((t=>{const n=t.row*o+t.column;return n>=0&&n<e.length?R.some(e[n]):R.none()}))},vy=(e,t,o,n,r)=>by(e,t,n,((t,s)=>{const a=t===o-1,i=a?e.length-t*n:n,l=Gd(s,r,0,i-1);return R.some({row:t,column:l})})),yy=(e,t,o,n,r)=>by(e,t,n,((t,s)=>{const a=Gd(t,r,0,o-1),i=a===o-1,l=i?e.length-a*n:n,c=Kd(s,0,l-1);return R.some({row:a,column:c})})),wy=(e,t,o,n)=>vy(e,t,o,n,1),xy=(e,t,o,n)=>vy(e,t,o,n,-1),Cy=(e,t,o,n)=>yy(e,t,o,n,-1),Sy=(e,t,o,n)=>yy(e,t,o,n,1),ky=[Rs("selector"),Qs("execute",Gv),Dd("onEscape"),Qs("captureTab",!1),Bd()],_y=(e,t,o)=>{nd(e.element,t.selector).each((o=>{t.focusManager.set(e,o)}))},Oy=(e,t)=>t.focusManager.get(e).bind((e=>rd(e,t.selector))),Ty=(e,t,o,n)=>Oy(e,o).bind((n=>o.execute(e,t,n))),Ey=e=>(t,o,n,r)=>py(t,o,n.selector).bind((t=>e(t.candidates,t.index,r.getNumRows().getOr(n.initSize.numRows),r.getNumColumns().getOr(n.initSize.numColumns)))),Dy=(e,t,o)=>o.captureTab?R.some(!0):R.none(),Ay=(e,t,o)=>o.onEscape(e,t),My=Ey(xy),Ny=Ey(wy),Ry=Ey(Cy),By=Ey(Sy),Ly=S([Iv(Nv(kv),sy(My,Ny)),Iv(Nv(Ov),ay(My,Ny)),Iv(Nv(_v),cy(Ry)),Iv(Nv(Tv),dy(By)),Iv(Rv([Bv,Nv(wv)]),Dy),Iv(Rv([Hv,Nv(wv)]),Dy),Iv(Nv(Sv.concat(xv)),Ty)]),Hy=S([Iv(Nv(Cv),Ay),Iv(Nv(Sv),Kv)]);var Iy=Uv(ky,ty,Ly,Hy,(()=>R.some(_y)));const Py=(e,t,o,n)=>{const r=e=>"button"===ut(e)&&"disabled"===oo(e,"disabled"),s=(e,t,o)=>{const a=Gd(t,n,0,o.length-1);return a===e?R.none():r(o[a])?s(e,a,o):R.from(o[a])};return py(e,o,t).bind((e=>{const t=e.index,o=e.candidates;return s(t,t,o)}))},zy=[Rs("selector"),Qs("getInitial",R.none),Qs("execute",Gv),Dd("onEscape"),Qs("executeOnMove",!1),Qs("allowVertical",!0)],Fy=(e,t)=>t.focusManager.get(e).bind((e=>rd(e,t.selector))),Vy=(e,t,o)=>Fy(e,o).bind((n=>o.execute(e,t,n))),Zy=(e,t,o)=>{t.getInitial(e).orThunk((()=>nd(e.element,t.selector))).each((o=>{t.focusManager.set(e,o)}))},Uy=(e,t,o)=>Py(e,o.selector,t,-1),jy=(e,t,o)=>Py(e,o.selector,t,1),$y=e=>(t,o,n,r)=>e(t,o,n,r).bind((()=>n.executeOnMove?Vy(t,o,n):R.some(!0))),Wy=(e,t,o)=>o.onEscape(e,t),qy=(e,t,o,n)=>{const r=kv.concat(o.allowVertical?_v:[]),s=Ov.concat(o.allowVertical?Tv:[]);return[Iv(Nv(r),$y(sy(Uy,jy))),Iv(Nv(s),$y(ay(Uy,jy))),Iv(Nv(xv),Vy),Iv(Nv(Sv),Vy)]},Gy=S([Iv(Nv(Sv),Kv),Iv(Nv(Cv),Wy)]);var Ky=Uv(zy,Al.init,qy,Gy,(()=>R.some(Zy)));const Yy=(e,t,o)=>R.from(e[t]).bind((e=>R.from(e[o]).map((e=>({rowIndex:t,columnIndex:o,cell:e}))))),Xy=(e,t,o,n)=>{const r=e[t],s=r.length,a=Gd(o,n,0,s-1);return Yy(e,t,a)},Jy=(e,t,o,n)=>{const r=Gd(o,n,0,e.length-1),s=e[r].length,a=Kd(t,0,s-1);return Yy(e,r,a)},Qy=(e,t,o,n)=>{const r=e[t],s=r.length,a=Kd(o+n,0,s-1);return Yy(e,t,a)},ew=(e,t,o,n)=>{const r=Kd(o+n,0,e.length-1),s=e[r].length,a=Kd(t,0,s-1);return Yy(e,r,a)},tw=(e,t,o)=>Xy(e,t,o,1),ow=(e,t,o)=>Xy(e,t,o,-1),nw=(e,t,o)=>Jy(e,o,t,-1),rw=(e,t,o)=>Jy(e,o,t,1),sw=(e,t,o)=>Qy(e,t,o,-1),aw=(e,t,o)=>Qy(e,t,o,1),iw=(e,t,o)=>ew(e,o,t,-1),lw=(e,t,o)=>ew(e,o,t,1),cw=[Vs("selectors",[Rs("row"),Rs("cell")]),Qs("cycles",!0),Qs("previousSelector",R.none),Qs("execute",Gv)],dw=(e,t,o)=>{const n=t.previousSelector(e).orThunk((()=>{const o=t.selectors;return nd(e.element,o.cell)}));n.each((o=>{t.focusManager.set(e,o)}))},mw=(e,t,o)=>Wm(e.element).bind((n=>o.execute(e,t,n))),uw=(e,t)=>U(e,(e=>oh(e,t.selectors.cell))),gw=(e,t)=>(o,n,r)=>{const s=r.cycles?e:t;return rd(n,r.selectors.row).bind((e=>{const t=oh(e,r.selectors.cell);return fy(t,n).bind((t=>{const n=oh(o,r.selectors.row);return fy(n,e).bind((e=>{const o=uw(n,r);return s(o,e,t).map((e=>e.cell))}))}))}))},hw=gw(ow,sw),pw=gw(tw,aw),fw=gw(nw,iw),bw=gw(rw,lw),vw=S([Iv(Nv(kv),sy(hw,pw)),Iv(Nv(Ov),ay(hw,pw)),Iv(Nv(_v),cy(fw)),Iv(Nv(Tv),dy(bw)),Iv(Nv(Sv.concat(xv)),mw)]),yw=S([Iv(Nv(Sv),Kv)]);var ww=Uv(cw,Al.init,vw,yw,(()=>R.some(dw)));const xw=[Rs("selector"),Qs("execute",Gv),Qs("moveOnTab",!1)],Cw=(e,t,o)=>o.focusManager.get(e).bind((n=>o.execute(e,t,n))),Sw=(e,t,o)=>{nd(e.element,t.selector).each((o=>{t.focusManager.set(e,o)}))},kw=(e,t,o)=>Py(e,o.selector,t,-1),_w=(e,t,o)=>Py(e,o.selector,t,1),Ow=(e,t,o,n)=>o.moveOnTab?my(kw)(e,t,o,n):R.none(),Tw=(e,t,o,n)=>o.moveOnTab?my(_w)(e,t,o,n):R.none(),Ew=S([Iv(Nv(_v),my(kw)),Iv(Nv(Tv),my(_w)),Iv(Rv([Bv,Nv(wv)]),Ow),Iv(Rv([Hv,Nv(wv)]),Tw),Iv(Nv(xv),Cw),Iv(Nv(Sv),Cw)]),Dw=S([Iv(Nv(Sv),Kv)]);var Aw=Uv(xw,Al.init,Ew,Dw,(()=>R.some(Sw)));const Mw=[Dd("onSpace"),Dd("onEnter"),Dd("onShiftEnter"),Dd("onLeft"),Dd("onRight"),Dd("onTab"),Dd("onShiftTab"),Dd("onUp"),Dd("onDown"),Dd("onEscape"),Qs("stopSpaceKeyup",!1),js("focusIn")],Nw=(e,t,o)=>[Iv(Nv(Sv),o.onSpace),Iv(Rv([Hv,Nv(xv)]),o.onEnter),Iv(Rv([Bv,Nv(xv)]),o.onShiftEnter),Iv(Rv([Bv,Nv(wv)]),o.onShiftTab),Iv(Rv([Hv,Nv(wv)]),o.onTab),Iv(Nv(_v),o.onUp),Iv(Nv(Tv),o.onDown),Iv(Nv(kv),o.onLeft),Iv(Nv(Ov),o.onRight),Iv(Nv(Sv),o.onSpace)],Rw=(e,t,o)=>[...o.stopSpaceKeyup?[Iv(Nv(Sv),Kv)]:[],Iv(Nv(Cv),o.onEscape)];var Bw=Uv(Mw,Al.init,Nw,Rw,(e=>e.focusIn));const Lw=$v.schema(),Hw=Wv.schema(),Iw=Ky.schema(),Pw=Iy.schema(),zw=ww.schema(),Fw=ey.schema(),Vw=Aw.schema(),Zw=Bw.schema();var Uw=Object.freeze({__proto__:null,acyclic:Lw,cyclic:Hw,flow:Iw,flatgrid:Pw,matrix:zw,execution:Fw,menu:Vw,special:Zw});const jw=e=>Oe(e,"setGridSize"),$w=Im({branchKey:"mode",branches:Uw,name:"keying",active:{events:(e,t)=>{const o=e.handler;return o.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)=>{jw(o)?o.setGridSize(n,r):console.error("Layout does not support setGridSize")}},state:ny}),Ww=(e,t)=>{qm((()=>{op(e,t,(()=>U(t,e.getSystem().build)))}),e.element)},qw=(e,t)=>{qm((()=>{np(e,t,(()=>Oc(e.element,t,e.getSystem().buildOrPatch)))}),e.element)},Gw=(e,t,o,n)=>{Qh(t);const r=_c(e.element,o,n,e.getSystem().buildOrPatch);Jh(e,r),e.syncComponents()},Kw=(e,t,o)=>{const n=e.getSystem().build(o);sp(e,n,t)},Yw=(e,t,o,n)=>{ip(t),Kw(e,((e,t)=>Hn(e,t,o)),n)},Xw=(e,t,o,n)=>{const r=t.reuseDom?qw:Ww;return r(e,n)},Jw=(e,t,o,n)=>{Kw(e,Ln,n)},Qw=(e,t,o,n)=>{Kw(e,Bn,n)},ex=(e,t,o,n)=>{const r=tx(e),s=X(r,(e=>_t(n.element,e.element)));s.each(ip)},tx=(e,t)=>e.components(),ox=(e,t,o,n,r)=>{const s=tx(e);return R.from(s[n]).map((o=>(r.fold((()=>ip(o)),(r=>{const s=t.reuseDom?Gw:Yw;s(e,o,n,r)})),o)))},nx=(e,t,o,n,r)=>{const s=tx(e);return J(s,n).bind((n=>ox(e,t,o,n,r)))};var rx=Object.freeze({__proto__:null,append:Jw,prepend:Qw,remove:ex,replaceAt:ox,replaceBy:nx,set:Xw,contents:tx});const sx=Lm({fields:[ra("reuseDom",!0)],name:"replacing",apis:rx}),ax=(e,t)=>{const o=Ri(t);return Lm({fields:[Rs("enabled")],name:e,active:{events:S(o)}})},ix=(e,t)=>{const o=ax(e,t);return{key:e,value:{config:{},me:o,configAsRaw:S({}),initialConfig:{},state:Al}}},lx=(e,t)=>{t.ignore||(Zm(e.element),t.onFocus(e))},cx=(e,t)=>{t.ignore||Um(e.element)},dx=e=>jm(e.element);var mx=Object.freeze({__proto__:null,focus:lx,blur:cx,isFocused:dx});const ux=(e,t)=>{const o=t.ignore?{}:{attributes:{tabindex:"-1"}};return Hl(o)},gx=e=>Ri([Ii(ti(),((t,o)=>{lx(t,e),o.stop()}))].concat(e.stopMousedown?[Ii(Ia(),((e,t)=>{t.event.prevent()}))]:[]));var hx=Object.freeze({__proto__:null,exhibit:ux,events:gx}),px=[Ed("onFocus"),Qs("stopMousedown",!1),Qs("ignore",!1)];const fx=Lm({fields:px,name:"focusing",active:hx,apis:mx}),bx=e=>{const t=()=>{const t=ca(e),o=()=>t.get(),n=e=>t.set(e),r=()=>t.set(e),s=()=>t.get();return{get:o,set:n,clear:r,readState:s}};return{init:t}},vx=(e,t,o)=>{const n=t.aria;n.update(e,n,o.get())},yx=(e,t,o)=>{t.toggleClass.each((t=>{o.get()?mc(e.element,t):gc(e.element,t)}))},wx=(e,t,o,n)=>{const r=o.get();o.set(n),yx(e,t,o),vx(e,t,o),r!==n&&t.onToggled(e,n)},xx=(e,t,o)=>{wx(e,t,o,!o.get())},Cx=(e,t,o)=>{wx(e,t,o,!0)},Sx=(e,t,o)=>{wx(e,t,o,!1)},kx=(e,t,o)=>o.get(),_x=(e,t,o)=>{wx(e,t,o,t.selected)};var Ox=Object.freeze({__proto__:null,onLoad:_x,toggle:xx,isOn:kx,on:Cx,off:Sx,set:wx});const Tx=()=>Hl({}),Ex=(e,t)=>{const o=Om(e,t,xx),n=Tm(e,t,_x);return Ri(Q([e.toggleOnExecute?[o]:[],[n]]))};var Dx=Object.freeze({__proto__:null,exhibit:Tx,events:Ex});const Ax=(e,t,o)=>{eo(e.element,"aria-pressed",o),t.syncWithExpanded&&Rx(e,t,o)},Mx=(e,t,o)=>{eo(e.element,"aria-selected",o)},Nx=(e,t,o)=>{eo(e.element,"aria-checked",o)},Rx=(e,t,o)=>{eo(e.element,"aria-expanded",o)};var Bx=[Qs("selected",!1),js("toggleClass"),Qs("toggleOnExecute",!0),Ed("onToggled"),ea("aria",{mode:"none"},Es("mode",{pressed:[Qs("syncWithExpanded",!1),Nd("update",Ax)],checked:[Nd("update",Nx)],expanded:[Nd("update",Rx)],selected:[Nd("update",Mx)],none:[Nd("update",y)]}))];const Lx=Lm({fields:Bx,name:"toggling",active:Dx,apis:Ox,state:bx(!1)}),Hx=()=>{const e=(e,t)=>{t.stop(),Ei(e)};return[Ii(Ga(),e),Ii(ii(),e),ji(Ra()),ji(Ia())]},Ix=e=>{const t=e=>Yi(((t,o)=>{e(t),o.stop()}));return Ri(Q([e.map(t).toArray(),Hx()]))},Px="alloy.item-hover",zx="alloy.item-focus",Fx="alloy.item-toggled",Vx=e=>{(Wm(e.element).isNone()||fx.isFocused(e))&&(fx.isFocused(e)||fx.focus(e),Ti(e,Px,{item:e}))},Zx=e=>{Ti(e,zx,{item:e})},Ux=(e,t)=>{Ti(e,Fx,{item:e,state:t})},jx=S(Px),$x=S(zx),Wx=S(Fx),qx=e=>e.toggling.map((e=>e.exclusive?"menuitemradio":"menuitemcheckbox")).getOr("menuitem"),Gx=e=>({aria:{mode:"checked"},...we(e,((e,t)=>"exclusive"!==t)),onToggled:(t,o)=>{f(e.onToggled)&&e.onToggled(t,o),Ux(t,o)}}),Kx=e=>({dom:e.dom,domModification:{...e.domModification,attributes:{role:qx(e),...e.domModification.attributes,"aria-haspopup":e.hasSubmenu,...e.hasSubmenu?{"aria-expanded":!1}:{}}},behaviours:yf.augment(e.itemBehaviours,[e.toggling.fold(Lx.revoke,(e=>Lx.config(Gx(e)))),fx.config({ignore:e.ignoreFocus,stopMousedown:e.ignoreFocus,onFocus:e=>{Zx(e)}}),$w.config({mode:"execution"}),pf.config({store:{mode:"memory",initialValue:e.data}}),ix("item-type-events",[...Hx(),Ii(Va(),Vx),Ii(ai(),fx.focus)])]),components:e.components,eventOrder:e.eventOrder}),Yx=[Rs("data"),Rs("components"),Rs("dom"),Qs("hasSubmenu",!1),js("toggling"),yf.field("itemBehaviours",[Lx,fx,$w,pf]),Qs("ignoreFocus",!1),Qs("domModification",{}),Nd("builder",Kx),Qs("eventOrder",{})],Xx=e=>({dom:e.dom,components:e.components,events:Ri([$i(ai())])}),Jx=[Rs("dom"),Rs("components"),Nd("builder",Xx)],Qx=S("item-widget"),eC=S([Gf({name:"widget",overrides:e=>({behaviours:Rm([pf.config({store:{mode:"manual",getValue:t=>e.data,setValue:y}})])})})]),tC=e=>{const t=ib(Qx(),e,eC()),o=lb(Qx(),e,t.internals()),n=t=>cb(t,e,"widget").map((e=>($w.focusIn(e),e))),r=(t,o)=>Db(o.event.target)?R.none():(()=>e.autofocus?(o.setSource(t.element),R.none()):R.none())();return{dom:e.dom,components:o,domModification:e.domModification,events:Ri([Yi(((e,t)=>{n(e).each((e=>{t.stop()}))})),Ii(Va(),Vx),Ii(ai(),((t,o)=>{e.autofocus?n(t):fx.focus(t)}))]),behaviours:yf.augment(e.widgetBehaviours,[pf.config({store:{mode:"memory",initialValue:e.data}}),fx.config({ignore:e.ignoreFocus,onFocus:e=>{Zx(e)}}),$w.config({mode:"special",focusIn:e.autofocus?e=>{n(e)}:Pm(),onLeft:r,onRight:r,onEscape:(t,o)=>fx.isFocused(t)||e.autofocus?e.autofocus?(o.setSource(t.element),R.none()):R.none():(fx.focus(t),R.some(!0))})])}},oC=[Rs("uid"),Rs("data"),Rs("components"),Rs("dom"),Qs("autofocus",!1),Qs("ignoreFocus",!1),yf.field("widgetBehaviours",[pf,fx,$w]),Qs("domModification",{}),fb(eC()),Nd("builder",tC)],nC=Es("type",{widget:oC,item:Yx,separator:Jx}),rC=(e,t)=>({mode:"flatgrid",selector:"."+e.markers.item,initSize:{numColumns:t.initSize.numColumns,numRows:t.initSize.numRows},focusManager:e.focusManager}),sC=(e,t)=>({mode:"matrix",selectors:{row:t.rowSelector,cell:"."+e.markers.item},previousSelector:t.previousSelector,focusManager:e.focusManager}),aC=(e,t)=>({mode:"menu",selector:"."+e.markers.item,moveOnTab:t.moveOnTab,focusManager:e.focusManager}),iC=S([Xf({factory:{sketch:e=>{const t=Os("menu.spec item",nC,e);return t.builder(t)}},name:"items",unit:"item",defaults:(e,t)=>_e(t,"uid")?t:{...t,uid:bl("item")},overrides:(e,t)=>({type:t.type,ignoreFocus:e.fakeFocus,domModification:{classes:[e.markers.item]}})})]),lC=S([Rs("value"),Rs("items"),Rs("dom"),Rs("components"),Qs("eventOrder",{}),ff("menuBehaviours",[vv,pf,Rb,$w]),ea("movement",{mode:"menu",moveOnTab:!0},Es("mode",{grid:[Bd(),Nd("config",rC)],matrix:[Nd("config",sC),Rs("rowSelector"),Qs("previousSelector",R.none)],menu:[Qs("moveOnTab",!0),Nd("config",aC)]})),kd(),Qs("fakeFocus",!1),Qs("focusManager",Fv()),Ed("onHighlight"),Ed("onDehighlight")]),cC=S("alloy.menu-focus"),dC=(e,t)=>{const o=oh(e.element,'[role="menuitemradio"][aria-checked="true"]');j(o,(o=>{_t(o,t.element)||e.getSystem().getByDom(o).each((e=>{Lx.off(e)}))}))},mC=(e,t,o,n)=>({uid:e.uid,dom:e.dom,markers:e.markers,behaviours:vf(e.menuBehaviours,[vv.config({highlightClass:e.markers.selectedItem,itemClass:e.markers.item,onHighlight:e.onHighlight,onDehighlight:e.onDehighlight}),pf.config({store:{mode:"memory",initialValue:e.value}}),Rb.config({find:R.some}),$w.config(e.movement.config(e,e.movement))]),events:Ri([Ii($x(),((e,t)=>{const o=t.event;e.getSystem().getByDom(o.target).each((o=>{vv.highlight(e,o),t.stop(),Ti(e,cC(),{menu:e,item:o})}))})),Ii(jx(),((e,t)=>{const o=t.event.item;vv.highlight(e,o)})),Ii(Wx(),((e,t)=>{const{item:o,state:n}=t.event;n&&"menuitemradio"===oo(o.element,"role")&&dC(e,o)}))]),components:t,eventOrder:e.eventOrder,domModification:{attributes:{role:"menu"}}}),uC=Eb({name:"Menu",configFields:lC(),partFields:iC(),factory:mC}),gC=e=>fe(e,((e,t)=>({k:e,v:t}))),hC=(e,t,o,n)=>ke(o,n).bind((n=>ke(e,n).bind((n=>{const r=hC(e,t,o,n);return R.some([n].concat(r))})))).getOr([]),pC=(e,t)=>{const o={};he(e,((e,t)=>{j(e,(e=>{o[e]=t}))}));const n=t,r=gC(t),s=pe(r,((e,t)=>[t].concat(hC(o,n,r,t))));return pe(o,(e=>ke(s,e).getOr([e])))},fC=()=>{const e=ca({}),t=ca({}),o=ca({}),n=xu(),r=ca({}),s=()=>{e.set({}),t.set({}),o.set({}),n.clear()},a=()=>n.get().isNone(),i=(e,o)=>{t.set({...t.get(),[e]:{type:"prepared",menu:o}})},l=(s,a,i,l)=>{n.set(s),e.set(i),t.set(a),r.set(l);const c=pC(l,i);o.set(c)},c=t=>Ce(e.get(),((e,o)=>e===t)),d=(e,t,o)=>p(e).bind((n=>c(e).bind((e=>t(e).map((e=>({triggeredMenu:n,triggeringItem:e,triggeringPath:o}))))))),m=(e,t)=>{const r=q(b(e).toArray(),(e=>p(e).isSome()));return ke(o.get(),e).bind((e=>{const o=oe(r.concat(e)),s=ee(o,((e,r)=>d(e,t,o.slice(0,r+1)).fold((()=>Te(n.get(),e)?[]:[R.none()]),(e=>[R.some(e)]))));return Ae(s)}))},u=t=>ke(e.get(),t).map((e=>{const n=ke(o.get(),t).getOr([]);return[e].concat(n)})),g=e=>ke(o.get(),e).bind((e=>e.length>1?R.some(e.slice(1)):R.none())),h=e=>ke(o.get(),e),p=e=>f(e).bind(bC),f=e=>ke(t.get(),e),b=t=>ke(e.get(),t),v=e=>{const t=r.get();return ne(ue(t),e)},y=()=>n.get().bind(p),w=()=>t.get();return{setMenuBuilt:i,setContents:l,expand:u,refresh:h,collapse:g,lookupMenu:f,lookupItem:b,otherMenus:v,getPrimary:y,getMenus:w,clear:s,isClear:a,getTriggeringPath:m}},bC=e=>"prepared"===e.type?R.some(e.menu):R.none(),vC={init:fC,extractPreparedMenu:bC},yC=cl("tiered-menu-item-highlight"),wC=cl("tiered-menu-item-dehighlight");var xC;(function(e){e[e["HighlightMenuAndItem"]=0]="HighlightMenuAndItem",e[e["HighlightJustMenu"]=1]="HighlightJustMenu",e[e["HighlightNone"]=2]="HighlightNone"})(xC||(xC={}));const CC=(e,t)=>{const o=xu(),n=(t,o,n)=>pe(n,((n,r)=>{const s=()=>uC.sketch({...n,value:r,markers:e.markers,fakeFocus:e.fakeFocus,onHighlight:(e,t)=>{const o={menuComp:e,itemComp:t};Ti(e,yC,o)},onDehighlight:(e,t)=>{const o={menuComp:e,itemComp:t};Ti(e,wC,o)},focusManager:e.fakeFocus?Vv():Fv()});return r===o?{type:"prepared",menu:t.getSystem().build(s())}:{type:"notbuilt",nbMenu:s}})),r=vC.init(),s=t=>{const o=n(t,e.data.primary,e.data.menus),s=l();return r.setContents(e.data.primary,o,e.data.expansions,s),r.getPrimary()},a=e=>pf.getValue(e).value,i=(e,t,o)=>me(t,(e=>{if(!e.getSystem().isConnected())return R.none();const t=vv.getCandidates(e);return X(t,(e=>a(e)===o))})),l=t=>pe(e.data.menus,((e,t)=>ee(e.items,(e=>"separator"===e.type?[]:[e.data.value])))),c=vv.highlight,d=(t,o)=>{c(t,o),vv.getHighlighted(o).orThunk((()=>vv.getFirst(o))).each((n=>{e.fakeFocus?vv.highlight(o,n):Di(t,n.element,ai())}))},m=(e,t)=>De(U(t,(t=>e.lookupMenu(t).bind((e=>"prepared"===e.type?R.some(e.menu):R.none()))))),u=(t,o,n)=>{const r=m(o,o.otherMenus(n));j(r,(o=>{fc(o.element,[e.markers.backgroundMenu]),e.stayInDom||sx.remove(t,o)}))},g=t=>o.get().getOrThunk((()=>{const n={},r=oh(t.element,`.${e.markers.item}`),s=q(r,(e=>"true"===oo(e,"aria-haspopup")));return j(s,(e=>{t.getSystem().getByDom(e).each((e=>{const t=a(e);n[t]=e}))})),o.set(n),n})),h=(e,t)=>{const o=g(e);he(o,((e,o)=>{const n=z(t,o);eo(e.element,"aria-expanded",n)}))},p=(t,o,n)=>R.from(n[0]).bind((r=>o.lookupMenu(r).bind((r=>{if("notbuilt"===r.type)return R.none();{const s=r.menu,a=m(o,n.slice(1));return j(a,(t=>{mc(t.element,e.markers.backgroundMenu)})),Yt(s.element)||sx.append(t,Gc(s)),fc(s.element,[e.markers.backgroundMenu]),d(t,s),u(t,o,n),R.some(s)}}))));let f;(function(e){e[e["HighlightSubmenu"]=0]="HighlightSubmenu",e[e["HighlightParent"]=1]="HighlightParent"})(f||(f={}));const b=(e,t,o)=>{if("notbuilt"===o.type){const n=e.getSystem().build(o.nbMenu());return r.setMenuBuilt(t,n),n}return o.menu},v=(t,o,n=f.HighlightSubmenu)=>{if(o.hasConfigured(Jb)&&Jb.isDisabled(o))return R.some(o);{const s=a(o);return r.expand(s).bind((s=>(h(t,s),R.from(s[0]).bind((a=>r.lookupMenu(a).bind((i=>{const l=b(t,a,i);return Yt(l.element)||sx.append(t,Gc(l)),e.onOpenSubmenu(t,o,l,oe(s)),n===f.HighlightSubmenu?(vv.highlightFirst(l),p(t,r,s)):(vv.dehighlightAll(l),R.some(o))})))))))}},w=(t,o)=>{const n=a(o);return r.collapse(n).bind((n=>(h(t,n),p(t,r,n).map((n=>(e.onCollapseMenu(t,o,n),n))))))},x=(e,t)=>{const o=a(t);return r.refresh(o).bind((t=>(h(e,t),p(e,r,t))))},C=(e,t)=>Db(t.element)?R.none():v(e,t,f.HighlightSubmenu),S=(e,t)=>Db(t.element)?R.none():w(e,t),k=(t,o)=>w(t,o).orThunk((()=>e.onEscape(t,o).map((()=>t)))),_=t=>(o,n)=>rd(n.getSource(),`.${e.markers.item}`).bind((e=>o.getSystem().getByDom(e).toOptional().bind((e=>t(o,e).map(M))))),O=Ri([Ii(cC(),((e,t)=>{const o=t.event.item;r.lookupItem(a(o)).each((()=>{const o=t.event.menu;vv.highlight(e,o);const n=a(t.event.item);r.refresh(n).each((t=>u(e,r,t)))}))})),Yi(((t,o)=>{const n=o.event.target;t.getSystem().getByDom(n).each((o=>{const n=a(o);0===n.indexOf("collapse-item")&&w(t,o),v(t,o,f.HighlightSubmenu).fold((()=>{e.onExecute(t,o)}),y)}))})),qi(((t,o)=>{s(t).each((o=>{sx.append(t,Gc(o)),e.onOpenMenu(t,o),e.highlightOnOpen===xC.HighlightMenuAndItem?d(t,o):e.highlightOnOpen===xC.HighlightJustMenu&&c(t,o)}))})),Ii(yC,((t,o)=>{e.onHighlightItem(t,o.event.menuComp,o.event.itemComp)})),Ii(wC,((t,o)=>{e.onDehighlightItem(t,o.event.menuComp,o.event.itemComp)})),...e.navigateOnHover?[Ii(jx(),((t,o)=>{const n=o.event.item;x(t,n),v(t,n,f.HighlightParent),e.onHover(t,n)}))]:[]]),T=e=>vv.getHighlighted(e).bind(vv.getHighlighted),E=e=>{T(e).each((t=>{w(e,t)}))},D=e=>{r.getPrimary().each((t=>{d(e,t)}))},A=e=>R.from(e.components()[0]).filter((e=>"menu"===oo(e.element,"role"))),N=t=>{const o=r.getPrimary().bind((e=>T(t).bind((e=>{const o=a(e),n=Se(r.getMenus()),s=De(U(n,vC.extractPreparedMenu));return r.getTriggeringPath(o,(e=>i(t,s,e)))})).map((t=>({primary:e,triggeringPath:t})))));o.fold((()=>{A(t).each((o=>{e.onRepositionMenu(t,o,[])}))}),(({primary:o,triggeringPath:n})=>{e.onRepositionMenu(t,o,n)}))},B={collapseMenu:E,highlightPrimary:D,repositionMenus:N};return{uid:e.uid,dom:e.dom,markers:e.markers,behaviours:vf(e.tmenuBehaviours,[$w.config({mode:"special",onRight:_(C),onLeft:_(S),onEscape:_(k),focusIn:(e,t)=>{r.getPrimary().each((t=>{Di(e,t.element,ai())}))}}),vv.config({highlightClass:e.markers.selectedMenu,itemClass:e.markers.menu}),Rb.config({find:e=>vv.getHighlighted(e)}),sx.config({})]),eventOrder:e.eventOrder,apis:B,events:O}},SC=S("collapse-item"),kC=(e,t,o)=>({primary:e,menus:t,expansions:o}),_C=(e,t)=>({primary:e,menus:ba(e,t),expansions:{}}),OC=e=>({value:cl(SC()),meta:{text:e}}),TC=Tb({name:"TieredMenu",configFields:[Md("onExecute"),Md("onEscape"),Ad("onOpenMenu"),Ad("onOpenSubmenu"),Ed("onRepositionMenu"),Ed("onCollapseMenu"),Qs("highlightOnOpen",xC.HighlightMenuAndItem),Vs("data",[Rs("primary"),Rs("menus"),Rs("expansions")]),Qs("fakeFocus",!1),Ed("onHighlightItem"),Ed("onDehighlightItem"),Ed("onHover"),_d(),Rs("dom"),Qs("navigateOnHover",!0),Qs("stayInDom",!1),ff("tmenuBehaviours",[$w,vv,Rb,sx]),Qs("eventOrder",{})],apis:{collapseMenu:(e,t)=>{e.collapseMenu(t)},highlightPrimary:(e,t)=>{e.highlightPrimary(t)},repositionMenus:(e,t)=>{e.repositionMenus(t)}},factory:CC,extraApis:{tieredData:kC,singleData:_C,collapseItem:OC}}),EC=(e,t,o,n,r)=>{const s=()=>e.lazySink(t),a="horizontal"===n.type?{layouts:{onLtr:()=>wm(),onRtl:()=>xm()}}:{},i=e=>2===e.length,l=e=>i(e)?a:{};return TC.sketch({dom:{tag:"div"},data:n.data,markers:n.menu.markers,highlightOnOpen:n.menu.highlightOnOpen,fakeFocus:n.menu.fakeFocus,onEscape:()=>(Np.close(t),e.onEscape.map((e=>e(t))),R.some(!0)),onExecute:()=>R.some(!0),onOpenMenu:(e,t)=>{Gh.positionWithinBounds(s().getOrDie(),t,o,r())},onOpenSubmenu:(e,t,o,n)=>{const r=s().getOrDie();Gh.position(r,o,{anchor:{type:"submenu",item:t,...l(n)}})},onRepositionMenu:(e,t,n)=>{const a=s().getOrDie();Gh.positionWithinBounds(a,t,o,r()),j(n,(e=>{const t=l(e.triggeringPath);Gh.position(a,e.triggeredMenu,{anchor:{type:"submenu",item:e.triggeringItem,...t}})}))}})},DC=(e,t)=>{const o=(t,o)=>{const n=e.getRelated(t);return n.exists((e=>cd(e,o)))},n=(e,t)=>{Np.setContent(e,t)},r=(e,t,o)=>{s(e,t,o,R.none())},s=(e,t,o,n)=>{a(e,t,o,(()=>n.map((e=>tr(e)))))},a=(t,o,n,r)=>{const s=e.lazySink(t).getOrDie();Np.openWhileCloaked(t,o,(()=>Gh.positionWithinBounds(s,t,n,r()))),pf.setValue(t,R.some({mode:"position",config:n,getBounds:r}))},i=(e,t,o)=>{l(e,t,o,R.none)},l=(t,o,n,r)=>{const s=EC(e,t,o,n,r);Np.open(t,s),pf.setValue(t,R.some({mode:"menu",menu:s}))},c=e=>{Np.isOpen(e)&&(pf.setValue(e,R.none()),Np.close(e))},d=e=>Np.getState(e),m=t=>{Np.isOpen(t)&&pf.getValue(t).each((o=>{switch(o.mode){case"menu":Np.getState(t).each(TC.repositionMenus);break;case"position":const n=e.lazySink(t).getOrDie();Gh.positionWithinBounds(n,t,o.config,o.getBounds());break}}))},u={setContent:n,showAt:r,showWithin:s,showWithinBounds:a,showMenuAt:i,showMenuWithinBounds:l,hide:c,getContent:d,reposition:m,isOpen:Np.isOpen};return{uid:e.uid,dom:e.dom,behaviours:vf(e.inlineBehaviours,[Np.config({isPartOf:(e,t,n)=>cd(t,n)||o(e,n),getAttachPoint:t=>e.lazySink(t).getOrDie(),onOpen:t=>{e.onShow(t)},onClose:t=>{e.onHide(t)}}),pf.config({store:{mode:"memory",initialValue:R.none()}}),zm.config({channels:{...Ip({isExtraPart:t.isExtraPart,...e.fireDismissalEventInstead.map((e=>({fireEventInstead:{event:e.event}}))).getOr({})}),...zp({...e.fireRepositionEventInstead.map((e=>({fireEventInstead:{event:e.event}}))).getOr({}),doReposition:m})}})]),eventOrder:e.eventOrder,apis:u}},AC=Tb({name:"InlineView",configFields:[Rs("lazySink"),Ed("onShow"),Ed("onHide"),Ks("onEscape"),ff("inlineBehaviours",[Np,pf,zm]),Xs("fireDismissalEventInstead",[Qs("event",vi())]),Xs("fireRepositionEventInstead",[Qs("event",yi())]),Qs("getRelated",R.none),Qs("isExtraPart",A),Qs("eventOrder",R.none)],factory:DC,apis:{showAt:(e,t,o,n)=>{e.showAt(t,o,n)},showWithin:(e,t,o,n,r)=>{e.showWithin(t,o,n,r)},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)}}});var MC=tinymce.util.Tools.resolve("tinymce.util.Delay");const NC=e=>{const t=Ix(e.action),o=e.dom.tag,n=t=>ke(e.dom,"attributes").bind((e=>ke(e,t))),r=()=>{if("button"===o){const e=n("type").getOr("button"),t=n("role").map((e=>({role:e}))).getOr({});return{type:e,...t}}{const e=n("role").getOr("button");return{role:e}}};return{uid:e.uid,dom:e.dom,components:e.components,events:t,behaviours:yf.augment(e.buttonBehaviours,[fx.config({}),$w.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:r()},eventOrder:e.eventOrder}},RC=Tb({name:"Button",factory:NC,configFields:[Qs("uid",void 0),Rs("dom"),Qs("components",[]),yf.field("buttonBehaviours",[fx,$w]),js("action"),js("role"),Qs("eventOrder",{})]}),BC=e=>{const t=kb(e)&&Oe(e,"uid")?e.uid:bl("memento"),o=e=>e.getSystem().getByUid(t).getOrDie(),n=e=>e.getSystem().getByUid(t).toOptional(),r=()=>({...e,uid:t});return{get:o,getOpt:n,asSpec:r}};var LC=tinymce.util.Tools.resolve("tinymce.util.I18n");const HC={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-default":!0,"list-bull-square":!0},IC="temporary-placeholder",PC=e=>()=>ke(e,IC).getOr("!not found!"),zC=(e,t)=>{const o=e.toLowerCase();if(LC.isRtl()){const e=ze(o,"-rtl");return _e(t,e)?e:o}return o},FC=(e,t)=>ke(t,zC(e,t)),VC=(e,t)=>{const o=t();return FC(e,o).getOrThunk(PC(o))},ZC=(e,t,o)=>{const n=t();return FC(e,n).or(o).getOrThunk(PC(n))},UC=e=>!!LC.isRtl()&&_e(HC,e),jC=()=>ix("add-focusable",[qi((e=>{od(e.element,"svg").each((e=>eo(e,"focusable","false")))}))]),$C=(e,t,o,n)=>{var r,s;const a=UC(t)?["tox-icon--flip"]:[],i=ke(o,zC(t,o)).or(n).getOrThunk(PC(o));return{dom:{tag:e.tag,attributes:null!==(r=e.attributes)&&void 0!==r?r:{},classes:e.classes.concat(a),innerHtml:i},behaviours:Rm([...null!==(s=e.behaviours)&&void 0!==s?s:[],jC()])}},WC=(e,t,o,n=R.none())=>$C(t,e,o(),n),qC=(e,t,o)=>{const n=o(),r=X(e,(e=>_e(n,zC(e,n))));return $C(t,r.getOr(IC),n,R.none())},GC={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},KC=e=>{const t=BC({dom:{tag:"p",innerHtml:e.translationProvider(e.text)},behaviours:Rm([sx.config({})])}),o=e=>({dom:{tag:"div",classes:["tox-bar"],styles:{width:`${e}%`}}}),n=e=>({dom:{tag:"div",classes:["tox-text"],innerHtml:`${e}%`}}),r=BC({dom:{tag:"div",classes:e.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[o(0)]},n(0)],behaviours:Rm([sx.config({})])}),s=(e,t)=>{e.getSystem().isConnected()&&r.getOpt(e).each((e=>{sx.set(e,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[o(t)]},n(t)])}))},a=(e,o)=>{if(e.getSystem().isConnected()){const n=t.get(e);sx.set(n,[Zc(o)])}},i={updateProgress:s,updateText:a},l=Q([e.icon.toArray(),e.level.toArray(),e.level.bind((e=>R.from(GC[e]))).toArray()]),c=BC(RC.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[WC("close",{tag:"div",classes:["tox-icon"],attributes:{"aria-label":e.translationProvider("Close")}},e.iconProvider)],action:t=>{e.onAction(t)}})),d=qC(l,{tag:"div",classes:["tox-notification__icon"]},e.iconProvider),m={dom:{tag:"div",classes:["tox-notification__body"]},components:[t.asSpec()],behaviours:Rm([sx.config({})])},u=[d,m];return{uid:e.uid,dom:{tag:"div",attributes:{role:"alert"},classes:e.level.map((e=>["tox-notification","tox-notification--in",`tox-notification--${e}`])).getOr(["tox-notification","tox-notification--in"])},behaviours:Rm([fx.config({}),ix("notification-events",[Ii(Za(),(e=>{c.getOpt(e).each(fx.focus)}))])]),components:u.concat(e.progress?[r.asSpec()]:[]).concat(e.closeButton?[c.asSpec()]:[]),apis:i}},YC=Tb({name:"Notification",factory:KC,configFields:[js("level"),Rs("progress"),js("icon"),Rs("onAction"),Rs("text"),Rs("iconProvider"),Rs("translationProvider"),ra("closeButton",!0)],apis:{updateProgress:(e,t,o)=>{e.updateProgress(t,o)},updateText:(e,t,o)=>{e.updateText(t,o)}}});var XC,JC,QC=(e,t,o)=>{const n=t.backstage.shared,r=()=>{const t=tr(Qe.fromDom(e.getContentAreaContainer())),o=nr(),n=Kd(o.x,t.x,t.right),r=Kd(o.y,t.y,t.bottom),s=Math.max(t.right,o.right),a=Math.max(t.bottom,o.bottom);return R.some(er(n,r,s-n,a-r))},s=(t,s)=>{const a=()=>{s(),AC.hide(l)},i=qc(YC.sketch({text:t.text,level:z(["success","error","warning","warn","info"],t.type)?t.type:void 0,progress:!0===t.progressBar,icon:t.icon,closeButton:t.closeButton,onAction:a,iconProvider:n.providers.icons,translationProvider:n.providers.translate})),l=qc(AC.sketch({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:n.getSink,fireDismissalEventInstead:{},...n.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}}}));o.add(l),b(t.timeout)&&t.timeout>0&&MC.setEditorTimeout(e,(()=>{a()}),t.timeout);const c=()=>{const t=Gc(i),o={maxHeightFunction:ju()},s=e.notificationManager.getNotifications();if(s[0]===d){const e={...n.anchors.banner(),overrides:o};AC.showWithinBounds(l,t,{anchor:e},r)}else P(s,d).each((e=>{const n=s[e-1].getEl(),a={type:"node",root:Xt(),node:R.some(Qe.fromDom(n)),overrides:o,layouts:{onRtl:()=>[gm],onLtr:()=>[gm]}};AC.showWithinBounds(l,t,{anchor:a},r)}))},d={close:a,reposition:c,text:e=>{YC.updateText(i,e)},settings:t,getEl:()=>i.element.dom,progressBar:{value:e=>{YC.updateProgress(i,e)}}};return d},a=e=>{e.close()},i=e=>e.settings;return{open:s,close:a,getArgs:i}},eS=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),tS=tinymce.util.Tools.resolve("tinymce.EditorManager"),oS=tinymce.util.Tools.resolve("tinymce.Env");(function(e){e["default"]="wrap",e["floating"]="floating",e["sliding"]="sliding",e["scrolling"]="scrolling"})(XC||(XC={})),function(e){e["auto"]="auto",e["top"]="top",e["bottom"]="bottom"}(JC||(JC={}));const nS=e=>t=>t.options.get(e),rS=e=>t=>R.from(e(t)),sS=e=>{const t=oS.deviceType.isPhone(),o=oS.deviceType.isTablet()||t,n=e.options.register,r=e=>i(e)||!1===e,s=e=>i(e)||b(e);n("skin",{processor:e=>i(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:eS.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("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=>i(e)||u(e),default:!t}),n("menu",{processor:"object",default:{}}),n("toolbar",{processor:e=>u(e)||i(e)||d(e)?{value:e,valid:!0}:{valid:!1,message:"Must be a boolean, string or array."},default:!0}),V(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:JC.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("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||u(e),default:!oS.deviceType.isTouch()}),n("sidebar_show",{processor:"string"})},aS=nS("readonly"),iS=nS("height"),lS=nS("width"),cS=rS(nS("min_width")),dS=rS(nS("min_height")),mS=rS(nS("max_width")),uS=rS(nS("max_height")),gS=rS(nS("style_formats")),hS=nS("style_formats_merge"),pS=nS("style_formats_autohide"),fS=nS("content_langs"),bS=nS("removed_menuitems"),vS=nS("toolbar_mode"),yS=nS("toolbar_groups"),wS=nS("toolbar_location"),xS=nS("fixed_toolbar_container"),CS=nS("fixed_toolbar_container_target"),SS=nS("toolbar_persist"),kS=nS("toolbar_sticky_offset"),_S=nS("menubar"),OS=nS("toolbar"),TS=nS("file_picker_callback"),ES=nS("file_picker_validator_handler"),DS=nS("file_picker_types"),AS=nS("typeahead_urls"),MS=nS("anchor_top"),NS=nS("anchor_bottom"),RS=nS("draggable_modal"),BS=nS("statusbar"),LS=nS("elementpath"),HS=nS("branding"),IS=nS("resize"),PS=nS("paste_as_text"),zS=nS("sidebar_show"),FS=nS("promotion"),VS=e=>!1===e.options.get("skin"),ZS=e=>!1!==e.options.get("menubar"),US=e=>{const t=e.options.get("skin_url");if(VS(e))return t;if(t)return e.documentBaseURI.toAbsolute(t);{const t=e.options.get("skin");return tS.baseURL+"/skins/ui/"+t}},jS=e=>e.options.get("line_height_formats").split(" "),$S=e=>{const t=OS(e),o=i(t),n=d(t)&&t.length>0;return!qS(e)&&(n||o||!0===t)},WS=e=>{const t=V(9,(t=>e.options.get("toolbar"+(t+1)))),o=q(t,i);return Be(o.length>0,o)},qS=e=>WS(e).fold((()=>{const t=OS(e);return v(t,i)&&t.length>0}),M),GS=e=>wS(e)===JC.bottom,KS=e=>{var t;if(!e.inline)return R.none();const o=null!==(t=xS(e))&&void 0!==t?t:"";if(o.length>0)return nd(Xt(),o);const n=CS(e);return p(n)?R.some(Qe.fromDom(n)):R.none()},YS=e=>e.inline&&KS(e).isSome(),XS=e=>{const t=KS(e);return t.getOrThunk((()=>jt(Ut(Qe.fromDom(e.getElement())))))},JS=e=>e.inline&&!ZS(e)&&!$S(e)&&!qS(e),QS=e=>{const t=e.options.get("toolbar_sticky");return(t||e.inline)&&!YS(e)&&!JS(e)},ek=e=>{const t=e.options.get("menu");return pe(t,(e=>({...e,items:e.items})))};var tk=Object.freeze({__proto__:null,get ToolbarMode(){return XC},get ToolbarLocation(){return JC},register:sS,getSkinUrl:US,isReadOnly:aS,isSkinDisabled:VS,getHeightOption:iS,getWidthOption:lS,getMinWidthOption:cS,getMinHeightOption:dS,getMaxWidthOption:mS,getMaxHeightOption:uS,getUserStyleFormats:gS,shouldMergeStyleFormats:hS,shouldAutoHideStyleFormats:pS,getLineHeightFormats:jS,getContentLanguages:fS,getRemovedMenuItems:bS,isMenubarEnabled:ZS,isMultipleToolbars:qS,isToolbarEnabled:$S,isToolbarPersist:SS,getMultipleToolbarsOption:WS,getUiContainer:XS,useFixedContainer:YS,getToolbarMode:vS,isDraggableModal:RS,isDistractionFree:JS,isStickyToolbar:QS,getStickyToolbarOffset:kS,getToolbarLocation:wS,isToolbarLocationBottom:GS,getToolbarGroups:yS,getMenus:ek,getMenubar:_S,getToolbar:OS,getFilePickerCallback:TS,getFilePickerTypes:DS,useTypeaheadUrls:AS,getAnchorTop:MS,getAnchorBottom:NS,getFilePickerValidatorHandler:ES,useStatusBar:BS,useElementPath:LS,promotionEnabled:FS,useBranding:HS,getResize:IS,getPasteAsText:PS,getSidebarShow:zS});const ok="[data-mce-autocompleter]",nk=e=>rd(e,ok),rk=e=>nd(e,ok),sk=(e,t)=>{const o=(e,t)=>{Ti(e,ja(),{raw:t})},n=()=>e.getMenu().bind(vv.getHighlighted);t.on("keydown",(t=>{const r=t.which;e.isActive()&&(e.isMenuOpen()?13===r?(n().each(Ei),t.preventDefault()):40===r?(n().fold((()=>{e.getMenu().each(vv.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",(t=>{e.isActive()&&!e.isProcessingAction()&&nk(Qe.fromDom(t.element)).isNone()&&e.cancelIfNecessary()}))},ak={setup:sk};var ik;(function(e){e[e["CLOSE_ON_EXECUTE"]=0]="CLOSE_ON_EXECUTE",e[e["BUBBLE_TO_SANDBOX"]=1]="BUBBLE_TO_SANDBOX"})(ik||(ik={}));var lk=ik;const ck="tox-menu-nav__js",dk="tox-collection__item",mk="tox-swatch",uk={normal:ck,color:mk},gk="tox-collection__item--enabled",hk="tox-collection__group-heading",pk="tox-collection__item-icon",fk="tox-collection__item-label",bk="tox-collection__item-accessory",vk="tox-collection__item-caret",yk="tox-collection__item-checkmark",wk="tox-collection__item--active",xk="tox-collection__item-container",Ck="tox-collection__item-container--column",Sk="tox-collection__item-container--row",kk="tox-collection__item-container--align-right",_k="tox-collection__item-container--align-left",Ok="tox-collection__item-container--valign-top",Tk="tox-collection__item-container--valign-middle",Ek="tox-collection__item-container--valign-bottom",Dk=e=>ke(uk,e).getOr(ck),Ak=e=>"color"===e?"tox-swatches":"tox-menu",Mk=e=>({backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:Ak(e),tieredMenu:"tox-tiered-menu"}),Nk=e=>{const t=Mk(e);return{backgroundMenu:t.backgroundMenu,selectedMenu:t.selectedMenu,menu:t.menu,selectedItem:t.selectedItem,item:Dk(e)}},Rk=(e,t,o)=>{const n=Mk(o);return{tag:"div",classes:Q([[n.menu,`tox-menu-${t}-column`],e?[n.hasIcons]:[]])}},Bk=[uC.parts.items({})],Lk=(e,t,o)=>{const n=Mk(o),r={tag:"div",classes:Q([[n.tieredMenu]])};return{dom:r,markers:Nk(o)}},Hk=S([js("data"),Qs("inputAttributes",{}),Qs("inputStyles",{}),Qs("tag","input"),Qs("inputClasses",[]),Ed("onSetValue"),Qs("styles",{}),Qs("eventOrder",{}),ff("inputBehaviours",[pf,fx]),Qs("selectOnFocus",!0)]),Ik=e=>Rm([fx.config({onFocus:e.selectOnFocus?e=>{const t=e.element,o=wc(t);t.dom.setSelectionRange(0,o.length)}:y})]),Pk=e=>({...Ik(e),...vf(e.inputBehaviours,[pf.config({store:{mode:"manual",...e.data.map((e=>({initialValue:e}))).getOr({}),getValue:e=>wc(e.element),setValue:(e,t)=>{const o=wc(e.element);o!==t&&xc(e.element,t)}},onSetValue:e.onSetValue})])}),zk=e=>({tag:e.tag,attributes:{type:"text",...e.inputAttributes},styles:e.inputStyles,classes:e.inputClasses}),Fk=(e,t)=>({uid:e.uid,dom:zk(e),components:[],behaviours:Pk(e),eventOrder:e.eventOrder}),Vk=Tb({name:"Input",configFields:Hk(),factory:Fk}),Zk=cl("refetch-trigger-event"),Uk=cl("redirect-menu-item-interaction"),jk="tox-menu__searcher",$k=e=>nd(e.element,`.${jk}`).bind((t=>e.getSystem().getByDom(t).toOptional())),Wk=$k,qk=(e,t)=>{pf.setValue(e,t.fetchPattern),e.element.dom.selectionStart=t.selectionStart,e.element.dom.selectionEnd=t.selectionEnd},Gk=e=>{const t=pf.getValue(e),o=e.element.dom.selectionStart,n=e.element.dom.selectionEnd;return{fetchPattern:t,selectionStart:o,selectionEnd:n}},Kk=(e,t)=>{no(t.element,"id").each((t=>eo(e.element,"aria-activedescendant",t)))},Yk=e=>{const t=(e,t)=>(t.cut(),R.none()),o=(e,t)=>{const o={interactionEvent:t.event,eventType:t.event.raw.type};return Ti(e,Uk,o),R.some(!0)},n="searcher-events";return{dom:{tag:"div",classes:[dk]},components:[Vk.sketch({inputClasses:[jk,"tox-textfield"],inputAttributes:{...e.placeholder.map((t=>({placeholder:e.i18n(t)}))).getOr({}),type:"search","aria-autocomplete":"list"},inputBehaviours:Rm([ix(n,[Ii(Wa(),(e=>{Oi(e,Zk)})),Ii(ja(),((e,t)=>{"Escape"===t.event.raw.key&&t.stop()}))]),$w.config({mode:"special",onLeft:t,onRight:t,onSpace:t,onEnter:o,onEscape:o,onUp:o,onDown:o})]),eventOrder:{keydown:[n,$w.name()]}})]}},Xk="tox-collection--results__js",Jk=e=>{var t;return e.dom?{...e,dom:{...e.dom,attributes:{...null!==(t=e.dom.attributes)&&void 0!==t?t:{},id:cl("aria-item-search-result-id"),"aria-selected":"false"}}}:e},Qk=(e,t)=>o=>{const n=Z(o,t);return U(n,(t=>({dom:e,components:t})))},e_=e=>({dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[uC.parts.items({preprocess:"auto"!==e?Qk({tag:"div",classes:["tox-swatches__row"]},e):k})]}]}),t_=e=>({dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[uC.parts.items({preprocess:Qk({tag:"div",classes:["tox-collection__group"]},e)})]}),o_=(e,t)=>{const o=[];let n=[];return j(e,((e,r)=>{t(e,r)?(n.length>0&&o.push(n),n=[],(_e(e.dom,"innerHtml")||e.components&&e.components.length>0)&&n.push(e)):n.push(e)})),n.length>0&&o.push(n),U(o,(e=>({dom:{tag:"div",classes:["tox-collection__group"]},components:e})))},n_=(e,t,o)=>uC.parts.items({preprocess:n=>{const r=U(n,o);return"auto"!==e&&e>1?Qk({tag:"div",classes:["tox-collection__group"]},e)(r):o_(r,((e,o)=>"separator"===t[o].type))}}),r_=(e,t,o=!0)=>({dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===e?["tox-collection--list"]:["tox-collection--grid"])},components:[n_(e,t,k)]}),s_=(e,t,o=!0)=>{const n=cl("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection",Xk].concat(1===e?["tox-collection--list"]:["tox-collection--grid"]),attributes:{id:n}},components:[n_(e,t,Jk)]}},a_=(e,t,o)=>{const n=cl("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===e?["tox-collection--list"]:["tox-collection--grid"])},components:[Yk({i18n:LC.translate,placeholder:o.placeholder}),{dom:{tag:"div",classes:[...1===e?["tox-collection--list"]:["tox-collection--grid"],Xk],attributes:{id:n}},components:[n_(e,t,Jk)]}]}},i_=(e,t=!0)=>({dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[uC.parts.items({preprocess:t=>o_(t,((t,o)=>"separator"===e[o].type))})]}),l_=e=>F(e,(e=>"icon"in e&&void 0!==e.icon)),c_=e=>(console.error(Ts(e)),console.log(e),R.none()),d_=(e,t,o,n,r)=>{const s=i_(o);return{value:e,dom:s.dom,components:s.components,items:o}},m_=(e,t,o,n,r)=>{const s=()=>"searchable"!==r.menuType?r_(n,o):"search-with-field"===r.searchMode.searchMode?a_(n,o,r.searchMode):s_(n,o);if("color"===r.menuType){const t=e_(n);return{value:e,dom:t.dom,components:t.components,items:o}}if("normal"===r.menuType&&"auto"===n){const t=r_(n,o);return{value:e,dom:t.dom,components:t.components,items:o}}if("normal"===r.menuType||"searchable"===r.menuType){const t=s();return{value:e,dom:t.dom,components:t.components,items:o}}if("listpreview"===r.menuType&&"auto"!==n){const t=t_(n);return{value:e,dom:t.dom,components:t.components,items:o}}return{value:e,dom:Rk(t,n,r.menuType),components:Bk,items:o}},u_=Hs("type"),g_=Hs("name"),h_=Hs("label"),p_=Hs("text"),f_=Hs("title"),b_=Hs("icon"),v_=Hs("value"),y_=zs("fetch"),w_=zs("getSubmenuItems"),x_=zs("onAction"),C_=zs("onItemAction"),S_=sa("onSetup",(()=>y)),k_=qs("name"),__=qs("text"),O_=qs("icon"),T_=qs("tooltip"),E_=qs("label"),D_=qs("shortcut"),A_=Ks("select"),M_=ra("active",!1),N_=ra("borderless",!1),R_=ra("enabled",!0),B_=ra("primary",!1),L_=e=>Qs("columns",e),H_=Qs("meta",{}),I_=sa("onAction",y),P_=e=>oa("type",e),z_=e=>As("name","name",Dr((()=>cl(`${e}-name`))),gs),F_=e=>As("value","value",Dr((()=>cl(`${e}-value`))),ds()),V_=rs([u_,__]),Z_=e=>ks("separatormenuitem",V_,e),U_=rs([P_("autocompleteitem"),M_,R_,H_,v_,__,O_]),j_=e=>ks("Autocompleter.Separator",V_,e),$_=e=>ks("Autocompleter.Item",U_,e),W_=[R_,T_,O_,__,S_],q_=rs([u_,x_].concat(W_)),G_=e=>ks("toolbarbutton",q_,e),K_=[M_].concat(W_),Y_=rs(K_.concat([u_,x_])),X_=e=>ks("ToggleButton",Y_,e),J_=[sa("predicate",A),na("scope","node",["node","editor"]),na("position","selection",["node","selection","line"])],Q_=W_.concat([P_("contextformbutton"),B_,x_,Ms("original",k)]),eO=K_.concat([P_("contextformbutton"),B_,x_,Ms("original",k)]),tO=W_.concat([P_("contextformbutton")]),oO=K_.concat([P_("contextformtogglebutton")]),nO=Es("type",{contextformbutton:Q_,contextformtogglebutton:eO}),rO=rs([P_("contextform"),sa("initValue",S("")),E_,Us("commands",nO),$s("launch",Es("type",{contextformbutton:tO,contextformtogglebutton:oO}))].concat(J_)),sO=e=>ks("ContextForm",rO,e),aO=rs([P_("contexttoolbar"),Hs("items")].concat(J_)),iO=e=>ks("ContextToolbar",aO,e),lO=[u_,Hs("src"),qs("alt"),ia("classes",[],gs)],cO=rs(lO),dO=[u_,p_,k_,ia("classes",["tox-collection__item-label"],gs)],mO=rs(dO),uO=ts((()=>ys("type",{cardimage:cO,cardtext:mO,cardcontainer:gO}))),gO=rs([u_,oa("direction","horizontal"),oa("align","left"),oa("valign","middle"),Us("items",uO)]),hO=[R_,__,D_,F_("menuitem"),H_],pO=rs([u_,E_,Us("items",uO),S_,I_].concat(hO)),fO=e=>ks("cardmenuitem",pO,e),bO=rs([u_,M_,O_].concat(hO)),vO=e=>ks("choicemenuitem",bO,e),yO=[u_,Hs("fancytype"),I_],wO=[Qs("initData",{})].concat(yO),xO=[la("initData",{},[ra("allowCustomColors",!0),oa("storageKey","default"),Ys("colors",ds())])].concat(yO),CO=Es("fancytype",{inserttable:wO,colorswatch:xO}),SO=e=>ks("fancymenuitem",CO,e),kO=rs([u_,S_,I_,O_].concat(hO)),_O=e=>ks("menuitem",kO,e),OO=rs([u_,w_,S_,O_].concat(hO)),TO=e=>ks("nestedmenuitem",OO,e),EO=rs([u_,O_,M_,S_,x_].concat(hO)),DO=e=>ks("togglemenuitem",EO,e),AO=(e,t,o)=>{const n=oh(e.element,"."+o);if(n.length>0){const e=J(n,(e=>{const o=e.dom.getBoundingClientRect().top,r=n[0].dom.getBoundingClientRect().top;return Math.abs(o-r)>t})).getOr(n.length);return R.some({numColumns:e,numRows:Math.ceil(n.length/e)})}return R.none()},MO=(e,t)=>Rm([ix(e,t)]),NO=e=>MO(cl("unnamed-events"),e),RO={namedEvents:MO,unnamedEvents:NO},BO=cl("tooltip.exclusive"),LO=cl("tooltip.show"),HO=cl("tooltip.hide"),IO=(e,t,o)=>{e.getSystem().broadcastOn([BO],{})},PO=(e,t,o,n)=>{o.getTooltip().each((e=>{e.getSystem().isConnected()&&sx.set(e,n)}))};var zO=Object.freeze({__proto__:null,hideAllExclusive:IO,setComponents:PO});const FO=(e,t)=>{const o=o=>{t.getTooltip().each((n=>{ip(n),e.onHide(o,n),t.clearTooltip()})),t.clearTimer()},n=o=>{if(!t.isShowing()){IO(o);const n=e.lazySink(o).getOrDie(),r=o.getSystem().build({dom:e.tooltipDom,components:e.tooltipComponents,events:Ri("normal"===e.mode?[Ii(Va(),(e=>{Oi(o,LO)})),Ii(za(),(e=>{Oi(o,HO)}))]:[]),behaviours:Rm([sx.config({})])});t.setTooltip(r),rp(n,r),e.onShow(o,r),Gh.position(n,r,{anchor:e.anchor(o)})}};return Ri(Q([[Ii(LO,(o=>{t.resetTimer((()=>{n(o)}),e.delay)})),Ii(HO,(n=>{t.resetTimer((()=>{o(n)}),e.delay)})),Ii(ri(),((e,t)=>{const n=t;n.universal||z(n.channels,BO)&&o(e)})),Gi((e=>{o(e)}))],"normal"===e.mode?[Ii(Za(),(e=>{Oi(e,LO)})),Ii(oi(),(e=>{Oi(e,HO)})),Ii(Va(),(e=>{Oi(e,LO)})),Ii(za(),(e=>{Oi(e,HO)}))]:[Ii(ki(),((e,t)=>{Oi(e,LO)})),Ii(_i(),(e=>{Oi(e,HO)}))]]))};var VO=Object.freeze({__proto__:null,events:FO}),ZO=[Rs("lazySink"),Rs("tooltipDom"),Qs("exclusive",!0),Qs("tooltipComponents",[]),Qs("delay",300),na("mode","normal",["normal","follow-highlight"]),Qs("anchor",(e=>({type:"hotspot",hotspot:e,layouts:{onLtr:S([gm,um,lm,dm,cm,mm]),onRtl:S([gm,um,lm,dm,cm,mm])}}))),Ed("onHide"),Ed("onShow")];const UO=()=>{const e=xu(),t=xu(),o=()=>{e.on(clearTimeout)},n=(t,n)=>{o(),e.set(setTimeout(t,n))},r=S("not-implemented");return Ml({getTooltip:t.get,isShowing:t.isSet,setTooltip:t.set,clearTooltip:t.clear,clearTimer:o,resetTimer:n,readState:r})};var jO=Object.freeze({__proto__:null,init:UO});const $O=Lm({fields:ZO,name:"tooltipping",active:VO,state:jO,apis:zO}),WO=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),qO="silver.readonly",GO=rs([Ps("readonly")]),KO=(e,t)=>{const o=e.mainUi.outerContainer,n=o.element,r=[e.mainUi.mothership,...e.uiMotherships];t&&j(r,(e=>{e.broadcastOn([Rp()],{target:n})})),j(r,(e=>{e.broadcastOn([qO],{readonly:t})}))},YO=(e,t)=>{e.on("init",(()=>{e.mode.isReadOnly()&&KO(t,!0)})),e.on("SwitchMode",(()=>KO(t,e.mode.isReadOnly()))),aS(e)&&e.mode.set("readonly")},XO=()=>zm.config({channels:{[qO]:{schema:GO,onReceive:(e,t)=>{Jb.set(e,t.readonly)}}}}),JO=e=>Jb.config({disabled:e,disableClass:"tox-collection__item--state-disabled"}),QO=e=>Jb.config({disabled:e}),eT=e=>Jb.config({disabled:e,disableClass:"tox-tbtn--disabled"}),tT=e=>Jb.config({disabled:e,disableClass:"tox-tbtn--disabled",useNative:!1}),oT={item:JO,button:QO,splitButton:eT,toolbarButton:tT},nT=(e,t)=>{const o=e.getApi(t);return e=>{e(o)}},rT=(e,t)=>qi((o=>{const n=nT(e,o);n((o=>{const n=e.onSetup(o);f(n)&&t.set(n)}))})),sT=(e,t)=>Gi((o=>nT(e,o)(t.get()))),aT=(e,t)=>Yi(((o,n)=>{nT(e,o)(e.onAction),e.triggersSubmenu||t!==lk.CLOSE_ON_EXECUTE||(o.getSystem().isConnected()&&Oi(o,ci()),n.stop())})),iT={[si()]:["disabling","alloy.base.behaviour","toggling","item-events"]},lT=De,cT=(e,t,o,n)=>{const r=ca(y);return{type:"item",dom:t.dom,components:lT(t.optComponents),data:e.data,eventOrder:iT,hasSubmenu:e.triggersSubmenu,itemBehaviours:Rm([ix("item-events",[aT(e,o),rT(e,r),sT(e,r)]),oT.item((()=>!e.enabled||n.isDisabled())),XO(),sx.config({})].concat(e.itemBehaviours))}},dT=e=>({value:e.value,meta:{text:e.text.getOr(""),...e.meta}}),mT=e=>{const t=oS.os.isMacOS()||oS.os.isiOS(),o={alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"},n={meta:"Ctrl",access:"Shift+Alt"},r=t?o:n,s=e.split("+"),a=U(s,(e=>{const t=e.toLowerCase().trim();return _e(r,t)?r[t]:e}));return t?a.join(""):a.join("+")},uT=(e,t,o=[pk])=>WC(e,{tag:"div",classes:o},t),gT=e=>({dom:{tag:"div",classes:[fk]},components:[Zc(LC.translate(e))]}),hT=(e,t)=>({dom:{tag:"div",classes:t,innerHtml:e}}),pT=(e,t)=>({dom:{tag:"div",classes:[fk]},components:[{dom:{tag:e.tag,styles:e.styles},components:[Zc(LC.translate(t))]}]}),fT=e=>({dom:{tag:"div",classes:[bk]},components:[Zc(mT(e))]}),bT=e=>uT("checkmark",e,[yk]),vT=e=>uT("chevron-right",e,[vk]),yT=e=>uT("chevron-down",e,[vk]),wT=(e,t)=>{const o="vertical"===e.direction?Ck:Sk,n="left"===e.align?_k:kk,r=()=>{switch(e.valign){case"top":return Ok;case"middle":return Tk;case"bottom":return Ek}};return{dom:{tag:"div",classes:[xk,o,n,r()]},components:t}},xT=(e,t,o)=>({dom:{tag:"img",classes:t,attributes:{src:e,alt:o.getOr("")}}}),CT=(e,t,o)=>{const n="custom",r="remove",s=e.ariaLabel,a=e.value,i=e.iconContent.map((e=>ZC(e,t.icons,o))),l=()=>{const e=mk,o=i.getOr(""),l=s.map((e=>({title:t.translate(e)}))).getOr({}),c={tag:"div",attributes:l,classes:[e]};return a===n?{...c,tag:"button",classes:[...c.classes,"tox-swatches__picker-btn"],innerHtml:o}:a===r?{...c,classes:[...c.classes,"tox-swatch--remove"],innerHtml:o}:p(a)?{...c,attributes:{...c.attributes,"data-mce-color":a},styles:{"background-color":a},innerHtml:o}:c};return{dom:l(),optComponents:[]}},ST=e=>{const t=e.map((e=>({attributes:{title:LC.translate(e)}}))).getOr({});return{tag:"div",classes:[ck,dk],...t}},kT=(e,t,o,n)=>{const r={tag:"div",classes:[pk]},s=e=>WC(e,r,t.icons,n),a=()=>R.some({dom:r}),i=o?e.iconContent.map(s).orThunk(a):R.none(),l=e.checkMark,c=R.from(e.meta).fold((()=>gT),(e=>_e(e,"style")?O(pT,e.style):gT)),d=e.htmlContent.fold((()=>e.textContent.map(c)),(e=>R.some(hT(e,[fk])))),m={dom:ST(e.ariaLabel),optComponents:[i,d,e.shortcutContent.map(fT),l,e.caret]};return m},_T=(e,t,o,n=R.none())=>"color"===e.presets?CT(e,t,n):kT(e,t,o,n),OT=(e,t)=>ke(e,"tooltipWorker").map((e=>[$O.config({lazySink:t.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:e=>({type:"submenu",item:e,overrides:{maxHeightFunction:ju}}),mode:"follow-highlight",onShow:(t,o)=>{e((e=>{$O.setComponents(t,[Uc({element:Qe.fromDom(e)})])}))}})])).getOr([]),TT=e=>eS.DOM.encode(e),ET=(e,t)=>{const o=LC.translate(e),n=TT(o);if(t.length>0){const e=new RegExp(WO(t),"gi");return n.replace(e,(e=>`<span class="tox-autocompleter-highlight">${e}</span>`))}return n},DT=(e,t,o,n,r,s,a,i=!0)=>{const l=_T({presets:n,textContent:R.none(),htmlContent:o?e.text.map((e=>ET(e,t))):R.none(),ariaLabel:e.text,iconContent:e.icon,shortcutContent:R.none(),checkMark:R.none(),caret:R.none(),value:e.value},a.providers,i,e.icon);return cT({data:dT(e),enabled:e.enabled,getApi:S({}),onAction:t=>r(e.value,e.meta),onSetup:S(y),triggersSubmenu:!1,itemBehaviours:OT(e.meta,a)},l,s,a.providers)},AT=(e,t)=>U(e,(e=>{switch(e.type){case"cardcontainer":return wT(e,AT(e.items,t));case"cardimage":return xT(e.src,e.classes,e.alt);case"cardtext":const o=e.name.exists((e=>z(t.cardText.highlightOn,e))),n=o?R.from(t.cardText.matchText).getOr(""):"";return hT(ET(e.text,n),e.classes)}})),MT=(e,t,o,n)=>{const r=e=>({isEnabled:()=>!Jb.isDisabled(e),setEnabled:t=>{Jb.set(e,!t),j(oh(e.element,"*"),(o=>{e.getSystem().getByDom(o).each((e=>{e.hasConfigured(Jb)&&Jb.set(e,!t)}))}))}}),s={dom:ST(e.label),optComponents:[R.some({dom:{tag:"div",classes:[xk,Sk]},components:AT(e.items,n)})]};return cT({data:dT({text:R.none(),...e}),enabled:e.enabled,getApi:r,onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:!1,itemBehaviours:R.from(n.itemBehaviours).getOr([])},s,t,o.providers)},NT=(e,t,o,n,r,s,a,i=!0)=>{const l=e=>({setActive:t=>{Lx.set(e,t)},isActive:()=>Lx.isOn(e),isEnabled:()=>!Jb.isDisabled(e),setEnabled:t=>Jb.set(e,!t)}),c=_T({presets:o,textContent:t?e.text:R.none(),htmlContent:R.none(),ariaLabel:e.text,iconContent:e.icon,shortcutContent:t?e.shortcut:R.none(),checkMark:t?R.some(bT(a.icons)):R.none(),caret:R.none(),value:e.value},a,i);return Or(cT({data:dT(e),enabled:e.enabled,getApi:l,onAction:t=>n(e.value),onSetup:e=>(e.setActive(r),y),triggersSubmenu:!1,itemBehaviours:[]},c,s,a),{toggling:{toggleClass:gk,toggleOnExecute:!1,selected:e.active,exclusive:!0}})},RT=ob(Qx(),eC()),BT=e=>({value:e}),LT=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,HT=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,IT=e=>LT.test(e)||HT.test(e),PT=e=>Pe(e,"#").toUpperCase(),zT=e=>IT(e)?R.some({value:PT(e)}):R.none(),FT=e=>{const t=e.value.replace(LT,((e,t,o,n)=>t+t+o+o+n+n));return{value:t}},VT=e=>{const t=FT(e),o=HT.exec(t.value);return null===o?["FFFFFF","FF","FF","FF"]:o},ZT=e=>{const t=e.toString(16);return(1===t.length?"0"+t:t).toUpperCase()},UT=e=>{const t=ZT(e.red)+ZT(e.green)+ZT(e.blue);return BT(t)},jT=Math.min,$T=Math.max,WT=Math.round,qT=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,GT=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,KT=(e,t,o,n)=>({red:e,green:t,blue:o,alpha:n}),YT=e=>{const t=parseInt(e,10);return t.toString()===e&&t>=0&&t<=255},XT=e=>{let t,o,n;const r=(e.hue||0)%360;let s=e.saturation/100,a=e.value/100;if(s=$T(0,jT(s,1)),a=$T(0,jT(a,1)),0===s)return t=o=n=WT(255*a),KT(t,o,n,1);const i=r/60,l=a*s,c=l*(1-Math.abs(i%2-1)),d=a-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=WT(255*(t+d)),o=WT(255*(o+d)),n=WT(255*(n+d)),KT(t,o,n,1)},JT=e=>{const t=VT(e),o=parseInt(t[1],16),n=parseInt(t[2],16),r=parseInt(t[3],16);return KT(o,n,r,1)},QT=(e,t,o,n)=>{const r=parseInt(e,10),s=parseInt(t,10),a=parseInt(o,10),i=parseFloat(n);return KT(r,s,a,i)},eE=e=>{if("transparent"===e)return R.some(KT(0,0,0,0));const t=qT.exec(e);if(null!==t)return R.some(QT(t[1],t[2],t[3],"1"));const o=GT.exec(e);return null!==o?R.some(QT(o[1],o[2],o[3],o[4])):R.none()},tE=e=>`rgba(${e.red},${e.green},${e.blue},${e.alpha})`,oE=KT(255,0,0,1),nE=e=>{e.dispatch("SkinLoaded")},rE=(e,t)=>{e.dispatch("SkinLoadError",t)},sE=e=>{e.dispatch("ResizeEditor")},aE=(e,t)=>{e.dispatch("ResizeContent",t)},iE=(e,t)=>{e.dispatch("ScrollContent",t)},lE=(e,t)=>{e.dispatch("TextColorChange",t)},cE=(e,t)=>{e.dispatch("AfterProgressState",{state:t})},dE=(e,t)=>e.dispatch("ResolveName",{name:t.nodeName.toLowerCase(),target:t}),mE=(e,t)=>{e.dispatch("ToggleToolbarDrawer",{state:t})};var uE=tinymce.util.Tools.resolve("tinymce.util.LocalStorage");const gE={},hE=(e,t=10)=>{const o=uE.getItem(e),n=i(o)?JSON.parse(o):[],r=e=>{const o=t-e.length;return o<0?e.slice(0,t):e},s=r(n),a=o=>{P(s,o).each(l),s.unshift(o),s.length>t&&s.pop(),uE.setItem(e,JSON.stringify(s))},l=e=>{s.splice(e,1)},c=()=>s.slice(0);return{add:a,state:c}},pE=e=>ke(gE,e).getOrThunk((()=>{const t=`tinymce-custom-colors-${e}`,o=uE.getItem(t);if(h(o)){const e=uE.getItem("tinymce-custom-colors");uE.setItem(t,p(e)?e:"[]")}const n=hE(t,10);return gE[e]=n,n})),fE=e=>U(pE(e).state(),(e=>({type:"choiceitem",text:e,icon:"checkmark",value:e}))),bE=(e,t)=>{pE(e).add(t)},vE=(e,t,o)=>({hue:e,saturation:t,value:o}),yE=e=>{let t=0,o=0,n=0;const r=e.red/255,s=e.green/255,a=e.blue/255,i=Math.min(r,Math.min(s,a)),l=Math.max(r,Math.max(s,a));if(i===l)return n=i,vE(0,0,100*n);const c=r===i?s-a:a===i?r-s:a-r;return t=r===i?3:a===i?1:5,t=60*(t-c/(l-i)),o=(l-i)/l,n=l,vE(Math.round(t),Math.round(100*o),Math.round(100*n))},wE=e=>yE(JT(e)),xE=e=>UT(XT(e)),CE=e=>zT(e).orThunk((()=>eE(e).map(UT))).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],s=n[1],a=n[2],i=n[3];return UT(KT(r,s,a,i))})),SE="forecolor",kE="hilitecolor",_E=e=>Math.max(5,Math.ceil(Math.sqrt(e))),OE=e=>{const t=[];for(let o=0;o<e.length;o+=2)t.push({text:e[o+1],value:"#"+CE(e[o]).value,icon:"checkmark",type:"choiceitem"});return t},TE=e=>t=>t.options.get(e),EE="#000000",DE=e=>{const t=e.options.register,o=e=>v(e,i)?{value:OE(e),valid:!0}:{valid:!1,message:"Must be an array of strings."};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_background",{processor:o}),t("color_map_foreground",{processor:o}),t("color_cols",{processor:"number",default:_E(NE(e,"default").length)}),t("color_cols_foreground",{processor:"number",default:_E(NE(e,SE).length)}),t("color_cols_background",{processor:"number",default:_E(NE(e,kE).length)}),t("custom_colors",{processor:"boolean",default:!0}),t("color_default_foreground",{processor:"string",default:EE}),t("color_default_background",{processor:"string",default:EE})},AE=(e,t)=>t===SE?TE("color_cols_foreground")(e):t===kE?TE("color_cols_background")(e):TE("color_cols")(e),ME=TE("custom_colors"),NE=(e,t)=>t===SE&&e.options.isSet("color_map_foreground")?TE("color_map_foreground")(e):t===kE&&e.options.isSet("color_map_background")?TE("color_map_background")(e):TE("color_map")(e),RE=TE("color_default_foreground"),BE=TE("color_default_background"),LE=(e,t)=>{const o=go(Qe.fromDom(e.selection.getStart()),"hilitecolor"===t?"background-color":"color");return eE(o).map((e=>"#"+UT(e).value))},HE=(e,t,o)=>{e.undoManager.transact((()=>{e.focus(),e.formatter.apply(t,{value:o}),e.nodeChanged()}))},IE=(e,t)=>{e.undoManager.transact((()=>{e.focus(),e.formatter.remove(t,{value:null},void 0,!0),e.nodeChanged()}))},PE=e=>{e.addCommand("mceApplyTextcolor",((t,o)=>{HE(e,t,o)})),e.addCommand("mceRemoveTextcolor",(t=>{IE(e,t)}))},zE=e=>{const t="choiceitem",o={type:t,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"},n={type:t,text:"Custom color",icon:"color-picker",value:"custom"};return e?[o,n]:[o]},FE=(e,t,o,n)=>{if("custom"===o){const o=WE(e);o((o=>{o.each((o=>{bE(t,o),e.execCommand("mceApplyTextcolor",t,o),n(o)}))}),LE(e,t).getOr(EE))}else"remove"===o?(n(""),e.execCommand("mceRemoveTextcolor",t)):(n(o),e.execCommand("mceApplyTextcolor",t,o))},VE=(e,t,o)=>e.concat(fE(t).concat(zE(o))),ZE=(e,t,o)=>n=>{n(VE(e,t,o))},UE=(e,t,o)=>{const n="forecolor"===t?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";e.setIconFill(n,o)},jE=(e,t,o,n,r)=>{e.ui.registry.addSplitButton(t,{tooltip:n,presets:"color",icon:"forecolor"===t?"text-color":"highlight-bg-color",select:t=>{const n=LE(e,o);return Te(n,t.toUpperCase())},columns:AE(e,o),fetch:ZE(NE(e,o),o,ME(e)),onAction:t=>{FE(e,o,r.get(),y)},onItemAction:(n,s)=>{FE(e,o,s,(o=>{r.set(o),lE(e,{name:t,color:o})}))},onSetup:o=>{UE(o,t,r.get());const n=e=>{e.name===t&&UE(o,e.name,e.color)};return e.on("TextColorChange",n),()=>{e.off("TextColorChange",n)}}})},$E=(e,t,o,n)=>{e.ui.registry.addNestedMenuItem(t,{text:n,icon:"forecolor"===t?"text-color":"highlight-bg-color",getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"colorswatch",initData:{storageKey:o},onAction:t=>{FE(e,o,t.value,y)}}]})},WE=e=>(t,o)=>{let n=!1;const r=o=>{const r=o.getData(),s=r.colorpicker;n?(t(R.from(s)),o.close()):e.windowManager.alert(e.translate(["Invalid hex color code: {0}",s]))},s=(e,t)=>{"hex-valid"===t.name&&(n=t.value)},a={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:a,onAction:s,onSubmit:r,onClose:y,onCancel:()=>{t(R.none())}})},qE=e=>{PE(e);const t=RE(e),o=BE(e),n=ca(t),r=ca(o);jE(e,"forecolor","forecolor","Text color",n),jE(e,"backcolor","hilitecolor","Background color",r),$E(e,"forecolor","forecolor","Text color"),$E(e,"backcolor","hilitecolor","Background color")},GE=(e,t,o,n,r,s,a,i)=>{const l=l_(t),c="color"!==r?"normal":"color",d=KE(t,o,n,c,s,a,i),m={menuType:r};return m_(e,l,d,n,m)},KE=(e,t,o,n,r,s,a)=>De(U(e,(i=>"choiceitem"===i.type?vO(i).fold(c_,(i=>R.some(NT(i,1===o,n,t,s(i.value),r,a,l_(e))))):R.none()))),YE=(e,t)=>{const o=Nk(t);if(1===e)return{mode:"menu",moveOnTab:!0};if("auto"===e)return{mode:"grid",selector:"."+o.item,initSize:{numColumns:1,numRows:1}};{const e="color"===t?"tox-swatches__row":"tox-collection__group";return{mode:"matrix",rowSelector:"."+e,previousSelector:e=>"color"===t?nd(e.element,"[aria-checked=true]"):R.none()}}},XE=(e,t)=>1===e?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===e?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===t?".tox-swatches__row":".tox-collection__group",cell:"color"===t?`.${mk}`:`.${dk}`}},JE=(e,t)=>{const o=QE(e,t),n=t.colorinput.getColorCols(e.initData.storageKey),r="color",s=GE(cl("menu-value"),o,(t=>{e.onAction({value:t})}),n,r,lk.CLOSE_ON_EXECUTE,A,t.shared.providers),a={...s,markers:Nk(r),movement:YE(n,r)};return{type:"widget",data:{value:cl("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[RT.widget(uC.sketch(a))]}},QE=(e,t)=>{const o=e.initData.allowCustomColors&&t.colorinput.hasCustomColors();return e.initData.colors.fold((()=>VE(t.colorinput.getColors(e.initData.storageKey),e.initData.storageKey,o)),(e=>e.concat(zE(o))))},eD=cl("cell-over"),tD=cl("cell-execute"),oD=(e,t,o)=>{const n=o=>Ti(o,eD,{row:e,col:t}),r=o=>Ti(o,tD,{row:e,col:t}),s=(e,t)=>{t.stop(),r(e)};return qc({dom:{tag:"div",attributes:{role:"button",["aria-labelledby"]:o}},behaviours:Rm([ix("insert-table-picker-cell",[Ii(Va(),fx.focus),Ii(si(),r),Ii(Ga(),s),Ii(ii(),s)]),Lx.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),fx.config({onFocus:n})])})},nD=(e,t,o)=>{const n=[];for(let r=0;r<t;r++){const t=[];for(let n=0;n<o;n++)t.push(oD(r,n,e));n.push(t)}return n},rD=(e,t,o,n,r)=>{for(let s=0;s<n;s++)for(let n=0;n<r;n++)Lx.set(e[s][n],s<=t&&n<=o)},sD=e=>ee(e,(e=>U(e,Gc))),aD=(e,t)=>Zc(`${t}x${e}`),iD=e=>{const t=10,o=10,n=cl("size-label"),r=nD(n,t,o),s=aD(0,0),a=BC({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:n}},components:[s],behaviours:Rm([sx.config({})])});return{type:"widget",data:{value:cl("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[RT.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:sD(r).concat(a.asSpec()),behaviours:Rm([ix("insert-table-picker",[qi((e=>{sx.set(a.get(e),[s])})),Ui(eD,((e,n,s)=>{const{row:i,col:l}=s.event;rD(r,i,l,t,o),sx.set(a.get(e),[aD(i+1,l+1)])})),Ui(tD,((t,o,n)=>{const{row:r,col:s}=n.event;e.onAction({numRows:r+1,numColumns:s+1}),Oi(t,ci())}))]),$w.config({initSize:{numRows:t,numColumns:o},mode:"flatgrid",selector:'[role="button"]'})])})]}},lD={inserttable:iD,colorswatch:JE},cD=(e,t)=>ke(lD,e.fancytype).map((o=>o(e,t))),dD=(e,t,o,n=!0,r=!1)=>{const s=r?yT(o.icons):vT(o.icons),a=e=>({isEnabled:()=>!Jb.isDisabled(e),setEnabled:t=>Jb.set(e,!t)}),i=_T({presets:"normal",iconContent:e.icon,textContent:e.text,htmlContent:R.none(),ariaLabel:e.text,caret:R.some(s),checkMark:R.none(),shortcutContent:e.shortcut},o,n);return cT({data:dT(e),getApi:a,enabled:e.enabled,onAction:y,onSetup:e.onSetup,triggersSubmenu:!0,itemBehaviours:[]},i,t,o)},mD=(e,t,o,n=!0)=>{const r=e=>({isEnabled:()=>!Jb.isDisabled(e),setEnabled:t=>Jb.set(e,!t)}),s=_T({presets:"normal",iconContent:e.icon,textContent:e.text,htmlContent:R.none(),ariaLabel:e.text,caret:R.none(),checkMark:R.none(),shortcutContent:e.shortcut},o,n);return cT({data:dT(e),getApi:r,enabled:e.enabled,onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:!1,itemBehaviours:[]},s,t,o)},uD=e=>({type:"separator",dom:{tag:"div",classes:[dk,hk]},components:e.text.map(Zc).toArray()}),gD=(e,t,o,n=!0)=>{const r=e=>({setActive:t=>{Lx.set(e,t)},isActive:()=>Lx.isOn(e),isEnabled:()=>!Jb.isDisabled(e),setEnabled:t=>Jb.set(e,!t)}),s=_T({iconContent:e.icon,textContent:e.text,htmlContent:R.none(),ariaLabel:e.text,checkMark:R.some(bT(o.icons)),caret:R.none(),shortcutContent:e.shortcut,presets:"normal",meta:e.meta},o,n);return Or(cT({data:dT(e),enabled:e.enabled,getApi:r,onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:!1,itemBehaviours:[]},s,t,o),{toggling:{toggleClass:gk,toggleOnExecute:!1,selected:e.active}})},hD=DT,pD=uD,fD=mD,bD=dD,vD=gD,yD=cD,wD=MT,xD=(e,t,o,n)=>o.getOrCreate(e,t,n),CD=(e,t,o,n)=>o.getExisting(e,t,n);var SD=Object.freeze({__proto__:null,getCoupled:xD,getExistingCoupled:CD}),kD=[Bs("others",Cs(ir.value,ds()))];const _D=()=>{const e={},t=(t,o)=>{const n=ue(t.others);if(0===n.length)throw new Error("Cannot find any known coupled components");return ke(e,o)},o=(o,n,r)=>t(n,r).getOrThunk((()=>{const t=ke(n.others,r).getOrDie("No information found for coupled component: "+r),s=t(o),a=o.getSystem().build(s);return e[r]=a,a})),n=(e,o,n)=>t(o,n).orThunk((()=>(ke(o.others,n).getOrDie("No information found for coupled component: "+n),R.none()))),r=S({});return Ml({readState:r,getExisting:n,getOrCreate:o})};var OD=Object.freeze({__proto__:null,init:_D});const TD=Lm({fields:kD,name:"coupling",apis:SD,state:OD}),ED=e=>{let t=R.none(),o=[];const n=e=>ED((t=>{r((o=>{t(e(o))}))})),r=e=>{a()?l(e):o.push(e)},s=e=>{a()||(t=R.some(e),i(o),o=[])},a=()=>t.isSome(),i=e=>{j(e,l)},l=e=>{t.each((t=>{setTimeout((()=>{e(t)}),0)}))};return e(s),{get:r,map:n,isReady:a}},DD=e=>ED((t=>{t(e)})),AD={nu:ED,pure:DD},MD=e=>{setTimeout((()=>{throw e}),0)},ND=e=>{const t=t=>{e().then(t,MD)},o=t=>ND((()=>e().then(t))),n=t=>ND((()=>e().then((e=>t(e).toPromise())))),r=t=>ND((()=>e().then((()=>t.toPromise())))),s=()=>AD.nu(t),a=()=>{let t=null;return ND((()=>(null===t&&(t=e()),t)))},i=e;return{map:o,bind:n,anonBind:r,toLazy:s,toCached:a,toPromise:i,get:t}},RD=e=>ND((()=>new Promise(e))),BD=e=>ND((()=>Promise.resolve(e))),LD={nu:RD,pure:BD},HD=S("sink"),ID=S(Yf({name:HD(),overrides:S({dom:{tag:"div"},behaviours:Rm([Gh.config({useFixed:M})]),events:Ri([ji(ja()),ji(Ia()),ji(Ga())])})})),PD=(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})))},zD=(e,t,o)=>{const n=e.fetch;return n(o).map(t)},FD=(e,t,o,n,r,s,a)=>{const i=zD(e,t,n),l=$D(n,e);return i.map((e=>e.bind((e=>R.from(TC.sketch({...s.menu(),uid:bl(""),data:e,highlightOnOpen:a,onOpenMenu:(e,t)=>{const n=l().getOrDie();Gh.position(n,t,{anchor:o}),Np.decloak(r)},onOpenSubmenu:(e,t,o)=>{const n=l().getOrDie();Gh.position(n,o,{anchor:{type:"submenu",item:t}}),Np.decloak(r)},onRepositionMenu:(e,t,n)=>{const r=l().getOrDie();Gh.position(r,t,{anchor:o}),j(n,(e=>{Gh.position(r,e.triggeredMenu,{anchor:{type:"submenu",item:e.triggeringItem}})}))},onEscape:()=>(fx.focus(n),Np.close(r),R.some(!0))}))))))},VD=(e,t,o,n,r,s,a)=>{const i=PD(e,o),l=FD(e,t,i,o,n,r,a);return l.map((e=>(e.fold((()=>{Np.isOpen(n)&&Np.close(n)}),(e=>{Np.cloak(n),Np.open(n,e),s(n)})),n)))},ZD=(e,t,o,n,r,s,a)=>(Np.close(n),LD.pure(n)),UD=(e,t,o,n,r,s)=>{const a=TD.getCoupled(o,"sandbox"),i=Np.isOpen(a),l=i?ZD:VD;return l(e,t,o,a,n,r,s)},jD=(e,t,o)=>{const n=Rb.getCurrent(t).getOr(t),r=Ro(e.element);o?co(n.element,"min-width",r+"px"):No(n.element,r)},$D=(e,t)=>e.getSystem().getByUid(t.uid+"-"+HD()).map((e=>()=>ir.value(e))).getOrThunk((()=>t.lazySink.fold((()=>()=>ir.error(new Error("No internal sink is specified, nor could an external sink be found"))),(t=>()=>t(e))))),WD=e=>{Np.getState(e).each((e=>{TC.repositionMenus(e)}))},qD=(e,t,o)=>{const n=id(),r=(r,s)=>{const a=PD(e,t);n.link(t.element),e.matchWidth&&jD(a.hotspot,s,e.useMinWidth),e.onOpen(a,r,s),void 0!==o&&void 0!==o.onOpen&&o.onOpen(r,s)},s=(e,r)=>{n.unlink(t.element),void 0!==o&&void 0!==o.onClose&&o.onClose(e,r)},a=$D(t,e);return{dom:{tag:"div",classes:e.sandboxClasses,attributes:{id:n.id,role:"listbox"}},behaviours:yf.augment(e.sandboxBehaviours,[pf.config({store:{mode:"memory",initialValue:t}}),Np.config({onOpen:r,onClose:s,isPartOf:(e,o,n)=>cd(o,n)||cd(t,n),getAttachPoint:()=>a().getOrDie()}),Rb.config({find:e=>Np.getState(e).bind((e=>Rb.getCurrent(e)))}),zm.config({channels:{...Ip({isExtraPart:A}),...zp({doReposition:WD})}})])}},GD=e=>{const t=TD.getCoupled(e,"sandbox");WD(t)},KD=()=>[Qs("sandboxClasses",[]),yf.field("sandboxBehaviours",[Rb,zm,Np,pf])],YD=S([Rs("dom"),Rs("fetch"),Ed("onOpen"),Dd("onExecute"),Qs("getHotspot",R.some),Qs("getAnchorOverrides",S({})),ng(),ff("dropdownBehaviours",[Lx,TD,$w,fx]),Rs("toggleClass"),Qs("eventOrder",{}),js("lazySink"),Qs("matchWidth",!1),Qs("useMinWidth",!1),js("role")].concat(KD())),XD=S([Kf({schema:[_d(),Qs("fakeFocus",!1)],name:"menu",defaults:e=>({onExecute:e.onExecute})}),ID()]),JD=(e,t,o,n)=>{const r=t=>ke(e.dom,"attributes").bind((e=>ke(e,t))),s=e=>{Np.getState(e).each((e=>{TC.highlightPrimary(e)}))},a=(t,o,r)=>UD(e,k,t,n,o,r),i=e=>{const t=s;a(e,t,xC.HighlightMenuAndItem).get(y)},l={expand:e=>{Lx.isOn(e)||a(e,y,xC.HighlightNone).get(y)},open:e=>{Lx.isOn(e)||a(e,y,xC.HighlightMenuAndItem).get(y)},refetch:t=>{const o=TD.getExistingCoupled(t,"sandbox");return o.fold((()=>a(t,y,xC.HighlightMenuAndItem).map(y)),(o=>VD(e,k,t,o,n,y,xC.HighlightMenuAndItem).map(y)))},isOpen:Lx.isOn,close:e=>{Lx.isOn(e)&&a(e,y,xC.HighlightMenuAndItem).get(y)},repositionMenus:e=>{Lx.isOn(e)&&GD(e)}},c=(e,t)=>(Ei(e),R.some(!0));return{uid:e.uid,dom:e.dom,components:t,behaviours:vf(e.dropdownBehaviours,[Lx.config({toggleClass:e.toggleClass,aria:{mode:"expanded"}}),TD.config({others:{sandbox:t=>qD(e,t,{onOpen:()=>Lx.on(t),onClose:()=>Lx.off(t)})}}),$w.config({mode:"special",onSpace:c,onEnter:c,onDown:(e,t)=>{if(QD.isOpen(e)){const t=TD.getCoupled(e,"sandbox");s(t)}else QD.open(e);return R.some(!0)},onEscape:(e,t)=>QD.isOpen(e)?(QD.close(e),R.some(!0)):R.none()}),fx.config({})]),events:Ix(R.some(i)),eventOrder:{...e.eventOrder,[si()]:["disabling","toggling","alloy.base.behaviour"]},apis:l,domModification:{attributes:{"aria-haspopup":"true",...e.role.fold((()=>({})),(e=>({role:e}))),..."button"===e.dom.tag?{type:r("type").getOr("button")}:{}}}}},QD=Eb({name:"Dropdown",configFields:YD(),partFields:XD(),factory:JD,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)}}),eA=e=>{switch(e.searchMode){case"no-search":return{menuType:"normal"};default:return{menuType:"searchable",searchMode:e}}},tA=e=>{const t=pf.getValue(e),o=$k(e).map(Gk);QD.refetch(t).get((()=>{const e=TD.getCoupled(t,"sandbox");o.each((t=>$k(e).each((e=>qk(e,t)))))}))},oA=(e,t)=>{nA(e).each((o=>{Mi(e,o.element,t.event.eventType,t.event.interactionEvent)}))},nA=e=>Np.getState(e).bind(vv.getHighlighted).bind(vv.getHighlighted),rA=e=>hc(e.element,Xk)?R.some(e.element):nd(e.element,"."+Xk),sA=(e,t,o)=>{Wk(e).each((e=>{Kk(e,o);const n=rA(t);n.each((t=>{no(t,"id").each((t=>eo(e.element,"aria-controls",t)))}))})),eo(o.element,"aria-selected","true")},aA=(e,t,o)=>{eo(o.element,"aria-selected","false")},iA=e=>{Wk(e).each((e=>fx.focus(e)))},lA=e=>{const t=TD.getExistingCoupled(e,"sandbox");return t.bind($k).map(Gk).map((e=>e.fetchPattern)).getOr("")};var cA;(function(e){e[e["ContentFocus"]=0]="ContentFocus",e[e["UiFocus"]=1]="UiFocus"})(cA||(cA={}));const dA=(e,t,o,n,r)=>{const s=o.shared.providers,a=e=>r?{...e,shortcut:R.none(),icon:e.text.isSome()?R.none():e.icon}:e;switch(e.type){case"menuitem":return _O(e).fold(c_,(e=>R.some(fD(a(e),t,s,n))));case"nestedmenuitem":return TO(e).fold(c_,(e=>R.some(bD(a(e),t,s,n,r))));case"togglemenuitem":return DO(e).fold(c_,(e=>R.some(vD(a(e),t,s,n))));case"separator":return Z_(e).fold(c_,(e=>R.some(pD(e))));case"fancymenuitem":return SO(e).fold(c_,(e=>yD(e,o)));default:return console.error("Unknown item in general menu",e),R.none()}},mA=(e,t,o,n,r,s,a)=>{const i=1===n,l=!i||l_(e);return De(U(e,(e=>{switch(e.type){case"separator":return j_(e).fold(c_,(e=>R.some(pD(e))));case"cardmenuitem":return fO(e).fold(c_,(e=>R.some(wD({...e,onAction:t=>{e.onAction(t),o(e.value,e.meta)}},r,s,{itemBehaviours:OT(e.meta,s),cardText:{matchText:t,highlightOn:a}}))));case"autocompleteitem":default:return $_(e).fold(c_,(e=>R.some(hD(e,t,i,"normal",o,r,s,l))))}})))},uA=(e,t,o,n,r,s)=>{const a=l_(t),i=De(U(t,(e=>{const t=e=>r?!_e(e,"text"):a,s=e=>dA(e,o,n,t(e),r);return"nestedmenuitem"===e.type&&e.getSubmenuItems().length<=0?s({...e,enabled:!1}):s(e)}))),l=eA(s),c=r?d_:m_;return c(e,a,i,1,l)},gA=e=>TC.singleData(e.value,e),hA=(e,t,o,n)=>{const r=YE(t,n),s=Nk(n);return{data:gA({...e,movement:r,menuBehaviours:RO.unnamedEvents("auto"!==t?[]:[qi(((e,t)=>{AO(e,4,s.item).each((({numColumns:t,numRows:o})=>{$w.setGridSize(e,o,t)}))}))])}),menu:{markers:Nk(n),fakeFocus:o===cA.ContentFocus}}},pA=(e,t)=>nk(Qe.fromDom(t.startContainer)).map((t=>{const o=e.createRng();return o.selectNode(t.dom),o})),fA=(e,t)=>{const o=ca(!1),n=ca(!1),r=qc(AC.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:Rm([ix("dismissAutocompleter",[Ii(vi(),(()=>c()))])]),lazySink:t.getSink})),s=()=>AC.isOpen(r),a=n.get,i=()=>{s()&&AC.hide(r)},l=()=>AC.getContent(r).bind((e=>ie(e.components(),0))),c=()=>e.execCommand("mceAutocompleterClose"),d=n=>{const r=me(n,(e=>R.from(e.columns))).getOr(1);return ee(n,(n=>{const s=n.items;return mA(s,n.matchText,((t,r)=>{const s=e.selection.getRng();pA(e.dom,s).each((s=>{const a={hide:()=>c(),reload:t=>{i(),e.execCommand("mceAutocompleterReload",!1,{fetchOptions:t})}};o.set(!0),n.onAction(a,s,t,r),o.set(!1)}))}),r,lk.BUBBLE_TO_SANDBOX,t,n.highlightOn)}))},m=(t,o)=>{rk(Qe.fromDom(e.getBody())).each((n=>{const s=me(t,(e=>R.from(e.columns))).getOr(1);AC.showMenuAt(r,{anchor:{type:"node",root:Qe.fromDom(e.getBody()),node:R.from(n)}},hA(m_("autocompleter-value",!0,o,s,{menuType:"normal"}),s,cA.ContentFocus,"normal"))})),l().each(vv.highlightFirst)},u=e=>{const t=d(e);t.length>0?m(e,t):i()};e.on("AutocompleterStart",(({lookupData:e})=>{n.set(!0),o.set(!1),u(e)})),e.on("AutocompleterUpdate",(({lookupData:e})=>u(e))),e.on("AutocompleterEnd",(()=>{i(),n.set(!1),o.set(!1)}));const g={cancelIfNecessary:c,isMenuOpen:s,isActive:a,isProcessingAction:o.get,getMenu:l};ak.setup(g,e)},bA={register:fA},vA=(e,t,o)=>rd(e,t,o).isSome(),yA=(e,t)=>{let o=null;const n=(...n)=>{o=setTimeout((()=>{e.apply(null,n),o=null}),t)},r=()=>{null!==o&&(clearTimeout(o),o=null)};return{cancel:r,schedule:n}},wA=5,xA=400,CA=e=>{const t=e.raw;return void 0===t.touches||1!==t.touches.length?R.none():R.some(t.touches[0])},SA=(e,t)=>{const o=Math.abs(e.clientX-t.x),n=Math.abs(e.clientY-t.y);return o>wA||n>wA},kA=e=>{const t=xu(),o=ca(!1),n=yA((t=>{e.triggerEvent(li(),t),o.set(!0)}),xA),r=e=>(CA(e).each((r=>{n.cancel();const s={x:r.clientX,y:r.clientY,target:e.target};n.schedule(e),o.set(!1),t.set(s)})),R.none()),s=e=>(n.cancel(),CA(e).each((e=>{t.on((o=>{SA(e,o)&&t.clear()}))})),R.none()),a=r=>{n.cancel();const s=e=>_t(e.target,r.target);return t.get().filter(s).map((t=>o.get()?(r.prevent(),!1):e.triggerEvent(ii(),r)))},i=va([{key:Ra(),value:r},{key:Ba(),value:s},{key:La(),value:a}]),l=(e,t)=>ke(i,t).bind((t=>t(e)));return{fireIfReady:l}},_A=e=>{const t=e.raw;return t.which===yv[0]&&!z(["input","textarea"],ut(e.target))&&!vA(e.target,'[contenteditable="true"]')},OA=(e,t)=>{const o={stopBackspace:!0,...t},n=["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"],r=kA(o),s=U(n.concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(t=>Su(e,t,(e=>{r.fireIfReady(e,t).each((t=>{t&&e.kill()}));const n=o.triggerEvent(t,e);n&&e.kill()})))),a=xu(),i=Su(e,"paste",(e=>{r.fireIfReady(e,"paste").each((t=>{t&&e.kill()}));const t=o.triggerEvent("paste",e);t&&e.kill(),a.set(setTimeout((()=>{o.triggerEvent(ni(),e)}),0))})),l=Su(e,"keydown",(e=>{const t=o.triggerEvent("keydown",e);t?e.kill():o.stopBackspace&&_A(e)&&e.prevent()})),c=Su(e,"focusin",(e=>{const t=o.triggerEvent("focusin",e);t&&e.kill()})),d=xu(),m=Su(e,"focusout",(e=>{const t=o.triggerEvent("focusout",e);t&&e.kill(),d.set(setTimeout((()=>{o.triggerEvent(oi(),e)}),0))})),u=()=>{j(s,(e=>{e.unbind()})),l.unbind(),c.unbind(),m.unbind(),i.unbind(),a.on(clearTimeout),d.on(clearTimeout)};return{unbind:u}},TA=(e,t)=>{const o=ke(e,"target").getOr(t);return ca(o)},EA=(e,t)=>{const o=ca(!1),n=ca(!1),r=()=>{o.set(!0)},s=()=>{n.set(!0)};return{stop:r,cut:s,isStopped:o.get,isCut:n.get,event:e,setSource:t.set,getSource:t.get}},DA=e=>{const t=ca(!1),o=()=>{t.set(!0)};return{stop:o,cut:y,isStopped:t.get,isCut:A,event:e,setSource:E("Cannot set source of a broadcasted event"),getSource:E("Cannot get source of a broadcasted event")}},AA=ma.generate([{stopped:[]},{resume:["element"]},{complete:[]}]),MA=(e,t,o,n,r,s)=>{const a=e(t,n),i=EA(o,r);return a.fold((()=>(s.logEventNoHandlers(t,n),AA.complete())),(e=>{const o=e.descHandler,n=Ul(o);return n(i),i.isStopped()?(s.logEventStopped(t,e.element,o.purpose),AA.stopped()):i.isCut()?(s.logEventCut(t,e.element,o.purpose),AA.complete()):Mt(e.element).fold((()=>(s.logNoParent(t,e.element,o.purpose),AA.complete())),(n=>(s.logEventResponse(t,e.element,o.purpose),AA.resume(n))))}))},NA=(e,t,o,n,r,s)=>MA(e,t,o,n,r,s).fold(M,(n=>NA(e,t,o,n,r,s)),A),RA=(e,t,o,n,r)=>{const s=TA(o,n);return MA(e,t,o,n,s,r)},BA=(e,t,o)=>{const n=DA(t);return j(e,(e=>{const t=e.descHandler,o=Ul(t);o(n)})),n.isStopped()},LA=(e,t,o,n)=>HA(e,t,o,o.target,n),HA=(e,t,o,n,r)=>{const s=TA(o,n);return NA(e,t,o,n,s,r)},IA=(e,t)=>({element:e,descHandler:t}),PA=(e,t)=>({id:e,descHandler:t}),zA=()=>{const e={},t=(t,o,n)=>{he(n,((n,r)=>{const s=void 0!==e[r]?e[r]:{};s[o]=Zl(n,t),e[r]=s}))},o=(e,t)=>fl(t).bind((t=>ke(e,t))).map((e=>IA(t,e))),n=t=>ke(e,t).map((e=>xe(e,((e,t)=>PA(t,e))))).getOr([]),r=(t,n,r)=>ke(e,n).bind((e=>ka(r,(t=>o(e,t)),t))),s=t=>{he(e,((e,o)=>{_e(e,t)&&delete e[t]}))};return{registerId:t,unregisterId:s,filterByType:n,find:r}},FA=()=>{const e=zA(),t={},o=e=>{const t=e.element;return fl(t).getOrThunk((()=>hl("uid-",e.element)))},n=(e,o)=>{const n=t[o];if(n!==e)throw new Error('The tagId "'+o+'" is already used by: '+rl(n.element)+"\nCannot use it for: "+rl(e.element)+"\nThe conflicting element is"+(Yt(n.element)?" ":" not ")+"already in the DOM");s(e)},r=r=>{const s=o(r);Oe(t,s)&&n(r,s);const a=[r];e.registerId(a,s,r.events),t[s]=r},s=o=>{fl(o.element).each((o=>{delete t[o],e.unregisterId(o)}))},a=t=>e.filterByType(t),i=(t,o,n)=>e.find(t,o,n),l=e=>ke(t,e);return{find:i,filter:a,register:r,unregister:s,getById:l}},VA=e=>{const{attributes:t,...o}=e.dom;return{uid:e.uid,dom:{tag:"div",attributes:{role:"presentation",...t},...o},components:e.components,behaviours:bf(e.containerBehaviours),events:e.events,domModification:e.domModification,eventOrder:e.eventOrder}},ZA=Tb({name:"Container",factory:VA,configFields:[Qs("components",[]),ff("containerBehaviours",[]),Qs("events",{}),Qs("domModification",{}),Qs("eventOrder",{})]}),UA=e=>{const t=t=>Mt(e.element).fold(M,(e=>_t(t,e))),o=FA(),n=(e,n)=>o.find(t,e,n),r=OA(e.element,{triggerEvent:(e,t)=>vd(e,t.target,(o=>LA(n,e,t,o)))}),s={debugInfo:S("real"),triggerEvent:(e,t,o)=>{vd(e,t,(r=>HA(n,e,o,t,r)))},triggerFocus:(e,t)=>{fl(e).fold((()=>{Zm(e)}),(o=>{vd(ti(),e,(o=>(RA(n,ti(),{originator:t,kill:y,prevent:y,target:e},e,o),!1)))}))},triggerEscape:(e,t)=>{s.triggerEvent("keydown",e.element,t.event)},getByUid:e=>p(e),getByDom:e=>f(e),build:qc,buildOrPatch:Wc,addToGui:e=>{l(e)},removeFromGui:e=>{c(e)},addToWorld:e=>{a(e)},removeFromWorld:e=>{i(e)},broadcast:e=>{u(e)},broadcastOn:(e,t)=>{g(e,t)},broadcastEvent:(e,t)=>{h(e,t)},isConnected:M},a=e=>{e.connect(s),bt(e.element)||(o.register(e),j(e.components(),a),s.triggerEvent(mi(),e.element,{target:e.element}))},i=e=>{bt(e.element)||(j(e.components(),i),o.unregister(e)),e.disconnect()},l=t=>{rp(e,t)},c=e=>{ip(e)},d=()=>{r.unbind(),zn(e.element)},m=e=>{const t=o.filter(ri());j(t,(t=>{const o=t.descHandler,n=Ul(o);n(e)}))},u=e=>{m({universal:!0,data:e})},g=(e,t)=>{m({universal:!1,channels:e,data:t})},h=(e,t)=>{const n=o.filter(e);return BA(n,t)},p=e=>o.getById(e).fold((()=>ir.error(new Error('Could not find component with uid: "'+e+'" in system.'))),ir.value),f=e=>{const t=fl(e).getOr("not found");return p(t)};return a(e),{root:e,element:e.element,destroy:d,add:l,remove:c,getByUid:p,getByDom:f,addToWorld:a,removeFromWorld:i,broadcast:u,broadcastOn:g,broadcastEvent:h}},jA=(e,t)=>({dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:U(e.items,t.interpreter)}),$A=S([Qs("prefix","form-field"),ff("fieldBehaviours",[Rb,pf])]),WA=S([Yf({schema:[Rs("dom")],name:"label"}),Yf({factory:{sketch:e=>({uid:e.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:e.text}})},schema:[Rs("text")],name:"aria-descriptor"}),Gf({factory:{sketch:e=>{const t=fa(e,["factory"]);return e.factory.sketch(t)}},schema:[Rs("factory")],name:"field"})]),qA=(e,t,o,n)=>{const r=vf(e.fieldBehaviours,[Rb.config({find:t=>cb(t,e,"field")}),pf.config({store:{mode:"manual",getValue:e=>Rb.getCurrent(e).bind(pf.getValue),setValue:(e,t)=>{Rb.getCurrent(e).each((e=>{pf.setValue(e,t)}))}}})]),s=Ri([qi(((t,o)=>{const n=mb(t,e,["label","field","aria-descriptor"]);n.field().each((t=>{const o=cl(e.prefix);n.label().each((e=>{eo(e.element,"for",o),eo(t.element,"id",o)})),n["aria-descriptor"]().each((o=>{const n=cl(e.prefix);eo(o.element,"id",n),eo(t.element,"aria-describedby",n)}))}))}))]),a={getField:t=>cb(t,e,"field"),getLabel:t=>cb(t,e,"label")};return{uid:e.uid,dom:e.dom,components:t,behaviours:r,events:s,apis:a}},GA=Eb({name:"FormField",configFields:$A(),partFields:WA(),factory:qA,apis:{getField:(e,t)=>e.getField(t),getLabel:(e,t)=>e.getLabel(t)}}),KA=(e,t)=>Hl({attributes:va([{key:t.tabAttr,value:"true"}])});var YA=Object.freeze({__proto__:null,exhibit:KA}),XA=[Qs("tabAttr","data-alloy-tabstop")];const JA=Lm({fields:XA,name:"tabstopping",active:YA});var QA=tinymce.util.Tools.resolve("tinymce.html.Entities");const eM=(e,t,o,n)=>{const r=oM(e,t,o,n);return GA.sketch(r)},tM=(e,t)=>eM(e,t,[],[]),oM=(e,t,o,n)=>({dom:rM(o),components:e.toArray().concat([t]),fieldBehaviours:Rm(n)}),nM=()=>rM([]),rM=e=>({tag:"div",classes:["tox-form__group"].concat(e)}),sM=(e,t)=>GA.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[Zc(t.translate(e))]}),aM=cl("form-component-change"),iM=cl("form-close"),lM=cl("form-cancel"),cM=cl("form-action"),dM=cl("form-submit"),mM=cl("form-block"),uM=cl("form-unblock"),gM=cl("form-tabchange"),hM=cl("form-resize"),pM=(e,t,o)=>{const n=e.label.map((e=>sM(e,t))),r=e=>(t,o)=>{rd(o.event.target,"[data-collection-item-value]").each((n=>{e(t,o,n,oo(n,"data-collection-item-value"))}))},s=(o,n)=>{const r=U(n,(o=>{const n=LC.translate(o.text),r=1===e.columns?`<div class="tox-collection__item-label">${n}</div>`:"",s=`<div class="tox-collection__item-icon">${o.icon}</div>`,a={_:" "," - ":" ","-":" "},i=n.replace(/\_| \- |\-/g,(e=>a[e])),l=t.isDisabled()?" tox-collection__item--state-disabled":"";return`<div class="tox-collection__item${l}" tabindex="-1" data-collection-item-value="${QA.encodeAllRaw(o.value)}" title="${i}" aria-label="${i}">${s}${r}</div>`})),s="auto"!==e.columns&&e.columns>1?Z(r,e.columns):[r],a=U(s,(e=>`<div class="tox-collection__group">${e.join("")}</div>`));Qi(o.element,a.join(""))},a=r(((o,n,r,s)=>{n.stop(),t.isDisabled()||Ti(o,cM,{name:e.name,value:s})})),i=[Ii(Va(),r(((e,t,o)=>{Zm(o)}))),Ii(Ga(),a),Ii(ii(),a),Ii(Za(),r(((e,t,o)=>{nd(e.element,"."+wk).each((e=>{gc(e,wk)})),mc(o,wk)}))),Ii(Ua(),r((e=>{nd(e.element,"."+wk).each((e=>{gc(e,wk)}))}))),Yi(r(((t,o,n,r)=>{Ti(t,cM,{name:e.name,value:r})})))],l=(e,t)=>U(oh(e.element,".tox-collection__item"),t),c=GA.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==e.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:k},behaviours:Rm([Jb.config({disabled:t.isDisabled,onDisabled:e=>{l(e,(e=>{mc(e,"tox-collection__item--state-disabled"),eo(e,"aria-disabled",!0)}))},onEnabled:e=>{l(e,(e=>{gc(e,"tox-collection__item--state-disabled"),so(e,"aria-disabled")}))}}),XO(),sx.config({}),pf.config({store:{mode:"memory",initialValue:o.getOr([])},onSetValue:(t,o)=>{s(t,o),"auto"===e.columns&&AO(t,5,"tox-collection__item").each((({numRows:e,numColumns:o})=>{$w.setGridSize(t,e,o)})),Oi(t,hM)}}),JA.config({}),$w.config(XE(e.columns,"normal")),ix("collection-events",i)]),eventOrder:{[si()]:["disabling","alloy.base.behaviour","collection-events"]}}),d=["tox-form__group--collection"];return eM(n,c,d,[])},fM=["input","textarea"],bM=e=>{const t=ut(e);return z(fM,t)},vM=(e,t)=>{const o=t.getRoot(e).getOr(e.element);gc(o,t.invalidClass),t.notify.each((t=>{bM(e.element)&&eo(e.element,"aria-invalid",!1),t.getContainer(e).each((e=>{Qi(e,t.validHtml)})),t.onValid(e)}))},yM=(e,t,o,n)=>{const r=t.getRoot(e).getOr(e.element);mc(r,t.invalidClass),t.notify.each((t=>{bM(e.element)&&eo(e.element,"aria-invalid",!0),t.getContainer(e).each((e=>{Qi(e,n)})),t.onInvalid(e,n)}))},wM=(e,t,o)=>t.validator.fold((()=>LD.pure(ir.value(!0))),(t=>t.validate(e))),xM=(e,t,o)=>(t.notify.each((t=>{t.onValidate(e)})),wM(e,t).map((n=>e.getSystem().isConnected()?n.fold((n=>(yM(e,t,o,n),ir.error(n))),(o=>(vM(e,t),ir.value(o)))):ir.error("No longer in system")))),CM=(e,t)=>{const o=t.getRoot(e).getOr(e.element);return hc(o,t.invalidClass)};var SM=Object.freeze({__proto__:null,markValid:vM,markInvalid:yM,query:wM,run:xM,isInvalid:CM});const kM=(e,t)=>e.validator.map((o=>Ri([Ii(o.onEvent,(o=>{xM(o,e,t).get(k)}))].concat(o.validateOnLoad?[qi((o=>{xM(o,e,t).get(y)}))]:[])))).getOr({});var _M=Object.freeze({__proto__:null,events:kM}),OM=[Rs("invalidClass"),Qs("getRoot",R.none),Xs("notify",[Qs("aria","alert"),Qs("getContainer",R.none),Qs("validHtml",""),Ed("onValid"),Ed("onInvalid"),Ed("onValidate")]),Xs("validator",[Rs("validate"),Qs("onEvent","input"),Qs("validateOnLoad",!0)])];const TM=Lm({fields:OM,name:"invalidating",active:_M,apis:SM,extra:{validation:e=>t=>{const o=pf.getValue(t);return LD.pure(e(o))}}}),EM=()=>Hl({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}}),DM=()=>Ri([Bi(Ja(),M)]);var AM=Object.freeze({__proto__:null,events:DM,exhibit:EM});const MM=Lm({fields:[],name:"unselecting",active:AM}),NM=(e,t)=>QD.sketch({dom:e.dom,components:e.components,toggleClass:"mce-active",dropdownBehaviours:Rm([oT.button(t.providers.isDisabled),XO(),MM.config({}),JA.config({})]),layouts:e.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:t.getSink,fetch:o=>LD.nu((t=>e.fetch(t))).map((n=>R.from(gA(Or(GE(cl("menu-value"),n,(t=>{e.onItemAction(o,t)}),e.columns,e.presets,lk.CLOSE_ON_EXECUTE,A,t.providers),{movement:YE(e.columns,e.presets)}))))),parts:{menu:Lk(!1,1,e.presets)}}),RM=cl("color-input-change"),BM=cl("color-swatch-change"),LM=cl("color-picker-cancel"),HM=(e,t,o,n)=>{const r=GA.parts.field({factory:Vk,inputClasses:["tox-textfield"],data:n,onSetValue:e=>TM.run(e).get(y),inputBehaviours:Rm([Jb.config({disabled:t.providers.isDisabled}),XO(),JA.config({}),TM.config({invalidClass:"tox-textbox-field-invalid",getRoot:e=>Nt(e.element),notify:{onValid:e=>{const t=pf.getValue(e);Ti(e,RM,{color:t})}},validator:{validateOnLoad:!1,validate:e=>{const t=pf.getValue(e);if(0===t.length)return LD.pure(ir.value(!0));{const e=Qe.fromTag("span");co(e,"background-color",t);const o=po(e,"background-color").fold((()=>ir.error("blah")),(e=>ir.value(t)));return LD.pure(o)}}}})]),selectOnFocus:!1}),s=e.label.map((e=>sM(e,t.providers))),a=(e,t)=>{Ti(e,BM,{value:t})},i=(t,n)=>{l.getOpt(t).each((t=>{"custom"===n?o.colorPicker((o=>{o.fold((()=>Oi(t,LM)),(o=>{a(t,o),bE(e.storageKey,o)}))}),"#ffffff"):a(t,"remove"===n?"":n)}))},l=BC(NM({dom:{tag:"span",attributes:{"aria-label":t.providers.translate("Color swatch")}},layouts:{onRtl:()=>[cm,lm,gm],onLtr:()=>[lm,cm,gm]},components:[],fetch:ZE(o.getColors(e.storageKey),e.storageKey,o.hasCustomColors()),columns:o.getColorCols(e.storageKey),presets:"color",onItemAction:i},t));return GA.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:s.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,l.asSpec()]}]),fieldBehaviours:Rm([ix("form-field-events",[Ii(RM,((t,o)=>{l.getOpt(t).each((e=>{co(e.element,"background-color",o.event.color)})),Ti(t,aM,{name:e.name})})),Ii(BM,((e,t)=>{GA.getField(e).each((o=>{pf.setValue(o,t.event.value),Rb.getCurrent(e).each(fx.focus)}))})),Ii(LM,((e,t)=>{GA.getField(e).each((t=>{Rb.getCurrent(e).each(fx.focus)}))}))])])})},IM=Yf({schema:[Rs("dom")],name:"label"}),PM=e=>Yf({name:e+"-edge",overrides:t=>{const o=t.model.manager.edgeActions[e];return o.fold((()=>({})),(e=>({events:Ri([Pi(Ra(),((t,o,n)=>e(t,n)),[t]),Pi(Ia(),((t,o,n)=>e(t,n)),[t]),Pi(Pa(),((t,o,n)=>{n.mouseIsDown.get()&&e(t,n)}),[t])])})))}}),zM=PM("top-left"),FM=PM("top"),VM=PM("top-right"),ZM=PM("right"),UM=PM("bottom-right"),jM=PM("bottom"),$M=PM("bottom-left"),WM=PM("left"),qM=Gf({name:"thumb",defaults:S({dom:{styles:{position:"absolute"}}}),overrides:e=>({events:Ri([Zi(Ra(),e,"spectrum"),Zi(Ba(),e,"spectrum"),Zi(La(),e,"spectrum"),Zi(Ia(),e,"spectrum"),Zi(Pa(),e,"spectrum"),Zi(Fa(),e,"spectrum")])})}),GM=Gf({schema:[Ms("mouseIsDown",(()=>ca(!1)))],name:"spectrum",overrides:e=>{const t=e.model,o=t.manager,n=(t,n)=>o.getValueFromEvent(n).map((n=>o.setValueFrom(t,e,n)));return{behaviours:Rm([$w.config({mode:"special",onLeft:t=>o.onLeft(t,e),onRight:t=>o.onRight(t,e),onUp:t=>o.onUp(t,e),onDown:t=>o.onDown(t,e)}),fx.config({})]),events:Ri([Ii(Ra(),n),Ii(Ba(),n),Ii(Ia(),n),Ii(Pa(),((t,o)=>{e.mouseIsDown.get()&&n(t,o)}))])}}});var KM=[IM,WM,ZM,FM,jM,zM,VM,$M,UM,qM,GM];const YM="slider.change.value",XM=S(YM),JM=e=>-1!==e.type.indexOf("touch"),QM=e=>{const t=e.event.raw;if(JM(t)){const e=t;return void 0!==e.touches&&1===e.touches.length?R.some(e.touches[0]).map((e=>Oo(e.clientX,e.clientY))):R.none()}{const e=t;return void 0!==e.clientX?R.some(e).map((e=>Oo(e.clientX,e.clientY))):R.none()}},eN="top",tN="right",oN="bottom",nN="left",rN=e=>e.model.minX,sN=e=>e.model.minY,aN=e=>e.model.minX-1,iN=e=>e.model.minY-1,lN=e=>e.model.maxX,cN=e=>e.model.maxY,dN=e=>e.model.maxX+1,mN=e=>e.model.maxY+1,uN=(e,t,o)=>t(e)-o(e),gN=e=>uN(e,lN,rN),hN=e=>uN(e,cN,sN),pN=e=>gN(e)/2,fN=e=>hN(e)/2,bN=e=>e.stepSize,vN=e=>e.snapToGrid,yN=e=>e.snapStart,wN=e=>e.rounded,xN=(e,t)=>void 0!==e[t+"-edge"],CN=e=>xN(e,nN),SN=e=>xN(e,tN),kN=e=>xN(e,eN),_N=e=>xN(e,oN),ON=e=>e.model.value.get(),TN=(e,t)=>({x:e,y:t}),EN=(e,t)=>{Ti(e,XM(),{value:t})},DN=(e,t)=>{EN(e,TN(aN(t),iN(t)))},AN=(e,t)=>{EN(e,iN(t))},MN=(e,t)=>{EN(e,TN(pN(t),iN(t)))},NN=(e,t)=>{EN(e,TN(dN(t),iN(t)))},RN=(e,t)=>{EN(e,dN(t))},BN=(e,t)=>{EN(e,TN(dN(t),fN(t)))},LN=(e,t)=>{EN(e,TN(dN(t),mN(t)))},HN=(e,t)=>{EN(e,mN(t))},IN=(e,t)=>{EN(e,TN(pN(t),mN(t)))},PN=(e,t)=>{EN(e,TN(aN(t),mN(t)))},zN=(e,t)=>{EN(e,aN(t))},FN=(e,t)=>{EN(e,TN(aN(t),fN(t)))},VN=(e,t,o,n)=>e<t?e:e>o?o:e===t?t-1:Math.max(t,e-n),ZN=(e,t,o,n)=>e>o?e:e<t?t:e===o?o+1:Math.min(o,e+n),UN=(e,t,o)=>Math.max(t,Math.min(o,e)),jN=(e,t,o,n,r)=>r.fold((()=>{const r=e-t,s=Math.round(r/n)*n;return UN(t+s,t-1,o+1)}),(t=>{const r=(e-t)%n,s=Math.round(r/n),a=Math.floor((e-t)/n),i=Math.floor((o-t)/n),l=Math.min(i,a+s),c=t+l*n;return Math.max(t,c)})),$N=(e,t,o)=>Math.min(o,Math.max(e,t))-t,WN=e=>{const{min:t,max:o,range:n,value:r,step:s,snap:a,snapStart:i,rounded:l,hasMinEdge:c,hasMaxEdge:d,minBound:m,maxBound:u,screenRange:g}=e,h=c?t-1:t,p=d?o+1:o;if(r<m)return h;if(r>u)return p;{const e=$N(r,m,u),c=UN(e/g*n+t,h,p);return a&&c>=t&&c<=o?jN(c,t,o,s,i):l?Math.round(c):c}},qN=e=>{const{min:t,max:o,range:n,value:r,hasMinEdge:s,hasMaxEdge:a,maxBound:i,maxOffset:l,centerMinEdge:c,centerMaxEdge:d}=e;return r<t?s?0:c:r>o?a?i:d:(r-t)/n*l},GN="top",KN="right",YN="bottom",XN="left",JN="width",QN="height",eR=e=>e.element.dom.getBoundingClientRect(),tR=(e,t)=>e[t],oR=e=>{const t=eR(e);return tR(t,XN)},nR=e=>{const t=eR(e);return tR(t,KN)},rR=e=>{const t=eR(e);return tR(t,GN)},sR=e=>{const t=eR(e);return tR(t,YN)},aR=e=>{const t=eR(e);return tR(t,JN)},iR=e=>{const t=eR(e);return tR(t,QN)},lR=(e,t,o)=>(e+t)/2-o,cR=(e,t)=>{const o=eR(e),n=eR(t),r=tR(o,XN),s=tR(o,KN),a=tR(n,XN);return lR(r,s,a)},dR=(e,t)=>{const o=eR(e),n=eR(t),r=tR(o,GN),s=tR(o,YN),a=tR(n,GN);return lR(r,s,a)},mR=(e,t)=>{Ti(e,XM(),{value:t})},uR=(e,t,o)=>{const n={min:rN(t),max:lN(t),range:gN(t),value:o,step:bN(t),snap:vN(t),snapStart:yN(t),rounded:wN(t),hasMinEdge:CN(t),hasMaxEdge:SN(t),minBound:oR(e),maxBound:nR(e),screenRange:aR(e)};return WN(n)},gR=(e,t,o)=>{const n=uR(e,t,o),r=n;return mR(e,r),n},hR=(e,t)=>{const o=rN(t);mR(e,o)},pR=(e,t)=>{const o=lN(t);mR(e,o)},fR=(e,t,o)=>{const n=e>0?ZN:VN,r=n(ON(o),rN(o),lN(o),bN(o));return mR(t,r),R.some(r)},bR=e=>(t,o)=>fR(e,t,o).map(M),vR=e=>{const t=QM(e);return t.map((e=>e.left))},yR=(e,t,o,n,r)=>{const s=0,a=aR(e),i=n.bind((t=>R.some(cR(t,e)))).getOr(s),l=r.bind((t=>R.some(cR(t,e)))).getOr(a),c={min:rN(t),max:lN(t),range:gN(t),value:o,hasMinEdge:CN(t),hasMaxEdge:SN(t),minBound:oR(e),minOffset:s,maxBound:nR(e),maxOffset:a,centerMinEdge:i,centerMaxEdge:l};return qN(c)},wR=(e,t,o,n,r,s)=>{const a=yR(t,s,o,n,r);return oR(t)-oR(e)+a},xR=(e,t,o,n)=>{const r=ON(o),s=wR(e,n.getSpectrum(e),r,n.getLeftEdge(e),n.getRightEdge(e),o),a=Ro(t.element)/2;co(t.element,"left",s-a+"px")},CR=bR(-1),SR=bR(1),kR=R.none,_R=R.none,OR={"top-left":R.none(),top:R.none(),"top-right":R.none(),right:R.some(RN),"bottom-right":R.none(),bottom:R.none(),"bottom-left":R.none(),left:R.some(zN)};var TR=Object.freeze({__proto__:null,setValueFrom:gR,setToMin:hR,setToMax:pR,findValueOfOffset:uR,getValueFromEvent:vR,findPositionOfValue:wR,setPositionFromValue:xR,onLeft:CR,onRight:SR,onUp:kR,onDown:_R,edgeActions:OR});const ER=(e,t)=>{Ti(e,XM(),{value:t})},DR=(e,t,o)=>{const n={min:sN(t),max:cN(t),range:hN(t),value:o,step:bN(t),snap:vN(t),snapStart:yN(t),rounded:wN(t),hasMinEdge:kN(t),hasMaxEdge:_N(t),minBound:rR(e),maxBound:sR(e),screenRange:iR(e)};return WN(n)},AR=(e,t,o)=>{const n=DR(e,t,o),r=n;return ER(e,r),n},MR=(e,t)=>{const o=sN(t);ER(e,o)},NR=(e,t)=>{const o=cN(t);ER(e,o)},RR=(e,t,o)=>{const n=e>0?ZN:VN,r=n(ON(o),sN(o),cN(o),bN(o));return ER(t,r),R.some(r)},BR=e=>(t,o)=>RR(e,t,o).map(M),LR=e=>{const t=QM(e);return t.map((e=>e.top))},HR=(e,t,o,n,r)=>{const s=0,a=iR(e),i=n.bind((t=>R.some(dR(t,e)))).getOr(s),l=r.bind((t=>R.some(dR(t,e)))).getOr(a),c={min:sN(t),max:cN(t),range:hN(t),value:o,hasMinEdge:kN(t),hasMaxEdge:_N(t),minBound:rR(e),minOffset:s,maxBound:sR(e),maxOffset:a,centerMinEdge:i,centerMaxEdge:l};return qN(c)},IR=(e,t,o,n,r,s)=>{const a=HR(t,s,o,n,r);return rR(t)-rR(e)+a},PR=(e,t,o,n)=>{const r=ON(o),s=IR(e,n.getSpectrum(e),r,n.getTopEdge(e),n.getBottomEdge(e),o),a=Co(t.element)/2;co(t.element,"top",s-a+"px")},zR=R.none,FR=R.none,VR=BR(-1),ZR=BR(1),UR={"top-left":R.none(),top:R.some(AN),"top-right":R.none(),right:R.none(),"bottom-right":R.none(),bottom:R.some(HN),"bottom-left":R.none(),left:R.none()};var jR=Object.freeze({__proto__:null,setValueFrom:AR,setToMin:MR,setToMax:NR,findValueOfOffset:DR,getValueFromEvent:LR,findPositionOfValue:IR,setPositionFromValue:PR,onLeft:zR,onRight:FR,onUp:VR,onDown:ZR,edgeActions:UR});const $R=(e,t)=>{Ti(e,XM(),{value:t})},WR=(e,t)=>({x:e,y:t}),qR=(e,t,o)=>{const n=uR(e,t,o.left),r=DR(e,t,o.top),s=WR(n,r);return $R(e,s),s},GR=(e,t,o,n)=>{const r=e>0?ZN:VN,s=t?ON(n).x:r(ON(n).x,rN(n),lN(n),bN(n)),a=t?r(ON(n).y,sN(n),cN(n),bN(n)):ON(n).y;return $R(o,WR(s,a)),R.some(s)},KR=(e,t)=>(o,n)=>GR(e,t,o,n).map(M),YR=(e,t)=>{const o=rN(t),n=sN(t);$R(e,WR(o,n))},XR=(e,t)=>{const o=lN(t),n=cN(t);$R(e,WR(o,n))},JR=e=>QM(e),QR=(e,t,o,n)=>{const r=ON(o),s=wR(e,n.getSpectrum(e),r.x,n.getLeftEdge(e),n.getRightEdge(e),o),a=IR(e,n.getSpectrum(e),r.y,n.getTopEdge(e),n.getBottomEdge(e),o),i=Ro(t.element)/2,l=Co(t.element)/2;co(t.element,"left",s-i+"px"),co(t.element,"top",a-l+"px")},eB=KR(-1,!1),tB=KR(1,!1),oB=KR(-1,!0),nB=KR(1,!0),rB={"top-left":R.some(DN),top:R.some(MN),"top-right":R.some(NN),right:R.some(BN),"bottom-right":R.some(LN),bottom:R.some(IN),"bottom-left":R.some(PN),left:R.some(FN)};var sB=Object.freeze({__proto__:null,setValueFrom:qR,setToMin:YR,setToMax:XR,getValueFromEvent:JR,setPositionFromValue:QR,onLeft:eB,onRight:tB,onUp:oB,onDown:nB,edgeActions:rB});const aB=[Qs("stepSize",1),Qs("onChange",y),Qs("onChoose",y),Qs("onInit",y),Qs("onDragStart",y),Qs("onDragEnd",y),Qs("snapToGrid",!1),Qs("rounded",!0),js("snapStart"),Bs("model",Es("mode",{x:[Qs("minX",0),Qs("maxX",100),Ms("value",(e=>ca(e.mode.minX))),Rs("getInitialValue"),Nd("manager",TR)],y:[Qs("minY",0),Qs("maxY",100),Ms("value",(e=>ca(e.mode.minY))),Rs("getInitialValue"),Nd("manager",jR)],xy:[Qs("minX",0),Qs("maxX",100),Qs("minY",0),Qs("maxY",100),Ms("value",(e=>ca({x:e.mode.minX,y:e.mode.minY}))),Rs("getInitialValue"),Nd("manager",sB)]})),ff("sliderBehaviours",[$w,pf]),Ms("mouseIsDown",(()=>ca(!1)))],iB=(e,t,o,n)=>{const r=t=>db(t,e,"thumb"),s=t=>db(t,e,"spectrum"),a=t=>cb(t,e,"left-edge"),i=t=>cb(t,e,"right-edge"),l=t=>cb(t,e,"top-edge"),c=t=>cb(t,e,"bottom-edge"),d=e.model,m=d.manager,u=(t,o)=>{m.setPositionFromValue(t,o,e,{getLeftEdge:a,getRightEdge:i,getTopEdge:l,getBottomEdge:c,getSpectrum:s})},g=(e,t)=>{d.value.set(t);const o=r(e);u(e,o)},h=(t,o)=>{g(t,o);const n=r(t);return e.onChange(t,n,o),R.some(!0)},p=t=>{m.setToMin(t,e)},f=t=>{m.setToMax(t,e)},b=t=>{const o=()=>{cb(t,e,"thumb").each((o=>{const n=d.value.get();e.onChoose(t,o,n)}))},n=e.mouseIsDown.get();e.mouseIsDown.set(!1),n&&o()},v=(t,o)=>{o.stop(),e.mouseIsDown.set(!0),e.onDragStart(t,r(t))},y=(t,o)=>{o.stop(),e.onDragEnd(t,r(t)),b(t)};return{uid:e.uid,dom:e.dom,components:t,behaviours:vf(e.sliderBehaviours,[$w.config({mode:"special",focusIn:t=>cb(t,e,"spectrum").map($w.focusIn).map(M)}),pf.config({store:{mode:"manual",getValue:e=>d.value.get(),setValue:g}}),zm.config({channels:{[Lp()]:{onReceive:b}}})]),events:Ri([Ii(XM(),((e,t)=>{h(e,t.event.value)})),qi(((t,o)=>{const n=d.getInitialValue();d.value.set(n);const a=r(t);u(t,a);const i=s(t);e.onInit(t,a,i,d.value.get())})),Ii(Ra(),v),Ii(La(),y),Ii(Ia(),v),Ii(Fa(),y)]),apis:{resetToMin:p,resetToMax:f,setValue:g,refresh:u},domModification:{styles:{position:"relative"}}}},lB=Eb({name:"Slider",configFields:aB,partFields:KM,factory:iB,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)}}}),cB=cl("rgb-hex-update"),dB=cl("slider-update"),mB=cl("palette-update"),uB=(e,t)=>{const o=lB.parts.spectrum({dom:{tag:"div",classes:[t("hue-slider-spectrum")],attributes:{role:"presentation"}}}),n=lB.parts.thumb({dom:{tag:"div",classes:[t("hue-slider-thumb")],attributes:{role:"presentation"}}});return lB.sketch({dom:{tag:"div",classes:[t("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:S(0)},components:[o,n],sliderBehaviours:Rm([fx.config({})]),onChange:(e,t,o)=>{Ti(e,dB,{value:o})}})},gB="form",hB=[ff("formBehaviours",[pf])],pB=e=>"<alloy.field."+e+">",fB=e=>{const t=(()=>{const e=[],t=(t,o)=>(e.push(t),rb(gB,pB(t),o));return{field:t,record:S(e)}})(),o=e(t),n=t.record(),r=U(n,(e=>Gf({name:e,pname:pB(e)})));return xb(gB,hB,r,vB,o)},bB=(e,t)=>e.fold((()=>ir.error(t)),ir.value),vB=(e,t)=>({uid:e.uid,dom:e.dom,components:t,behaviours:vf(e.formBehaviours,[pf.config({store:{mode:"manual",getValue:t=>{const o=ub(t,e);return pe(o,((e,t)=>e().bind((e=>{const o=Rb.getCurrent(e);return bB(o,new Error(`Cannot find a current component to extract the value from for form part '${t}': `+rl(e.element)))})).map(pf.getValue)))},setValue:(t,o)=>{he(o,((o,n)=>{cb(t,e,n).each((e=>{Rb.getCurrent(e).each((e=>{pf.setValue(e,o)}))}))}))}}})]),apis:{getField:(t,o)=>cb(t,e,o).bind(Rb.getCurrent)}}),yB={getField:Dl(((e,t,o)=>e.getField(t,o))),sketch:fB},wB=cl("valid-input"),xB=cl("invalid-input"),CB=cl("validating-input"),SB="colorcustom.rgb.",kB=(e,t,o,n)=>{const r=(o,n)=>TM.config({invalidClass:t("invalid"),notify:{onValidate:e=>{Ti(e,CB,{type:o})},onValid:e=>{Ti(e,wB,{type:o,value:pf.getValue(e)})},onInvalid:e=>{Ti(e,xB,{type:o,value:pf.getValue(e)})}},validator:{validate:t=>{const o=pf.getValue(t),r=n(o)?ir.value(!0):ir.error(e("aria.input.invalid"));return LD.pure(r)},validateOnLoad:!1}}),s=(o,n,s,a,i)=>{const l=e(SB+"range"),c=GA.parts.label({dom:{tag:"label",attributes:{"aria-label":a}},components:[Zc(s)]}),d=GA.parts.field({data:i,factory:Vk,inputAttributes:{type:"text",..."hex"===n?{"aria-live":"polite"}:{}},inputClasses:[t("textfield")],inputBehaviours:Rm([r(n,o),JA.config({})]),onSetValue:e=>{if(TM.isInvalid(e)){const t=TM.run(e);t.get(y)}}}),m=[c,d],u="hex"!==n?[GA.parts["aria-descriptor"]({text:l})]:[],g=m.concat(u);return{dom:{tag:"div",attributes:{role:"presentation"}},components:g}},a=(e,t)=>{const o=UT(t);return yB.getField(e,"hex").each((t=>{fx.isFocused(t)||pf.setValue(e,{hex:o.value})})),o},i=(e,t)=>{const o=t.red,n=t.green,r=t.blue;pf.setValue(e,{red:o,green:n,blue:r})},l=BC({dom:{tag:"div",classes:[t("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),c=(e,t)=>{l.getOpt(e).each((e=>{co(e.element,"background-color","#"+t.value)}))},d=()=>{const r={red:ca(R.some(255)),green:ca(R.some(255)),blue:ca(R.some(255)),hex:ca(R.some("ffffff"))},d=(e,t)=>{const o=JT(t);i(e,o),h(o)},m=e=>r[e].get(),u=(e,t)=>{r[e].set(t)},g=()=>m("red").bind((e=>m("green").bind((t=>m("blue").map((o=>KT(e,t,o,1))))))),h=e=>{const t=e.red,o=e.green,n=e.blue;u("red",R.some(t)),u("green",R.some(o)),u("blue",R.some(n))},p=(e,t)=>{const o=t.event;"hex"!==o.type?u(o.type,R.none()):n(e)},f=(e,t)=>{o(e);const n=BT(t);u("hex",R.some(t));const r=JT(n);i(e,r),h(r),Ti(e,cB,{hex:n}),c(e,n)},b=(e,t,o)=>{const n=parseInt(o,10);u(t,R.some(n)),g().each((t=>{const o=a(e,t);Ti(e,cB,{hex:o}),c(e,o)}))},v=e=>"hex"===e.type,y=(e,t)=>{const o=t.event;v(o)?f(e,o.value):b(e,o.type,o.value)},w=t=>({label:e(SB+t+".label"),description:e(SB+t+".description")}),x=w("red"),C=w("green"),S=w("blue"),k=w("hex");return Or(yB.sketch((o=>({dom:{tag:"form",classes:[t("rgb-form")],attributes:{"aria-label":e("aria.color.picker")}},components:[o.field("red",GA.sketch(s(YT,"red",x.label,x.description,255))),o.field("green",GA.sketch(s(YT,"green",C.label,C.description,255))),o.field("blue",GA.sketch(s(YT,"blue",S.label,S.description,255))),o.field("hex",GA.sketch(s(IT,"hex",k.label,k.description,"ffffff"))),l.asSpec()],formBehaviours:Rm([TM.config({invalidClass:t("form-invalid")}),ix("rgb-form-events",[Ii(wB,y),Ii(xB,p),Ii(CB,p)])])}))),{apis:{updateHex:(e,t)=>{pf.setValue(e,{hex:t.value}),d(e,t),c(e,t)}}})},m=Tb({factory:d,name:"RgbForm",configFields:[],apis:{updateHex:(e,t,o)=>{e.updateHex(t,o)}},extraApis:{}});return m},_B=(e,t)=>{const o=lB.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[t("sv-palette-spectrum")]}}),n=lB.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 s=r.createLinearGradient(0,0,o,0);s.addColorStop(0,"rgba(255,255,255,1)"),s.addColorStop(1,"rgba(255,255,255,0)"),r.fillStyle=s,r.fillRect(0,0,o,n);const a=r.createLinearGradient(0,0,0,n);a.addColorStop(0,"rgba(0,0,0,0)"),a.addColorStop(1,"rgba(0,0,0,1)"),r.fillStyle=a,r.fillRect(0,0,o,n)},s=(e,t)=>{const o=e.components()[0].element.dom,n=vE(t,100,100),s=XT(n);r(o,tE(s))},a=(e,t)=>{const o=yE(JT(t));lB.setValue(e,{x:o.saturation,y:100-o.value})},i=e=>{const s=S({x:0,y:0}),a=(e,t,o)=>{Ti(e,mB,{value:o})},i=(e,t,o,n)=>{r(o.element.dom,tE(oE))},l=Rm([Rb.config({find:R.some}),fx.config({})]);return lB.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[t("sv-palette")]},model:{mode:"xy",getInitialValue:s},rounded:!1,components:[o,n],onChange:a,onInit:i,sliderBehaviours:l})},l=Tb({factory:i,name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:(e,t,o)=>{s(t,o)},setThumb:(e,t,o)=>{a(t,o)}},extraApis:{}});return l},OB=(e,t)=>{const o=o=>{const n=kB(e,t,o.onValidHex,o.onInvalidHex),r=_B(e,t),s=e=>(100-e)/100*360,a=e=>100-e/360*100,i={paletteRgba:ca(oE),paletteHue:ca(0)},l=BC(uB(e,t)),c=BC(r.sketch({})),d=BC(n.sketch({})),m=(e,t,o)=>{c.getOpt(e).each((e=>{r.setHue(e,o)}))},u=(e,t)=>{d.getOpt(e).each((e=>{n.updateHex(e,t)}))},g=(e,t,o)=>{l.getOpt(e).each((e=>{lB.setValue(e,a(o))}))},h=(e,t)=>{c.getOpt(e).each((e=>{r.setThumb(e,t)}))},p=(e,t)=>{const o=JT(e);i.paletteRgba.set(o),i.paletteHue.set(t)},f=(e,t,o,n)=>{p(t,o),j(n,(n=>{n(e,t,o)}))},b=()=>{const e=[u];return(t,o)=>{const n=o.event.value,r=i.paletteHue.get(),s=vE(r,n.x,100-n.y),a=xE(s);f(t,a,r,e)}},v=()=>{const e=[m,u];return(t,o)=>{const n=s(o.event.value),r=i.paletteRgba.get(),a=yE(r),l=vE(n,a.saturation,a.value),c=xE(l);f(t,c,n,e)}},y=()=>{const e=[m,g,h];return(t,o)=>{const n=o.event.hex,r=wE(n);f(t,n,r.hue,e)}};return{uid:o.uid,dom:o.dom,components:[c.asSpec(),l.asSpec(),d.asSpec()],behaviours:Rm([ix("colour-picker-events",[Ii(cB,y()),Ii(mB,b()),Ii(dB,v())]),Rb.config({find:e=>d.getOpt(e)}),$w.config({mode:"acyclic"})])}},n=Tb({name:"ColourPicker",configFields:[Rs("dom"),Qs("onValidHex",y),Qs("onInvalidHex",y)],factory:o});return n},TB=()=>Rb.config({find:R.some}),EB=e=>Rb.config({find:e.getOpt}),DB=e=>Rb.config({find:t=>Ht(t.element,e).bind((e=>t.getSystem().getByDom(e).toOptional()))}),AB={self:TB,memento:EB,childAt:DB},MB=rs([Qs("preprocess",k),Qs("postprocess",k)]),NB=(e,t)=>{const o=Os("RepresentingConfigs.memento processors",MB,t);return pf.config({store:{mode:"manual",getValue:t=>{const n=e.get(t),r=pf.getValue(n);return o.postprocess(r)},setValue:(t,n)=>{const r=o.preprocess(n),s=e.get(t);pf.setValue(s,r)}}})},RB=(e,t,o)=>pf.config({store:{mode:"manual",...e.map((e=>({initialValue:e}))).getOr({}),getValue:t,setValue:o}}),BB=(e,t,o)=>RB(e,(e=>t(e.element)),((e,t)=>o(e.element,t))),LB=e=>BB(e,wc,xc),HB=e=>BB(e,Ji,Qi),IB=e=>pf.config({store:{mode:"memory",initialValue:e}}),PB={memento:NB,withElement:BB,withComp:RB,domValue:LB,domHtml:HB,memory:IB},zB={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},FB=e=>t=>e.translate(zB[t]),VB=(e,t,o)=>{const n=e=>"tox-"+e,r=OB(FB(t),n),s=e=>{Ti(e,cM,{name:"hex-valid",value:!0})},a=e=>{Ti(e,cM,{name:"hex-valid",value:!1})},i=BC(r.sketch({dom:{tag:"div",classes:[n("color-picker-container")],attributes:{role:"presentation"}},onValidHex:s,onInvalidHex:a}));return{dom:{tag:"div"},components:[i.asSpec()],behaviours:Rm([PB.withComp(o,(e=>{const t=i.get(e),o=Rb.getCurrent(t),n=o.bind((e=>{const t=pf.getValue(e);return t.hex}));return n.map((e=>"#"+e)).getOr("")}),((e,t)=>{const o=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/,n=R.from(o.exec(t)).bind((e=>ie(e,1))),r=i.get(e),s=Rb.getCurrent(r);s.fold((()=>{console.log("Can not find form")}),(e=>{pf.setValue(e,{hex:n.getOr("")}),yB.getField(e,"hex").each((e=>{Oi(e,Wa())}))}))})),AB.self()])}};var ZB=tinymce.util.Tools.resolve("tinymce.Resource");const UB=e=>_e(e,"init"),jB=e=>{const t=xu(),o=BC({dom:{tag:e.tag}}),n=xu();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:Rm([ix("custom-editor-events",[qi((r=>{o.getOpt(r).each((o=>{(UB(e)?e.init(o.element.dom):ZB.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)}))}))}))]),PB.withComp(R.none(),(()=>t.get().fold((()=>n.get().getOr("")),(e=>e.getValue()))),((e,o)=>{t.get().fold((()=>n.set(o)),(e=>e.setValue(o)))})),AB.self()]),components:[o.asSpec()]}};var $B=tinymce.util.Tools.resolve("tinymce.util.Tools");const WB=(e,t)=>{const o=$B.explode(t.getOption("images_file_types")),n=e=>F(o,(t=>Ze(e.name.toLowerCase(),`.${t.toLowerCase()}`)));return q(de(e),n)},qB=(e,t,o)=>{const n=(e,t)=>{t.stop()},r=e=>(t,o)=>{j(e,(e=>{e(t,o)}))},s=(e,t)=>{var o;if(!Jb.isDisabled(e)){const n=t.event.raw;i(e,null===(o=n.dataTransfer)||void 0===o?void 0:o.files)}},a=(e,t)=>{const o=t.event.raw.target;i(e,o.files)},i=(o,n)=>{n&&(pf.setValue(o,WB(n,t)),Ti(o,aM,{name:e.name}))},l=BC({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:Rm([ix("input-file-events",[ji(Ga()),ji(ii())])])}),c=e=>({uid:e.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:Rm([PB.memory(o.getOr([])),AB.self(),Jb.config({}),Lx.config({toggleClass:"dragenter",toggleOnExecute:!1}),ix("dropzone-events",[Ii("dragenter",r([n,Lx.toggle])),Ii("dragleave",r([n,Lx.toggle])),Ii("dragover",n),Ii("drop",r([n,s])),Ii(qa(),a)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p"},components:[Zc(t.translate("Drop an image here"))]},RC.sketch({dom:{tag:"button",styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[Zc(t.translate("Browse for an image")),l.asSpec()],action:e=>{const t=l.get(e);t.element.dom.click()},buttonBehaviours:Rm([JA.config({}),oT.button(t.isDisabled),XO()])})]}]}),d=e.label.map((e=>sM(e,t))),m=GA.parts.field({factory:{sketch:c}});return eM(d,m,["tox-form__group--stretched"],[])},GB=(e,t)=>({dom:{tag:"div",classes:["tox-form__grid",`tox-form__grid--${e.columns}col`]},components:U(e.items,t.interpreter)}),KB=cl("alloy-fake-before-tabstop"),YB=cl("alloy-fake-after-tabstop"),XB=e=>({dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:e},behaviours:Rm([fx.config({ignore:!0}),JA.config({})])}),JB=e=>({dom:{tag:"div",classes:["tox-navobj"]},components:[XB([KB]),e,XB([YB])],behaviours:Rm([AB.childAt(1)])}),QB=(e,t)=>{Ti(e,ja(),{raw:{which:9,shiftKey:t}})},eL=(e,t)=>{const o=t.element;hc(o,KB)?QB(e,!0):hc(o,YB)&&QB(e,!1)},tL=e=>vA(e,["."+KB,"."+YB].join(","),A),oL=e=>{const t=ca(e.getOr(""));return{getValue:e=>t.get(),setValue:(e,o)=>{t.get()!==o&&eo(e.element,"srcdoc",o),t.set(o)}}},nL=(e,t,o)=>{const n=e.sandboxed,r=e.transparent,s="tox-dialog__iframe",a={...e.label.map((e=>({title:e}))).getOr({}),...o.map((e=>({srcdoc:e}))).getOr({}),...n?{sandbox:"allow-scripts allow-same-origin"}:{}},i=oL(o),l=e.label.map((e=>sM(e,t))),c=e=>JB({uid:e.uid,dom:{tag:"iframe",attributes:a,classes:r?[s]:[s,`${s}--opaque`]},behaviours:Rm([JA.config({}),fx.config({}),PB.withComp(o,i.getValue,i.setValue)])}),d=GA.parts.field({factory:{sketch:c}});return eM(l,d,["tox-form__group--stretched"],[])},rL=e=>new Promise(((t,o)=>{const n=()=>{s(),t(e)},r=[Su(e,"load",n),Su(e,"error",(()=>{s(),o("Unable to load data from image: "+e.dom.src)}))],s=()=>j(r,(e=>e.unbind()));e.dom.complete&&n()})),sL=(e,t,o,n,r)=>{const s=o*r,a=n*r,i=Math.max(0,e/2-s/2),l=Math.max(0,t/2-a/2);return{left:i.toString()+"px",top:l.toString()+"px",width:s.toString()+"px",height:a.toString()+"px"}},aL=(e,t,o)=>{const n=Ro(e),r=Co(e);return Math.min(n/t,r/o,1)},iL=(e,t)=>{const o=ca(t.getOr({url:""})),n=BC({dom:{tag:"img",classes:["tox-imagepreview__image"],attributes:t.map((e=>({src:e.url}))).getOr({})}}),r=BC({dom:{tag:"div",classes:["tox-imagepreview__container"],attributes:{role:"presentation"}},components:[n.asSpec()]}),s=(e,t)=>{const s={url:t.url};t.zoom.each((e=>s.zoom=e)),t.cachedWidth.each((e=>s.cachedWidth=e)),t.cachedHeight.each((e=>s.cachedHeight=e)),o.set(s);const a=()=>{const{cachedWidth:t,cachedHeight:o,zoom:n}=s;if(!g(t)&&!g(o)){if(g(n)){const n=aL(e.element,t,o);s.zoom=n}const a=sL(Ro(e.element),Co(e.element),t,o,s.zoom);r.getOpt(e).each((e=>{mo(e.element,a)}))}};n.getOpt(e).each((o=>{const n=o.element;t.url!==oo(n,"src")&&(eo(n,"src",t.url),gc(e.element,"tox-imagepreview__loaded")),a(),rL(n).then((t=>{e.getSystem().isConnected()&&(mc(e.element,"tox-imagepreview__loaded"),s.cachedWidth=t.dom.naturalWidth,s.cachedHeight=t.dom.naturalHeight,a())}))}))},a={};e.height.each((e=>a.height=e));const i=t.map((e=>({url:e.url,zoom:R.from(e.zoom),cachedWidth:R.from(e.cachedWidth),cachedHeight:R.from(e.cachedHeight)})));return{dom:{tag:"div",classes:["tox-imagepreview"],styles:a,attributes:{role:"presentation"}},components:[r.asSpec()],behaviours:Rm([AB.self(),PB.withComp(i,(()=>o.get()),s)])}},lL=(e,t)=>{const o={dom:{tag:"label",classes:["tox-label"]},components:[Zc(t.providers.translate(e.label))]},n=U(e.items,t.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[o,...n],behaviours:Rm([AB.self(),sx.config({}),PB.domHtml(R.none()),$w.config({mode:"acyclic"})])}},cL=cl("toolbar.button.execute"),dL=e=>Yi(((t,o)=>{nT(e,t)((o=>{Ti(t,cL,{buttonApi:o}),e.onAction(o)}))})),mL={[si()]:["disabling","alloy.base.behaviour","toggling","toolbar-button-events"]},uL=(e,t,o)=>WC(e,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:o},t),gL=(e,t)=>uL(e,t,[]),hL=(e,t)=>uL(e,t,[sx.config({})]),pL=(e,t,o)=>({dom:{tag:"span",classes:[`${t}__select-label`]},components:[Zc(o.translate(e))],behaviours:Rm([sx.config({})])}),fL=cl("update-menu-text"),bL=cl("update-menu-icon"),vL=(e,t,o)=>{const n=ca(y),r=e.text.map((e=>BC(pL(e,t,o.providers)))),s=e.icon.map((e=>BC(hL(e,o.providers.icons)))),a=(e,t)=>{const o=pf.getValue(e);return fx.focus(o),Ti(o,"keydown",{raw:t.event.raw}),QD.close(o),R.some(!0)},i=e.role.fold((()=>({})),(e=>({role:e}))),l=e.tooltip.fold((()=>({})),(e=>{const t=o.providers.translate(e);return{title:t,"aria-label":t}})),c=WC("chevron-down",{tag:"div",classes:[`${t}__select-chevron`]},o.providers.icons),d=BC(QD.sketch({...e.uid?{uid:e.uid}:{},...i,dom:{tag:"button",classes:[t,`${t}--select`].concat(U(e.classes,(e=>`${t}--${e}`))),attributes:{...l}},components:lT([s.map((e=>e.asSpec())),r.map((e=>e.asSpec())),R.some(c)]),matchWidth:!0,useMinWidth:!0,onOpen:(t,o,n)=>{e.searchable&&iA(n)},dropdownBehaviours:Rm([...e.dropdownBehaviours,oT.button((()=>e.disabled||o.providers.isDisabled())),XO(),MM.config({}),sx.config({}),ix("dropdown-events",[rT(e,n),sT(e,n)]),ix("menubutton-update-display-text",[Ii(fL,((e,t)=>{r.bind((t=>t.getOpt(e))).each((e=>{sx.set(e,[Zc(o.providers.translate(t.event.text))])}))})),Ii(bL,((e,t)=>{s.bind((t=>t.getOpt(e))).each((e=>{sx.set(e,[hL(t.event.icon,o.providers.icons)])}))}))])]),eventOrder:Or(mL,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:Rm([$w.config({mode:"special",onLeft:a,onRight:a}),ix("dropdown-sandbox-events",[Ii(Zk,((e,t)=>{tA(e),t.stop()})),Ii(Uk,((e,t)=>{oA(e,t),t.stop()}))])]),lazySink:o.getSink,toggleClass:`${t}--active`,parts:{menu:{...Lk(!1,e.columns,e.presets),fakeFocus:e.searchable,onHighlightItem:sA,onCollapseMenu:(e,t,o)=>{vv.getHighlighted(o).each((t=>{sA(e,o,t)}))},onDehighlightItem:aA}},fetch:t=>LD.nu(O(e.fetch,t))}));return d.asSpec()},yL=e=>i(e),wL=e=>"separator"===e.type,xL=e=>_e(e,"getSubmenuItems"),CL={type:"separator"},SL=(e,t)=>{const o=K(e,((e,o)=>yL(o)?""===o?e:"|"===o?e.length>0&&!wL(e[e.length-1])?e.concat([CL]):e:_e(t,o.toLowerCase())?e.concat([t[o.toLowerCase()]]):e:e.concat([o])),[]);return o.length>0&&wL(o[o.length-1])&&o.pop(),o},kL=(e,t)=>{const o=e.getSubmenuItems(),n=OL(o,t),r=Or(n.menus,{[e.value]:n.items}),s=Or(n.expansions,{[e.value]:e.value});return{item:e,menus:r,expansions:s}},_L=e=>{const t=ke(e,"value").getOrThunk((()=>cl("generated-menu-item")));return Or({value:t},e)},OL=(e,t)=>{const o=SL(i(e)?e.split(" "):e,t);return G(o,((e,o)=>{if(xL(o)){const n=_L(o),r=kL(n,t);return{menus:Or(e.menus,r.menus),items:[r.item,...e.items],expansions:Or(e.expansions,r.expansions)}}return{...e,items:[o,...e.items]}}),{menus:{},expansions:{},items:[]})},TL=e=>e.search.fold((()=>({searchMode:"no-search"})),(e=>({searchMode:"search-with-field",placeholder:e.placeholder}))),EL=e=>e.search.fold((()=>({searchMode:"no-search"})),(e=>({searchMode:"search-with-results"}))),DL=(e,t,o,n)=>{const r=cl("primary-menu"),s=OL(e,o.shared.providers.menuItems());if(0===s.items.length)return R.none();const a=TL(n),i=uA(r,s.items,t,o,n.isHorizontalMenu,a),l=EL(n),c=pe(s.menus,((e,n)=>uA(n,e,t,o,!1,l))),d=Or(c,ba(r,i));return R.from(TC.tieredData(r,d,s.expansions))},AL=e=>!_e(e,"items"),ML="data-value",NL=(e,t,o,n)=>U(o,(o=>AL(o)?{type:"togglemenuitem",text:o.text,value:o.value,active:o.value===n,onAction:()=>{pf.setValue(e,o.value),Ti(e,aM,{name:t}),fx.focus(e)}}:{type:"nestedmenuitem",text:o.text,getSubmenuItems:()=>NL(e,t,o.items,n)})),RL=(e,t)=>me(e,(e=>AL(e)?Be(e.value===t,e):RL(e.items,t))),BL=(e,t,o)=>{const n=t.shared.providers,r=o.bind((t=>RL(e.items,t))).orThunk((()=>le(e.items).filter(AL))),s=e.label.map((e=>sM(e,n))),a=GA.parts.field({dom:{},factory:{sketch:o=>vL({uid:o.uid,text:r.map((e=>e.text)),icon:R.none(),tooltip:e.label,role:R.none(),fetch:(o,n)=>{const r=NL(o,e.name,e.items,pf.getValue(o));n(DL(r,lk.CLOSE_ON_EXECUTE,t,{isHorizontalMenu:!1,search:R.none()}))},onSetup:S(y),getApi:S({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[JA.config({}),PB.withComp(r.map((e=>e.value)),(e=>oo(e.element,ML)),((t,o)=>{RL(e.items,o).each((e=>{eo(t.element,ML,e.value),Ti(t,fL,{text:e.text})}))}))]},"tox-listbox",t.shared)}}),i={dom:{tag:"div",classes:["tox-listboxfield"]},components:[a]};return GA.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:Q([s.toArray(),[i]]),fieldBehaviours:Rm([Jb.config({disabled:S(!e.enabled),onDisabled:e=>{GA.getField(e).each(Jb.disable)},onEnabled:e=>{GA.getField(e).each(Jb.enable)}})])})},LL=(e,t)=>({dom:{tag:"div",classes:e.classes},components:U(e.items,t.shared.interpreter)}),HL=(e,t)=>{const o=U(e.options,(e=>({dom:{tag:"option",value:e.value,innerHtml:e.text}}))),n=e.data.map((e=>ba("initialValue",e))).getOr({});return{uid:e.uid,dom:{tag:"select",classes:e.selectClasses,attributes:e.selectAttributes},components:o,behaviours:vf(e.selectBehaviours,[fx.config({}),pf.config({store:{mode:"manual",getValue:e=>wc(e.element),setValue:(t,o)=>{const n=X(e.options,(e=>e.value===o));n.isSome()&&xc(t.element,o)},...n}})])}},IL=Tb({name:"HtmlSelect",configFields:[Rs("options"),ff("selectBehaviours",[fx,pf]),Qs("selectClasses",[]),Qs("selectAttributes",{}),js("data")],factory:HL}),PL=(e,t,o)=>{const n=U(e.items,(e=>({text:t.translate(e.text),value:e.value}))),r=e.label.map((e=>sM(e,t))),s=GA.parts.field({dom:{},...o.map((e=>({data:e}))).getOr({}),selectAttributes:{size:e.size},options:n,factory:IL,selectBehaviours:Rm([Jb.config({disabled:()=>!e.enabled||t.isDisabled()}),JA.config({}),ix("selectbox-change",[Ii(qa(),((t,o)=>{Ti(t,aM,{name:e.name})}))])])}),a=e.size>1?R.none():R.some(WC("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},t.icons)),i={dom:{tag:"div",classes:["tox-selectfield"]},components:Q([[s],a.toArray()])};return GA.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:Q([r.toArray(),[i]]),fieldBehaviours:Rm([Jb.config({disabled:()=>!e.enabled||t.isDisabled(),onDisabled:e=>{GA.getField(e).each(Jb.disable)},onEnabled:e=>{GA.getField(e).each(Jb.enable)}}),XO()])})},zL=S([Qs("field1Name","field1"),Qs("field2Name","field2"),Ad("onLockedChange"),Od(["lockClass"]),Qs("locked",!1),yf.field("coupledFieldBehaviours",[Rb,pf])]),FL=(e,t,o)=>cb(e,t,o).bind(Rb.getCurrent),VL=(e,t)=>Gf({factory:GA,name:e,overrides:e=>({fieldBehaviours:Rm([ix("coupled-input-behaviour",[Ii(Wa(),(o=>{FL(o,e,t).each((t=>{cb(o,e,"lock").each((n=>{Lx.isOn(n)&&e.onLockedChange(o,t,n)}))}))}))])])})}),ZL=S([VL("field1","field2"),VL("field2","field1"),Gf({factory:RC,schema:[Rs("dom")],name:"lock",overrides:e=>({buttonBehaviours:Rm([Lx.config({selected:e.locked,toggleClass:e.markers.lockClass,aria:{mode:"pressed"}})])})})]),UL=(e,t,o,n)=>({uid:e.uid,dom:e.dom,components:t,behaviours:yf.augment(e.coupledFieldBehaviours,[Rb.config({find:R.some}),pf.config({store:{mode:"manual",getValue:t=>{const o=hb(t,e,["field1","field2"]);return{[e.field1Name]:pf.getValue(o.field1()),[e.field2Name]:pf.getValue(o.field2())}},setValue:(t,o)=>{const n=hb(t,e,["field1","field2"]);Oe(o,e.field1Name)&&pf.setValue(n.field1(),o[e.field1Name]),Oe(o,e.field2Name)&&pf.setValue(n.field2(),o[e.field2Name])}}})]),apis:{getField1:t=>cb(t,e,"field1"),getField2:t=>cb(t,e,"field2"),getLock:t=>cb(t,e,"lock")}}),jL=Eb({name:"FormCoupledInputs",configFields:zL(),partFields:ZL(),factory:UL,apis:{getField1:(e,t)=>e.getField1(t),getField2:(e,t)=>e.getField2(t),getLock:(e,t)=>e.getLock(t)}}),$L=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},o=e=>e in t?t[e]:1;let n=e.value.toFixed(o(e.unit));return-1!==n.indexOf(".")&&(n=n.replace(/\.?0*$/,"")),n+e.unit},WL=e=>{const t=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/,o=t.exec(e);if(null!==o){const e=parseFloat(o[1]),t=o[2];return ir.value({value:e,unit:t})}return ir.error(e)},qL=(e,t)=>{const o={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},n=e=>_e(o,e);return e.unit===t?R.some(e.value):n(e.unit)&&n(t)?o[e.unit]===o[t]?R.some(e.value):R.some(e.value/o[e.unit]*o[t]):R.none()},GL=e=>R.none(),KL=(e,t)=>o=>qL(o,t).map((o=>({value:o*e,unit:t}))),YL=(e,t)=>{const o=WL(e).toOptional(),n=WL(t).toOptional();return Me(o,n,((e,t)=>qL(e,t.unit).map((e=>t.value/e)).map((e=>KL(e,t.unit))).getOr(GL))).getOr(GL)},XL=(e,t)=>{let o=GL;const n=cl("ratio-event"),r=e=>WC(e,{tag:"span",classes:["tox-icon","tox-lock-icon__"+e]},t.icons),s=jL.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:t.translate(e.label.getOr("Constrain proportions"))}},components:[r("lock"),r("unlock")],buttonBehaviours:Rm([Jb.config({disabled:()=>!e.enabled||t.isDisabled()}),XO(),JA.config({})])}),a=e=>({dom:{tag:"div",classes:["tox-form__group"]},components:e}),i=o=>GA.parts.field({factory:Vk,inputClasses:["tox-textfield"],inputBehaviours:Rm([Jb.config({disabled:()=>!e.enabled||t.isDisabled()}),XO(),JA.config({}),ix("size-input-events",[Ii(Za(),((e,t)=>{Ti(e,n,{isField1:o})})),Ii(qa(),((t,o)=>{Ti(t,aM,{name:e.name})}))])]),selectOnFocus:!1}),l=e=>({dom:{tag:"label",classes:["tox-label"]},components:[Zc(t.translate(e))]}),c=jL.parts.field1(a([GA.parts.label(l("Width")),i(!0)])),d=jL.parts.field2(a([GA.parts.label(l("Height")),i(!1)]));return jL.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[c,d,a([l(kg),s])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:(e,t,n)=>{WL(pf.getValue(e)).each((e=>{o(e).each((e=>{pf.setValue(t,$L(e))}))}))},coupledFieldBehaviours:Rm([Jb.config({disabled:()=>!e.enabled||t.isDisabled(),onDisabled:e=>{jL.getField1(e).bind(GA.getField).each(Jb.disable),jL.getField2(e).bind(GA.getField).each(Jb.disable),jL.getLock(e).each(Jb.disable)},onEnabled:e=>{jL.getField1(e).bind(GA.getField).each(Jb.enable),jL.getField2(e).bind(GA.getField).each(Jb.enable),jL.getLock(e).each(Jb.enable)}}),XO(),ix("size-input-events2",[Ii(n,((e,t)=>{const n=t.event.isField1,r=n?jL.getField1(e):jL.getField2(e),s=n?jL.getField2(e):jL.getField1(e),a=r.map(pf.getValue).getOr(""),i=s.map(pf.getValue).getOr("");o=YL(a,i)}))])])})},JL=(e,t,o)=>{const n=lB.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[Zc(t.translate(e.label))]}),r=lB.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),s=lB.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return lB.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:e.min,maxX:e.max,getInitialValue:S(o.getOrThunk((()=>(Math.abs(e.max)-Math.abs(e.min))/2)))},components:[n,r,s],sliderBehaviours:Rm([AB.self(),fx.config({})]),onChoose:(t,o,n)=>{Ti(t,aM,{name:e.name,value:n})}})},QL=(e,t)=>{const o=e=>({dom:{tag:"th",innerHtml:t.translate(e)}}),n=e=>({dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:U(e,o)}]}),r=e=>({dom:{tag:"td",innerHtml:t.translate(e)}}),s=e=>({dom:{tag:"tr"},components:U(e,r)}),a=e=>({dom:{tag:"tbody"},components:U(e,s)});return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[n(e.header),a(e.cells)],behaviours:Rm([JA.config({}),fx.config({})])}},eH=(e,t)=>{const o=e.label.map((e=>sM(e,t))),n=[Jb.config({disabled:()=>e.disabled||t.isDisabled()}),XO(),$w.config({mode:"execution",useEnter:!0!==e.multiline,useControlEnter:!0===e.multiline,execute:e=>(Oi(e,dM),R.some(!0))}),ix("textfield-change",[Ii(Wa(),((t,o)=>{Ti(t,aM,{name:e.name})})),Ii(ni(),((t,o)=>{Ti(t,aM,{name:e.name})}))]),JA.config({})],r=e.validation.map((e=>TM.config({getRoot:e=>Nt(e.element),invalidClass:"tox-invalid",validator:{validate:t=>{const o=pf.getValue(t),n=e.validator(o);return LD.pure(!0===n?ir.value(o):ir.error(n))},validateOnLoad:e.validateOnLoad}}))).toArray(),s=e.placeholder.fold(S({}),(e=>({placeholder:t.translate(e)}))),a=e.inputMode.fold(S({}),(e=>({inputmode:e}))),i={...s,...a},l=GA.parts.field({tag:!0===e.multiline?"textarea":"input",...e.data.map((e=>({data:e}))).getOr({}),inputAttributes:i,inputClasses:[e.classname],inputBehaviours:Rm(Q([n,r])),selectOnFocus:!1,factory:Vk}),c=e.flex?["tox-form__group--stretched"]:[],d=c.concat(e.maximized?["tox-form-group--maximize"]:[]),m=[Jb.config({disabled:()=>e.disabled||t.isDisabled(),onDisabled:e=>{GA.getField(e).each(Jb.disable)},onEnabled:e=>{GA.getField(e).each(Jb.enable)}}),XO()];return eM(o,l,d,m)},tH=(e,t,o)=>eH({name:e.name,multiline:!1,label:e.label,inputMode:e.inputMode,placeholder:e.placeholder,flex:!1,disabled:!e.enabled,classname:"tox-textfield",validation:R.none(),maximized:e.maximized,data:o},t),oH=(e,t,o)=>eH({name:e.name,multiline:!0,label:e.label,inputMode:R.none(),placeholder:e.placeholder,flex:!0,disabled:!e.enabled,classname:"tox-textarea",validation:R.none(),maximized:e.maximized,data:o},t),nH=(e,t)=>{const o=e.stream.streams,n=o.setup(e,t);return Ri([Ii(e.event,n),Gi((()=>t.cancel()))].concat(e.cancelEvent.map((e=>[Ii(e,(()=>t.cancel()))])).getOr([])))};var rH=Object.freeze({__proto__:null,events:nH});const sH=(e,t)=>{let o=null;const n=()=>{m(o)||(clearTimeout(o),o=null)},r=(...n)=>{m(o)&&(o=setTimeout((()=>{o=null,e.apply(null,n)}),t))};return{cancel:n,throttle:r}},aH=(e,t)=>{let o=null;const n=()=>{m(o)||(clearTimeout(o),o=null)},r=(...r)=>{n(),o=setTimeout((()=>{o=null,e.apply(null,r)}),t)};return{cancel:n,throttle:r}},iH=e=>{const t=ca(null),o=()=>({timer:null!==t.get()?"set":"unset"}),n=e=>{t.set(e)},r=()=>{const e=t.get();null!==e&&e.cancel()};return Ml({readState:o,setTimer:n,cancel:r})},lH=e=>e.stream.streams.state(e);var cH=Object.freeze({__proto__:null,throttle:iH,init:lH});const dH=(e,t)=>{const o=e.stream,n=aH(e.onStream,o.delay);return t.setTimer(n),(e,t)=>{n.throttle(e,t),o.stopEvent&&t.stop()}};var mH=[Bs("stream",Es("mode",{throttle:[Rs("delay"),Qs("stopEvent",!0),Nd("streams",{setup:dH,state:iH})]})),Qs("event","input"),js("cancelEvent"),Ad("onStream")];const uH=Lm({fields:mH,name:"streaming",active:rH,state:cH}),gH=(e,t,o)=>{const n=pf.getValue(o);pf.setValue(t,n),pH(t)},hH=(e,t)=>{const o=e.element,n=wc(o),r=o.dom;"number"!==oo(o,"type")&&t(r,n)},pH=e=>{hH(e,((e,t)=>e.setSelectionRange(t.length,t.length)))},fH=(e,t)=>{hH(e,((e,o)=>e.setSelectionRange(t,o.length)))},bH=(e,t,o)=>{if(e.selectsOver){const n=pf.getValue(t),r=e.getDisplayText(n),s=pf.getValue(o),a=e.getDisplayText(s);return 0===a.indexOf(r)?R.some((()=>{gH(e,t,o),fH(t,r.length)})):R.none()}return R.none()},vH=S("alloy.typeahead.itemexecute"),yH=(e,t,o,n)=>{const r=(t,o,r)=>{e.previewing.set(!1);const s=TD.getCoupled(t,"sandbox");if(Np.isOpen(s))Rb.getCurrent(s).each((e=>{vv.getHighlighted(e).fold((()=>{r(e)}),(()=>{Ni(s,e.element,"keydown",o)}))}));else{const o=e=>{Rb.getCurrent(e).each(r)};VD(e,a(t),t,s,n,o,xC.HighlightMenuAndItem).get(y)}},s=Ik(e),a=e=>t=>t.map((t=>{const o=Se(t.menus),n=ee(o,(e=>q(e.items,(e=>"item"===e.type)))),r=pf.getState(e);return r.update(U(n,(e=>e.data))),t})),i=e=>Rb.getCurrent(e),l="typeaheadevents",c=[fx.config({}),pf.config({onSetValue:e.onSetValue,store:{mode:"dataset",getDataKey:e=>wc(e.element),getFallbackEntry:e=>({value:e,meta:{}}),setValue:(t,o)=>{xc(t.element,e.model.getDisplayText(o))},...e.initialData.map((e=>ba("initialValue",e))).getOr({})}}),uH.config({stream:{mode:"throttle",delay:e.responseTime,stopEvent:!1},onStream:(t,o)=>{const r=TD.getCoupled(t,"sandbox"),s=fx.isFocused(t);if(s&&wc(t.element).length>=e.minChars){const o=i(r).bind((e=>vv.getHighlighted(e).map(pf.getValue)));e.previewing.set(!0);const s=t=>{i(r).each((t=>{o.fold((()=>{e.model.selectsOver&&vv.highlightFirst(t)}),(e=>{vv.highlightBy(t,(t=>{const o=pf.getValue(t);return o.value===e.value})),vv.getHighlighted(t).orThunk((()=>(vv.highlightFirst(t),R.none())))}))}))};VD(e,a(t),t,r,n,s,xC.HighlightJustMenu).get(y)}},cancelEvent:di()}),$w.config({mode:"special",onDown:(e,t)=>(r(e,t,vv.highlightFirst),R.some(!0)),onEscape:e=>{const t=TD.getCoupled(e,"sandbox");return Np.isOpen(t)?(Np.close(t),R.some(!0)):R.none()},onUp:(e,t)=>(r(e,t,vv.highlightLast),R.some(!0)),onEnter:t=>{const o=TD.getCoupled(t,"sandbox"),n=Np.isOpen(o);if(n&&!e.previewing.get())return i(o).bind((e=>vv.getHighlighted(e))).map((e=>(Ti(t,vH(),{item:e}),!0)));{const r=pf.getValue(t);return Oi(t,di()),e.onExecute(o,t,r),n&&Np.close(o),R.some(!0)}}}),Lx.config({toggleClass:e.markers.openClass,aria:{mode:"expanded"}}),TD.config({others:{sandbox:t=>qD(e,t,{onOpen:()=>Lx.on(t),onClose:()=>Lx.off(t)})}}),ix(l,[qi((t=>{e.lazyTypeaheadComp.set(R.some(t))})),Gi((t=>{e.lazyTypeaheadComp.set(R.none())})),Yi((t=>{const o=y;UD(e,a(t),t,n,o,xC.HighlightMenuAndItem).get(y)})),Ii(vH(),((t,o)=>{const n=TD.getCoupled(t,"sandbox");gH(e.model,t,o.event.item),Oi(t,di()),e.onItemExecute(t,n,o.event.item,pf.getValue(t)),Np.close(n),pH(t)}))].concat(e.dismissOnBlur?[Ii(oi(),(e=>{const t=TD.getCoupled(e,"sandbox");Wm(t.element).isNone()&&Np.close(t)}))]:[]))],d={[bi()]:[pf.name(),uH.name(),l],...e.eventOrder};return{uid:e.uid,dom:zk(Or(e,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:{...s,...vf(e.typeaheadBehaviours,c)},eventOrder:d}},wH=S([js("lazySink"),Rs("fetch"),Qs("minChars",5),Qs("responseTime",1e3),Ed("onOpen"),Qs("getHotspot",R.some),Qs("getAnchorOverrides",S({})),Qs("layouts",R.none()),Qs("eventOrder",{}),la("model",{},[Qs("getDisplayText",(e=>void 0!==e.meta&&void 0!==e.meta.text?e.meta.text:e.value)),Qs("selectsOver",!0),Qs("populateFromBrowse",!0)]),Ed("onSetValue"),Dd("onExecute"),Ed("onItemExecute"),Qs("inputClasses",[]),Qs("inputAttributes",{}),Qs("inputStyles",{}),Qs("matchWidth",!0),Qs("useMinWidth",!1),Qs("dismissOnBlur",!0),Od(["openClass"]),js("initialData"),ff("typeaheadBehaviours",[fx,pf,uH,$w,Lx,TD]),Ms("lazyTypeaheadComp",(()=>ca(R.none))),Ms("previewing",(()=>ca(!0)))].concat(Hk()).concat(KD())),xH=S([Kf({schema:[_d()],name:"menu",overrides:e=>({fakeFocus:!0,onHighlightItem:(t,o,n)=>{e.previewing.get()?e.lazyTypeaheadComp.get().each((t=>{bH(e.model,t,n).fold((()=>{e.model.selectsOver?(vv.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&&gH(e.model,t,n)}))},onExecute:(t,o)=>e.lazyTypeaheadComp.get().map((e=>(Ti(e,vH(),{item:o}),!0))),onHover:(t,o)=>{e.previewing.set(!1),e.lazyTypeaheadComp.get().each((t=>{e.model.populateFromBrowse&&gH(e.model,t,o)}))}})})]),CH=Eb({name:"Typeahead",configFields:wH(),partFields:xH(),factory:yH}),SH=e=>{const t=()=>SH(e.toCached()),o=t=>SH(e.bind((e=>e.fold((e=>LD.pure(ir.error(e))),(e=>t(e)))))),n=t=>SH(e.map((e=>e.bind(t)))),r=t=>SH(e.map((e=>e.map(t)))),s=t=>SH(e.map((e=>e.mapError(t)))),a=(t,o)=>e.map((e=>e.fold(t,o))),i=(t,o)=>SH(LD.nu((n=>{let r=!1;const s=setTimeout((()=>{r=!0,n(ir.error(o()))}),t);e.get((e=>{r||(clearTimeout(s),n(e))}))})));return{...e,toCached:t,bindFuture:o,bindResult:n,mapResult:r,mapError:s,foldResult:a,withTimeout:i}},kH=e=>SH(LD.nu(e)),_H=e=>SH(LD.pure(ir.value(e))),OH=e=>SH(LD.pure(ir.error(e))),TH=e=>SH(LD.pure(e)),EH=e=>SH(e.map(ir.value)),DH=e=>kH((t=>{e.then((e=>{t(ir.value(e))}),(e=>{t(ir.error(e))}))})),AH={nu:kH,wrap:SH,pure:_H,value:_H,error:OH,fromResult:TH,fromFuture:EH,fromPromise:DH},MH=e=>({isEnabled:()=>!Jb.isDisabled(e),setEnabled:t=>Jb.set(e,!t),setActive:t=>{const o=e.element;t?(mc(o,"tox-tbtn--enabled"),eo(o,"aria-pressed",!0)):(gc(o,"tox-tbtn--enabled"),so(o,"aria-pressed"))},isActive:()=>hc(e.element,"tox-tbtn--enabled")}),NH=(e,t,o,n)=>vL({text:e.text,icon:e.icon,tooltip:e.tooltip,searchable:e.search.isSome(),role:n,fetch:(t,n)=>{const r={pattern:e.search.isSome()?lA(t):""};e.fetch((t=>{n(DL(t,lk.CLOSE_ON_EXECUTE,o,{isHorizontalMenu:!1,search:e.search}))}),r)},onSetup:e.onSetup,getApi:MH,columns:1,presets:"normal",classes:[],dropdownBehaviours:[JA.config({})]},t,o.shared),RH=(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=>{Zm(t.element),Ti(t,cM,{name:e.name,value:e.storage.get()})}))}))},r=e=>t=>{t.setActive(e.storage.get())};return t=>{t(U(e,(e=>{const t=e.text.fold((()=>({})),(e=>({text:e})));return{type:e.type,active:!1,...t,onAction:n(e),onSetup:r(e)}})))}},BH=(e,t,o=[],n,r,s)=>{const a=t.fold((()=>({})),(e=>({action:e}))),i={buttonBehaviours:Rm([oT.button((()=>!e.enabled||s.isDisabled())),XO(),JA.config({}),ix("button press",[Hi("click"),Hi("mousedown")])].concat(o)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]},...a},l=Or(i,{dom:n});return Or(l,{components:r})},LH=(e,t,o,n=[])=>{const r=e.tooltip.map((e=>({"aria-label":o.translate(e),title:o.translate(e)}))).getOr({}),s={tag:"button",classes:["tox-tbtn"],attributes:r},a=e.icon.map((e=>gL(e,o.icons))),i=lT([a]);return BH(e,t,n,s,i,o)},HH=e=>{switch(e){case"primary":return["tox-button"];case"toolbar":return["tox-tbtn"];case"secondary":default:return["tox-button","tox-button--secondary"]}},IH=(e,t,o,n=[],r=[])=>{const s=o.translate(e.text),a=e.icon.map((e=>gL(e,o.icons))),i=[a.getOrThunk((()=>Zc(s)))],l=e.buttonType.getOr(e.primary||e.borderless?"primary":"secondary"),c=HH(l),d=[...c,...a.isSome()?["tox-button--icon"]:[],...e.borderless?["tox-button--naked"]:[],...r],m={tag:"button",classes:d,attributes:{title:s}};return BH(e,t,n,m,i,o)},PH=(e,t,o,n=[],r=[])=>{const s=IH(e,R.some(t),o,n,r);return RC.sketch(s)},zH=(e,t)=>o=>{"custom"===t?Ti(o,cM,{name:e,value:{}}):"submit"===t?Oi(o,dM):"cancel"===t?Oi(o,lM):console.error("Unknown button type: ",t)},FH=(e,t)=>"menu"===t,VH=(e,t)=>"custom"===t||"cancel"===t||"submit"===t,ZH=(e,t,o)=>{if(FH(e,t)){const t=()=>s,n=e,r={...e,type:"menubutton",search:R.none(),onSetup:t=>(t.setEnabled(e.enabled),y),fetch:RH(n.items,t,o)},s=BC(NH(r,"tox-tbtn",o,R.none()));return s.asSpec()}if(VH(e,t)){const n=zH(e.name,t),r={...e,borderless:!1};return PH(r,n,o.shared.providers,[])}throw console.error("Unknown footer button type: ",t),new Error("Unknown footer button type")},UH=(e,t)=>{const o=zH(e.name,"custom");return tM(R.none(),GA.parts.field({factory:RC,...IH(e,R.some(o),t,[PB.memory(""),AB.self()])}))},jH={type:"separator"},$H=e=>({type:"menuitem",value:e.url,text:e.title,meta:{attach:e.attach},onAction:y}),WH=(e,t)=>({type:"menuitem",value:t,text:e,meta:{attach:void 0},onAction:y}),qH=e=>U(e,$H),GH=(e,t)=>q(t,(t=>t.type===e)),KH=(e,t)=>qH(GH(e,t)),YH=e=>KH("header",e.targets),XH=e=>KH("anchor",e.targets),JH=e=>R.from(e.anchorTop).map((e=>WH("<top>",e))).toArray(),QH=e=>R.from(e.anchorBottom).map((e=>WH("<bottom>",e))).toArray(),eI=e=>U(e,(e=>WH(e,e))),tI=e=>K(e,((e,t)=>{const o=0===e.length||0===t.length;return o?e.concat(t):e.concat(jH,t)}),[]),oI=(e,t)=>{const o=e.toLowerCase();return q(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 Fe(n.toLowerCase(),o)||Fe(r.toLowerCase(),o)}))},nI=(e,t,o)=>{const n=pf.getValue(t),r=void 0!==n.meta.text?n.meta.text:n.value,s=o.getLinkInformation();return s.fold((()=>[]),(t=>{const n=oI(r,eI(o.getHistory(e)));return"file"===e?tI([n,oI(r,YH(t)),oI(r,Q([JH(t),XH(t),QH(t)]))]):n}))},rI=cl("aria-invalid"),sI=(e,t,o,n)=>{const r=t.shared.providers,s=t=>{const n=pf.getValue(t);o.addToHistory(n.value,e.filetype)},a={...n.map((e=>({initialData:e}))).getOr({}),dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":rI,type:"url"},minChars:0,responseTime:0,fetch:n=>{const r=nI(e.filetype,n,o),s=DL(r,lk.BUBBLE_TO_SANDBOX,t,{isHorizontalMenu:!1,search:R.none()});return LD.pure(s)},getHotspot:e=>h.getOpt(e),onSetValue:(e,t)=>{e.hasConfigured(TM)&&TM.run(e).get(y)},typeaheadBehaviours:Rm([...o.getValidationHandler().map((t=>TM.config({getRoot:e=>Nt(e.element),invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:(e,t)=>{d.getOpt(e).each((e=>{eo(e.element,"title",r.translate(t))}))}},validator:{validate:o=>{const n=pf.getValue(o);return AH.nu((o=>{t({type:e.filetype,url:n.value},(e=>{if("invalid"===e.status){const t=ir.error(e.message);o(t)}else{const t=ir.value(e.message);o(t)}}))}))},validateOnLoad:!1}}))).toArray(),Jb.config({disabled:()=>!e.enabled||r.isDisabled()}),JA.config({}),ix("urlinput-events",[Ii(Wa(),(t=>{const o=wc(t.element),n=o.trim();n!==o&&xc(t.element,n),"file"===e.filetype&&Ti(t,aM,{name:e.name})})),Ii(qa(),(t=>{Ti(t,aM,{name:e.name}),s(t)})),Ii(ni(),(t=>{Ti(t,aM,{name:e.name}),s(t)}))])]),eventOrder:{[Wa()]:["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:Lk(!1,1,"normal")},onExecute:(e,t,o)=>{Ti(t,dM,{})},onItemExecute:(t,o,n,r)=>{s(t),Ti(t,aM,{name:e.name})}},i=GA.parts.field({...a,factory:CH}),l=e.label.map((e=>sM(e,r))),c=(e,t,o=e,n=e)=>WC(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),d=BC(c("invalid",R.some(rI),"warning")),m=BC({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[d.asSpec()]}),u=o.getUrlPicker(e.filetype),g=cl("browser.url.event"),h=BC({dom:{tag:"div",classes:["tox-control-wrap"]},components:[i,m.asSpec()],behaviours:Rm([Jb.config({disabled:()=>!e.enabled||r.isDisabled()})])}),p=BC(PH({name:e.name,icon:R.some("browse"),text:e.label.getOr(""),enabled:e.enabled,primary:!1,buttonType:R.none(),borderless:!0},(e=>Oi(e,g)),r,[],["tox-browse-url"])),f=()=>({dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:Q([[h.asSpec()],u.map((()=>p.asSpec())).toArray()])}),b=t=>{Rb.getCurrent(t).each((o=>{const n=pf.getValue(o),r={fieldname:e.name,...n};u.each((n=>{n(r).get((n=>{pf.setValue(o,n),Ti(t,aM,{name:e.name})}))}))}))};return GA.sketch({dom:nM(),components:l.toArray().concat([f()]),fieldBehaviours:Rm([Jb.config({disabled:()=>!e.enabled||r.isDisabled(),onDisabled:e=>{GA.getField(e).each(Jb.disable),p.getOpt(e).each(Jb.disable)},onEnabled:e=>{GA.getField(e).each(Jb.enable),p.getOpt(e).each(Jb.enable)}}),XO(),ix("url-input-events",[Ii(g,b)])])})},aI=(e,t)=>ZA.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"]},components:[RC.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:VC(e.icon,t.icons),attributes:{title:t.translate(e.iconTooltip)}},action:t=>{Ti(t,cM,{name:"alert-banner",value:e.url})},buttonBehaviours:Rm([jC()])})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:t.translate(e.text)}}]}),iI=(e,t)=>{e.dom.checked=t},lI=e=>e.dom.checked,cI=(e,t,o)=>{const n=e=>(e.element.dom.click(),R.some(!0)),r=GA.parts.field({factory:{sketch:k},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:Rm([AB.self(),Jb.config({disabled:()=>!e.enabled||t.isDisabled()}),JA.config({}),fx.config({}),PB.withElement(o,lI,iI),$w.config({mode:"special",onEnter:n,onSpace:n,stopSpaceKeyup:!0}),ix("checkbox-events",[Ii(qa(),((t,o)=>{Ti(t,aM,{name:e.name})}))])])}),s=GA.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"]},components:[Zc(t.translate(e.label))],behaviours:Rm([MM.config({})])}),a=e=>{const o="checked"===e?"selected":"unselected";return WC(o,{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+e]},t.icons)},i=BC({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[a("checked"),a("unchecked")]});return GA.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[r,i.asSpec(),s],fieldBehaviours:Rm([Jb.config({disabled:()=>!e.enabled||t.isDisabled(),disableClass:"tox-checkbox--disabled",onDisabled:e=>{GA.getField(e).each(Jb.disable)},onEnabled:e=>{GA.getField(e).each(Jb.enable)}}),XO()])})},dI=e=>"presentation"===e.presets?ZA.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:e.html}}):ZA.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:e.html,attributes:{role:"document"}},containerBehaviours:Rm([JA.config({}),fx.config({})])}),mI=e=>(t,o,n,r)=>ke(o,"name").fold((()=>e(o,r,R.none())),(s=>t.field(s,e(o,r,ke(n,s))))),uI=e=>(t,o,n,r)=>{const s=Or(o,{source:"dynamic"});return mI(e)(t,s,n,r)},gI={bar:mI(((e,t)=>jA(e,t.shared))),collection:mI(((e,t,o)=>pM(e,t.shared.providers,o))),alertbanner:mI(((e,t)=>aI(e,t.shared.providers))),input:mI(((e,t,o)=>tH(e,t.shared.providers,o))),textarea:mI(((e,t,o)=>oH(e,t.shared.providers,o))),label:mI(((e,t)=>lL(e,t.shared))),iframe:uI(((e,t,o)=>nL(e,t.shared.providers,o))),button:mI(((e,t)=>UH(e,t.shared.providers))),checkbox:mI(((e,t,o)=>cI(e,t.shared.providers,o))),colorinput:mI(((e,t,o)=>HM(e,t.shared,t.colorinput,o))),colorpicker:mI(((e,t,o)=>VB(e,t.shared.providers,o))),dropzone:mI(((e,t,o)=>qB(e,t.shared.providers,o))),grid:mI(((e,t)=>GB(e,t.shared))),listbox:mI(((e,t,o)=>BL(e,t,o))),selectbox:mI(((e,t,o)=>PL(e,t.shared.providers,o))),sizeinput:mI(((e,t)=>XL(e,t.shared.providers))),slider:mI(((e,t,o)=>JL(e,t.shared.providers,o))),urlinput:mI(((e,t,o)=>sI(e,t,t.urlinput,o))),customeditor:mI(jB),htmlpanel:mI(dI),imagepreview:mI(((e,t,o)=>iL(e,o))),table:mI(((e,t)=>QL(e,t.shared.providers))),panel:mI(((e,t)=>LL(e,t)))},hI={field:(e,t)=>t,record:S([])},pI=(e,t,o,n)=>{const r=Or(n,{shared:{interpreter:t=>fI(e,t,o,r)}});return fI(e,t,o,r)},fI=(e,t,o,n)=>ke(gI,t.type).fold((()=>(console.error(`Unknown factory type "${t.type}", defaulting to container: `,t),t)),(r=>r(e,t,o,n))),bI=(e,t,o)=>fI(hI,e,t,o),vI="layout-inset",yI=e=>e.x,wI=(e,t)=>e.x+e.width/2-t.width/2,xI=(e,t)=>e.x+e.width-t.width,CI=e=>e.y,SI=(e,t)=>e.y+e.height-t.height,kI=(e,t)=>e.y+e.height/2-t.height/2,_I=(e,t,o)=>Ld(xI(e,t),SI(e,t),o.insetSouthwest(),Ud(),"southwest",Xd(e,{right:0,bottom:3}),vI),OI=(e,t,o)=>Ld(yI(e),SI(e,t),o.insetSoutheast(),Zd(),"southeast",Xd(e,{left:1,bottom:3}),vI),TI=(e,t,o)=>Ld(xI(e,t),CI(e),o.insetNorthwest(),Vd(),"northwest",Xd(e,{right:0,top:2}),vI),EI=(e,t,o)=>Ld(yI(e),CI(e),o.insetNortheast(),Fd(),"northeast",Xd(e,{left:1,top:2}),vI),DI=(e,t,o)=>Ld(wI(e,t),CI(e),o.insetNorth(),jd(),"north",Xd(e,{top:2}),vI),AI=(e,t,o)=>Ld(wI(e,t),SI(e,t),o.insetSouth(),$d(),"south",Xd(e,{bottom:3}),vI),MI=(e,t,o)=>Ld(xI(e,t),kI(e,t),o.insetEast(),qd(),"east",Xd(e,{right:0}),vI),NI=(e,t,o)=>Ld(yI(e),kI(e,t),o.insetWest(),Wd(),"west",Xd(e,{left:1}),vI),RI=e=>{switch(e){case"north":return DI;case"northeast":return EI;case"northwest":return TI;case"south":return AI;case"southeast":return OI;case"southwest":return _I;case"east":return MI;case"west":return NI}},BI=(e,t,o,n,r)=>{const s=du(n).map(RI).getOr(DI);return s(e,t,o,n,r)},LI=e=>{switch(e){case"north":return AI;case"northeast":return OI;case"northwest":return _I;case"south":return DI;case"southeast":return EI;case"southwest":return TI;case"east":return NI;case"west":return MI}},HI=(e,t,o,n,r)=>{const s=du(n).map(LI).getOr(DI);return s(e,t,o,n,r)},II={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},PI=(e,t,o)=>{const n=12,r={maxHeightFunction:ju()},s=()=>({type:"node",root:jt(Ut(e())),node:R.from(e()),bubble:Ku(n,n,II),layouts:{onRtl:()=>[EI],onLtr:()=>[TI]},overrides:r}),a=()=>({type:"hotspot",hotspot:t(),bubble:Ku(-n,n,II),layouts:{onRtl:()=>[lm],onLtr:()=>[cm]},overrides:r});return()=>o()?s():a()},zI=(e,t,o)=>{const n=()=>({type:"node",root:jt(Ut(e())),node:R.from(e()),layouts:{onRtl:()=>[DI],onLtr:()=>[DI]}}),r=()=>({type:"hotspot",hotspot:t(),layouts:{onRtl:()=>[gm],onLtr:()=>[gm]}});return()=>o()?n():r()},FI=(e,t)=>()=>({type:"selection",root:t(),getSelection:()=>{const t=e.selection.getRng();return R.some(Zg.range(Qe.fromDom(t.startContainer),t.startOffset,Qe.fromDom(t.endContainer),t.endOffset))}}),VI=e=>t=>({type:"node",root:e(),node:t}),ZI=(e,t,o)=>{const n=YS(e),r=()=>Qe.fromDom(e.getBody()),s=()=>Qe.fromDom(e.getContentAreaContainer()),a=()=>n||!o();return{inlineDialog:PI(s,t,a),banner:zI(s,t,a),cursor:FI(e,r),node:VI(r)}},UI=e=>(t,o)=>{const n=WE(e);n(t,o)},jI=e=>()=>ME(e),$I=e=>t=>NE(e,t),WI=e=>t=>AE(e,t),qI=e=>({colorPicker:UI(e),hasCustomColors:jI(e),getColors:$I(e),getColorCols:WI(e)}),GI=e=>()=>RS(e),KI=e=>({isDraggableModal:GI(e)}),YI=e=>{const t=ca(GS(e)?"bottom":"top");return{isPositionedAtTop:()=>"top"===t.get(),getDockingMode:t.get,setDockingMode:t.set}},XI=e=>Oe(e,"items"),JI=e=>Oe(e,"format"),QI=[{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"}]}],eP=e=>_e(e,"items"),tP=e=>_e(e,"block"),oP=e=>_e(e,"inline"),nP=e=>_e(e,"selector"),rP=e=>K(e,((e,t)=>{if(eP(t)){const o=rP(t.items);return{customFormats:e.customFormats.concat(o.customFormats),formats:e.formats.concat([{title:t.title,items:o.formats}])}}if(oP(t)||tP(t)||nP(t)){const o=i(t.name)?t.name:t.title.toLowerCase(),n=`custom-${o}`;return{customFormats:e.customFormats.concat([{name:n,format:t}]),formats:e.formats.concat([{title:t.title,format:n,icon:t.icon}])}}return{...e,formats:e.formats.concat(t)}}),{customFormats:[],formats:[]}),sP=(e,t)=>{const o=rP(t),n=t=>{j(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},aP=e=>gS(e).map((t=>{const o=sP(e,t);return hS(e)?QI.concat(o):o})).getOr(QI),iP=e=>{const t=ue(e);return 1===t.length&&z(t,"title")},lP=(e,t,o)=>({...e,type:"formatter",isSelected:t(e.format),getStylePreview:o(e.format)}),cP=(e,t,o,n)=>{const r=e=>lP(e,o,n),s=e=>{const t=l(e.items);return{...e,type:"submenu",getStyleItems:S(t)}},a=t=>{const r=i(t.name)?t.name:cl(t.title),s=`custom-${r}`,a={...t,type:"formatter",format:s,isSelected:o(s),getStylePreview:n(s)};return e.formatter.register(r,a),a},l=e=>U(e,(e=>XI(e)?s(e):JI(e)?r(e):iP(e)?{...e,type:"separator"}:a(e)));return l(t)},dP=e=>{const t=t=>()=>e.formatter.match(t),o=t=>()=>{const o=e.formatter.get(t);return void 0!==o?R.some({tag:o.length>0&&(o[0].inline||o[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))}):R.none()},n=ca([]),r=ca([]),s=ca(!1);e.on("PreInit",(r=>{const s=aP(e),a=cP(e,s,t,o);n.set(a)})),e.on("addStyleModifications",(n=>{const a=cP(e,n.items,t,o);r.set(a),s.set(n.replace)}));const a=()=>{const e=s.get()?[]:n.get(),t=r.get();return e.concat(t)};return{getData:a}},mP=e=>p(e)&&1===e.nodeType,uP=$B.trim,gP=e=>t=>{if(mP(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1},hP=gP("true"),pP=gP("false"),fP=(e,t,o,n,r)=>({type:e,title:t,url:o,level:n,attach:r}),bP=e=>{let t=e;while(t=t.parentNode){const e=t.contentEditable;if(e&&"inherit"!==e)return hP(t)}return!1},vP=(e,t)=>U(oh(Qe.fromDom(t),e),(e=>e.dom)),yP=e=>e.innerText||e.textContent,wP=e=>e.id?e.id:cl("h"),xP=e=>e&&"A"===e.nodeName&&void 0!==(e.id||e.name),CP=e=>xP(e)&&kP(e),SP=e=>e&&/^(H[1-6])$/.test(e.nodeName),kP=e=>bP(e)&&!pP(e),_P=e=>SP(e)&&kP(e),OP=e=>SP(e)?parseInt(e.nodeName.substr(1),10):0,TP=e=>{var t;const o=wP(e),n=()=>{e.id=o};return fP("header",null!==(t=yP(e))&&void 0!==t?t:"","#"+o,OP(e),n)},EP=e=>{const t=e.id||e.name,o=yP(e);return fP("anchor",o||"#"+t,"#"+t,0,y)},DP=e=>U(q(e,_P),TP),AP=e=>U(q(e,CP),EP),MP=e=>{const t=vP("h1,h2,h3,h4,h5,h6,a:not([href])",e);return t},NP=e=>uP(e.title).length>0,RP=e=>{const t=MP(e);return q(DP(t).concat(AP(t)),NP)},BP={find:RP},LP="tinymce-url-history",HP=5,IP=e=>i(e)&&/^https?/.test(e),PP=e=>d(e)&&e.length<=HP&&te(e,IP),zP=e=>l(e)&&Ce(e,(e=>!PP(e))).isNone(),FP=()=>{const e=uE.getItem(LP);if(null===e)return{};let t;try{t=JSON.parse(e)}catch(o){if(o instanceof SyntaxError)return console.log("Local storage "+LP+" was not valid JSON",o),{};throw o}return zP(t)?t:(console.log("Local storage "+LP+" was not valid format",t),{})},VP=e=>{if(!zP(e))throw new Error("Bad format for history:\n"+JSON.stringify(e));uE.setItem(LP,JSON.stringify(e))},ZP=e=>{const t=FP();return ke(t,e).getOr([])},UP=(e,t)=>{if(!IP(e))return;const o=FP(),n=ke(o,t).getOr([]),r=q(n,(t=>t!==e));o[t]=[e].concat(r).slice(0,HP),VP(o)},jP=e=>!!e,$P=e=>pe($B.makeMap(e,/[, ]/),jP),WP=e=>R.from(TS(e)),qP=e=>{const t=R.from(DS(e)).filter(jP).map($P);return WP(e).fold(A,(e=>t.fold(M,(e=>ue(e).length>0&&e))))},GP=(e,t)=>{const o=qP(e);return u(o)?o?WP(e):R.none():o[t]?WP(e):R.none()},KP=(e,t)=>GP(e,t).map((o=>n=>LD.nu((r=>{const s=(e,t)=>{if(!i(e))throw new Error("Expected value to be string");if(void 0!==t&&!l(t))throw new Error("Expected meta to be a object");const o={value:e,meta:t};r(o)},a={filetype:t,fieldname:n.fieldname,...R.from(n.meta).getOr({})};o.call(e,s,n.value,a)})))),YP=e=>R.from(e).filter(i).getOrUndefined(),XP=e=>AS(e)?R.some({targets:BP.find(e.getBody()),anchorTop:YP(MS(e)),anchorBottom:YP(NS(e))}):R.none(),JP=e=>R.from(ES(e)),QP=e=>({getHistory:ZP,addToHistory:UP,getLinkInformation:()=>XP(e),getValidationHandler:()=>JP(e),getUrlPicker:t=>KP(e,t)}),ez=(e,t,o)=>{const n=ca(!1),r=YI(t),s={icons:()=>t.ui.registry.getAll().icons,menuItems:()=>t.ui.registry.getAll().menuItems,translate:LC.translate,isDisabled:()=>t.mode.isReadOnly()||!t.ui.isEnabled(),getOption:t.options.get},a=QP(t),i=dP(t),l=qI(t),c=KI(t),d=()=>n.get(),m=e=>n.set(e),u={shared:{providers:s,anchors:ZI(t,o,r.isPositionedAtTop),header:r},urlinput:a,styles:i,colorinput:l,dialog:c,isContextMenuOpen:d,setContextMenuState:m},g={...u,shared:{...u.shared,interpreter:e=>bI(e,{},g),getSink:e.popup}},h={...u,shared:{...u.shared,interpreter:e=>bI(e,{},h),getSink:e.dialog}};return{popup:g,dialog:h}},tz=(e,t,o)=>{const n=(e,n)=>{j([t,...o],(t=>{t.broadcastEvent(e,n)}))},r=(e,n)=>{j([t,...o],(t=>{t.broadcastOn([e],n)}))},s=e=>r(Rp(),{target:e.target}),a=$n(),i=Su(a,"touchstart",s),l=Su(a,"touchmove",(e=>n(ui(),e))),c=Su(a,"touchend",(e=>n(gi(),e))),d=Su(a,"mousedown",s),m=Su(a,"mouseup",(e=>{0===e.raw.button&&r(Lp(),{target:e.target})})),u=e=>r(Rp(),{target:Qe.fromDom(e.target)}),g=e=>{0===e.button&&r(Lp(),{target:Qe.fromDom(e.target)})},h=()=>{j(e.editorManager.get(),(t=>{e!==t&&t.dispatch("DismissPopups",{relatedTarget:e})}))},p=e=>n(hi(),_u(e)),f=e=>{r(Bp(),{}),n(pi(),_u(e))},b=()=>r(Bp(),{}),v=t=>{t.state&&r(Rp(),{target:Qe.fromDom(e.getContainer())})},y=e=>{r(Rp(),{target:Qe.fromDom(e.relatedTarget.getContainer())})};e.on("PostRender",(()=>{e.on("click",u),e.on("tap",u),e.on("mouseup",g),e.on("mousedown",h),e.on("ScrollWindow",p),e.on("ResizeWindow",f),e.on("ResizeEditor",b),e.on("AfterProgressState",v),e.on("DismissPopups",y)})),e.on("remove",(()=>{e.off("click",u),e.off("tap",u),e.off("mouseup",g),e.off("mousedown",h),e.off("ScrollWindow",p),e.off("ResizeWindow",f),e.off("ResizeEditor",b),e.off("AfterProgressState",v),e.off("DismissPopups",y),d.unbind(),i.unbind(),l.unbind(),c.unbind(),m.unbind()})),e.on("detach",(()=>{j([t,...o],up),j([t,...o],(e=>e.destroy()))}))},oz=bb,nz=Qf,rz=S([Qs("shell",!1),Rs("makeItem"),Qs("setupItem",y),yf.field("listBehaviours",[sx])]),sz=()=>({behaviours:Rm([sx.config({})])}),az=Yf({name:"items",overrides:sz}),iz=S([az]),lz=S("CustomList"),cz=(e,t,o,n)=>{const r=(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=sx.contents(n),s=o.length,a=s-r.length,i=a>0?V(a,(()=>e.makeItem())):[],l=r.slice(s);j(l,(e=>sx.remove(n,e))),j(i,(e=>sx.append(n,e)));const c=sx.contents(n);j(c,((n,r)=>{e.setupItem(t,n,o[r],r)}))}))},s=e.shell?{behaviours:[sx.config({})],components:[]}:{behaviours:[],components:t},a=t=>e.shell?R.some(t):cb(t,e,"items");return{uid:e.uid,dom:e.dom,components:s.components,behaviours:vf(e.listBehaviours,s.behaviours),apis:{setItems:r}}},dz=Eb({name:lz(),configFields:rz(),partFields:iz(),factory:cz,apis:{setItems:(e,t,o)=>{e.setItems(t,o)}}}),mz=S([Rs("dom"),Qs("shell",!0),ff("toolbarBehaviours",[sx])]),uz=()=>({behaviours:Rm([sx.config({})])}),gz=S([Yf({name:"groups",overrides:uz})]),hz=(e,t,o,n)=>{const r=(e,t)=>{s(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=>{sx.set(e,t)}))},s=t=>e.shell?R.some(t):cb(t,e,"groups"),a=e.shell?{behaviours:[sx.config({})],components:[]}:{behaviours:[],components:t};return{uid:e.uid,dom:e.dom,components:a.components,behaviours:vf(e.toolbarBehaviours,a.behaviours),apis:{setGroups:r},domModification:{attributes:{role:"group"}}}},pz=Eb({name:"Toolbar",configFields:mz(),partFields:gz(),factory:hz,apis:{setGroups:(e,t,o)=>{e.setGroups(t,o)}}}),fz=y,bz=A,vz=S([]);var yz=Object.freeze({__proto__:null,setup:fz,isDocked:bz,getBehaviours:vz});const wz=e=>{const t=Te(po(e,"position"),"fixed"),o=t?R.none():Rt(e);return o.orThunk((()=>{const t=Qe.fromTag("span");return Mt(e).bind((e=>{Ln(e,t);const o=Rt(t);return zn(t),o}))}))},xz=e=>wz(e).map(Do).getOrThunk((()=>Oo(0,0))),Cz=ma.generate([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),Sz=(e,t)=>{const o=e.element;mc(o,t.transitionClass),gc(o,t.fadeOutClass),mc(o,t.fadeInClass),t.onShow(e)},kz=(e,t)=>{const o=e.element;mc(o,t.transitionClass),gc(o,t.fadeInClass),mc(o,t.fadeOutClass),t.onHide(e)},_z=(e,t)=>e.y<t.bottom&&e.bottom>t.y,Oz=(e,t)=>e.y>=t.y,Tz=(e,t)=>e.bottom<=t.bottom,Ez=(e,t,o)=>te(e,(e=>{switch(e){case"bottom":return Tz(t,o);case"top":return Oz(t,o)}})),Dz=(e,t)=>t.getInitialPos().map((t=>er(t.bounds.x,t.bounds.y,Ro(e),Co(e)))),Az=(e,t,o)=>{o.setInitialPos({style:fo(e),position:go(e,"position")||"static",bounds:t})},Mz=(e,t,o)=>o.getInitialPos().bind((n=>{switch(o.clearInitialPos(),n.position){case"static":return R.some(Cz.static());case"absolute":const o=wz(e).map(tr).getOrThunk((()=>tr(Xt())));return R.some(Cz.absolute(Gm("absolute",ke(n.style,"left").map((e=>t.x-o.x)),ke(n.style,"top").map((e=>t.y-o.y)),ke(n.style,"right").map((e=>o.right-t.right)),ke(n.style,"bottom").map((e=>o.bottom-t.bottom)))));default:return R.none()}})),Nz=(e,t,o)=>Dz(e,o).filter((e=>Ez(o.getModes(),e,t))).bind((t=>Mz(e,t,o))),Rz=(e,t,o)=>{const n=tr(e);if(Ez(o.getModes(),n,t))return R.none();{Az(e,n,o);const r=nr(),s=n.x-r.x,a=t.y-r.y,i=r.bottom-t.bottom,l=n.y<=t.y;return R.some(Cz.fixed(Gm("fixed",R.some(s),l?R.some(a):R.none(),R.none(),l?R.none():R.some(i))))}},Bz=(e,t,o)=>{const n=e.element,r=Te(po(n,"position"),"fixed");return r?Nz(n,t,o):Rz(n,t,o)},Lz=(e,t)=>{const o=e.element;return Dz(o,t).bind((e=>Mz(o,e,t)))},Hz=(e,t,o)=>{o.setDocked(!1),j(["left","right","top","bottom","position"],(t=>vo(e.element,t))),t.onUndocked(e)},Iz=(e,t,o,n)=>{const r="fixed"===n.position;o.setDocked(r),Ym(e.element,n);const s=r?t.onDocked:t.onUndocked;s(e)},Pz=(e,t,o,n,r=!1)=>{t.contextual.each((t=>{t.lazyContext(e).each((s=>{const a=_z(s,n);if(a!==o.isVisible())if(o.setVisible(a),r&&!a)pc(e.element,[t.fadeOutClass]),t.onHide(e);else{const o=a?Sz:kz;o(e,t)}}))}))},zz=(e,t,o)=>{const n=t.lazyViewport(e),r=o.isDocked();r&&Pz(e,t,o,n),Bz(e,n,o).each((r=>{r.fold((()=>Hz(e,t,o)),(n=>Iz(e,t,o,n)),(r=>{Pz(e,t,o,n,!0),Iz(e,t,o,r)}))}))},Fz=(e,t,o)=>{const n=e.element;o.setDocked(!1),Lz(e,o).each((n=>{n.fold((()=>Hz(e,t,o)),(n=>Iz(e,t,o,n)),y)})),o.setVisible(!0),t.contextual.each((t=>{fc(n,[t.fadeInClass,t.fadeOutClass,t.transitionClass]),t.onShow(e)})),Vz(e,t,o)},Vz=(e,t,o)=>{e.getSystem().isConnected()&&zz(e,t,o)},Zz=(e,t,o)=>{o.isDocked()&&Fz(e,t,o)},Uz=(e,t,o)=>o.isDocked(),jz=(e,t,o,n)=>o.setModes(n),$z=(e,t,o)=>o.getModes();var Wz=Object.freeze({__proto__:null,refresh:Vz,reset:Zz,isDocked:Uz,getModes:$z,setModes:jz});const qz=(e,t)=>Ri([Wi(Ya(),((o,n)=>{e.contextual.each((e=>{if(hc(o.element,e.transitionClass)){fc(o.element,[e.transitionClass,e.fadeInClass]);const n=t.isVisible()?e.onShown:e.onHidden;n(o)}n.stop()}))})),Ii(hi(),((o,n)=>{Vz(o,e,t)})),Ii(pi(),((o,n)=>{Zz(o,e,t)}))]);var Gz=Object.freeze({__proto__:null,events:qz}),Kz=[Xs("contextual",[Hs("fadeInClass"),Hs("fadeOutClass"),Hs("transitionClass"),zs("lazyContext"),Ed("onShow"),Ed("onShown"),Ed("onHide"),Ed("onHidden")]),sa("lazyViewport",nr),ia("modes",["top","bottom"],gs),Ed("onDocked"),Ed("onUndocked")];const Yz=e=>{const t=ca(!1),o=ca(!0),n=xu(),r=ca(e.modes),s=()=>`docked: ${t.get()}, visible: ${o.get()}, modes: ${r.get().join(",")}`;return Ml({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:s})};var Xz=Object.freeze({__proto__:null,init:Yz});const Jz=Lm({fields:Kz,name:"docking",active:Gz,apis:Wz,state:Xz}),Qz=S(cl("toolbar-height-change")),eF={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},tF="tox-tinymce--toolbar-sticky-on",oF="tox-tinymce--toolbar-sticky-off",nF=(e,t)=>{const o=Tt(t),n=At(t),r=n.dom.innerHeight,s=Fn(o),a=Qe.fromDom(e.elm),i=or(a),l=Co(a),c=i.y,d=c+l,m=Do(t),u=Co(t),g=m.top,h=g+u,p=Math.abs(g-s.top)<2,f=Math.abs(h-(s.top+r))<2;if(p&&c<h)Vn(s.left,c-u,o);else if(f&&d>g){const e=c-r+l+u;Vn(s.left,e,o)}},rF=(e,t)=>z(Jz.getModes(e),t),sF=e=>{const t=e=>So(e)+(parseInt(go(e,"margin-top"),10)||0)+(parseInt(go(e,"margin-bottom"),10)||0),o=e.element;Nt(o).each((n=>{const r="padding-"+Jz.getModes(e)[0];if(Jz.isDocked(e)){const e=Ro(n);co(o,"width",e+"px"),co(n,r,t(o)+"px")}else vo(o,"width"),vo(n,r)}))},aF=(e,t)=>{t?(gc(e,eF.fadeOutClass),pc(e,[eF.transitionClass,eF.fadeInClass])):(gc(e,eF.fadeInClass),pc(e,[eF.fadeOutClass,eF.transitionClass]))},iF=(e,t)=>{const o=Qe.fromDom(e.getContainer());t?(mc(o,tF),gc(o,oF)):(mc(o,oF),gc(o,tF))},lF=(e,t)=>{const o=Tt(t);$m(o).filter((e=>!_t(t,e))).filter((t=>_t(t,Qe.fromDom(o.dom.body))||Ot(e,t))).each((()=>Zm(t)))},cF=(e,t)=>Wm(e).orThunk((()=>t().toOptional().bind((e=>Wm(e.element))))),dF=(e,t,o)=>{e.inline||(t.header.isPositionedAtTop()||e.on("ResizeEditor",(()=>{o().each(Jz.reset)})),e.on("ResizeWindow ResizeEditor",(()=>{o().each(sF)})),e.on("SkinLoaded",(()=>{o().each((e=>{Jz.isDocked(e)?Jz.reset(e):Jz.refresh(e)}))})),e.on("FullscreenStateChanged",(()=>{o().each(Jz.reset)}))),e.on("AfterScrollIntoView",(e=>{o().each((t=>{Jz.refresh(t);const o=t.element;gy(o)&&nF(e,o)}))})),e.on("PostRender",(()=>{iF(e,!1)}))},mF=e=>e().map(Jz.isDocked).getOr(!1),uF=()=>[zm.config({channels:{[Qz()]:{onReceive:sF}}})],gF=(e,t)=>{const o=xu(),n=t.getSink,r=e=>{n().each((t=>e(t.element)))},s=t=>{e.inline||sF(t),iF(e,Jz.isDocked(t)),t.getSystem().broadcastOn([Bp()],{}),n().each((e=>e.getSystem().broadcastOn([Bp()],{})))},a=e.inline?[]:uF();return[fx.config({}),Jz.config({contextual:{lazyContext:t=>{const o=So(t.element),n=e.inline?e.getContentAreaContainer():e.getContainer(),r=tr(Qe.fromDom(n)),s=r.height-o,a=r.y+(rF(t,"top")?0:o);return R.some(er(r.x,a,r.width,s))},onShow:()=>{r((e=>aF(e,!0)))},onShown:e=>{r((e=>fc(e,[eF.transitionClass,eF.fadeInClass]))),o.get().each((t=>{lF(e.element,t),o.clear()}))},onHide:e=>{cF(e.element,n).fold(o.clear,o.set),r((e=>aF(e,!1)))},onHidden:()=>{r((e=>fc(e,[eF.transitionClass])))},...eF},lazyViewport:t=>{const o=nr(),n=kS(e),r=o.y+(rF(t,"top")?n:0),s=o.height-(rF(t,"bottom")?n:0);return er(o.x,r,o.width,s)},modes:[t.header.getDockingMode()],onDocked:s,onUndocked:s}),...a]};var hF=Object.freeze({__proto__:null,setup:dF,isDocked:mF,getBehaviours:gF});const pF=e=>{const t=e.editor,o=e.sticky?gF:vz;return{uid:e.uid,dom:e.dom,components:e.components,behaviours:Rm(o(t,e.sharedBackstage))}},fF=rs([u_,Bs("items",as([cs([g_,Us("items",gs)]),gs]))].concat(W_)),bF=e=>ks("GroupToolbarButton",fF,e),vF=[qs("text"),qs("tooltip"),qs("icon"),ea("search",!1,as([hs,rs([qs("placeholder")])],(e=>u(e)?e?R.some({placeholder:R.none()}):R.none():R.some(e)))),zs("fetch"),sa("onSetup",(()=>y))],yF=rs([u_,...vF]),wF=e=>ks("menubutton",yF,e),xF=rs([u_,T_,O_,__,A_,y_,S_,na("presets","normal",["normal","color","listpreview"]),L_(1),x_,C_]),CF=e=>ks("SplitButton",xF,e),SF=(e,t)=>{const o=(e,o)=>{const n=U(o,(e=>{const o={type:"menubutton",text:e.text,fetch:t=>{t(e.getItems())}},n=wF(o).mapError((e=>Ts(e))).getOrDie();return NH(n,"tox-mbtn",t.backstage,R.some("menuitem"))}));sx.set(e,n)},n={focus:$w.focusIn,setMenus:o};return{uid:e.uid,dom:e.dom,components:[],behaviours:Rm([sx.config({}),ix("menubar-events",[qi((t=>{e.onSetup(t)})),Ii(Va(),((e,t)=>{nd(e.element,".tox-mbtn--active").each((o=>{rd(t.event.target,".tox-mbtn").each((t=>{_t(o,t)||e.getSystem().getByDom(o).each((o=>{e.getSystem().getByDom(t).each((e=>{QD.expand(e),QD.close(o),fx.focus(e)}))}))}))}))})),Ii(wi(),((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=>{QD.isOpen(o)&&(QD.expand(e),QD.close(o))}))}))}))]),$w.config({mode:"flow",selector:".tox-mbtn",onEscape:t=>(e.onEscape(t),R.some(!0))}),JA.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}};var kF=Tb({factory:SF,name:"silver.Menubar",configFields:[Rs("dom"),Rs("uid"),Rs("onEscape"),Rs("backstage"),Qs("onSetup",y)],apis:{focus:(e,t)=>{e.focus(t)},setMenus:(e,t,o)=>{e.setMenus(t,o)}}});const _F="⚡Upgrade",OF="https://www.tiny.cloud/tinymce-self-hosted-premium-features/?utm_source=TinyMCE&utm_medium=SPAP&utm_campaign=SPAP&utm_id=editorreferral",TF=e=>({uid:e.uid,dom:e.dom,components:[{dom:{tag:"a",attributes:{href:OF,rel:"noopener",target:"_blank","aria-hidden":"true"},classes:["tox-promotion-link"],innerHtml:_F}}]}),EF=(e,t)=>t.getAnimationRoot.fold((()=>e.element),(t=>t(e))),DF=e=>e.dimension.property,AF=(e,t)=>e.dimension.getDimension(t),MF=(e,t)=>{const o=EF(e,t);fc(o,[t.shrinkingClass,t.growingClass])},NF=(e,t)=>{gc(e.element,t.openClass),mc(e.element,t.closedClass),co(e.element,DF(t),"0px"),yo(e.element)},RF=(e,t)=>{gc(e.element,t.closedClass),mc(e.element,t.openClass),vo(e.element,DF(t))},BF=(e,t,o,n)=>{o.setCollapsed(),co(e.element,DF(t),AF(t,e.element)),MF(e,t),NF(e,t),t.onStartShrink(e),t.onShrunk(e)},LF=(e,t,o,n)=>{const r=n.getOrThunk((()=>AF(t,e.element)));o.setCollapsed(),co(e.element,DF(t),r),yo(e.element);const s=EF(e,t);gc(s,t.growingClass),mc(s,t.shrinkingClass),NF(e,t),t.onStartShrink(e)},HF=(e,t,o)=>{const n=AF(t,e.element),r="0px"===n?BF:LF;r(e,t,o,R.some(n))},IF=(e,t,o)=>{const n=EF(e,t),r=hc(n,t.shrinkingClass),s=AF(t,e.element);RF(e,t);const a=AF(t,e.element),i=()=>{co(e.element,DF(t),s),yo(e.element)},l=()=>{NF(e,t)},c=r?i:l;c(),gc(n,t.shrinkingClass),mc(n,t.growingClass),RF(e,t),co(e.element,DF(t),a),o.setExpanded(),t.onStartGrow(e)},PF=(e,t,o)=>{if(o.isExpanded()){vo(e.element,DF(t));const o=AF(t,e.element);co(e.element,DF(t),o)}},zF=(e,t,o)=>{o.isExpanded()||IF(e,t,o)},FF=(e,t,o)=>{o.isExpanded()&&HF(e,t,o)},VF=(e,t,o)=>{o.isExpanded()&&BF(e,t,o)},ZF=(e,t,o)=>o.isExpanded(),UF=(e,t,o)=>o.isCollapsed(),jF=(e,t,o)=>{const n=EF(e,t);return!0===hc(n,t.growingClass)},$F=(e,t,o)=>{const n=EF(e,t);return!0===hc(n,t.shrinkingClass)},WF=(e,t,o)=>jF(e,t)||$F(e,t),qF=(e,t,o)=>{const n=o.isExpanded()?HF:IF;n(e,t,o)},GF=(e,t,o)=>{o.isExpanded()||(RF(e,t),co(e.element,DF(t),AF(t,e.element)),MF(e,t),o.setExpanded(),t.onStartGrow(e),t.onGrown(e))};var KF=Object.freeze({__proto__:null,refresh:PF,grow:zF,shrink:FF,immediateShrink:VF,hasGrown:ZF,hasShrunk:UF,isGrowing:jF,isShrinking:$F,isTransitioning:WF,toggleGrow:qF,disableTransitions:MF,immediateGrow:GF});const YF=(e,t,o)=>{const n=t.expanded;return Hl(n?{classes:[t.openClass],styles:{}}:{classes:[t.closedClass],styles:ba(t.dimension.property,"0px")})},XF=(e,t)=>Ri([Wi(Ya(),((o,n)=>{const r=n.event.raw;if(r.propertyName===e.dimension.property){MF(o,e),t.isExpanded()&&vo(o.element,e.dimension.property);const n=t.isExpanded()?e.onGrown:e.onShrunk;n(o)}}))]);var JF=Object.freeze({__proto__:null,exhibit:YF,events:XF}),QF=[Rs("closedClass"),Rs("openClass"),Rs("shrinkingClass"),Rs("growingClass"),js("getAnimationRoot"),Ed("onShrunk"),Ed("onStartShrink"),Ed("onGrown"),Ed("onStartGrow"),Qs("expanded",!1),Bs("dimension",Es("property",{width:[Nd("property","width"),Nd("getDimension",(e=>Ro(e)+"px"))],height:[Nd("property","height"),Nd("getDimension",(e=>Co(e)+"px"))]}))];const eV=e=>{const t=ca(e.expanded),o=()=>"expanded: "+t.get();return Ml({isExpanded:()=>!0===t.get(),isCollapsed:()=>!1===t.get(),setCollapsed:O(t.set,!1),setExpanded:O(t.set,!0),readState:o})};var tV=Object.freeze({__proto__:null,init:eV});const oV=Lm({fields:QF,name:"sliding",active:JF,apis:KF,state:tV}),nV="container",rV=[ff("slotBehaviours",[])],sV=e=>"<alloy.field."+e+">",aV=e=>{const t=(()=>{const e=[],t=(t,o)=>(e.push(t),rb(nV,sV(t),o));return{slot:t,record:S(e)}})(),o=e(t),n=t.record(),r=U(n,(e=>Gf({name:e,pname:sV(e)})));return xb(nV,rV,r,iV,o)},iV=(e,t)=>{const o=t=>gb(e),n=(t,o)=>cb(t,e,o),r=(t,o)=>(n,r)=>cb(n,e,r).map((e=>t(e,r))).getOr(o),s=e=>(t,o)=>{j(o,(o=>e(t,o)))},a=(e,t)=>"true"!==oo(e.element,"aria-hidden"),i=(e,t)=>{if(!a(e)){const o=e.element;vo(o,"display"),so(o,"aria-hidden"),Ti(e,xi(),{name:t,visible:!0})}},l=(e,t)=>{if(a(e)){const o=e.element;co(o,"display","none"),eo(o,"aria-hidden","true"),Ti(e,xi(),{name:t,visible:!1})}},c=r(a,!1),d=r(l),m=s(d),u=e=>m(e,o()),g=r(i),h={getSlotNames:o,getSlot:n,isShowing:c,hideSlot:d,hideAllSlots:u,showSlot:g};return{uid:e.uid,dom:e.dom,components:t,behaviours:bf(e.slotBehaviours),apis:h}},lV=pe({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=>Dl(e))),cV={...lV,sketch:aV},dV=rs([O_,T_,sa("onShow",y),sa("onHide",y),S_]),mV=e=>ks("sidebar",dV,e),uV=e=>{const{sidebars:t}=e.ui.registry.getAll();j(ue(t),(o=>{const n=t[o],r=()=>Te(R.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)}}})}))},gV=e=>({element:()=>e.element.dom}),hV=(e,t)=>{const o=U(ue(t),(e=>{const o=t[e],n=_s(mV(o));return{name:e,getApi:gV,onSetup:n.onSetup,onShow:n.onShow,onHide:n.onHide}}));return U(o,(t=>{const n=ca(y);return e.slot(t.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:RO.unnamedEvents([rT(t,n),sT(t,n),Ii(xi(),((e,t)=>{const n=t.event,r=X(o,(e=>e.name===n.name));r.each((t=>{const o=n.visible?t.onShow:t.onHide;o(t.getApi(e))}))}))])})}))},pV=e=>cV.sketch((t=>({dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:hV(t,e),slotBehaviours:RO.unnamedEvents([qi((e=>cV.hideAllSlots(e)))])}))),fV=(e,t,o)=>{const n=Rb.getCurrent(e);n.each((e=>{sx.set(e,[pV(t)]);const n=null===o||void 0===o?void 0:o.toLowerCase();i(n)&&_e(t,n)&&Rb.getCurrent(e).each((t=>{cV.showSlot(t,n),oV.immediateGrow(e),vo(e.element,"width")}))}))},bV=(e,t)=>{const o=Rb.getCurrent(e);o.each((e=>{const o=Rb.getCurrent(e);o.each((o=>{oV.hasGrown(e)?cV.isShowing(o,t)?oV.shrink(e):(cV.hideAllSlots(o),cV.showSlot(o,t)):(cV.hideAllSlots(o),cV.showSlot(o,t),oV.grow(e))}))}))},vV=e=>{const t=Rb.getCurrent(e);return t.bind((e=>{const t=oV.isGrowing(e)||oV.hasGrown(e);if(t){const t=Rb.getCurrent(e);return t.bind((e=>X(cV.getSlotNames(e),(t=>cV.isShowing(e,t)))))}return R.none()}))},yV=cl("FixSizeEvent"),wV=cl("AutoSizeEvent"),xV=e=>({uid:e.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:Rm([JA.config({}),fx.config({}),oV.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=>{const t=Rb.getCurrent(e);t.each(cV.hideAllSlots),Oi(e,wV)},onGrown:e=>{Oi(e,wV)},onStartGrow:e=>{Ti(e,yV,{width:po(e.element,"width").getOr("")})},onStartShrink:e=>{Ti(e,yV,{width:Ro(e.element)+"px"})}}),sx.config({}),Rb.config({find:e=>{const t=sx.contents(e);return le(t)}})])}],behaviours:Rm([AB.childAt(0),ix("sidebar-sliding-events",[Ii(yV,((e,t)=>{co(e.element,"width",t.event.width)})),Ii(wV,((e,t)=>{vo(e.element,"width")}))])])}),CV=(e,t,o,n)=>{eo(e.element,"aria-busy",!0);const r=t.getRoot(e).getOr(e),s=Rm([$w.config({mode:"special",onTab:()=>R.some(!0),onShiftTab:()=>R.some(!0)}),fx.config({})]),a=n(r,s),i=r.getSystem().build(a);sx.append(r,Gc(i)),i.hasConfigured($w)&&t.focus&&$w.focusIn(i),o.isBlocked()||t.onBlock(e),o.blockWith((()=>sx.remove(r,i)))},SV=(e,t,o)=>{so(e.element,"aria-busy"),o.isBlocked()&&t.onUnblock(e),o.clear()};var kV=Object.freeze({__proto__:null,block:CV,unblock:SV}),_V=[sa("getRoot",R.none),ra("focus",!0),Ed("onBlock"),Ed("onUnblock")];const OV=()=>{const e=yu(),t=t=>{e.set({destroy:t})};return Ml({readState:e.isSet,blockWith:t,clear:e.clear,isBlocked:e.isSet})};var TV=Object.freeze({__proto__:null,init:OV});const EV=Lm({fields:_V,name:"blocking",apis:kV,state:TV}),DV=e=>{const t=void 0!==e.dom.attributes?e.dom.attributes:[];return K(t,((e,t)=>"class"===t.name?e:{...e,[t.name]:t.value}),{})},AV=e=>Array.prototype.slice.call(e.dom.classList,0),MV=e=>{const t=Qe.fromHtml(e),o=Lt(t),n=DV(t),r=AV(t),s=0===o.length?{}:{innerHtml:Ji(t)};return{tag:ut(t),classes:r,attributes:n,...s}},NV=e=>(t,o)=>({dom:{tag:"div",attributes:{"aria-label":e.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:MV('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}),RV=e=>Rb.getCurrent(e).each((e=>Zm(e.element))),BV=(e,t)=>{const o="tabindex",n=`data-mce-${o}`;R.from(e.iframeElement).map(Qe.fromDom).each((e=>{t?(no(e,o).each((t=>eo(e,n,t))),eo(e,o,-1)):(so(e,o),no(e,n).each((t=>{eo(e,o,t),so(e,n)})))}))},LV=(e,t,o,n)=>{const r=t.element;if(BV(e,o),o)EV.block(t,NV(n)),vo(r,"display"),so(r,"aria-hidden"),e.hasFocus()&&RV(t);else{const o=Rb.getCurrent(t).exists((e=>jm(e.element)));EV.unblock(t),co(r,"display","none"),eo(r,"aria-hidden","true"),o&&e.focus()}},HV=e=>({uid:e.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:Rm([sx.config({}),EV.config({focus:!1}),Rb.config({find:e=>le(e.components())})]),components:[]}),IV=e=>"focusin"===e.type,PV=e=>{if(IV(e)){const t=e.composed?le(e.composedPath()):R.from(e.target);return t.map(Qe.fromDom).filter(ft).exists((e=>hc(e,"mce-pastebin")))}return!1},zV=(e,t,o)=>{const n=ca(!1),r=xu(),s=o=>{n.get()&&!PV(o)&&(o.preventDefault(),RV(t()),e.editorManager.setActive(e))};e.inline||e.on("PreInit",(()=>{e.dom.bind(e.getWin(),"focusin",s),e.on("BeforeExecCommand",(e=>{"mcefocus"===e.command.toLowerCase()&&!0!==e.value&&s(e)}))}));const a=r=>{r!==n.get()&&(n.set(r),LV(e,t(),r,o.providers),cE(e,r))};e.on("ProgressState",(t=>{if(r.on(clearTimeout),b(t.time)){const o=MC.setEditorTimeout(e,(()=>a(t.state)),t.time);r.set(o)}else a(t.state),r.clear()}))},FV=(e,t)=>{const o={len:0,list:[]},n=K(e,((e,o)=>{const n=t(o,e.len);return n.fold(S(e),(t=>({len:t.finish,list:e.list.concat([t])})))}),o);return n.list},VV=(e,t,o)=>({within:e,extra:t,withinWidth:o}),ZV=(e,t,o)=>{const n=FV(e,((e,t)=>{const n=o(e);return R.some({element:e,start:t,finish:t+n,width:n})})),r=q(n,(e=>e.finish<=t)),s=G(r,((e,t)=>e+t.width),0),a=n.slice(r.length);return{within:r,extra:a,withinWidth:s}},UV=e=>U(e,(e=>e.element)),jV=(e,t,o)=>{const n=UV(e.concat(t));return VV(n,[],o)},$V=(e,t,o,n)=>{const r=UV(e).concat([o]);return VV(r,UV(t),n)},WV=(e,t,o)=>VV(UV(e),[],o),qV=(e,t,o)=>{const n=ZV(t,e,o);return 0===n.extra.length?R.some(n):R.none()},GV=(e,t,o,n)=>{const r=qV(e,t,o).getOrThunk((()=>ZV(t,e-o(n),o))),s=r.within,a=r.extra,i=r.withinWidth;return 1===a.length&&a[0].width<=o(n)?jV(s,a,i):a.length>=1?$V(s,a,n,i):WV(s,a,i)},KV=(e,t)=>{const o=U(t,(e=>Gc(e)));pz.setGroups(e,o)},YV=e=>me(e,(e=>Wm(e.element).bind((t=>e.getSystem().getByDom(t).toOptional())))),XV=(e,t,o)=>{const n=t.builtGroups.get();if(0===n.length)return;const r=db(e,t,"primary"),s=TD.getCoupled(e,"overflowGroup");co(r.element,"visibility","hidden");const a=n.concat([s]),i=YV(a);o([]),KV(r,a);const l=Ro(r.element),c=GV(l,t.builtGroups.get(),(e=>Ro(e.element)),s);0===c.extra.length?(sx.remove(r,s),o([])):(KV(r,c.within),o(c.extra)),vo(r.element,"visibility"),yo(r.element),i.each(fx.focus)},JV=S([ff("splitToolbarBehaviours",[TD]),Ms("builtGroups",(()=>ca([])))]),QV=S([Od(["overflowToggledClass"]),Ks("getOverflowBounds"),Rs("lazySink"),Ms("overflowGroups",(()=>ca([]))),Ed("onOpened"),Ed("onClosed")].concat(JV())),eZ=S([Gf({factory:pz,schema:mz(),name:"primary"}),Kf({schema:mz(),name:"overflow"}),Kf({name:"overflow-button"}),Kf({name:"overflow-group"})]),tZ=S(((e,t)=>{Lo(e,Math.floor(t))})),oZ=S([Od(["toggledClass"]),Rs("lazySink"),zs("fetch"),Ks("getBounds"),Xs("fireDismissalEventInstead",[Qs("event",vi())]),ng(),Ed("onToggled")]),nZ=S([Kf({name:"button",overrides:e=>({dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:Rm([Lx.config({toggleClass:e.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1,onToggled:e.onToggled})])})}),Kf({factory:pz,schema:mz(),name:"toolbar",overrides:e=>({toolbarBehaviours:Rm([$w.config({mode:"cyclic",onEscape:t=>(cb(t,e,"button").each(fx.focus),R.none())})])})})]),rZ=(e,t)=>{const o=TD.getCoupled(e,"toolbarSandbox");Np.isOpen(o)?Np.close(o):Np.open(o,t.toolbar())},sZ=(e,t,o,n)=>{const r=o.getBounds.map((e=>e())),s=o.lazySink(e).getOrDie();Gh.positionWithinBounds(s,t,{anchor:{type:"hotspot",hotspot:e,layouts:n,overrides:{maxWidthFunction:tZ()}}},r)},aZ=(e,t,o,n,r)=>{pz.setGroups(t,r),sZ(e,t,o,n),Lx.on(e)},iZ=(e,t,o)=>{const n=id(),r=(r,s)=>{o.fetch().get((r=>{aZ(e,s,o,t.layouts,r),n.link(e.element),$w.focusIn(s)}))},s=()=>{Lx.off(e),fx.focus(e),n.unlink(e.element)};return{dom:{tag:"div",attributes:{id:n.id}},behaviours:Rm([$w.config({mode:"special",onEscape:e=>(Np.close(e),R.some(!0))}),Np.config({onOpen:r,onClose:s,isPartOf:(t,o,n)=>cd(o,n)||cd(e,n),getAttachPoint:()=>o.lazySink(e).getOrDie()}),zm.config({channels:{...Ip({isExtraPart:A,...o.fireDismissalEventInstead.map((e=>({fireEventInstead:{event:e.event}}))).getOr({})}),...zp({doReposition:()=>{Np.getState(TD.getCoupled(e,"toolbarSandbox")).each((n=>{sZ(e,n,o,t.layouts)}))}})}})])}},lZ=(e,t,o,n)=>({...RC.sketch({...n.button(),action:e=>{rZ(e,n)},buttonBehaviours:yf.augment({dump:n.button().buttonBehaviours},[TD.config({others:{toolbarSandbox:t=>iZ(t,o,e)}})])}),apis:{setGroups:(t,n)=>{Np.getState(TD.getCoupled(t,"toolbarSandbox")).each((r=>{aZ(t,r,e,o.layouts,n)}))},reposition:t=>{Np.getState(TD.getCoupled(t,"toolbarSandbox")).each((n=>{sZ(t,n,e,o.layouts)}))},toggle:e=>{rZ(e,n)},getToolbar:e=>Np.getState(TD.getCoupled(e,"toolbarSandbox")),isOpen:e=>Np.isOpen(TD.getCoupled(e,"toolbarSandbox"))}}),cZ=Eb({name:"FloatingToolbarButton",factory:lZ,configFields:oZ(),partFields:nZ(),apis:{setGroups:(e,t,o)=>{e.setGroups(t,o)},reposition:(e,t)=>{e.reposition(t)},toggle:(e,t)=>{e.toggle(t)},getToolbar:(e,t)=>e.getToolbar(t),isOpen:(e,t)=>e.isOpen(t)}}),dZ=S([Rs("items"),Od(["itemSelector"]),ff("tgroupBehaviours",[$w])]),mZ=S([Xf({name:"items",unit:"item"})]),uZ=(e,t,o,n)=>({uid:e.uid,dom:e.dom,components:t,behaviours:vf(e.tgroupBehaviours,[$w.config({mode:"flow",selector:e.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}),gZ=Eb({name:"ToolbarGroup",configFields:dZ(),partFields:mZ(),factory:uZ}),hZ=e=>U(e,(e=>Gc(e))),pZ=(e,t,o)=>{XV(e,o,(n=>{o.overflowGroups.set(n),t.getOpt(e).each((e=>{cZ.setGroups(e,hZ(n))}))}))},fZ=(e,t,o,n)=>{const r=BC(cZ.sketch({fetch:()=>LD.nu((t=>{t(hZ(e.overflowGroups.get()))})),layouts:{onLtr:()=>[cm,lm],onRtl:()=>[lm,cm],onBottomLtr:()=>[mm,dm],onBottomRtl:()=>[dm,mm]},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:vf(e.splitToolbarBehaviours,[TD.config({others:{overflowGroup:()=>gZ.sketch({...n["overflow-group"](),items:[r.asSpec()]})}})]),apis:{setGroups:(t,o)=>{e.builtGroups.set(U(o,t.getSystem().build)),pZ(t,r,e)},refresh:t=>pZ(t,r,e),toggle:e=>{r.getOpt(e).each((e=>{cZ.toggle(e)}))},isOpen:e=>r.getOpt(e).map(cZ.isOpen).getOr(!1),reposition:e=>{r.getOpt(e).each((e=>{cZ.reposition(e)}))},getOverflow:e=>r.getOpt(e).bind(cZ.getToolbar)},domModification:{attributes:{role:"group"}}}},bZ=Eb({name:"SplitFloatingToolbar",configFields:QV(),partFields:eZ(),factory:fZ,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)},isOpen:(e,t)=>e.isOpen(t),getOverflow:(e,t)=>e.getOverflow(t)}}),vZ=S([Od(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),Ed("onOpened"),Ed("onClosed")].concat(JV())),yZ=S([Gf({factory:pz,schema:mz(),name:"primary"}),Gf({factory:pz,schema:mz(),name:"overflow",overrides:e=>({toolbarBehaviours:Rm([oV.config({dimension:{property:"height"},closedClass:e.markers.closedClass,openClass:e.markers.openClass,shrinkingClass:e.markers.shrinkingClass,growingClass:e.markers.growingClass,onShrunk:t=>{cb(t,e,"overflow-button").each((e=>{Lx.off(e),fx.focus(e)})),e.onClosed(t)},onGrown:t=>{$w.focusIn(t),e.onOpened(t)},onStartGrow:t=>{cb(t,e,"overflow-button").each(Lx.on)}}),$w.config({mode:"acyclic",onEscape:t=>(cb(t,e,"overflow-button").each(fx.focus),R.some(!0))})])})}),Kf({name:"overflow-button",overrides:e=>({buttonBehaviours:Rm([Lx.config({toggleClass:e.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])})}),Kf({name:"overflow-group"})]),wZ=(e,t)=>cb(e,t,"overflow").map(oV.hasGrown).getOr(!1),xZ=(e,t)=>{cb(e,t,"overflow-button").bind((()=>cb(e,t,"overflow"))).each((o=>{CZ(e,t),oV.toggleGrow(o)}))},CZ=(e,t)=>{cb(e,t,"overflow").each((o=>{XV(e,t,(e=>{const t=U(e,(e=>Gc(e)));pz.setGroups(o,t)})),cb(e,t,"overflow-button").each((e=>{oV.hasGrown(o)&&Lx.on(e)})),oV.refresh(o)}))},SZ=(e,t,o,n)=>{const r="alloy.toolbar.toggle",s=(t,o)=>{const n=U(o,t.getSystem().build);e.builtGroups.set(n)};return{uid:e.uid,dom:e.dom,components:t,behaviours:vf(e.splitToolbarBehaviours,[TD.config({others:{overflowGroup:e=>gZ.sketch({...n["overflow-group"](),items:[RC.sketch({...n["overflow-button"](),action:t=>{Oi(e,r)}})]})}}),ix("toolbar-toggle-events",[Ii(r,(t=>{xZ(t,e)}))])]),apis:{setGroups:(t,o)=>{s(t,o),CZ(t,e)},refresh:t=>CZ(t,e),toggle:t=>xZ(t,e),isOpen:t=>wZ(t,e)},domModification:{attributes:{role:"group"}}}},kZ=Eb({name:"SplitSlidingToolbar",configFields:vZ(),partFields:yZ(),factory:SZ,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)}}),_Z=e=>{const t=e.title.fold((()=>({})),(e=>({attributes:{title:e}})));return{dom:{tag:"div",classes:["tox-toolbar__group"],...t},components:[gZ.parts.items({})],items:e.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:Rm([JA.config({}),fx.config({})])}},OZ=e=>gZ.sketch(_Z(e)),TZ=(e,t)=>{const o=qi((t=>{const o=U(e.initGroups,OZ);pz.setGroups(t,o)}));return Rm([oT.toolbarButton(e.providers.isDisabled),XO(),$w.config({mode:t,onEscape:e.onEscape,selector:".tox-toolbar__group"}),ix("toolbar-events",[o])])},EZ=e=>{const t=e.cyclicKeying?"cyclic":"acyclic";return{uid:e.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":_Z({title:R.none(),items:[]}),"overflow-button":LH({name:"more",icon:R.some("more-drawer"),enabled:!0,tooltip:R.some("More..."),primary:!1,buttonType:R.none(),borderless:!1},R.none(),e.providers)},splitToolbarBehaviours:TZ(e,t)}},DZ=e=>{const t=EZ(e),o=4,n=bZ.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return bZ.sketch({...t,lazySink:e.getSink,getOverflowBounds:()=>{const t=e.moreDrawerData.lazyHeader().element,n=or(t),r=Dt(t),s=or(r),a=Math.max(r.dom.scrollHeight,s.height);return er(n.x+o,s.y,n.width-2*o,a)},parts:{...t.parts,overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:e.attributes}}},components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"},onOpened:t=>e.onToggled(t,!0),onClosed:t=>e.onToggled(t,!1)})},AZ=e=>{const t=kZ.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),o=kZ.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),n=EZ(e);return kZ.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([Qz()],{type:"opened"}),e.onToggled(t,!0)},onClosed:t=>{t.getSystem().broadcastOn([Qz()],{type:"closed"}),e.onToggled(t,!1)}})},MZ=e=>{const t=e.cyclicKeying?"cyclic":"acyclic";return pz.sketch({uid:e.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(e.type===XC.scrolling?["tox-toolbar--scrolling"]:[])},components:[pz.parts.groups({})],toolbarBehaviours:TZ(e,t)})},NZ=[Is("type",["button"]),p_,na("buttonType","secondary",["primary","secondary"]),zs("onAction")],RZ=Es("type",{button:NZ}),BZ=rs([ia("buttons",[],RZ),zs("onShow"),zs("onHide")]),LZ=e=>ks("view",BZ,e),HZ=(e,t)=>PH({text:e.text,enabled:!0,primary:!1,name:"name",icon:R.none(),borderless:!1,buttonType:R.some(e.buttonType)},(t=>{e.onAction()}),t),IZ=e=>{const t=U(e.buttons,(t=>HZ(t,e.providers)));return{uid:e.uid,dom:{tag:"div",classes:["tox-view__header"]},components:[ZA.sketch({dom:{tag:"div",classes:["tox-view__header-start"]},components:[]}),ZA.sketch({dom:{tag:"div",classes:["tox-view__header-end"]},components:t})]}},PZ=e=>({uid:e.uid,dom:{tag:"div",classes:["tox-view__pane"]}}),zZ=(e,t,o,n)=>{const r={getPane:t=>oz.getPart(t,e,"pane"),getOnShow:t=>e.viewConfig.onShow,getOnHide:t=>e.viewConfig.onHide};return{uid:e.uid,dom:e.dom,components:t,apis:r}};var FZ=Eb({name:"silver.View",configFields:[Rs("viewConfig")],partFields:[Yf({factory:{sketch:IZ},schema:[Rs("buttons"),Rs("providers")],name:"header"}),Yf({factory:{sketch:PZ},schema:[],name:"pane"})],factory:zZ,apis:{getPane:(e,t)=>e.getPane(t),getOnShow:(e,t)=>e.getOnShow(t),getOnHide:(e,t)=>e.getOnHide(t)}});const VZ=(e,t,o)=>xe(t,((t,n)=>{const r=_s(LZ(t));return e.slot(n,FZ.sketch({dom:{tag:"div",classes:["tox-view"]},viewConfig:r,components:[...r.buttons.length>0?[FZ.parts.header({buttons:r.buttons,providers:o})]:[],FZ.parts.pane({})]}))})),ZZ=(e,t)=>cV.sketch((o=>({dom:{tag:"div",classes:["tox-view-wrap__slot-container"]},components:VZ(o,e,t),slotBehaviours:RO.unnamedEvents([qi((e=>cV.hideAllSlots(e)))])}))),UZ=e=>X(cV.getSlotNames(e),(t=>cV.isShowing(e,t))),jZ=e=>{const t=e.element;co(t,"display","none"),eo(t,"aria-hidden","true")},$Z=e=>{const t=e.element;vo(t,"display"),so(t,"aria-hidden")},WZ=e=>({getContainer:S(e)}),qZ=(e,t,o)=>{cV.getSlot(e,t).each((e=>{FZ.getPane(e).each((t=>{const n=o(e);n(WZ(t.element.dom))}))}))},GZ=(e,t)=>qZ(e,t,FZ.getOnShow),KZ=(e,t)=>qZ(e,t,FZ.getOnHide),YZ=(e,t)=>{const o=(e,o)=>{sx.set(e,[ZZ(o,t.backstage.shared.providers)])},n=e=>Rb.getCurrent(e).bind(UZ),r=(e,t,o,n)=>Rb.getCurrent(e).exists((r=>{const s=UZ(r),a=s.exists((e=>n===e)),i=cV.getSlot(r,n).isSome();return i&&(cV.hideAllSlots(r),a?(jZ(e),t()):(o(),$Z(e),cV.showSlot(r,n),GZ(r,n)),s.each((e=>KZ(r,e)))),i})),s={setViews:o,whichView:n,toggleView:r};return{uid:e.uid,dom:{tag:"div",classes:["tox-view-wrap"],attributes:{"aria-hidden":"true"},styles:{display:"none"}},components:[],behaviours:Rm([sx.config({}),Rb.config({find:e=>{const t=sx.contents(e);return le(t)}})]),apis:s}};var XZ=Tb({factory:YZ,name:"silver.ViewWrapper",configFields:[Rs("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 JZ=(e,t,o)=>{let n=!1;const r={getSocket:t=>oz.getPart(t,e,"socket"),setSidebar:(t,o,n)=>{oz.getPart(t,e,"sidebar").each((e=>fV(e,o,n)))},toggleSidebar:(t,o)=>{oz.getPart(t,e,"sidebar").each((e=>bV(e,o)))},whichSidebar:t=>oz.getPart(t,e,"sidebar").bind(vV).getOrNull(),getHeader:t=>oz.getPart(t,e,"header"),getToolbar:t=>oz.getPart(t,e,"toolbar"),setToolbar:(t,o)=>{oz.getPart(t,e,"toolbar").each((e=>{const t=U(o,OZ);e.getApis().setGroups(e,t)}))},setToolbars:(t,o)=>{oz.getPart(t,e,"multiple-toolbar").each((e=>{const t=U(o,(e=>U(e,OZ)));dz.setItems(e,t)}))},refreshToolbar:t=>{const o=oz.getPart(t,e,"toolbar");o.each((e=>e.getApis().refresh(e)))},toggleToolbarDrawer:t=>{oz.getPart(t,e,"toolbar").each((e=>{Re(e.getApis().toggle,(t=>t(e)))}))},isToolbarDrawerToggled:t=>oz.getPart(t,e,"toolbar").bind((e=>R.from(e.getApis().isOpen).map((t=>t(e))))).getOr(!1),getThrobber:t=>oz.getPart(t,e,"throbber"),focusToolbar:t=>{const o=oz.getPart(t,e,"toolbar").orThunk((()=>oz.getPart(t,e,"multiple-toolbar")));o.each((e=>{$w.focusIn(e)}))},setMenubar:(t,o)=>{oz.getPart(t,e,"menubar").each((e=>{kF.setMenus(e,o)}))},focusMenubar:t=>{oz.getPart(t,e,"menubar").each((e=>{kF.focus(e)}))},setViews:(t,o)=>{oz.getPart(t,e,"viewWrapper").each((e=>{XZ.setViews(e,o)}))},toggleView:(t,o)=>oz.getPart(t,e,"viewWrapper").exists((e=>XZ.toggleView(e,(()=>r.showMainView(t)),(()=>r.hideMainView(t)),o))),whichView:t=>oz.getPart(t,e,"viewWrapper").bind(XZ.whichView).getOrNull(),hideMainView:t=>{n=r.isToolbarDrawerToggled(t),n&&r.toggleToolbarDrawer(t),oz.getPart(t,e,"editorContainer").each((e=>{const t=e.element;co(t,"display","none"),eo(t,"aria-hidden","true")}))},showMainView:t=>{n&&r.toggleToolbarDrawer(t),oz.getPart(t,e,"editorContainer").each((e=>{const t=e.element;vo(t,"display"),so(t,"aria-hidden")}))}};return{uid:e.uid,dom:e.dom,components:t,apis:r,behaviours:e.behaviours}},QZ=nz.optional({factory:kF,name:"menubar",schema:[Rs("backstage")]}),eU=e=>e.type===XC.sliding?AZ:e.type===XC.floating?DZ:MZ,tU=nz.optional({factory:{sketch:e=>dz.sketch({uid:e.uid,dom:e.dom,listBehaviours:Rm([$w.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:()=>MZ({type:e.type,uid:cl("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:e.providers,onEscape:()=>(e.onEscape(),R.some(!0))}),setupItem:(e,t,o,n)=>{pz.setGroups(t,o)},shell:!0})},name:"multiple-toolbar",schema:[Rs("dom"),Rs("onEscape")]}),oU=nz.optional({factory:{sketch:e=>{const t=eU(e),o={type:e.type,uid:e.uid,onEscape:()=>(e.onEscape(),R.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};return t(o)}},name:"toolbar",schema:[Rs("dom"),Rs("onEscape"),Rs("getSink")]}),nU=nz.optional({factory:{sketch:pF},name:"header",schema:[Rs("dom")]}),rU=nz.optional({factory:{sketch:TF},name:"promotion",schema:[Rs("dom")]}),sU=nz.optional({name:"socket",schema:[Rs("dom")]}),aU=nz.optional({factory:{sketch:xV},name:"sidebar",schema:[Rs("dom")]}),iU=nz.optional({factory:{sketch:HV},name:"throbber",schema:[Rs("dom")]}),lU=nz.optional({factory:XZ,name:"viewWrapper",schema:[Rs("backstage")]}),cU=e=>({uid:e.uid,dom:{tag:"div",classes:["tox-editor-container"]},components:e.components}),dU=nz.optional({factory:{sketch:cU},name:"editorContainer",schema:[]});var mU=Eb({name:"OuterContainer",factory:JZ,configFields:[Rs("dom"),Rs("behaviours")],partFields:[nU,QZ,oU,tU,sU,aU,rU,iU,lU,dU],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)},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 uU="file edit view insert format tools table help",gU={file:{title:"File",items:"newdocument restoredraft | preview | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | 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:"spellchecker spellcheckerlanguage | autocorrect capitalization | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},hU=(e,t,o)=>{const n=bS(o).split(/[ ,]/);return{text:e.title,getItems:()=>ee(e.items,(e=>{const o=e.toLowerCase();return 0===o.trim().length||F(n,(e=>e===o))?[]:"separator"===o||"|"===o?[{type:"separator"}]:t.menuItems[o]?[t.menuItems[o]]:[]}))}},pU=e=>e.split(" "),fU=(e,t)=>{const o={...gU,...t.menus},n=ue(t.menus).length>0,r=void 0===t.menubar||!0===t.menubar?pU(uU):pU(!1===t.menubar?"":t.menubar),s=q(r,(e=>{const o=_e(gU,e);return n?o||ke(t.menus,e).exists((e=>_e(e,"items"))):o})),a=U(s,(n=>{const r=o[n];return hU({title:r.title,items:pU(r.items)},t,e)}));return q(a,(e=>{const t=e=>i(e)||"separator"!==e.type;return e.getItems().length>0&&F(e.getItems(),t)}))},bU=e=>{const t=()=>{e._skinLoaded=!0,nE(e)};return()=>{e.initialized?t():e.on("init",t)}},vU=(e,t)=>()=>rE(e,{message:t}),yU=(e,t,o)=>(e.on("remove",(()=>o.unload(t))),o.load(t)),wU=(e,t)=>{const o=t+"/skin.min.css";return yU(e,o,e.ui.styleSheetLoader)},xU=(e,t)=>{const o=$t(Qe.fromDom(e.getElement()));if(o){const o=t+"/skin.shadowdom.min.css";return yU(e,o,eS.DOM.styleSheetLoader)}return Promise.resolve()},CU=(e,t)=>{const o=US(t);o&&t.contentCSS.push(o+(e?"/content.inline":"/content")+".min.css"),!VS(t)&&i(o)?Promise.all([wU(t,o),xU(t,o)]).then(bU(t),vU(t,"Skin could not be loaded")):bU(t)()},SU=O(CU,!1),kU=O(CU,!0),_U=(e,t)=>o=>{const n=wu(),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()}},OU=(e,t,o)=>n=>{const r=()=>o(n),s=()=>{o(n),e.on(t,r)};return e.initialized?s():e.once("init",s),()=>{e.off("init",s),e.off(t,r)}},TU=e=>t=>()=>{e.undoManager.transact((()=>{e.focus(),e.execCommand("mceToggleFormat",!1,t.format)}))},EU=(e,t)=>()=>e.execCommand(t),DU=(e,t,o)=>{const n=(e,n,s,a)=>{const i=t.shared.providers.translate(e.title);if("separator"===e.type)return R.some({type:"separator",text:i});if("submenu"===e.type){const t=ee(e.getStyleItems(),(e=>r(e,n,a)));return 0===n&&t.length<=0?R.none():R.some({type:"nestedmenuitem",text:i,enabled:t.length>0,getSubmenuItems:()=>ee(e.getStyleItems(),(e=>r(e,n,a)))})}return R.some({type:"togglemenuitem",text:i,icon:e.icon,active:e.isSelected(a),enabled:!s,onAction:o.onAction(e),...e.getStylePreview().fold((()=>({})),(e=>({meta:{style:e}})))})},r=(e,t,r)=>{const s="formatter"===e.type&&o.isInvalid(e);return 0===t?s?[]:n(e,t,!1,r).toArray():n(e,t,s,r).toArray()},s=e=>{const t=o.getCurrentValue(),n=o.shouldHide?0:1;return ee(e,(e=>r(e,n,t)))},a=(e,t)=>(o,n)=>{const r=t(),a=s(r),i=DL(a,lk.CLOSE_ON_EXECUTE,e,{isHorizontalMenu:!1,search:R.none()});n(i)};return{validateItems:s,getFetch:a}},AU=(e,t,o)=>{const n=o.dataset,r="basic"===n.type?()=>U(n.data,(e=>lP(e,o.isSelectedFor,o.getPreviewFor))):n.getData;return{items:DU(e,t,o),getStyleItems:r}},MU=(e,t,o)=>{const{items:n,getStyleItems:r}=AU(e,t,o),s=e=>({getComponent:S(e)}),a=OU(e,"NodeChange",(e=>{const t=e.getComponent();o.updateText(t)}));return vL({text:o.icon.isSome()?R.none():o.text,icon:o.icon,tooltip:R.from(o.tooltip),role:R.none(),fetch:n.getFetch(t,r),onSetup:a,getApi:s,columns:1,presets:"normal",classes:o.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",t.shared)},NU=e=>U(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}})),RU=e=>({type:"basic",data:e});var BU;(function(e){e[e["SemiColon"]=0]="SemiColon",e[e["Space"]=1]="Space"})(BU||(BU={}));const LU=(e,t)=>t===BU.SemiColon?e.replace(/;$/,"").split(";"):e.split(" "),HU=(e,t,o)=>{const n=e.options.get(t),r=NU(LU(n,o));return{type:"basic",data:r}},IU=[{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"}],PU=e=>{const t=()=>X(IU,(t=>e.formatter.match(t.format))),o=t=>()=>e.formatter.match(t),n=e=>R.none,r=e=>{const o=t(),n=o.fold(S("left"),(e=>e.title.toLowerCase()));Ti(e,bL,{icon:`align-${n}`})},s=RU(IU),a=t=>()=>X(IU,(e=>e.format===t.format)).each((t=>e.execCommand(t.command)));return{tooltip:"Align",text:R.none(),icon:R.some("align-left"),isSelectedFor:o,getCurrentValue:R.none,getPreviewFor:n,onAction:a,updateText:r,dataset:s,shouldHide:!1,isInvalid:t=>!e.formatter.canApply(t.format)}},zU=(e,t)=>MU(e,t,PU(e)),FU=(e,t)=>{const o=AU(e,t,PU(e));e.ui.registry.addNestedMenuItem("align",{text:t.shared.providers.translate("Align"),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})},VU=(e,t)=>{const o=t(),n=U(o,(e=>e.format));return R.from(e.formatter.closest(n)).bind((e=>X(o,(t=>t.format===e)))).orThunk((()=>Be(e.formatter.match("p"),{title:"Paragraph",format:"p"})))},ZU=e=>{const t="Paragraph",o=t=>()=>e.formatter.match(t),n=t=>()=>{const o=e.formatter.get(t);return o?R.some({tag:o.length>0&&(o[0].inline||o[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))}):R.none()},r=o=>{const n=VU(e,(()=>s.data)),r=n.fold(S(t),(e=>e.title));Ti(o,fL,{text:r})},s=HU(e,"block_formats",BU.SemiColon);return{tooltip:"Blocks",text:R.some(t),icon:R.none(),isSelectedFor:o,getCurrentValue:R.none,getPreviewFor:n,onAction:TU(e),updateText:r,dataset:s,shouldHide:!1,isInvalid:t=>!e.formatter.canApply(t.format)}},UU=(e,t)=>MU(e,t,ZU(e)),jU=(e,t)=>{const o=AU(e,t,ZU(e));e.ui.registry.addNestedMenuItem("blocks",{text:"Blocks",getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})},$U=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],WU=e=>{const t=e.split(/\s*,\s*/);return U(t,(e=>e.replace(/^['"]+|['"]+$/g,"")))},qU=e=>{const t=()=>{const t=WU(e.toLowerCase());return te($U,(e=>t.indexOf(e.toLowerCase())>-1))};return 0===e.indexOf("-apple-system")&&t()},GU=e=>{const t="System Font",o=()=>{const o=e=>e?WU(e)[0]:"",n=e.queryCommandValue("FontName"),r=l.data,s=n?n.toLowerCase():"",a=X(r,(e=>{const t=e.format;return t.toLowerCase()===s||o(t).toLowerCase()===o(s).toLowerCase()})).orThunk((()=>Be(qU(s),{title:t,format:s})));return{matchOpt:a,font:n}},n=e=>t=>t.exists((t=>t.format===e)),r=()=>{const{matchOpt:e}=o();return e},s=e=>()=>R.some({tag:"div",styles:-1===e.indexOf("dings")?{"font-family":e}:{}}),a=t=>()=>{e.undoManager.transact((()=>{e.focus(),e.execCommand("FontName",!1,t.format)}))},i=e=>{const{matchOpt:t,font:n}=o(),r=t.fold(S(n),(e=>e.title));Ti(e,fL,{text:r})},l=HU(e,"font_family_formats",BU.SemiColon);return{tooltip:"Fonts",text:R.some(t),icon:R.none(),isSelectedFor:n,getCurrentValue:r,getPreviewFor:s,onAction:a,updateText:i,dataset:l,shouldHide:!1,isInvalid:A}},KU=(e,t)=>MU(e,t,GU(e)),YU=(e,t)=>{const o=AU(e,t,GU(e));e.ui.registry.addNestedMenuItem("fontfamily",{text:t.shared.providers.translate("Fonts"),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})},XU={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},JU={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},QU=(e,t)=>{const o=Math.pow(10,t);return Math.round(e*o)/o},ej=(e,t)=>/[0-9.]+px$/.test(e)?QU(72*parseInt(e,10)/96,t||0)+"pt":ke(JU,e).getOr(e),tj=e=>ke(XU,e).getOr(""),oj=e=>{const t=()=>{let t=R.none();const o=i.data,n=e.queryCommandValue("FontSize");if(n)for(let e=3;t.isNone()&&e>=0;e--){const r=ej(n,e),s=tj(r);t=X(o,(e=>e.format===n||e.format===r||e.format===s))}return{matchOpt:t,size:n}},o=e=>t=>t.exists((t=>t.format===e)),n=()=>{const{matchOpt:e}=t();return e},r=S(R.none),s=t=>()=>{e.undoManager.transact((()=>{e.focus(),e.execCommand("FontSize",!1,t.format)}))},a=e=>{const{matchOpt:o,size:n}=t(),r=o.fold(S(n),(e=>e.title));Ti(e,fL,{text:r})},i=HU(e,"font_size_formats",BU.Space);return{tooltip:"Font sizes",text:R.some("12pt"),icon:R.none(),isSelectedFor:o,getPreviewFor:r,getCurrentValue:n,onAction:s,updateText:a,dataset:i,shouldHide:!1,isInvalid:A}},nj=(e,t)=>MU(e,t,oj(e)),rj=(e,t)=>{const o=AU(e,t,oj(e));e.ui.registry.addNestedMenuItem("fontsize",{text:"Font sizes",getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})},sj=(e,t)=>{const o="Paragraph",n=t=>()=>e.formatter.match(t),r=t=>()=>{const o=e.formatter.get(t);return void 0!==o?R.some({tag:o.length>0&&(o[0].inline||o[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))}):R.none()},s=t=>{const n=e=>XI(e)?ee(e.items,n):JI(e)?[{title:e.title,format:e.format}]:[],r=ee(aP(e),n),s=VU(e,S(r)),a=s.fold(S(o),(e=>e.title));Ti(t,fL,{text:a})};return{tooltip:"Formats",text:R.some(o),icon:R.none(),isSelectedFor:n,getCurrentValue:R.none,getPreviewFor:r,onAction:TU(e),updateText:s,shouldHide:pS(e),isInvalid:t=>!e.formatter.canApply(t.format),dataset:t}},aj=(e,t)=>{const o={type:"advanced",...t.styles};return MU(e,t,sj(e,o))},ij=(e,t)=>{const o={type:"advanced",...t.styles},n=AU(e,t,sj(e,o));e.ui.registry.addNestedMenuItem("styles",{text:"Formats",getSubmenuItems:()=>n.items.validateItems(n.getStyleItems())})},lj=(e,t)=>{const o=(o,n)=>{e.updateState.each((e=>{const r=e(o,n);t.set(r)})),e.renderComponents.each((r=>{const s=r(n,t.get()),a=e.reuseDom?qw:Ww;a(o,s)}))};return Ri([Ii(ri(),((t,n)=>{const r=n;if(!r.universal){const n=e.channel;z(r.channels,n)&&o(t,r.data)}})),qi(((t,n)=>{e.initialData.each((e=>{o(t,e)}))}))])};var cj=Object.freeze({__proto__:null,events:lj});const dj=(e,t,o)=>o;var mj=Object.freeze({__proto__:null,getState:dj}),uj=[Rs("channel"),js("renderComponents"),js("updateState"),js("initialData"),ra("reuseDom",!0)];const gj=()=>{const e=ca(R.none()),t=()=>e.set(R.none()),o=()=>e.get().getOr("none");return{readState:o,get:e.get,set:e.set,clear:t}};var hj=Object.freeze({__proto__:null,init:gj});const pj=Lm({fields:uj,name:"reflecting",active:cj,apis:mj,state:hj}),fj=S([Rs("toggleClass"),Rs("fetch"),Ad("onExecute"),Qs("getHotspot",R.some),Qs("getAnchorOverrides",S({})),ng(),Ad("onItemExecute"),js("lazySink"),Rs("dom"),Ed("onOpen"),ff("splitDropdownBehaviours",[TD,$w,fx]),Qs("matchWidth",!1),Qs("useMinWidth",!1),Qs("eventOrder",{}),js("role")].concat(KD())),bj=Gf({factory:RC,schema:[Rs("dom")],name:"arrow",defaults:()=>({buttonBehaviours:Rm([fx.revoke()])}),overrides:e=>({dom:{tag:"span",attributes:{role:"presentation"}},action:t=>{t.getSystem().getByUid(e.uid).each(Ei)},buttonBehaviours:Rm([Lx.config({toggleOnExecute:!1,toggleClass:e.toggleClass})])})}),vj=Gf({factory:RC,schema:[Rs("dom")],name:"button",defaults:()=>({buttonBehaviours:Rm([fx.revoke()])}),overrides:e=>({dom:{tag:"span",attributes:{role:"presentation"}},action:t=>{t.getSystem().getByUid(e.uid).each((o=>{e.onExecute(o,t)}))}})}),yj=S([bj,vj,Yf({factory:{sketch:e=>({uid:e.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:e.text}})},schema:[Rs("text")],name:"aria-descriptor"}),Kf({schema:[_d()],name:"menu",defaults:e=>({onExecute:(t,o)=>{t.getSystem().getByUid(e.uid).each((n=>{e.onItemExecute(n,t,o)}))}})}),ID()]),wj=(e,t,o,n)=>{const r=e=>{Rb.getCurrent(e).each((e=>{vv.highlightFirst(e),$w.focusIn(e)}))},s=t=>{const o=r;UD(e,k,t,n,o,xC.HighlightMenuAndItem).get(y)},a=e=>(s(e),R.some(!0)),i=t=>{const o=db(t,e,"button");return Ei(o),R.some(!0)},l={...Ri([qi(((t,o)=>{const n=cb(t,e,"aria-descriptor");n.each((e=>{const o=cl("aria");eo(e.element,"id",o),eo(t.element,"aria-describedby",o)}))}))]),...Ix(R.some(s))},c={repositionMenus:e=>{Lx.isOn(e)&&GD(e)}};return{uid:e.uid,dom:e.dom,components:t,apis:c,eventOrder:{...e.eventOrder,[si()]:["disabling","toggling","alloy.base.behaviour"]},events:l,behaviours:vf(e.splitDropdownBehaviours,[TD.config({others:{sandbox:t=>{const o=db(t,e,"arrow"),n={onOpen:()=>{Lx.on(o),Lx.on(t)},onClose:()=>{Lx.off(o),Lx.off(t)}};return qD(e,t,n)}}}),$w.config({mode:"special",onSpace:i,onEnter:i,onDown:a}),fx.config({}),Lx.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:e.role.getOr("button"),"aria-haspopup":!0}}}},xj=Eb({name:"SplitDropdown",configFields:fj(),partFields:yj(),factory:wj,apis:{repositionMenus:(e,t)=>e.repositionMenus(t)}}),Cj=e=>({isEnabled:()=>!Jb.isDisabled(e),setEnabled:t=>Jb.set(e,!t)}),Sj=e=>({setActive:t=>{Lx.set(e,t)},isActive:()=>Lx.isOn(e),isEnabled:()=>!Jb.isDisabled(e),setEnabled:t=>Jb.set(e,!t)}),kj=(e,t)=>e.map((e=>({"aria-label":t.translate(e),title:t.translate(e)}))).getOr({}),_j=cl("focus-button"),Oj=(e,t,o,n,r,s)=>({dom:{tag:"button",classes:["tox-tbtn"].concat(t.isSome()?["tox-tbtn--select"]:[]),attributes:kj(o,s)},components:lT([e.map((e=>gL(e,s.icons))),t.map((e=>pL(e,"tox-tbtn",s)))]),eventOrder:{[Ia()]:["focusing","alloy.base.behaviour","common-button-display-events"]},buttonBehaviours:Rm([oT.toolbarButton(s.isDisabled),XO(),ix("common-button-display-events",[Ii(Ia(),((e,t)=>{t.event.prevent(),Oi(e,_j)}))])].concat(n.map((o=>pj.config({channel:o,initialData:{icon:e,text:t},renderComponents:(e,t)=>lT([e.icon.map((e=>gL(e,s.icons))),e.text.map((e=>pL(e,"tox-tbtn",s)))])}))).toArray()).concat(r.getOr([])))}),Tj=(e,t,o,n)=>{const r=t.shared;return cZ.sketch({lazySink:r.getSink,fetch:()=>LD.nu((t=>{t(U(o(e.items),OZ))})),markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:Oj(e.icon,e.text,e.tooltip,R.none(),R.none(),r.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:n}}}})},Ej=(e,t,o)=>{const n=ca(y),r=Oj(e.icon,e.text,e.tooltip,R.none(),R.none(),o);return RC.sketch({dom:r.dom,components:r.components,eventOrder:mL,buttonBehaviours:Rm([ix("toolbar-button-events",[dL({onAction:e.onAction,getApi:t.getApi}),rT(t,n),sT(t,n)]),oT.toolbarButton((()=>!e.enabled||o.isDisabled())),XO()].concat(t.toolbarButtonBehaviours))})},Dj=(e,t)=>Aj(e,t,[]),Aj=(e,t,o)=>Ej(e,{toolbarButtonBehaviours:o.length>0?[ix("toolbarButtonWith",o)]:[],getApi:Cj,onSetup:e.onSetup},t),Mj=(e,t)=>Nj(e,t,[]),Nj=(e,t,o)=>Ej(e,{toolbarButtonBehaviours:[sx.config({}),Lx.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(o.length>0?[ix("toolbarToggleButtonWith",o)]:[]),getApi:Sj,onSetup:e.onSetup},t),Rj=(e,t,o)=>n=>LD.nu((e=>t.fetch(e))).map((r=>R.from(gA(Or(GE(cl("menu-value"),r,(o=>{t.onItemAction(e(n),o)}),t.columns,t.presets,lk.CLOSE_ON_EXECUTE,t.select.getOr(A),o),{movement:YE(t.columns,t.presets),menuBehaviours:RO.unnamedEvents("auto"!==t.columns?[]:[qi(((e,o)=>{AO(e,4,Dk(t.presets)).each((({numRows:t,numColumns:o})=>{$w.setGridSize(e,t,o)}))}))])}))))),Bj=(e,t)=>{const o=cl("channel-update-split-dropdown-display"),n=e=>({isEnabled:()=>!Jb.isDisabled(e),setEnabled:t=>Jb.set(e,!t),setIconFill:(t,o)=>{nd(e.element,'svg path[id="'+t+'"], rect[id="'+t+'"]').each((e=>{eo(e,"fill",o)}))},setActive:t=>{eo(e.element,"aria-pressed",t),nd(e.element,"span").each((o=>{e.getSystem().getByDom(o).each((e=>Lx.set(e,t)))}))},isActive:()=>nd(e.element,"span").exists((t=>e.getSystem().getByDom(t).exists(Lx.isOn)))}),r=ca(y),s={getApi:n,onSetup:e.onSetup};return xj.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:{"aria-pressed":!1,...kj(e.tooltip,t.providers)}},onExecute:t=>{e.onAction(n(t))},onItemExecute:(e,t,o)=>{},splitDropdownBehaviours:Rm([oT.splitButton(t.providers.isDisabled),XO(),ix("split-dropdown-events",[Ii(_j,fx.focus),rT(s,r),sT(s,r)]),MM.config({})]),eventOrder:{[fi()]:["alloy.base.behaviour","split-dropdown-events"]},toggleClass:"tox-tbtn--enabled",lazySink:t.getSink,fetch:Rj(n,e,t.providers),parts:{menu:Lk(!1,e.columns,e.presets)},components:[xj.parts.button(Oj(e.icon,e.text,R.none(),R.some(o),R.some([Lx.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),t.providers)),xj.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:VC("chevron-down",t.providers.icons)},buttonBehaviours:Rm([oT.splitButton(t.providers.isDisabled),XO(),jC()])}),xj.parts["aria-descriptor"]({text:t.providers.translate("To open the popup, press Shift+Enter")})]})},Lj=[{name:"history",items:["undo","redo"]},{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"]}],Hj=(e,t)=>(o,n,r)=>{const s=e(o).mapError((e=>Ts(e))).getOrDie();return t(s,n,r)},Ij={button:Hj(G_,((e,t)=>Dj(e,t.shared.providers))),togglebutton:Hj(X_,((e,t)=>Mj(e,t.shared.providers))),menubutton:Hj(wF,((e,t)=>NH(e,"tox-tbtn",t,R.none()))),splitbutton:Hj(CF,((e,t)=>Bj(e,t.shared))),grouptoolbarbutton:Hj(bF,((e,t,o)=>{const n=o.ui.registry.getAll().buttons,r=e=>$j(o,{buttons:n,toolbar:e,allowToolbarGroups:!1},t,R.none()),s={[tg]:t.shared.header.isPositionedAtTop()?eg.TopToBottom:eg.BottomToTop};switch(vS(o)){case XC.floating:return Tj(e,t,r,s);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}}))},Pj=(e,t,o)=>ke(Ij,e.type).fold((()=>(console.error("skipping button defined by",e),R.none())),(n=>R.some(n(e,t,o)))),zj={styles:aj,fontsize:nj,fontfamily:KU,blocks:UU,align:zU},Fj=e=>{const t=U(Lj,(t=>{const o=q(t.items,(t=>_e(e,t)||_e(zj,t)));return{name:t.name,items:o}}));return q(t,(e=>e.items.length>0))},Vj=e=>{const t=e.split("|");return U(t,(e=>({items:e.trim().split(" ")})))},Zj=e=>v(e,(e=>_e(e,"name")&&_e(e,"items"))),Uj=e=>{const t=e.toolbar,o=e.buttons;return!1===t?[]:void 0===t||!0===t?Fj(o):i(t)?Vj(t):Zj(t)?t:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},jj=(e,t,o,n,r,s)=>ke(t,o.toLowerCase()).orThunk((()=>s.bind((e=>me(e,(e=>ke(t,e+o.toLowerCase()))))))).fold((()=>ke(zj,o.toLowerCase()).map((t=>t(e,r)))),(t=>"grouptoolbarbutton"!==t.type||n?Pj(t,r,e):(console.warn(`Ignoring the '${o}' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested.`),R.none()))),$j=(e,t,o,n)=>{const r=Uj(t),s=U(r,(r=>{const s=ee(r.items,(r=>0===r.trim().length?[]:jj(e,t.buttons,r,t.allowToolbarGroups,o,n).toArray()));return{title:R.from(e.translate(r.name)),items:s}}));return q(s,(e=>e.items.length>0))},Wj=(e,t,o,n)=>{const r=t.mainUi.outerContainer,s=o.toolbar,a=o.buttons;if(v(s,i)){const t=s.map((t=>{const r={toolbar:t,buttons:a,allowToolbarGroups:o.allowToolbarGroups};return $j(e,r,n,R.none())}));mU.setToolbars(r,t)}else mU.setToolbar(r,$j(e,o,n,R.none()))},qj=kn(),Gj=qj.os.isiOS()&&qj.os.version.major<=12,Kj=(e,t)=>{const{uiMotherships:o}=t,n=e.dom;let r=e.getWin();const s=e.getDoc().documentElement,a=ca(Oo(r.innerWidth,r.innerHeight)),i=ca(Oo(s.offsetWidth,s.offsetHeight)),l=()=>{const t=a.get();t.left===r.innerWidth&&t.top===r.innerHeight||(a.set(Oo(r.innerWidth,r.innerHeight)),aE(e))},c=()=>{const t=e.getDoc().documentElement,o=i.get();o.left===t.offsetWidth&&o.top===t.offsetHeight||(i.set(Oo(t.offsetWidth,t.offsetHeight)),aE(e))},d=t=>{iE(e,t)};n.bind(r,"resize",l),n.bind(r,"scroll",d);const m=ku(Qe.fromDom(e.getBody()),"load",c);e.on("hide",(()=>{j(o,(e=>{co(e.element,"display","none")}))})),e.on("show",(()=>{j(o,(e=>{vo(e.element,"display")}))})),e.on("NodeChange",c),e.on("remove",(()=>{m.unbind(),n.unbind(r,"resize",l),n.unbind(r,"scroll",d),r=null}))},Yj=(e,t)=>{cp(e,t.dialogUi.mothership)},Xj=(e,t,o,n,r)=>{const{mainUi:s,uiMotherships:a}=t,i=ca(0),l=s.outerContainer;SU(e);const c=Qe.fromDom(r.targetNode),d=jt(Ut(c));dp(c,s.mothership),Yj(d,t),e.on("PostRender",(()=>{mU.setSidebar(l,o.sidebar,zS(e)),Wj(e,t,o,n),i.set(e.getWin().innerWidth),mU.setMenubar(l,fU(e,o)),mU.setViews(l,o.views),Kj(e,t)}));const u=mU.getSocket(l).getOrDie("Could not find expected socket element");if(Gj){mo(u.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});const t=sH((()=>{e.dispatch("ScrollContent")}),20),o=Su(u.element,"scroll",t.throttle);e.on("remove",o.unbind)}YO(e,t),e.addCommand("ToggleSidebar",((t,o)=>{mU.toggleSidebar(l,o),e.dispatch("ToggleSidebar")})),e.addQueryValueHandler("ToggleSidebar",(()=>{var e;return null!==(e=mU.whichSidebar(l))&&void 0!==e?e:""})),e.addCommand("ToggleView",((t,o)=>{if(mU.toggleView(l,o)){const t=l.element;s.mothership.broadcastOn([Rp()],{target:t}),j(a,(e=>{e.broadcastOn([Rp()],{target:t})})),m(mU.whichView(l))&&(e.focus(),e.nodeChanged())}})),e.addQueryValueHandler("ToggleView",(()=>{var e;return null!==(e=mU.whichView(l))&&void 0!==e?e:""}));const g=vS(e),h=()=>{mU.refreshToolbar(t.mainUi.outerContainer)};g!==XC.sliding&&g!==XC.floating||e.on("ResizeWindow ResizeEditor ResizeContent",(()=>{const t=e.getWin().innerWidth;t!==i.get()&&(h(),i.set(t))}));const p={setEnabled:e=>{KO(t,!e)},isEnabled:()=>!Jb.isDisabled(l)};return{iframeContainer:u.element.dom,editorContainer:l.element.dom,api:p}};var Jj=Object.freeze({__proto__:null,render:Xj});const Qj=e=>{const t=/^[0-9\.]+(|px)$/i;return t.test(""+e)?R.some(parseInt(""+e,10)):R.none()},e$=e=>b(e)?e+"px":e,t$=(e,t,o)=>{const n=t.filter((t=>e<t)),r=o.filter((t=>e>t));return n.or(r).getOr(e)},o$=e=>{const t=iS(e),o=dS(e),n=uS(e);return Qj(t).map((e=>t$(e,o,n)))},n$=e=>{const t=o$(e);return t.getOr(iS(e))},r$=e=>{const t=lS(e),o=cS(e),n=mS(e);return Qj(t).map((e=>t$(e,o,n)))},s$=e=>{const t=r$(e);return t.getOr(lS(e))},{ToolbarLocation:a$,ToolbarMode:i$}=tk,l$=(e,t,o,n,r)=>{const{mainUi:s,uiMotherships:a}=o,i=eS.DOM,l=YS(e),c=QS(e),d=mS(e).or(r$(e)),m=n.shared.header,u=m.isPositionedAtTop,g=vS(e),h=g===i$.sliding||g===i$.floating,p=ca(!1),f=()=>p.get()&&!e.removed,b=e=>h?e.fold(S(0),(e=>e.components().length>1?Co(e.components()[1].element):0)):0,v=o=>{switch(wS(e)){case a$.auto:const e=mU.getToolbar(s.outerContainer),n=b(e),r=Co(o.element)-n,a=tr(t),i=a.y>r;if(i)return"top";{const e=Dt(t),o=Math.max(e.dom.scrollHeight,Co(e)),n=a.bottom<o-r;if(n)return"bottom";{const e=nr(),t=e.bottom<a.bottom-r;return t?"bottom":"top"}}case a$.bottom:return"bottom";case a$.top:default:return"top"}},y=e=>{r.on((t=>{Jz.setModes(t,[e]),m.setDockingMode(e);const o=u()?eg.TopToBottom:eg.BottomToTop;eo(t.element,tg,o)}))},w=()=>{r.on((e=>{const o=d.getOrThunk((()=>{const e=Qj(go(Xt(),"margin-left")).getOr(0);return Ro(Xt())-Do(t).left+e}));co(e.element,"max-width",o+"px")}))},x=()=>{r.on((e=>{const o=mU.getToolbar(s.outerContainer),n=b(o),r=tr(t),a=u()?Math.max(r.y-Co(e.element)+n,0):r.bottom;mo(s.outerContainer.element,{position:"absolute",top:Math.round(a)+"px",left:Math.round(r.x)+"px"})}))},C=()=>{j(a,(e=>{e.broadcastOn([Bp()],{})}))},k=(e=!1)=>{if(f()){if(l||w(),h&&mU.refreshToolbar(s.outerContainer),l||x(),c){const t=e?Jz.reset:Jz.refresh;r.on(t)}C()}},_=(e=!0)=>{!l&&c&&f()&&r.on((t=>{const o=m.getDockingMode(),n=v(t);n!==o&&(y(n),e&&k(!0))}))},O=()=>{p.set(!0),co(s.outerContainer.element,"display","flex"),i.addClass(e.getBody(),"mce-edit-focus"),j(a,(e=>{vo(e.element,"display")})),_(!1),k()},T=()=>{p.set(!1),co(s.outerContainer.element,"display","none"),i.removeClass(e.getBody(),"mce-edit-focus"),j(a,(e=>{co(e.element,"display","none")}))};return{isVisible:f,isPositionedAtTop:u,show:O,hide:T,update:k,updateMode:_,repositionPopups:C}},c$=(e,t)=>{const o=tr(e);return{pos:t?o.y:o.bottom,bounds:o}},d$=(e,t,o,n)=>{const r=ca(c$(t,o.isPositionedAtTop())),s=n=>{const{pos:s,bounds:a}=c$(t,o.isPositionedAtTop()),{pos:i,bounds:l}=r.get(),c=a.height!==l.height||a.width!==l.width;r.set({pos:s,bounds:a}),c&&aE(e,n),o.isVisible()&&(i!==s?o.update(!0):c&&(o.updateMode(),o.repositionPopups()))};n||(e.on("activate",o.show),e.on("deactivate",o.hide)),e.on("SkinLoaded ResizeWindow",(()=>o.update(!0))),e.on("NodeChange keydown",(e=>{requestAnimationFrame((()=>s(e)))})),e.on("ScrollWindow",(()=>o.updateMode()));const a=wu();a.set(ku(Qe.fromDom(e.getBody()),"load",(e=>s(e.raw)))),e.on("remove",(()=>{a.clear()}))},m$=(e,t)=>{cp(e,t.dialogUi.mothership)},u$=(e,t,o,n,r)=>{const{mainUi:s}=t,a=xu(),i=Qe.fromDom(r.targetNode),l=l$(e,i,t,n,a),c=SS(e);kU(e);const d=()=>{if(a.isSet())return void l.show();a.set(mU.getHeader(s.outerContainer).getOrDie());const r=XS(e);cp(r,s.mothership),m$(r,t),Wj(e,t,o,n),mU.setMenubar(s.outerContainer,fU(e,o)),l.show(),d$(e,i,l,c),e.nodeChanged()};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()})),YO(e,t);const m={show:d,hide:l.hide,setEnabled:e=>{KO(t,!e)},isEnabled:()=>!Jb.isDisabled(s.outerContainer)};return{editorContainer:s.outerContainer.element.dom,api:m}};var g$=Object.freeze({__proto__:null,render:u$});const h$=()=>{const e=xu(),t=xu(),o=xu(),n=t=>{e.set(t)},r=(e,t)=>()=>o.get().bind((e=>t(e.outerContainer))).getOrDie(`Could not find ${e} element in OuterContainer`);return{dialogUi:e,popupUi:t,mainUi:o,getUiMotherships:()=>[...e.get().map((e=>e.mothership)).toArray()],setupDialogUi:n,lazyGetInOuterOrDie:r}},p$="contexttoolbar-show",f$="contexttoolbar-hide",b$=e=>({hide:()=>Oi(e,ci()),getValue:()=>pf.getValue(e)}),v$=(e,t)=>Ii(cL,((o,n)=>{const r=e.get(o),s=b$(r);t.onAction(s,n.event.buttonApi)})),y$=(e,t,o)=>{const{primary:n,...r}=t.original,s=_s(G_({...r,type:"button",onAction:y}));return Aj(s,o,[v$(e,t)])},w$=(e,t,o)=>{const{primary:n,...r}=t.original,s=_s(X_({...r,type:"togglebutton",onAction:y}));return Nj(s,o,[v$(e,t)])},x$=e=>"contextformtogglebutton"===e.type,C$=(e,t,o)=>x$(t)?w$(e,t,o):y$(e,t,o),S$=(e,t,o)=>{const n=U(t,(t=>BC(C$(e,t,o)))),r=()=>U(n,(e=>e.asSpec())),s=e=>me(t,((t,o)=>t.primary?R.from(n[o]).bind((t=>t.getOpt(e))).filter(T(Jb.isDisabled)):R.none()));return{asSpecs:r,findPrimary:s}},k$=(e,t)=>{const o=e.label.fold((()=>({})),(e=>({"aria-label":e}))),n=BC(Vk.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:e.initValue(),inputAttributes:o,selectOnFocus:!0,inputBehaviours:Rm([$w.config({mode:"special",onEnter:e=>r.findPrimary(e).map((e=>(Ei(e),!0))),onLeft:(e,t)=>(t.cut(),R.none()),onRight:(e,t)=>(t.cut(),R.none())})])})),r=S$(n,e.commands,t);return[{title:R.none(),items:[n.asSpec()]},{title:R.none(),items:r.asSpecs()}]},_$=(e,t,o)=>MZ({type:e,uid:cl("context-toolbar"),initGroups:k$(t,o),onEscape:R.none,cyclicKeying:!0,providers:o}),O$={renderContextForm:_$,buildInitGroups:k$},T$=(e,t,o)=>t.bottom-e.y>=o&&e.bottom-t.y>=o,E$=e=>{const t=e.getBoundingClientRect();if(t.height<=0&&t.width<=0){const o=zt(Qe.fromDom(e.startContainer),e.startOffset).element,n=bt(o)?Mt(o):R.some(o);return n.filter(ft).map((e=>e.dom.getBoundingClientRect())).getOr(t)}return t},D$=e=>{const t=e.selection.getRng(),o=E$(t);if(e.inline){const e=Fn();return er(e.left+o.left,e.top+o.top,o.width,o.height)}{const t=or(Qe.fromDom(e.getBody()));return er(t.x+o.left,t.y+o.top,o.width,o.height)}},A$=(e,t)=>t.filter((e=>Yt(e)&&pt(e))).map(or).getOrThunk((()=>D$(e))),M$=(e,t,o)=>{const n=Math.max(e.x+o,t.x),r=Math.min(e.right-o,t.right);return{x:n,width:r-n}},N$=(e,t,o,n,r,s)=>{const a=Qe.fromDom(e.getContainer()),i=nd(a,".tox-editor-header").getOr(a),l=tr(i),c=l.y>=t.bottom,d=n&&!c;if(e.inline&&d)return{y:Math.max(l.bottom+s,o.y),bottom:o.bottom};if(e.inline&&!d)return{y:o.y,bottom:Math.min(l.y-s,o.bottom)};const m="line"===r?tr(a):t;return d?{y:Math.max(l.bottom+s,o.y),bottom:Math.min(m.bottom-s,o.bottom)}:{y:Math.max(m.y+s,o.y),bottom:Math.min(l.y-s,o.bottom)}},R$=(e,t,o,n=0)=>{const r=jn(window),s=tr(Qe.fromDom(e.getContentAreaContainer())),a=ZS(e)||$S(e)||qS(e),{x:i,width:l}=M$(s,r,n);if(e.inline&&!a)return er(i,r.y,l,r.height);{const a=t.header.isPositionedAtTop(),{y:c,bottom:d}=N$(e,s,r,a,o,n);return er(i,c,l,d-c)}},B$=12,L$={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"]},H$={maxHeightFunction:ju(),maxWidthFunction:tZ()},I$=(e,t)=>{const o=e.selection.getRng(),n=zt(Qe.fromDom(o.startContainer),o.startOffset);return o.startContainer===o.endContainer&&o.startOffset===o.endOffset-1&&_t(n.element,t)},P$=(e,t,o)=>{const n=po(e,"position");co(e,"position",t);const r=o(e);return n.each((t=>co(e,"position",t))),r},z$=e=>"node"===e,F$=(e,t,o,n,r)=>{const s=D$(e),a=n.lastElement().exists((e=>_t(o,e)));if(I$(e,o))return a?BI:DI;if(a)return P$(t,n.getMode(),(()=>{const e=T$(s,tr(t),-20);return e&&!n.isReposition()?HI:BI}));{const e="fixed"===n.getMode()?r.y+Fn().top:r.y,o=Co(t)+B$;return e+o<=s.y?DI:AI}},V$=(e,t,o,n)=>{const r=t=>(n,r,s,a,i)=>{const l=F$(e,a,t,o,i),c={...n,y:i.y,height:i.height};return{...l(c,r,s,a,i),alwaysFit:!0}},s=e=>z$(n)?[r(e)]:[],a={onLtr:e=>[um,gm,dm,lm,mm,cm].concat(s(e)),onRtl:e=>[um,gm,mm,cm,dm,lm].concat(s(e))},i={onLtr:e=>[gm,lm,cm,dm,mm,um].concat(s(e)),onRtl:e=>[gm,cm,lm,mm,dm,um].concat(s(e))};return t?i:a},Z$=(e,t,o,n)=>"line"===t?{bubble:Ku(B$,0,L$),layouts:{onLtr:()=>[hm],onRtl:()=>[pm]},overrides:H$}:{bubble:Ku(0,B$,L$,1/B$),layouts:V$(e,o,n,t),overrides:H$},U$=(e,t)=>{const o=q(t,(t=>t.predicate(e.dom))),{pass:n,fail:r}=W(o,(e=>"contexttoolbar"===e.type));return{contextToolbars:n,contextForms:r}},j$=e=>{if(e.length<=1)return e;{const t=t=>F(e,(e=>e.position===t)),o=t=>q(e,(e=>e.position===t)),n=t("selection"),r=t("node");if(n||r){if(r&&n){const e=o("node"),t=U(o("selection"),(e=>({...e,position:"node"})));return e.concat(t)}return o(n?"selection":"node")}return o("line")}},$$=e=>{if(e.length<=1)return e;{const t=t=>X(e,(e=>e.position===t)),o=t("selection").orThunk((()=>t("node"))).orThunk((()=>t("line"))).map((e=>e.position));return o.fold((()=>[]),(t=>q(e,(e=>e.position===t))))}},W$=(e,t,o)=>{const n=U$(e,t);if(n.contextForms.length>0)return R.some({elem:e,toolbars:[n.contextForms[0]]});{const t=U$(e,o);if(t.contextForms.length>0)return R.some({elem:e,toolbars:[t.contextForms[0]]});if(n.contextToolbars.length>0||t.contextToolbars.length>0){const o=j$(n.contextToolbars.concat(t.contextToolbars));return R.some({elem:e,toolbars:o})}return R.none()}},q$=(e,t,o)=>e(t)?R.none():Sa(t,(e=>{if(ft(e)){const{contextToolbars:t,contextForms:n}=U$(e,o.inNodeScope),r=n.length>0?n:$$(t);return r.length>0?R.some({elem:e,toolbars:r}):R.none()}return R.none()}),e),G$=(e,t)=>{const o=Qe.fromDom(t.getBody()),n=e=>_t(e,o),r=e=>!n(e)&&!Ot(o,e),s=Qe.fromDom(t.selection.getNode());return r(s)?R.none():W$(s,e.inNodeScope,e.inEditorScope).orThunk((()=>q$(n,s,e)))},K$=(e,t)=>{const o={},n=[],r=[],s={},a={},i=(e,i)=>{const l=_s(sO(i));o[e]=l,l.launch.map((o=>{s["form:"+e]={...i.launch,type:"contextformtogglebutton"===o.type?"togglebutton":"button",onAction:()=>{t(l)}}})),"editor"===l.scope?r.push(l):n.push(l),a[e]=l},l=(e,t)=>{iO(t).each((o=>{"editor"===t.scope?r.push(o):n.push(o),a[e]=o}))},c=ue(e);return j(c,(t=>{const o=e[t];"contextform"===o.type?i(t,o):"contexttoolbar"===o.type&&l(t,o)})),{forms:o,inNodeScope:n,inEditorScope:r,lookupTable:a,formNavigators:s}},Y$=cl("forward-slide"),X$=cl("backward-slide"),J$=cl("change-slide-event"),Q$="tox-pop--resizing",eW=e=>{const t=ca([]);return AC.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:e=>{t.set([]),AC.getContent(e).each((e=>{vo(e.element,"visibility")})),gc(e.element,Q$),vo(e.element,"width")},inlineBehaviours:Rm([ix("context-toolbar-events",[Wi(Ya(),((e,t)=>{"width"===t.event.raw.propertyName&&(gc(e.element,Q$),vo(e.element,"width"))})),Ii(J$,((e,t)=>{const o=e.element;vo(o,"width");const n=Ro(o);AC.setContent(e,t.event.contents),mc(o,Q$);const r=Ro(o);co(o,"width",n+"px"),AC.getContent(e).each((e=>{t.event.focus.bind((e=>(Zm(e),Wm(o)))).orThunk((()=>($w.focusIn(e),$m(Ut(o)))))})),setTimeout((()=>{co(e.element,"width",r+"px")}),0)})),Ii(Y$,((e,o)=>{AC.getContent(e).each((o=>{t.set(t.get().concat([{bar:o,focus:$m(Ut(e.element))}]))})),Ti(e,J$,{contents:o.event.forwardContents,focus:R.none()})})),Ii(X$,((e,o)=>{ce(t.get()).each((o=>{t.set(t.get().slice(0,t.get().length-1)),Ti(e,J$,{contents:Gc(o.bar),focus:o.focus})}))}))]),$w.config({mode:"special",onEscape:o=>ce(t.get()).fold((()=>e.onEscape()),(e=>(Oi(o,X$),R.some(!0))))})]),lazySink:()=>ir.value(e.sink)})},tW="tox-pop--transition",oW=(e,t,o,n)=>{const r=n.backstage,s=r.shared,a=kn().deviceType.isTouch,i=xu(),l=xu(),c=xu(),d=qc(eW({sink:o,onEscape:()=>(e.focus(),R.some(!0))})),m=()=>{const t=c.get().getOr("node"),o=z$(t)?1:0;return R$(e,s,t,o)},u=()=>!e.removed&&!(a()&&r.isContextMenuOpen()),g=e=>Te(Me(e,i.get(),_t),!0),h=()=>{if(u()){const t=m(),o=Te(c.get(),"node")?A$(e,i.get()):D$(e);return t.height<=0||!T$(o,t,.01)}return!0},p=()=>{i.clear(),l.clear(),c.clear(),AC.hide(d)},f=()=>{if(AC.isOpen(d)){const e=d.element;vo(e,"display"),h()?co(e,"display","none"):(l.set(0),AC.reposition(d))}},b=t=>({dom:{tag:"div",classes:["tox-pop__dialog"]},components:[t],behaviours:Rm([$w.config({mode:"acyclic"}),ix("pop-dialog-wrap-events",[qi((t=>{e.shortcuts.add("ctrl+F9","focus statusbar",(()=>$w.focusIn(t)))})),Gi((t=>{e.shortcuts.remove("ctrl+F9")}))])])}),v=Ho((()=>K$(t,(e=>{const t=C([e]);Ti(d,Y$,{forwardContents:b(t)})})))),w=(t,o)=>$j(e,{buttons:t,toolbar:o.items,allowToolbarGroups:!1},n.backstage,R.some(["form:"])),x=(e,t)=>O$.buildInitGroups(e,t),C=t=>{const{buttons:o}=e.ui.registry.getAll(),n=v(),r={...o,...n.formNavigators},a=vS(e)===XC.scrolling?XC.scrolling:XC.default,i=Q(U(t,(e=>"contexttoolbar"===e.type?w(r,e):x(e,s.providers))));return MZ({type:a,uid:cl("context-toolbar"),initGroups:i,onEscape:R.none,cyclicKeying:!0,providers:s.providers})},S=(t,n)=>{const r="node"===t?s.anchors.node(n):s.anchors.cursor(),c=Z$(e,t,a(),{lastElement:i.get,isReposition:()=>Te(l.get(),0),getMode:()=>Gh.getMode(o)});return Or(r,c)},k=(e,t)=>{if(_.cancel(),!u())return;const n=C(e),r=e[0].position,s=S(r,t);c.set(r),l.set(1);const a=d.element;vo(a,"display"),g(t)||(gc(a,tW),Gh.reset(o,d)),AC.showWithinBounds(d,b(n),{anchor:s,transition:{classes:[tW],mode:"placement"}},(()=>R.some(m()))),t.fold(i.clear,i.set),h()&&co(a,"display","none")},_=aH((()=>{if(e.hasFocus()&&!e.removed)if(hc(d.element,tW))_.throttle();else{const t=v();G$(t,e).fold(p,(e=>{k(e.toolbars,R.some(e.elem))}))}}),17);e.on("init",(()=>{e.on("remove",p),e.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",f),e.on("click keyup focus SetContent",_.throttle),e.on(f$,p),e.on(p$,(t=>{const o=v();ke(o.lookupTable,t.toolbarKey).each((o=>{k([o],Be(t.target!==e,t.target)),AC.getContent(d).each($w.focusIn)}))})),e.on("focusout",(t=>{MC.setEditorTimeout(e,(()=>{Wm(o.element).isNone()&&Wm(d.element).isNone()&&p()}),0)})),e.on("SwitchMode",(()=>{e.mode.isReadOnly()&&p()})),e.on("AfterProgressState",(t=>{t.state?p():e.hasFocus()&&_.throttle()})),e.on("NodeChange",(e=>{Wm(d.element).fold(_.throttle,y)}))}))},nW=e=>{const t=[{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"}];j(t,(t=>{e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:EU(e,t.cmd),onSetup:_U(e,t.name)})})),e.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onAction:EU(e,"JustifyNone")})},rW={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:[""]},sW=(()=>{const e="[0-9]+",t="[+-]?"+e,o="[eE]"+t,n="\\.",r=e=>`(?:${e})?`,s=["Infinity",e+n+r(e)+r(o),n+e+r(o),e+r(o)].join("|"),a=`[+-]?(?:${s})`;return new RegExp(`^(${a})(.*)$`)})(),aW=(e,t)=>F(t,(t=>F(rW[t],(t=>e===t)))),iW=(e,t)=>{const o=R.from(sW.exec(e));return o.bind((e=>{const o=Number(e[1]),n=e[2];return aW(n,t)?R.some({value:o,unit:n}):R.none()}))},lW=(e,t)=>iW(e,t).map((({value:e,unit:t})=>e+t)),cW=(e,t)=>{const o=()=>{const o=t.getOptions(e),n=t.getCurrent(e).map(t.hash),r=xu();return U(o,(o=>({type:"togglemenuitem",text:t.display(o),onSetup:s=>{const a=e=>{e&&(r.on((e=>e.setActive(!1))),r.set(s)),s.setActive(e)};a(Te(n,t.hash(o)));const i=t.watcher(e,o,a);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})},dW={name:"lineheight",text:"Line height",icon:"line-height",getOptions:jS,hash:e=>lW(e,["fixed","relative","empty"]).getOr(e),display:k,watcher:(e,t,o)=>e.formatter.formatChanged("lineheight",o,!1,{value:t}).unbind,getCurrent:e=>R.from(e.queryCommandValue("LineHeight")),setCurrent:(e,t)=>e.execCommand("LineHeight",!1,t)},mW=e=>{const t=R.from(fS(e));return t.map((t=>({name:"language",text:"Language",icon:"language",getOptions:S(t),hash:e=>g(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=Qe.fromDom(e.selection.getNode());return ka(t,(e=>R.some(e).filter(ft).bind((e=>{const t=no(e,"lang");return t.map((t=>{const o=no(e,"data-mce-lang").getOrUndefined();return{code:t,customCode:o,title:""}}))}))))},setCurrent:(e,t)=>e.execCommand("Lang",!1,t),onToolbarSetup:t=>{const o=wu();return t.setActive(e.formatter.match("lang",{},void 0,!0)),o.set(e.formatter.formatChanged("lang",t.setActive,!0)),o.clear}})))},uW=e=>{cW(e,dW),mW(e).each((t=>cW(e,t)))},gW=(e,t)=>{FU(e,t),YU(e,t),ij(e,t),jU(e,t),rj(e,t)},hW=e=>OU(e,"NodeChange",(t=>{t.setEnabled(e.queryCommandState("outdent"))})),pW=e=>{e.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:hW(e),onAction:EU(e,"outdent")}),e.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:EU(e,"indent")})},fW=e=>{pW(e)},bW=(e,t)=>o=>{o.setActive(t.get());const n=e=>{t.set(e.state),o.setActive(e.state)};return e.on("PastePlainTextToggle",n),()=>e.off("PastePlainTextToggle",n)},vW=e=>{const t=ca(PS(e)),o=()=>e.execCommand("mceTogglePlainTextPaste");e.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:o,onSetup:bW(e,t)}),e.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:o,onSetup:bW(e,t)})},yW=(e,t)=>()=>{e.execCommand("mceToggleFormat",!1,t)},wW=e=>{$B.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{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:_U(e,t.name),onAction:yW(e,t.name)})}));for(let t=1;t<=6;t++){const o="h"+t;e.ui.registry.addToggleButton(o,{text:o.toUpperCase(),tooltip:"Heading "+t,onSetup:_U(e,o),onAction:yW(e,o)})}},xW=e=>{$B.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"},{name:"print",text:"Print",action:"mcePrint",icon:"print"},{name:"hr",text:"Horizontal line",action:"InsertHorizontalRule",icon:"horizontal-rule"}],(t=>{e.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onAction:EU(e,t.action)})}))},CW=e=>{$B.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(t=>{e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:EU(e,t.action),onSetup:_U(e,t.name)})}))},SW=e=>{wW(e),xW(e),CW(e)},kW=e=>{$B.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:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"},{name:"print",text:"Print...",action:"mcePrint",icon:"print",shortcut:"Meta+P"},{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,onAction:EU(e,t.action)})})),e.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:yW(e,"code")})},_W=e=>{SW(e),kW(e)},OW=(e,t)=>OU(e,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",(o=>{o.setEnabled(!e.mode.isReadOnly()&&e.undoManager[t]())})),TW=e=>{e.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:OW(e,"hasUndo"),onAction:EU(e,"undo")}),e.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:OW(e,"hasRedo"),onAction:EU(e,"redo")})},EW=e=>{e.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",enabled:!1,onSetup:OW(e,"hasUndo"),onAction:EU(e,"undo")}),e.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",enabled:!1,onSetup:OW(e,"hasRedo"),onAction:EU(e,"redo")})},DW=e=>{TW(e),EW(e)},AW=e=>OU(e,"VisualAid",(t=>{t.setActive(e.hasVisual)})),MW=e=>{e.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:AW(e),onAction:EU(e,"mceToggleVisualAid")})},NW=e=>{e.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:EU(e,"mceToggleVisualAid")})},RW=e=>{NW(e),MW(e)},BW=(e,t)=>{nW(e),_W(e),gW(e,t),DW(e),qE(e),RW(e),fW(e),uW(e),vW(e)},LW=e=>i(e)?e.split(/[ ,]/):e,HW=e=>t=>t.options.get(e),IW=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}:i(e)||v(e,i)?{value:LW(e),valid:!0}:{valid:!1,message:"Must be false or a string."},default:"link linkchecker image editimage table spellchecker configurepermanentpen"})},PW=HW("contextmenu_never_use_native"),zW=HW("contextmenu_avoid_overlap"),FW=e=>0===VW(e).length,VW=e=>{const t=e.ui.registry.getAll().contextMenus,o=e.options.get("contextmenu");return e.options.isSet("contextmenu")?o:q(o,(e=>_e(t,e)))},ZW=(e,t)=>({type:"makeshift",x:e,y:t}),UW=(e,t,o)=>ZW(e.x+t,e.y+o),jW=e=>"longpress"===e.type||0===e.type.indexOf("touch"),$W=e=>{if(jW(e)){const t=e.touches[0];return ZW(t.pageX,t.pageY)}return ZW(e.pageX,e.pageY)},WW=e=>{if(jW(e)){const t=e.touches[0];return ZW(t.clientX,t.clientY)}return ZW(e.clientX,e.clientY)},qW=(e,t)=>{const o=eS.DOM.getPos(e);return UW(t,o.x,o.y)},GW=(e,t)=>"contextmenu"===t.type||"longpress"===t.type?e.inline?$W(t):qW(e.getContentAreaContainer(),WW(t)):KW(e),KW=e=>({type:"selection",root:Qe.fromDom(e.selection.getNode())}),YW=e=>({type:"node",node:R.some(Qe.fromDom(e.selection.getNode())),root:Qe.fromDom(e.getBody())}),XW=(e,t,o)=>{switch(o){case"node":return YW(e);case"point":return GW(e,t);case"selection":return KW(e)}},JW=(e,t,o,n,r,s)=>{const a=o(),i=XW(e,t,s);DL(a,lk.CLOSE_ON_EXECUTE,n,{isHorizontalMenu:!1,search:R.none()}).map((e=>{t.preventDefault(),AC.showMenuAt(r,{anchor:i},{menu:{markers:Nk("normal")},data:e})}))},QW={onLtr:()=>[gm,lm,cm,dm,mm,um,DI,AI,EI,OI,TI,_I],onRtl:()=>[gm,cm,lm,mm,dm,um,DI,AI,TI,_I,EI,OI]},eq=12,tq={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"]},oq=(e,t)=>{const o=e.selection;if(o.isCollapsed()||t.touches.length<1)return!1;{const n=t.touches[0],r=o.getRng(),s=ch(e.getWin(),Zg.domRange(r));return s.exists((e=>e.left<=n.clientX&&e.right>=n.clientX&&e.top<=n.clientY&&e.bottom>=n.clientY))}},nq=e=>{const t=e.selection.getRng(),o=()=>{MC.setEditorTimeout(e,(()=>{e.selection.setRng(t)}),10),s()};e.once("touchend",o);const n=e=>{e.preventDefault(),e.stopImmediatePropagation()};e.on("mousedown",n,!0);const r=()=>s();e.once("longpresscancel",r);const s=()=>{e.off("touchend",o),e.off("longpresscancel",r),e.off("mousedown",n)}},rq=(e,t,o)=>{const n=XW(e,t,o),r="point"===o?eq:0;return{bubble:Ku(0,r,tq),layouts:QW,overrides:{maxWidthFunction:tZ(),maxHeightFunction:ju()},...n}},sq=(e,t,o,n,r,s,a)=>{const i=rq(e,t,s);DL(o,lk.CLOSE_ON_EXECUTE,n,{isHorizontalMenu:!0,search:R.none()}).map((o=>{t.preventDefault();const l=a?xC.HighlightMenuAndItem:xC.HighlightNone;AC.showMenuWithinBounds(r,{anchor:i},{menu:{markers:Nk("normal"),highlightOnOpen:l},data:o,type:"horizontal"},(()=>R.some(R$(e,n.shared,"node"===s?"node":"selection")))),e.dispatch(f$)}))},aq=(e,t,o,n,r,s)=>{const a=kn(),i=a.os.isiOS(),l=a.os.isMacOS(),c=a.os.isAndroid(),d=a.deviceType.isTouch(),m=()=>!(c||i||l&&d),u=()=>{const a=o();sq(e,t,a,n,r,s,m())};if((l||i)&&"node"!==s){const o=()=>{nq(e),u()};oq(e,t)?o():(e.once("selectionchange",o),e.once("touchend",(()=>e.off("selectionchange",o))))}else u()},iq=e=>i(e)?"|"===e:"separator"===e.type,lq={type:"separator"},cq=e=>{const t=e=>({text:e.text,icon:e.icon,enabled:e.enabled,shortcut:e.shortcut});if(i(e))return e;switch(e.type){case"separator":return lq;case"submenu":return{type:"nestedmenuitem",...t(e),getSubmenuItems:()=>{const t=e.getSubmenuItems();return i(t)?t:U(t,cq)}};default:const o=e;return{type:"menuitem",...t(o),onAction:w(o.onAction)}}},dq=(e,t)=>{if(0===t.length)return e;const o=ce(e).filter((e=>!iq(e))),n=o.fold((()=>[]),(e=>[lq]));return e.concat(n).concat(t).concat([lq])},mq=(e,t,o)=>{const n=K(t,((t,n)=>ke(e,n.toLowerCase()).map((e=>{const n=e.update(o);if(i(n))return dq(t,n.split(" "));if(n.length>0){const e=U(n,cq);return dq(t,e)}return t})).getOrThunk((()=>t.concat([n])))),[]);return n.length>0&&iq(n[n.length-1])&&n.pop(),n},uq=(e,t)=>t.ctrlKey&&!PW(e),gq=e=>"longpress"===e.type||_e(e,"touches"),hq=(e,t)=>!gq(t)&&(2!==t.button||t.target===e.getBody()&&""===t.pointerType),pq=(e,t)=>hq(e,t)?e.selection.getStart(!0):t.target,fq=(e,t)=>{const o=zW(e),n=hq(e,t)?"selection":"point";if($e(o)){const r=pq(e,t),s=vA(Qe.fromDom(r),o);return s?"node":n}return n},bq=(e,t,o)=>{const n=kn(),r=n.deviceType.isTouch,s=qc(AC.sketch({dom:{tag:"div"},lazySink:t,onEscape:()=>e.focus(),onShow:()=>o.setContextMenuState(!0),onHide:()=>o.setContextMenuState(!1),fireDismissalEventInstead:{},inlineBehaviours:Rm([ix("dismissContextMenu",[Ii(vi(),((t,o)=>{Np.close(t),e.focus()}))])])})),a=()=>AC.hide(s),i=t=>{if(PW(e)&&t.preventDefault(),uq(e,t)||FW(e))return;const n=fq(e,t),a=()=>{const o=pq(e,t),n=e.ui.registry.getAll(),r=VW(e);return mq(n.contextMenus,r,o)},i=r()?aq:JW;i(e,t,a,o,s,n)};e.on("init",(()=>{const t="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(r()?"":" ResizeWindow");e.on(t,a),e.on("longpress contextmenu",i)}))},vq=ma.generate([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),yq=e=>t=>t.translate(-e.left,-e.top),wq=e=>t=>t.translate(e.left,e.top),xq=e=>(t,o)=>K(e,((e,t)=>t(e)),Oo(t,o)),Cq=(e,t,o)=>e.fold(xq([wq(o),yq(t)]),xq([yq(t)]),xq([])),Sq=(e,t,o)=>e.fold(xq([wq(o)]),xq([]),xq([wq(t)])),kq=(e,t,o)=>e.fold(xq([]),xq([yq(o)]),xq([wq(t),yq(o)])),_q=(e,t,o,n,r,s)=>{const a=Sq(e,r,s),i=Sq(t,r,s);return Math.abs(a.left-i.left)<=o&&Math.abs(a.top-i.top)<=n},Oq=(e,t,o,n,r,s)=>{const a=Sq(e,r,s),i=Sq(t,r,s),l=Math.abs(a.left-i.left),c=Math.abs(a.top-i.top);return Oo(l,c)},Tq=(e,t,o)=>{const n=e.fold(((e,t)=>({position:R.some("absolute"),left:R.some(e+"px"),top:R.some(t+"px")})),((e,t)=>({position:R.some("absolute"),left:R.some(e-o.left+"px"),top:R.some(t-o.top+"px")})),((e,t)=>({position:R.some("fixed"),left:R.some(e+"px"),top:R.some(t+"px")})));return{right:R.none(),bottom:R.none(),...n}},Eq=(e,t,o)=>e.fold(((e,n)=>Aq(e+t,n+o)),((e,n)=>Mq(e+t,n+o)),((e,n)=>Nq(e+t,n+o))),Dq=(e,t,o,n)=>{const r=(e,r)=>(s,a)=>{const i=e(t,o,n);return r(s.getOr(i.left),a.getOr(i.top))};return e.fold(r(kq,Aq),r(Sq,Mq),r(Cq,Nq))},Aq=vq.offset,Mq=vq.absolute,Nq=vq.fixed,Rq=(e,t)=>{const o=oo(e,t);return g(o)?NaN:parseInt(o,10)},Bq=(e,t)=>{const o=e.element,n=Rq(o,t.leftAttr),r=Rq(o,t.topAttr);return isNaN(n)||isNaN(r)?R.none():R.some(Oo(n,r))},Lq=(e,t,o)=>{const n=e.element;eo(n,t.leftAttr,o.left+"px"),eo(n,t.topAttr,o.top+"px")},Hq=(e,t)=>{const o=e.element;so(o,t.leftAttr),so(o,t.topAttr)},Iq=(e,t,o,n)=>Bq(e,t).fold((()=>o),(e=>Nq(e.left+n.left,e.top+n.top))),Pq=(e,t,o,n,r,s)=>{const a=Iq(e,t,o,n),i=t.mustSnap?Vq(e,t,a,r,s):Zq(e,t,a,r,s),l=Cq(a,r,s);return Lq(e,t,l),i.fold((()=>({coord:Nq(l.left,l.top),extra:R.none()})),(e=>({coord:e.output,extra:e.extra})))},zq=(e,t)=>{Hq(e,t)},Fq=(e,t,o,n)=>me(e,(e=>{const r=e.sensor,s=_q(t,r,e.range.left,e.range.top,o,n);return s?R.some({output:Dq(e.output,t,o,n),extra:e.extra}):R.none()})),Vq=(e,t,o,n,r)=>{const s=t.getSnapPoints(e),a=Fq(s,o,n,r);return a.orThunk((()=>{const e=K(s,((e,t)=>{const s=t.sensor,a=Oq(o,s,t.range.left,t.range.top,n,r);return e.deltas.fold((()=>({deltas:R.some(a),snap:R.some(t)})),(o=>{const n=(a.left+a.top)/2,r=(o.left+o.top)/2;return n<=r?{deltas:R.some(a),snap:R.some(t)}:e}))}),{deltas:R.none(),snap:R.none()});return e.snap.map((e=>({output:Dq(e.output,o,n,r),extra:e.extra})))}))},Zq=(e,t,o,n,r)=>{const s=t.getSnapPoints(e);return Fq(s,o,n,r)},Uq=(e,t,o)=>({coord:Dq(e.output,e.output,t,o),extra:e.extra}),jq=(e,t,o,n)=>{const r=t.getTarget(e.element);if(t.repositionTarget){const t=Tt(e.element),o=Fn(t),s=xz(r),a=Uq(n,o,s),i=Tq(a.coord,o,s);uo(r,i)}};var $q=Object.freeze({__proto__:null,snapTo:jq});const Wq="data-initial-z-index",qq=e=>{Mt(e.element).filter(ft).each((e=>{no(e,Wq).fold((()=>vo(e,"z-index")),(t=>co(e,"z-index",t))),so(e,Wq)}))},Gq=e=>{Mt(e.element).filter(ft).each((t=>{po(t,"z-index").each((e=>{eo(t,Wq,e)})),co(t,"z-index",go(e.element,"z-index"))}))},Kq=(e,t)=>{e.getSystem().addToGui(t),Gq(t)},Yq=e=>{qq(e),e.getSystem().removeFromGui(e)},Xq=(e,t,o)=>e.getSystem().build(ZA.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[t]},events:o}));var Jq=Xs("snaps",[Rs("getSnapPoints"),Ed("onSensor"),Rs("leftAttr"),Rs("topAttr"),Qs("lazyViewport",nr),Qs("mustSnap",!1)]);const Qq=[Qs("useFixed",A),Rs("blockerClass"),Qs("getTarget",k),Qs("onDrag",y),Qs("repositionTarget",!0),Qs("onDrop",y),sa("getBounds",nr),Jq],eG=e=>Ne(po(e,"left"),po(e,"top"),po(e,"position"),((e,t,o)=>{const n="fixed"===o?Nq:Aq;return n(parseInt(e,10),parseInt(t,10))})).getOrThunk((()=>{const t=Do(e);return Mq(t.left,t.top)})),tG=(e,t,o,n,r)=>{const s=r.bounds,a=Sq(t,o,n),i=Kd(a.left,s.x,s.x+s.width-r.width),l=Kd(a.top,s.y,s.y+s.height-r.height),c=Mq(i,l);return t.fold((()=>{const e=kq(c,o,n);return Aq(e.left,e.top)}),S(c),(()=>{const e=Cq(c,o,n);return Nq(e.left,e.top)}))},oG=(e,t,o,n,r,s,a)=>{const i=t.fold((()=>{const e=Eq(o,s.left,s.top),t=Cq(e,n,r);return Nq(t.left,t.top)}),(t=>{const a=Pq(e,t,o,s,n,r);return a.extra.each((o=>{t.onSensor(e,o)})),a.coord}));return tG(e,i,n,r,a)},nG=(e,t,o,n)=>{const r=t.getTarget(e.element);if(t.repositionTarget){const s=Tt(e.element),a=Fn(s),i=xz(r),l=eG(r),c=oG(e,t.snaps,l,a,i,n,o),d=Tq(c,a,i);uo(r,d)}t.onDrag(e,r,n)},rG=(e,t)=>({bounds:e.getBounds(),height:So(t.element),width:Bo(t.element)}),sG=(e,t,o,n,r)=>{const s=o.update(n,r),a=o.getStartData().getOrThunk((()=>rG(t,e)));s.each((o=>{nG(e,t,a,o)}))},aG=(e,t,o,n)=>{t.each(Yq),o.snaps.each((t=>{zq(e,t)}));const r=o.getTarget(e.element);n.reset(),o.onDrop(e,r)},iG=e=>(t,o)=>{const n=e=>{o.setStartData(rG(t,e))};return Ri([Ii(hi(),(e=>{o.getStartData().each((()=>n(e)))})),...e(t,o,n)])},lG=e=>Ri([Ii(Ia(),e.forceDrop),Ii(Fa(),e.drop),Ii(Pa(),((t,o)=>{e.move(o.event)})),Ii(za(),e.delayDrop)]),cG=e=>R.from(Oo(e.x,e.y)),dG=(e,t)=>Oo(t.left-e.left,t.top-e.top);var mG=Object.freeze({__proto__:null,getData:cG,getDelta:dG});const uG=(e,t,o)=>[Ii(Ia(),((n,r)=>{const s=r.event.raw;if(0!==s.button)return;r.stop();const a=()=>aG(n,R.some(c),e,t),i=yA(a,200),l={drop:a,delayDrop:i.schedule,forceDrop:a,move:o=>{i.cancel(),sG(n,e,t,mG,o)}},c=Xq(n,e.blockerClass,lG(l)),d=()=>{o(n),Kq(n,c)};d()}))],gG=[...Qq,Nd("dragger",{handlers:iG(uG)})],hG=e=>Ri([Ii(Ra(),e.forceDrop),Ii(La(),e.drop),Ii(Ha(),e.drop),Ii(Ba(),((t,o)=>{e.move(o.event)}))]),pG=e=>{const t=e[0];return R.some(Oo(t.clientX,t.clientY))},fG=e=>{const t=e.raw,o=t.touches;return 1===o.length?pG(o):R.none()},bG=(e,t)=>Oo(t.left-e.left,t.top-e.top);var vG=Object.freeze({__proto__:null,getData:fG,getDelta:bG});const yG=(e,t,o)=>{const n=xu(),r=o=>{aG(o,n.get(),e,t),n.clear()};return[Ii(Ra(),((s,a)=>{a.stop();const i=()=>r(s),l={drop:i,delayDrop:y,forceDrop:i,move:o=>{sG(s,e,t,vG,o)}},c=Xq(s,e.blockerClass,hG(l));n.set(c);const d=()=>{o(s),Kq(s,c)};d()})),Ii(Ba(),((o,n)=>{n.stop(),sG(o,e,t,vG,n.event)})),Ii(La(),((e,t)=>{t.stop(),r(e)})),Ii(Ha(),r)]},wG=[...Qq,Nd("dragger",{handlers:iG(yG)})],xG=(e,t,o)=>[...uG(e,t,o),...yG(e,t,o)],CG=[...Qq,Nd("dragger",{handlers:iG(xG)})],SG=gG,kG=wG,_G=CG;var OG=Object.freeze({__proto__:null,mouse:SG,touch:kG,mouseOrTouch:_G});const TG=()=>{let e=R.none(),t=R.none();const o=()=>{e=R.none(),t=R.none()},n=(t,o)=>{const n=e.map((e=>t.getDelta(e,o)));return e=R.some(o),n},r=(e,t)=>e.getData(t).bind((t=>n(e,t))),s=e=>{t=R.some(e)},a=()=>t,i=S({});return Ml({readState:i,reset:o,update:r,getStartData:a,setStartData:s})};var EG=Object.freeze({__proto__:null,init:TG});const DG=Im({branchKey:"mode",branches:OG,name:"dragging",active:{events:(e,t)=>{const o=e.dragger;return o.handlers(e,t)}},extra:{snap:e=>({sensor:e.sensor,range:e.range,output:e.output,extra:R.from(e.extra)})},state:EG,apis:$q}),AG=40,MG=AG/2,NG=(e,t,o,n,r,s)=>e.fold((()=>DG.snap({sensor:Mq(o-MG,n-MG),range:Oo(r,s),output:Mq(R.some(o),R.some(n)),extra:{td:t}})),(e=>{const r=o-MG,s=n-MG,a=AG,i=AG,l=e.element.dom.getBoundingClientRect();return DG.snap({sensor:Mq(r,s),range:Oo(a,i),output:Mq(R.some(o-l.width/2),R.some(n-l.height/2)),extra:{td:t}})})),RG=(e,t,o)=>{const n=(e,t)=>e.exists((e=>_t(e,t)));return{getSnapPoints:e,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:(e,r)=>{const s=r.td;n(t.get(),s)||(t.set(s),o(s))},mustSnap:!0}},BG=e=>BC(RC.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:Rm([DG.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:e}),MM.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}})),LG=(e,t)=>{const o=ca([]),n=ca([]),r=ca(!1),s=xu(),a=xu(),i=e=>{const o=or(e);return NG(g.getOpt(t),e,o.x,o.y,o.width,o.height)},l=()=>U(o.get(),(e=>i(e))),c=e=>{const o=or(e);return NG(h.getOpt(t),e,o.right,o.bottom,o.width,o.height)},d=()=>U(n.get(),(e=>c(e))),m=RG(l,s,(t=>{a.get().each((o=>{e.dispatch("TableSelectorChange",{start:t,finish:o})}))})),u=RG(d,a,(t=>{s.get().each((o=>{e.dispatch("TableSelectorChange",{start:o,finish:t})}))})),g=BG(m),h=BG(u),p=qc(g.asSpec()),f=qc(h.asSpec()),b=(t,o,n,r)=>{const s=o.dom.getBoundingClientRect();vo(t.element,"display");const a=At(Qe.fromDom(e.getBody())).dom.innerHeight,i=n(s),l=r(s,a);(i||l)&&co(t.element,"display","none")},v=(e,t,o,n)=>{const r=o(t);DG.snapTo(e,r);const s=e=>e[n]<0,a=(e,t)=>e[n]>t;b(e,t,s,a)},y=e=>v(p,e,i,"top"),w=()=>s.get().each(y),x=e=>v(f,e,c,"bottom"),C=()=>a.get().each(x);kn().deviceType.isTouch()&&(e.on("TableSelectionChange",(e=>{r.get()||(rp(t,p),rp(t,f),r.set(!0)),s.set(e.start),a.set(e.finish),e.otherCells.each((t=>{o.set(t.upOrLeftCells),n.set(t.downOrRightCells),y(e.start),x(e.finish)}))})),e.on("ResizeEditor ResizeWindow ScrollContent",(()=>{w(),C()})),e.on("TableSelectionClear",(()=>{r.get()&&(ip(p),ip(f),r.set(!1)),s.clear(),a.clear()})))};var HG='<svg width="50px" height="16px" viewBox="0 0 50 16" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M10.143 0c2.608.015 5.186 2.178 5.186 5.331 0 0 .077 3.812-.084 4.87-.361 2.41-2.164 4.074-4.65 4.496-1.453.284-2.523.49-3.212.623-.373.071-.634.122-.785.152-.184.038-.997.145-1.35.145-2.732 0-5.21-2.04-5.248-5.33 0 0 0-3.514.03-4.442.093-2.4 1.758-4.342 4.926-4.963 0 0 3.875-.752 4.036-.782.368-.07.775-.1 1.15-.1Zm1.826 2.8L5.83 3.989v2.393l-2.455.475v5.968l6.137-1.189V9.243l2.456-.476V2.8ZM5.83 6.382l3.682-.713v3.574l-3.682.713V6.382Zm27.173-1.64-.084-1.066h-2.226v9.132h2.456V7.743c-.008-1.151.998-2.064 2.149-2.072 1.15-.008 1.987.92 1.995 2.072v5.065h2.455V7.359c-.015-2.18-1.657-3.929-3.837-3.913a3.993 3.993 0 0 0-2.908 1.296Zm-6.3-4.266L29.16 0v2.387l-2.456.475V.476Zm0 3.2v9.132h2.456V3.676h-2.456Zm18.179 11.787L49.11 3.676H46.58l-1.612 4.527-.46 1.382-.384-1.382-1.611-4.527H39.98l3.3 9.132L42.15 16l2.732-.537ZM22.867 9.738c0 .752.568 1.075.921 1.075.353 0 .668-.047.998-.154l.537 1.765c-.23.154-.92.537-2.225.537-1.305 0-2.655-.997-2.686-2.686a136.877 136.877 0 0 1 0-4.374H18.8V3.676h1.612v-1.98l2.455-.476v2.456h2.302V5.9h-2.302v3.837Z"/>\n</svg>\n';const IG=e=>"BR"===e.nodeName||!!e.getAttribute("data-mce-bogus")||"bookmark"===e.getAttribute("data-mce-type"),PG=(e,t,o)=>{var n;const r=null!==(n=t.delimiter)&&void 0!==n?n:"",s=(t,n,r)=>RC.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{"data-index":r,"aria-level":r+1}},components:[Zc(t)],action:t=>{e.focus(),e.selection.select(n),e.nodeChanged()},buttonBehaviours:Rm([oT.button(o.isDisabled),XO()])}),a=()=>({dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0}},components:[Zc(` ${r} `)]}),i=e=>K(e,((e,t,o)=>{const n=s(t.name,t.element,o);return 0===o?e.concat([n]):e.concat([a(),n])}),[]),l=t=>{const o=[];let n=t.length;while(n-- >0){const r=t[n];if(1===r.nodeType&&!IG(r)){const t=dE(e,r);if(t.isDefaultPrevented()||o.push({name:t.name,element:r}),t.isPropagationStopped())break}}return o};return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:Rm([$w.config({mode:"flow",selector:"div[role=button]"}),Jb.config({disabled:o.isDisabled}),XO(),JA.config({}),sx.config({}),ix("elementPathEvents",[qi(((t,o)=>{e.shortcuts.add("alt+F11","focus statusbar elementpath",(()=>$w.focusIn(t))),e.on("NodeChange",(e=>{const o=l(e.parents),n=o.length>0?i(o):[];sx.set(t,n)}))}))])]),components:[]}};var zG;(function(e){e[e["None"]=0]="None",e[e["Both"]=1]="Both",e[e["Vertical"]=2]="Vertical"})(zG||(zG={}));const FG=(e,t,o,n,r)=>{const s={height:t$(n+t.top,dS(e),uS(e))};return o===zG.Both&&(s.width=t$(r+t.left,cS(e),mS(e))),s},VG=(e,t,o)=>{const n=Qe.fromDom(e.getContainer()),r=FG(e,t,o,Co(n),Ro(n));he(r,((e,t)=>{b(e)&&co(n,t,e$(e))})),sE(e)},ZG=e=>{const t=IS(e);return!1===t?zG.None:"both"===t?zG.Both:zG.Vertical},UG=(e,t,o,n)=>{const r=20,s=Oo(o*r,n*r);return VG(e,s,t),R.some(!0)},jG=(e,t)=>{const o=ZG(e);return o===zG.None?R.none():R.some(WC("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:t.translate("Resize")},behaviours:[DG.config({mode:"mouse",repositionTarget:!1,onDrag:(t,n,r)=>VG(e,r,o),blockerClass:"tox-blocker"}),$w.config({mode:"special",onLeft:()=>UG(e,o,-1,0),onRight:()=>UG(e,o,1,0),onUp:()=>UG(e,o,0,-1),onDown:()=>UG(e,o,0,1)}),JA.config({}),fx.config({})]},t.icons))},$G=(e,t)=>{const o=(e,o,n)=>sx.set(e,[Zc(t.translate(["{0} "+n,o[n]]))]);return RC.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:Rm([oT.button(t.isDisabled),XO(),JA.config({}),sx.config({}),pf.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),ix("wordcount-events",[Yi((e=>{const t=pf.getValue(e),n="words"===t.mode?"characters":"words";pf.setValue(e,{mode:n,count:t.count}),o(e,t.count,n)})),qi((t=>{e.on("wordCountUpdate",(e=>{const{mode:n}=pf.getValue(t);pf.setValue(t,{mode:n,count:e.wordCount}),o(t,e.wordCount,n)}))}))])]),eventOrder:{[si()]:["disabling","alloy.base.behaviour","wordcount-events"]}})},WG=(e,t)=>{const o=()=>({dom:{tag:"span",classes:["tox-statusbar__branding"]},components:[{dom:{tag:"a",attributes:{href:"https://www.tiny.cloud/powered-by-tiny?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce&utm_content=v6",rel:"noopener",target:"_blank","aria-label":LC.translate(["Powered by {0}","Tiny"])},innerHtml:HG.trim()},behaviours:Rm([fx.config({})])}]}),n=()=>{const n=[];return LS(e)&&n.push(PG(e,{},t)),e.hasPlugin("wordcount")&&n.push($G(e,t)),HS(e)&&n.push(o()),n.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:n}]:[]},r=()=>{const o=n(),r=jG(e,t);return o.concat(r.toArray())};return{dom:{tag:"div",classes:["tox-statusbar"]},components:r()}},qG=(e,t)=>t.get().getOrDie(`UI for ${e} has not been rendered`),GG=e=>{const t=e.inline,o=t?g$:Jj,n=QS(e)?hF:yz,r=h$(),s=xu(),a=xu(),i=kn(),l=i.deviceType.isTouch(),c="tox-platform-touch",d=l?[c]:[],m=GS(e),u=vS(e),g=BC({dom:{tag:"div",classes:["tox-anchorbar"]}}),h=()=>r.mainUi.get().map((e=>e.outerContainer)).bind(mU.getHeader),p=()=>ir.fromOption(r.dialogUi.get().map((e=>e.sink)),"UI has not been rendered"),f=()=>ir.fromOption(r.popupUi.get().map((e=>e.sink)),"(popup) UI has not been rendered"),b=r.lazyGetInOuterOrDie("anchor bar",g.getOpt),v=r.lazyGetInOuterOrDie("toolbar",mU.getToolbar),y=r.lazyGetInOuterOrDie("throbber",mU.getThrobber),w=ez({popup:f,dialog:p},e,b),x=()=>{const t={attributes:{[tg]:m?eg.BottomToTop:eg.TopToBottom}},o=mU.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:w.popup,onEscape:()=>{e.focus()}}),n=mU.parts.toolbar({dom:{tag:"div",classes:["tox-toolbar"]},getSink:w.popup.shared.getSink,providers:w.popup.shared.providers,onEscape:()=>{e.focus()},onToolbarToggled:t=>{mE(e,t)},type:u,lazyToolbar:v,lazyHeader:()=>h().getOrDie("Could not find header element"),...t}),r=mU.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:w.popup.shared.providers,onEscape:()=>{e.focus()},type:u}),s=qS(e),a=$S(e),i=ZS(e),l=FS(e),c=C(),d=s||a||i,p=()=>s?[r]:a?[n]:[],f=l?[c,o]:[o];return mU.parts.header({dom:{tag:"div",classes:["tox-editor-header"].concat(d?[]:["tox-editor-header--empty"]),...t},components:Q([i?f:[],p(),YS(e)?[]:[g.asSpec()]]),sticky:QS(e),editor:e,sharedBackstage:w.popup.shared})},C=()=>mU.parts.promotion({dom:{tag:"div",classes:["tox-promotion"]}}),S=()=>{const e=mU.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),t=mU.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}});return{dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[e,t]}},_=()=>{const t=XS(e),o=_t(Xt(),t)&&"grid"===go(t,"display"),r={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(d),attributes:{...LC.isRtl()?{dir:"rtl"}:{}}},behaviours:Rm([Gh.config({useFixed:()=>n.isDocked(h)})])},s={dom:{styles:{width:document.body.clientWidth+"px"}},events:Ri([Ii(pi(),(e=>{co(e.element,"width",document.body.clientWidth+"px")}))])},i=qc(Or(r,o?s:{})),l=UA(i);return a.set(l),{sink:i,mothership:l}},O=k,T=()=>{const o=x(),n=S(),r=mU.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:w.popup}),a=mU.parts.viewWrapper({backstage:w.popup}),i=BS(e)&&!t?R.some(WG(e,w.popup.shared.providers)):R.none(),l=Q([m?[]:[o],t?[]:[n],m?[o]:[]]),c=mU.parts.editorContainer({components:Q([l,t?[]:i.toArray()])}),u=JS(e),g={role:"application",...LC.isRtl()?{dir:"rtl"}:{},...u?{"aria-hidden":"true"}:{}},h=qc(mU.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(t?["tox-tinymce-inline"]:[]).concat(m?["tox-tinymce--toolbar-bottom"]:[]).concat(d),styles:{visibility:"hidden",...u?{opacity:"0",border:"0"}:{}},attributes:g},components:[c,...t?[]:[a],r],behaviours:Rm([XO(),Jb.config({disableClass:"tox-tinymce--disabled"}),$w.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"})])})),p=UA(h);return s.set(p),{mothership:p,outerContainer:h}},E=t=>{const o=e$(n$(e)),n=e$(s$(e));return e.inline||(bo("div","width",n)&&co(t.element,"width",n),bo("div","height",o)?co(t.element,"height",o):co(t.element,"height","400px")),o},D=t=>{e.addShortcut("alt+F9","focus menubar",(()=>{mU.focusMenubar(t)})),e.addShortcut("alt+F10","focus toolbar",(()=>{mU.focusToolbar(t)})),e.addCommand("ToggleToolbarDrawer",(()=>{mU.toggleToolbarDrawer(t)})),e.addQueryStateHandler("ToggleToolbarDrawer",(()=>mU.isToolbarDrawerToggled(t)))},A=t=>{const{mainUi:r,popupUi:s,uiMotherships:a}=t;pe(yS(e),((t,o)=>{e.ui.registry.addGroupToolbarButton(o,t)}));const{buttons:i,menuItems:l,contextToolbars:c,sidebars:d,views:m}=e.ui.registry.getAll(),g=WS(e),p={menuItems:l,menus:ek(e),menubar:_S(e),toolbar:g.getOrThunk((()=>OS(e))),allowToolbarGroups:u===XC.floating,buttons:i,sidebar:d,views:m};D(r.outerContainer),tz(e,r.mothership,a),n.setup(e,w.popup.shared,h),BW(e,w.popup),bq(e,w.popup.shared.getSink,w.popup),uV(e),zV(e,y,w.popup.shared),oW(e,c,s.sink,{backstage:w.popup}),LG(e,s.sink);const f=e.getElement(),b=E(r.outerContainer),v={targetNode:f,height:b};return o.render(e,t,p,w.popup,v)},M=()=>{const e=T(),t=_(),o=O(t);r.dialogUi.set(t),r.popupUi.set(o),r.mainUi.set(e);const n={popupUi:o,dialogUi:t,mainUi:e,uiMotherships:r.getUiMotherships()};return A(n)};return{popups:{backstage:w.popup,getMothership:()=>qG("popups",a)},dialogs:{backstage:w.dialog,getMothership:()=>qG("dialogs",a)},renderUI:M}},KG=(e,t)=>{const o=R.from(oo(e,"id")).fold((()=>{const e=cl("dialog-describe");return eo(t,"id",e),e}),k);eo(e,"aria-describedby",o)},YG=(e,t)=>{const o=no(e,"id").fold((()=>{const e=cl("dialog-label");return eo(t,"id",e),e}),k);eo(e,"aria-labelledby",o)},XG=S([Rs("lazySink"),js("dragBlockClass"),sa("getBounds",nr),Qs("useTabstopAt",M),Qs("eventOrder",{}),ff("modalBehaviours",[$w]),Dd("onExecute"),Md("onEscape")]),JG={sketch:k},QG=S([Yf({name:"draghandle",overrides:(e,t)=>({behaviours:Rm([DG.config({mode:"mouse",getTarget:e=>td(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})])})}),Gf({schema:[Rs("dom")],name:"title"}),Gf({factory:JG,schema:[Rs("dom")],name:"close"}),Gf({factory:JG,schema:[Rs("dom")],name:"body"}),Yf({factory:JG,schema:[Rs("dom")],name:"footer"}),Kf({factory:{sketch:(e,t)=>({...e,dom:t.dom,components:t.components})},schema:[Qs("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),Qs("components",[])],name:"blocker"})]),eK=(e,t,o,n)=>{const r=xu(),s=t=>{r.set(t);const o=e.lazySink(t).getOrDie(),s=n.blocker(),a=o.getSystem().build({...s,components:s.components.concat([Gc(t)]),behaviours:Rm([fx.config({}),ix("dialog-blocker-events",[Wi(Za(),(()=>{$w.focusIn(t)}))])])});rp(o,a),$w.focusIn(t)},a=e=>{r.clear(),Mt(e.element).each((t=>{e.getSystem().getByDom(t).each((e=>{ip(e)}))}))},i=t=>db(t,e,"body"),l=t=>db(t,e,"footer"),c=(e,t)=>{EV.block(e,t)},d=e=>{EV.unblock(e)},m=cl("modal-events"),u={...e.eventOrder,[fi()]:[m].concat(e.eventOrder["alloy.system.attached"]||[])};return{uid:e.uid,dom:e.dom,components:t,apis:{show:s,hide:a,getBody:i,getFooter:l,setIdle:d,setBusy:c},eventOrder:u,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:vf(e.modalBehaviours,[sx.config({}),$w.config({mode:"cyclic",onEnter:e.onExecute,onEscape:e.onEscape,useTabstopAt:e.useTabstopAt}),EV.config({getRoot:r.get}),ix(m,[qi((t=>{YG(t.element,db(t,e,"title").element),KG(t.element,db(t,e,"body").element)}))])])}},tK=Eb({name:"ModalDialog",configFields:XG(),partFields:QG(),factory:eK,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)}}}),oK=rs([u_,g_].concat(hO)),nK=hs,rK=[z_("button"),O_,na("align","end",["start","end"]),B_,R_,Gs("buttonType",["primary","secondary"])],sK=[...rK,p_],aK=[Is("type",["submit","cancel","custom"]),...sK],iK=[Is("type",["menu"]),__,T_,O_,Us("items",oK),...rK],lK=Es("type",{submit:aK,cancel:aK,custom:aK,menu:iK}),cK=[u_,p_,Is("level",["info","warn","error","success"]),b_,Qs("url","")],dK=rs(cK),mK=e=>[u_,e],uK=[u_,p_,R_,z_("button"),O_,N_,Gs("buttonType",["primary","secondary","toolbar"]),B_],gK=rs(uK),hK=[u_,g_],pK=hK.concat([E_]),fK=hK.concat([h_,R_]),bK=rs(fK),vK=hs,yK=pK.concat([L_("auto")]),wK=rs(yK),xK=cs([v_,p_,b_]),CK=pK.concat([oa("storageKey","default")]),SK=rs(CK),kK=gs,_K=pK,OK=rs(_K),TK=gs,EK=hK.concat([oa("tag","textarea"),Hs("scriptId"),Hs("scriptUrl"),aa("settings",void 0)]),DK=hK.concat([oa("tag","textarea"),zs("init")]),AK=xs((e=>ks("customeditor.old",ns(DK),e).orThunk((()=>ks("customeditor.new",ns(EK),e))))),MK=gs,NK=pK,RK=rs(NK),BK=ws(),LK=e=>[u_,Ls("columns"),e],HK=[u_,Hs("html"),na("presets","presentation",["presentation","document"])],IK=rs(HK),PK=pK.concat([ra("sandboxed",!0),ra("transparent",!0)]),zK=rs(PK),FK=gs,VK=rs(hK.concat([qs("height")])),ZK=rs([Hs("url"),Ws("zoom"),Ws("cachedWidth"),Ws("cachedHeight")]),UK=pK.concat([qs("inputMode"),qs("placeholder"),ra("maximized",!1),R_]),jK=rs(UK),$K=gs,WK=e=>[u_,h_,e],qK=[p_,v_],GK=[p_,Us("items",Ds("items",(()=>KK)))],KK=as([rs(qK),rs(GK)]),YK=pK.concat([Us("items",KK),R_]),XK=rs(YK),JK=gs,QK=pK.concat([Zs("items",[p_,v_]),ta("size",1),R_]),eY=rs(QK),tY=gs,oY=pK.concat([ra("constrain",!0),R_]),nY=rs(oY),rY=rs([Hs("width"),Hs("height")]),sY=hK.concat([h_,ta("min",0),ta("max",0)]),aY=rs(sY),iY=us,lY=[u_,Us("header",gs),Us("cells",ss(gs))],cY=rs(lY),dY=pK.concat([qs("placeholder"),ra("maximized",!1),R_]),mY=rs(dY),uY=gs,gY=pK.concat([na("filetype","file",["image","media","file"]),R_]),hY=rs(gY),pY=rs([v_,H_]),fY=e=>As("items","items",Er(),ss(xs((t=>ks(`Checking item of ${e}`,bY,t).fold((e=>ir.error(Ts(e))),(e=>ir.value(e))))))),bY=ts((()=>ys("type",{alertbanner:dK,bar:rs(mK(fY("bar"))),button:gK,checkbox:bK,colorinput:SK,colorpicker:OK,dropzone:RK,grid:rs(LK(fY("grid"))),iframe:zK,input:jK,listbox:XK,selectbox:eY,sizeinput:nY,slider:aY,textarea:mY,urlinput:hY,customeditor:AK,htmlpanel:IK,imagepreview:VK,collection:wK,label:rs(WK(fY("label"))),table:cY,panel:yY}))),vY=[u_,Qs("classes",[]),Us("items",bY)],yY=rs(vY),wY=[z_("tab"),f_,Us("items",bY)],xY=[u_,Zs("tabs",wY)],CY=rs(xY),SY=sK,kY=lK,_Y=rs([Hs("title"),Bs("body",ys("type",{panel:yY,tabpanel:CY})),oa("size","normal"),Us("buttons",kY),Qs("initialData",{}),sa("onAction",y),sa("onChange",y),sa("onSubmit",y),sa("onClose",y),sa("onCancel",y),sa("onTabChange",y)]),OY=e=>ks("dialog",_Y,e),TY=rs([Is("type",["cancel","custom"]),...SY]),EY=rs([Hs("title"),Hs("url"),Ws("height"),Ws("width"),Ys("buttons",TY),sa("onAction",y),sa("onCancel",y),sa("onClose",y),sa("onMessage",y)]),DY=e=>ks("dialog",EY,e),AY=e=>l(e)?[e].concat(ee(Se(e),AY)):d(e)?ee(e,AY):[],MY=e=>i(e.type)&&i(e.name),NY={checkbox:vK,colorinput:kK,colorpicker:TK,dropzone:BK,input:$K,iframe:FK,imagepreview:ZK,selectbox:tY,sizeinput:rY,slider:iY,listbox:JK,size:rY,textarea:uY,urlinput:pY,customeditor:MK,collection:xK,togglemenuitem:nK},RY=e=>R.from(NY[e.type]),BY=e=>q(AY(e),MY),LY=e=>{const t=BY(e),o=ee(t,(e=>RY(e).fold((()=>[]),(t=>[Bs(e.name,t)]))));return rs(o)},HY=e=>{var t;const o=_s(OY(e)),n=LY(e),r=null!==(t=e.initialData)&&void 0!==t?t:{};return{internalDialog:o,dataValidator:n,initialData:r}},IY={open:(e,t)=>{const o=HY(t);return e(o.internalDialog,o.initialData,o.dataValidator)},openUrl:(e,t)=>{const o=_s(DY(t));return e(o)},redial:e=>HY(e)},PY=e=>{const t=[],o={};return he(e,((e,n)=>{e.fold((()=>{t.push(n)}),(e=>{o[n]=e}))})),t.length>0?ir.error(t):ir.value(o)},zY=(e,t,o)=>{const n=BC(yB.sketch((n=>({dom:{tag:"div",classes:["tox-form"].concat(e.classes)},components:U(e.items,(e=>pI(n,e,t,o)))}))));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[n.asSpec()]}],behaviours:Rm([$w.config({mode:"acyclic",useTabstopAt:T(tL)}),AB.memento(n),PB.memento(n,{postprocess:e=>PY(e).fold((e=>(console.error(e),{})),k)})])}},FY=(e,t)=>({uid:e.uid,dom:e.dom,components:e.components,events:Ix(e.action),behaviours:vf(e.tabButtonBehaviours,[fx.config({}),$w.config({mode:"execution",useSpace:!0,useEnter:!0}),pf.config({store:{mode:"memory",initialValue:e.value}})]),domModification:e.domModification}),VY=Tb({name:"TabButton",configFields:[Qs("uid",void 0),Rs("value"),As("dom","dom",Nr((()=>({attributes:{role:"tab",id:cl("aria"),"aria-selected":"false"}}))),ds()),js("action"),Qs("domModification",{}),ff("tabButtonBehaviours",[fx,$w,pf]),Rs("view")],factory:FY}),ZY=S([Rs("tabs"),Rs("dom"),Qs("clickToDismiss",!1),ff("tabbarBehaviours",[vv,$w]),Od(["tabClass","selectedClass"])]),UY=Xf({factory:VY,name:"tabs",unit:"tab",overrides:e=>{const t=(e,t)=>{vv.dehighlight(e,t),Ti(e,Si(),{tabbar:e,button:t})},o=(e,t)=>{vv.highlight(e,t),Ti(e,Ci(),{tabbar:e,button:t})};return{action:n=>{const r=n.getSystem().getByUid(e.uid).getOrDie(),s=vv.isHighlighted(r,n),a=(()=>s&&e.clickToDismiss?t:s?y:o)();a(r,n)},domModification:{classes:[e.markers.tabClass]}}}}),jY=S([UY]),$Y=(e,t,o,n)=>({uid:e.uid,dom:e.dom,components:t,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:vf(e.tabbarBehaviours,[vv.config({highlightClass:e.markers.selectedClass,itemClass:e.markers.tabClass,onHighlight:(e,t)=>{eo(t.element,"aria-selected","true")},onDehighlight:(e,t)=>{eo(t.element,"aria-selected","false")}}),$w.config({mode:"flow",getInitial:e=>vv.getHighlighted(e).map((e=>e.element)),selector:"."+e.markers.tabClass,executeOnMove:!0})])}),WY=Eb({name:"Tabbar",configFields:ZY(),partFields:jY(),factory:$Y}),qY=(e,t)=>({uid:e.uid,dom:e.dom,behaviours:vf(e.tabviewBehaviours,[sx.config({})]),domModification:{attributes:{role:"tabpanel"}}}),GY=Tb({name:"Tabview",configFields:[ff("tabviewBehaviours",[sx])],factory:qY}),KY=S([Qs("selectFirst",!0),Ed("onChangeTab"),Ed("onDismissTab"),Qs("tabs",[]),ff("tabSectionBehaviours",[])]),YY=Gf({factory:WY,schema:[Rs("dom"),Vs("markers",[Rs("tabClass"),Rs("selectedClass")])],name:"tabbar",defaults:e=>({tabs:e.tabs})}),XY=Gf({factory:GY,name:"tabview"}),JY=S([YY,XY]),QY=(e,t,o,n)=>{const r=t=>{const o=pf.getValue(t);cb(t,e,"tabview").each((n=>{const r=X(e.tabs,(e=>e.value===o));r.each((o=>{const r=o.view();no(t.element,"id").each((e=>{eo(n.element,"aria-labelledby",e)})),sx.set(n,r),e.onChangeTab(n,t,r)}))}))},s=(t,o)=>{cb(t,e,"tabbar").each((e=>{o(e).each(Ei)}))};return{uid:e.uid,dom:e.dom,components:t,behaviours:bf(e.tabSectionBehaviours),events:Ri(Q([e.selectFirst?[qi(((e,t)=>{s(e,vv.getFirst)}))]:[],[Ii(Ci(),((e,t)=>{const o=t.event.button;r(o)})),Ii(Si(),((t,o)=>{const n=o.event.button;e.onDismissTab(t,n)}))]])),apis:{getViewItems:t=>cb(t,e,"tabview").map((e=>sx.contents(e))).getOr([]),showTab:(e,t)=>{const o=e=>{const o=vv.getCandidates(e),n=X(o,(e=>pf.getValue(e)===t));return n.filter((t=>!vv.isHighlighted(e,t)))};s(e,o)}}}},eX=Eb({name:"TabSection",configFields:KY(),partFields:JY(),factory:QY,apis:{getViewItems:(e,t)=>e.getViewItems(t),showTab:(e,t,o)=>{e.showTab(t,o)}}}),tX=(e,t,o)=>U(e,((n,r)=>{sx.set(o,e[r].view());const s=t.dom.getBoundingClientRect();return sx.set(o,[]),s.height})),oX=e=>le(ae(e,((e,t)=>e>t?-1:e<t?1:0))),nX=(e,t,o)=>{const n=Dt(e).dom,r=td(e,".tox-dialog-wrap").getOr(e),s="fixed"===go(r,"position");let a;a=s?Math.max(n.clientHeight,window.innerHeight):Math.max(n.offsetHeight,n.scrollHeight);const i=Co(t),l=t.dom.offsetLeft>=o.dom.offsetLeft+Ro(o),c=l?Math.max(Co(o),i):i,d=parseInt(go(e,"margin-top"),10)||0,m=parseInt(go(e,"margin-bottom"),10)||0,u=Co(e)+d+m,g=u-c;return a-g},rX=(e,t)=>{le(e).each((e=>eX.showTab(t,e.value)))},sX=(e,t)=>{co(e,"height",t+"px"),co(e,"flex-basis",t+"px")},aX=(e,t,o)=>{td(e,'[role="dialog"]').each((e=>{nd(e,'[role="tablist"]').each((n=>{o.get().map((o=>(co(t,"height","0"),co(t,"flex-basis","0"),Math.min(o,nX(e,t,n))))).each((e=>{sX(t,e)}))}))}))},iX=e=>nd(e,'[role="tabpanel"]'),lX=e=>{const t=xu(),o=[qi((o=>{const n=o.element;iX(n).each((r=>{co(r,"visibility","hidden"),o.getSystem().getByDom(r).toOptional().each((o=>{const n=tX(e,r,o),s=oX(n);s.fold(t.clear,t.set)})),aX(n,r,t),vo(r,"visibility"),rX(e,o),requestAnimationFrame((()=>{aX(n,r,t)}))}))})),Ii(pi(),(e=>{const o=e.element;iX(o).each((e=>{aX(o,e,t)}))})),Ii(hM,((e,o)=>{const n=e.element;iX(n).each((e=>{const o=$m(Ut(e));co(e,"visibility","hidden");const r=po(e,"height").map((e=>parseInt(e,10)));vo(e,"height"),vo(e,"flex-basis");const s=e.dom.getBoundingClientRect().height,a=r.forall((e=>s>e));a?(t.set(s),aX(n,e,t)):r.each((t=>{sX(e,t)})),vo(e,"visibility"),o.each(Zm)}))}))],n=!1;return{extraEvents:o,selectFirst:n}},cX="send-data-to-section",dX="send-data-to-view",mX=(e,t,o)=>{const n=ca({}),r=e=>{const t=pf.getValue(e),o=PY(t).getOr({}),r=n.get(),s=Or(r,o);n.set(s)},s=e=>{const t=n.get();pf.setValue(e,t)},a=ca(null),i=U(e.tabs,(e=>({value:e.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"]},components:[Zc(o.shared.providers.translate(e.title))],view:()=>[yB.sketch((n=>({dom:{tag:"div",classes:["tox-form"]},components:U(e.items,(e=>pI(n,e,t,o))),formBehaviours:Rm([$w.config({mode:"acyclic",useTabstopAt:T(tL)}),ix("TabView.form.events",[qi(s),Gi(r)]),zm.config({channels:va([{key:cX,value:{onReceive:r}},{key:dX,value:{onReceive:s}}])})])})))]}))),l=lX(i);return eX.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:(e,t,o)=>{const n=pf.getValue(t);Ti(e,gM,{name:n,oldName:a.get()}),a.set(n)},tabs:i,components:[eX.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[WY.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:Rm([JA.config({})])}),eX.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:l.selectFirst,tabSectionBehaviours:Rm([ix("tabpanel",l.extraEvents),$w.config({mode:"acyclic"}),Rb.config({find:e=>le(eX.getViewItems(e))}),PB.withComp(R.none(),(e=>(e.getSystem().broadcastOn([cX],{}),n.get())),((e,t)=>{n.set(t),e.getSystem().broadcastOn([dX],{})}))])})},uX=cl("update-dialog"),gX=cl("update-title"),hX=cl("update-body"),pX=cl("update-footer"),fX=cl("body-send-message"),bX=(e,t,o,n,r)=>{const s=e=>{const t=e.body;switch(t.type){case"tabpanel":return[mX(t,e.initialData,n)];default:return[zY(t,e.initialData,n)]}},a=(e,t)=>R.some({isTabPanel:()=>"tabpanel"===t.body.type}),i={"aria-live":"polite"};return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:{...o.map((e=>({id:e}))).getOr({}),...r?i:{}}},components:[],behaviours:Rm([AB.childAt(0),pj.config({channel:`${hX}-${t}`,updateState:a,renderComponents:s,initialData:e})])}},vX=(e,t,o,n,r)=>bX(e,t,R.some(o),n,r),yX=(e,t,o)=>{const n=bX(e,t,R.none(),o,!1);return tK.parts.body(n)},wX=e=>{const t={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[JB({dom:{tag:"iframe",attributes:{src:e.url}},behaviours:Rm([JA.config({}),fx.config({})])})]}],behaviours:Rm([$w.config({mode:"acyclic",useTabstopAt:T(tL)})])};return tK.parts.body(t)};function xX(e){return xX="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xX(e)}function CX(e,t){return CX=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},CX(e,t)}function SX(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function kX(e,t,o){return kX=SX()?Reflect.construct:function(e,t,o){var n=[null];n.push.apply(n,t);var r=Function.bind.apply(e,n),s=new r;return o&&CX(s,o.prototype),s},kX.apply(null,arguments)}function _X(e){return OX(e)||TX(e)||EX(e)||AX()}function OX(e){if(Array.isArray(e))return DX(e)}function TX(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function EX(e,t){if(e){if("string"===typeof e)return DX(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?DX(e,t):void 0}}function DX(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}function AX(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var MX=Object.hasOwnProperty,NX=Object.setPrototypeOf,RX=Object.isFrozen,BX=Object.getPrototypeOf,LX=Object.getOwnPropertyDescriptor,HX=Object.freeze,IX=Object.seal,PX=Object.create,zX="undefined"!==typeof Reflect&&Reflect,FX=zX.apply,VX=zX.construct;FX||(FX=function(e,t,o){return e.apply(t,o)}),HX||(HX=function(e){return e}),IX||(IX=function(e){return e}),VX||(VX=function(e,t){return kX(e,_X(t))});var ZX=JX(Array.prototype.forEach),UX=JX(Array.prototype.pop),jX=JX(Array.prototype.push),$X=JX(String.prototype.toLowerCase),WX=JX(String.prototype.match),qX=JX(String.prototype.replace),GX=JX(String.prototype.indexOf),KX=JX(String.prototype.trim),YX=JX(RegExp.prototype.test),XX=QX(TypeError);function JX(e){return function(t){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return FX(e,t,n)}}function QX(e){return function(){for(var t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];return VX(e,o)}}function eJ(e,t){NX&&NX(e,null);var o=t.length;while(o--){var n=t[o];if("string"===typeof n){var r=$X(n);r!==n&&(RX(t)||(t[o]=r),n=r)}e[n]=!0}return e}function tJ(e){var t,o=PX(null);for(t in e)FX(MX,e,[t])&&(o[t]=e[t]);return o}function oJ(e,t){while(null!==e){var o=LX(e,t);if(o){if(o.get)return JX(o.get);if("function"===typeof o.value)return JX(o.value)}e=BX(e)}function n(e){return console.warn("fallback value for",e),null}return n}var nJ=HX(["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"]),rJ=HX(["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"]),sJ=HX(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),aJ=HX(["animate","color-profile","cursor","discard","fedropshadow","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"]),iJ=HX(["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"]),lJ=HX(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),cJ=HX(["#text"]),dJ=HX(["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","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","xmlns","slot"]),mJ=HX(["accent-height","accumulate","additive","alignment-baseline","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","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","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","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","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"]),uJ=HX(["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"]),gJ=HX(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),hJ=IX(/\{\{[\w\W]*|[\w\W]*\}\}/gm),pJ=IX(/<%[\w\W]*|[\w\W]*%>/gm),fJ=IX(/^data-[\-\w.\u00B7-\uFFFF]/),bJ=IX(/^aria-[\-\w]+$/),vJ=IX(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),yJ=IX(/^(?:\w+script|data):/i),wJ=IX(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),xJ=IX(/^html$/i),CJ=function(){return"undefined"===typeof window?null:window},SJ=function(e,t){if("object"!==xX(e)||"function"!==typeof e.createPolicy)return null;var o=null,n="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(n)&&(o=t.currentScript.getAttribute(n));var r="dompurify"+(o?"#"+o:"");try{return e.createPolicy(r,{createHTML:function(e){return e}})}catch(s){return console.warn("TrustedTypes policy "+r+" could not be created."),null}};function kJ(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:CJ(),t=function(e){return kJ(e)};if(t.version="2.3.8",t.removed=[],!e||!e.document||9!==e.document.nodeType)return t.isSupported=!1,t;var o=e.document,n=e.document,r=e.DocumentFragment,s=e.HTMLTemplateElement,a=e.Node,i=e.Element,l=e.NodeFilter,c=e.NamedNodeMap,d=void 0===c?e.NamedNodeMap||e.MozNamedAttrMap:c,m=e.HTMLFormElement,u=e.DOMParser,g=e.trustedTypes,h=i.prototype,p=oJ(h,"cloneNode"),f=oJ(h,"nextSibling"),b=oJ(h,"childNodes"),v=oJ(h,"parentNode");if("function"===typeof s){var y=n.createElement("template");y.content&&y.content.ownerDocument&&(n=y.content.ownerDocument)}var w=SJ(g,o),x=w?w.createHTML(""):"",C=n,S=C.implementation,k=C.createNodeIterator,_=C.createDocumentFragment,O=C.getElementsByTagName,T=o.importNode,E={};try{E=tJ(n).documentMode?n.documentMode:{}}catch(Ve){}var D={};t.isSupported="function"===typeof v&&S&&"undefined"!==typeof S.createHTMLDocument&&9!==E;var A,M,N=hJ,R=pJ,B=fJ,L=bJ,H=yJ,I=wJ,P=vJ,z=null,F=eJ({},[].concat(_X(nJ),_X(rJ),_X(sJ),_X(iJ),_X(cJ))),V=null,Z=eJ({},[].concat(_X(dJ),_X(mJ),_X(uJ),_X(gJ))),U=Object.seal(Object.create(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}})),j=null,$=null,W=!0,q=!0,G=!1,K=!1,Y=!1,X=!1,J=!1,Q=!1,ee=!1,te=!1,oe=!0,ne=!0,re=!1,se={},ae=null,ie=eJ({},["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"]),le=null,ce=eJ({},["audio","video","img","source","image","track"]),de=null,me=eJ({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ue="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",he="http://www.w3.org/1999/xhtml",pe=he,fe=!1,be=["application/xhtml+xml","text/html"],ve="text/html",ye=null,we=n.createElement("form"),xe=function(e){return e instanceof RegExp||e instanceof Function},Ce=function(e){ye&&ye===e||(e&&"object"===xX(e)||(e={}),e=tJ(e),z="ALLOWED_TAGS"in e?eJ({},e.ALLOWED_TAGS):F,V="ALLOWED_ATTR"in e?eJ({},e.ALLOWED_ATTR):Z,de="ADD_URI_SAFE_ATTR"in e?eJ(tJ(me),e.ADD_URI_SAFE_ATTR):me,le="ADD_DATA_URI_TAGS"in e?eJ(tJ(ce),e.ADD_DATA_URI_TAGS):ce,ae="FORBID_CONTENTS"in e?eJ({},e.FORBID_CONTENTS):ie,j="FORBID_TAGS"in e?eJ({},e.FORBID_TAGS):{},$="FORBID_ATTR"in e?eJ({},e.FORBID_ATTR):{},se="USE_PROFILES"in e&&e.USE_PROFILES,W=!1!==e.ALLOW_ARIA_ATTR,q=!1!==e.ALLOW_DATA_ATTR,G=e.ALLOW_UNKNOWN_PROTOCOLS||!1,K=e.SAFE_FOR_TEMPLATES||!1,Y=e.WHOLE_DOCUMENT||!1,Q=e.RETURN_DOM||!1,ee=e.RETURN_DOM_FRAGMENT||!1,te=e.RETURN_TRUSTED_TYPE||!1,J=e.FORCE_BODY||!1,oe=!1!==e.SANITIZE_DOM,ne=!1!==e.KEEP_CONTENT,re=e.IN_PLACE||!1,P=e.ALLOWED_URI_REGEXP||P,pe=e.NAMESPACE||he,e.CUSTOM_ELEMENT_HANDLING&&xe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(U.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&xe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(U.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"===typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(U.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),A=A=-1===be.indexOf(e.PARSER_MEDIA_TYPE)?ve:e.PARSER_MEDIA_TYPE,M="application/xhtml+xml"===A?function(e){return e}:$X,K&&(q=!1),ee&&(Q=!0),se&&(z=eJ({},_X(cJ)),V=[],!0===se.html&&(eJ(z,nJ),eJ(V,dJ)),!0===se.svg&&(eJ(z,rJ),eJ(V,mJ),eJ(V,gJ)),!0===se.svgFilters&&(eJ(z,sJ),eJ(V,mJ),eJ(V,gJ)),!0===se.mathMl&&(eJ(z,iJ),eJ(V,uJ),eJ(V,gJ))),e.ADD_TAGS&&(z===F&&(z=tJ(z)),eJ(z,e.ADD_TAGS)),e.ADD_ATTR&&(V===Z&&(V=tJ(V)),eJ(V,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&eJ(de,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(ae===ie&&(ae=tJ(ae)),eJ(ae,e.FORBID_CONTENTS)),ne&&(z["#text"]=!0),Y&&eJ(z,["html","head","body"]),z.table&&(eJ(z,["tbody"]),delete j.tbody),HX&&HX(e),ye=e)},Se=eJ({},["mi","mo","mn","ms","mtext"]),ke=eJ({},["foreignobject","desc","title","annotation-xml"]),_e=eJ({},["title","style","font","a","script"]),Oe=eJ({},rJ);eJ(Oe,sJ),eJ(Oe,aJ);var Te=eJ({},iJ);eJ(Te,lJ);var Ee=function(e){var t=v(e);t&&t.tagName||(t={namespaceURI:he,tagName:"template"});var o=$X(e.tagName),n=$X(t.tagName);return e.namespaceURI===ge?t.namespaceURI===he?"svg"===o:t.namespaceURI===ue?"svg"===o&&("annotation-xml"===n||Se[n]):Boolean(Oe[o]):e.namespaceURI===ue?t.namespaceURI===he?"math"===o:t.namespaceURI===ge?"math"===o&&ke[n]:Boolean(Te[o]):e.namespaceURI===he&&(!(t.namespaceURI===ge&&!ke[n])&&(!(t.namespaceURI===ue&&!Se[n])&&(!Te[o]&&(_e[o]||!Oe[o]))))},De=function(e){jX(t.removed,{element:e});try{e.parentNode.removeChild(e)}catch(Ve){try{e.outerHTML=x}catch(Ve){e.remove()}}},Ae=function(e,o){try{jX(t.removed,{attribute:o.getAttributeNode(e),from:o})}catch(Ve){jX(t.removed,{attribute:null,from:o})}if(o.removeAttribute(e),"is"===e&&!V[e])if(Q||ee)try{De(o)}catch(Ve){}else try{o.setAttribute(e,"")}catch(Ve){}},Me=function(e){var t,o;if(J)e="<remove></remove>"+e;else{var r=WX(e,/^[\r\n\t ]+/);o=r&&r[0]}"application/xhtml+xml"===A&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var s=w?w.createHTML(e):e;if(pe===he)try{t=(new u).parseFromString(s,A)}catch(Ve){}if(!t||!t.documentElement){t=S.createDocument(pe,"template",null);try{t.documentElement.innerHTML=fe?"":s}catch(Ve){}}var a=t.body||t.documentElement;return e&&o&&a.insertBefore(n.createTextNode(o),a.childNodes[0]||null),pe===he?O.call(t,Y?"html":"body")[0]:Y?t.documentElement:a},Ne=function(e){return k.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,null,!1)},Re=function(e){return e instanceof m&&("string"!==typeof e.nodeName||"string"!==typeof e.textContent||"function"!==typeof e.removeChild||!(e.attributes instanceof d)||"function"!==typeof e.removeAttribute||"function"!==typeof e.setAttribute||"string"!==typeof e.namespaceURI||"function"!==typeof e.insertBefore)},Be=function(e){return"object"===xX(a)?e instanceof a:e&&"object"===xX(e)&&"number"===typeof e.nodeType&&"string"===typeof e.nodeName},Le=function(e,o,n){D[e]&&ZX(D[e],(function(e){e.call(t,o,n,ye)}))},He=function(e){var o;if(Le("beforeSanitizeElements",e,null),Re(e))return De(e),!0;if(YX(/[\u0080-\uFFFF]/,e.nodeName))return De(e),!0;var n=M(e.nodeName);if(Le("uponSanitizeElement",e,{tagName:n,allowedTags:z}),e.hasChildNodes()&&!Be(e.firstElementChild)&&(!Be(e.content)||!Be(e.content.firstElementChild))&&YX(/<[/\w]/g,e.innerHTML)&&YX(/<[/\w]/g,e.textContent))return De(e),!0;if("select"===n&&YX(/<template/i,e.innerHTML))return De(e),!0;if(!z[n]||j[n]){if(!j[n]&&Pe(n)){if(U.tagNameCheck instanceof RegExp&&YX(U.tagNameCheck,n))return!1;if(U.tagNameCheck instanceof Function&&U.tagNameCheck(n))return!1}if(ne&&!ae[n]){var r=v(e)||e.parentNode,s=b(e)||e.childNodes;if(s&&r)for(var a=s.length,l=a-1;l>=0;--l)r.insertBefore(p(s[l],!0),f(e))}return De(e),!0}return e instanceof i&&!Ee(e)?(De(e),!0):"noscript"!==n&&"noembed"!==n||!YX(/<\/no(script|embed)/i,e.innerHTML)?(K&&3===e.nodeType&&(o=e.textContent,o=qX(o,N," "),o=qX(o,R," "),e.textContent!==o&&(jX(t.removed,{element:e.cloneNode()}),e.textContent=o)),Le("afterSanitizeElements",e,null),!1):(De(e),!0)},Ie=function(e,t,o){if(oe&&("id"===t||"name"===t)&&(o in n||o in we))return!1;if(q&&!$[t]&&YX(B,t));else if(W&&YX(L,t));else if(!V[t]||$[t]){if(!(Pe(e)&&(U.tagNameCheck instanceof RegExp&&YX(U.tagNameCheck,e)||U.tagNameCheck instanceof Function&&U.tagNameCheck(e))&&(U.attributeNameCheck instanceof RegExp&&YX(U.attributeNameCheck,t)||U.attributeNameCheck instanceof Function&&U.attributeNameCheck(t))||"is"===t&&U.allowCustomizedBuiltInElements&&(U.tagNameCheck instanceof RegExp&&YX(U.tagNameCheck,o)||U.tagNameCheck instanceof Function&&U.tagNameCheck(o))))return!1}else if(de[t]);else if(YX(P,qX(o,I,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==GX(o,"data:")||!le[e]){if(G&&!YX(H,qX(o,I,"")));else if(o)return!1}else;return!0},Pe=function(e){return e.indexOf("-")>0},ze=function(e){var t,o,n,r;Le("beforeSanitizeAttributes",e,null);var s=e.attributes;if(s){var a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:V};r=s.length;while(r--){t=s[r];var i=t,l=i.name,c=i.namespaceURI;o="value"===l?t.value:KX(t.value),n=M(l);var d=o;if(a.attrName=n,a.attrValue=o,a.keepAttr=!0,a.forceKeepAttr=void 0,Le("uponSanitizeAttribute",e,a),o=a.attrValue,!a.forceKeepAttr)if(a.keepAttr)if(YX(/\/>/i,o))Ae(l,e);else{K&&(o=qX(o,N," "),o=qX(o,R," "));var m=M(e.nodeName);if(Ie(m,n,o)){if(o!==d)try{c?e.setAttributeNS(c,l,o):e.setAttribute(l,o)}catch(Ve){Ae(l,e)}}else Ae(l,e)}else Ae(l,e)}Le("afterSanitizeAttributes",e,null)}},Fe=function e(t){var o,n=Ne(t);Le("beforeSanitizeShadowDOM",t,null);while(o=n.nextNode())Le("uponSanitizeShadowNode",o,null),He(o)||(o.content instanceof r&&e(o.content),ze(o));Le("afterSanitizeShadowDOM",t,null)};return t.sanitize=function(n,s){var i,l,c,d,m;if(fe=!n,fe&&(n="\x3c!--\x3e"),"string"!==typeof n&&!Be(n)){if("function"!==typeof n.toString)throw XX("toString is not a function");if(n=n.toString(),"string"!==typeof n)throw XX("dirty is not a string, aborting")}if(!t.isSupported){if("object"===xX(e.toStaticHTML)||"function"===typeof e.toStaticHTML){if("string"===typeof n)return e.toStaticHTML(n);if(Be(n))return e.toStaticHTML(n.outerHTML)}return n}if(X||Ce(s),t.removed=[],"string"===typeof n&&(re=!1),re){if(n.nodeName){var u=M(n.nodeName);if(!z[u]||j[u])throw XX("root node is forbidden and cannot be sanitized in-place")}}else if(n instanceof a)i=Me("\x3c!----\x3e"),l=i.ownerDocument.importNode(n,!0),1===l.nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?i=l:i.appendChild(l);else{if(!Q&&!K&&!Y&&-1===n.indexOf("<"))return w&&te?w.createHTML(n):n;if(i=Me(n),!i)return Q?null:te?x:""}i&&J&&De(i.firstChild);var g=Ne(re?n:i);while(c=g.nextNode())3===c.nodeType&&c===d||He(c)||(c.content instanceof r&&Fe(c.content),ze(c),d=c);if(d=null,re)return n;if(Q){if(ee){m=_.call(i.ownerDocument);while(i.firstChild)m.appendChild(i.firstChild)}else m=i;return V.shadowroot&&(m=T.call(o,m,!0)),m}var h=Y?i.outerHTML:i.innerHTML;return Y&&z["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&YX(xJ,i.ownerDocument.doctype.name)&&(h="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+h),K&&(h=qX(h,N," "),h=qX(h,R," ")),w&&te?w.createHTML(h):h},t.setConfig=function(e){Ce(e),X=!0},t.clearConfig=function(){ye=null,X=!1},t.isValidAttribute=function(e,t,o){ye||Ce({});var n=M(e),r=M(t);return Ie(n,r,o)},t.addHook=function(e,t){"function"===typeof t&&(D[e]=D[e]||[],jX(D[e],t))},t.removeHook=function(e){if(D[e])return UX(D[e])},t.removeHooks=function(e){D[e]&&(D[e]=[])},t.removeAllHooks=function(){D={}},t}var _J=kJ();const OJ=e=>_J().sanitize(e),TJ=oS.deviceType.isTouch(),EJ=(e,t)=>({dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[e,t]}),DJ=(e,t)=>tK.parts.close(RC.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close")}},action:e,buttonBehaviours:Rm([JA.config({})])})),AJ=()=>tK.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}}),MJ=(e,t)=>tK.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:MV(`<p>${OJ(t.translate(e))}</p>`)}]}]}),NJ=e=>tK.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:e}),RJ=(e,t)=>[ZA.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:e}),ZA.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:t})],BJ=e=>{const t="tox-dialog",o=t+"-wrap",n=o+"__backdrop",r=t+"__disable-scroll";return tK.sketch({lazySink:e.lazySink,onEscape:t=>(e.onEscape(t),R.some(!0)),useTabstopAt:e=>!tL(e),dom:{tag:"div",classes:[t].concat(e.extraClasses),styles:{position:"relative",...e.extraStyles}},components:[e.header,e.body,...e.footer.toArray()],parts:{blocker:{dom:MV(`<div class="${o}"></div>`),components:[{dom:{tag:"div",classes:TJ?[n,n+"--opaque"]:[n]}}]}},dragBlockClass:o,modalBehaviours:Rm([fx.config({}),ix("dialog-events",e.dialogEvents.concat([Wi(Za(),((e,t)=>{$w.focusIn(e)}))])),ix("scroll-lock",[qi((()=>{mc(Xt(),r)})),Gi((()=>{gc(Xt(),r)}))]),...e.extraBehaviours]),eventOrder:{[si()]:["dialog-events"],[fi()]:["scroll-lock","dialog-events","alloy.base.behaviour"],[bi()]:["alloy.base.behaviour","dialog-events","scroll-lock"],...e.eventOrder}})},LJ=e=>RC.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close"),title:e.translate("Close")}},components:[WC("close",{tag:"div",classes:["tox-icon"]},e.icons)],action:e=>{Oi(e,lM)}}),HJ=(e,t,o,n)=>{const r=e=>[Zc(n.translate(e.title))];return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:{...o.map((e=>({id:e}))).getOr({})}},components:[],behaviours:Rm([pj.config({channel:`${gX}-${t}`,initialData:e,renderComponents:r})])}},IJ=()=>({dom:MV('<div class="tox-dialog__draghandle"></div>')}),PJ=(e,t,o,n)=>ZA.sketch({dom:MV('<div class="tox-dialog__header"></div>'),components:[HJ(e,t,R.some(o),n),IJ(),LJ(n)],containerBehaviours:Rm([DG.config({mode:"mouse",blockerClass:"blocker",getTarget:e=>rd(e,'[role="dialog"]').getOrDie(),snaps:{getSnapPoints:()=>[],leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}),zJ=(e,t,o)=>{const n=tK.parts.title(HJ(e,t,R.none(),o)),r=tK.parts.draghandle(IJ()),s=tK.parts.close(LJ(o)),a=[n].concat(e.draggable?[r]:[]).concat([s]);return ZA.sketch({dom:MV('<div class="tox-dialog__header"></div>'),components:a})},FJ=(e,t,o)=>zJ({title:o.shared.providers.translate(e),draggable:o.dialog.isDraggableModal()},t,o.shared.providers),VJ=(e,t,o)=>({dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":o.translate(e)},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:t,components:[{dom:MV('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}),ZJ=(e,t,o)=>({onClose:()=>o.closeWindow(),onBlock:o=>{tK.setBusy(e(),((e,n)=>VJ(o.message,n,t)))},onUnblock:()=>{tK.setIdle(e())}}),UJ=(e,t,o,n)=>{const r=(e,t)=>R.some(t);return qc(BJ({...e,lazySink:n.shared.getSink,extraBehaviours:[pj.config({channel:`${uX}-${e.id}`,updateState:r,initialData:t}),PB.memory({}),...e.extraBehaviours],onEscape:e=>{Oi(e,lM)},dialogEvents:o,eventOrder:{[ri()]:[pj.name(),zm.name()],[fi()]:["scroll-lock",pj.name(),"messages","dialog-events","alloy.base.behaviour"],[bi()]:["alloy.base.behaviour","dialog-events","messages",pj.name(),"scroll-lock"]}}))},jJ=e=>{const t=e=>{const t=U(e.items,(e=>{const t=ca(!1);return{...e,storage:t}}));return{...e,items:t}};return U(e,(e=>"menu"===e.type?t(e):e))},$J=e=>K(e,((e,t)=>{if("menu"===t.type){const o=t;return K(o.items,((e,t)=>(e[t.name]=t.storage,e)),e)}return e}),{}),WJ=(e,t)=>[Ui(Za(),eL),e(iM,((e,o)=>{t.onClose(),o.onClose()})),e(lM,((e,t,o,n)=>{t.onCancel(e),Oi(n,iM)})),Ii(uM,((e,o)=>t.onUnblock())),Ii(mM,((e,o)=>t.onBlock(o.event)))],qJ=(e,t)=>{const o=(t,o)=>Ii(t,((t,r)=>{n(t,((n,s)=>{o(e(),n,r.event,t)}))})),n=(e,t)=>{pj.getState(e).get().each((o=>{t(o,e)}))};return[...WJ(o,t),o(cM,((e,t,o)=>{t.onAction(e,{name:o.name})}))]},GJ=(e,t,o)=>{const n=(t,o)=>Ii(t,((t,n)=>{r(t,((r,s)=>{o(e(),r,n.event,t)}))})),r=(e,t)=>{pj.getState(e).get().each((o=>{t(o.internalDialog,e)}))};return[...WJ(n,t),n(dM,((e,t)=>t.onSubmit(e))),n(aM,((e,t,o)=>{t.onChange(e,{name:o.name})})),n(cM,((e,t,n,r)=>{const s=()=>$w.focusIn(r),a=e=>ro(e,"disabled")||no(e,"aria-disabled").exists((e=>"true"===e)),i=Ut(r.element),l=$m(i);t.onAction(e,{name:n.name,value:n.value}),$m(i).fold(s,(e=>{a(e)||l.exists((t=>Ot(e,t)&&a(t)))?s():o().toOptional().filter((t=>!Ot(t.element,e))).each(s)}))})),n(gM,((e,t,o)=>{t.onTabChange(e,{newTabName:o.name,oldTabName:o.oldName})})),Gi((t=>{const o=e();pf.setValue(t,o.getData())}))]},KJ={initUrlDialog:qJ,initDialog:GJ},YJ=(e,t)=>ZH(e,e.type,t),XJ=(e,t,o)=>X(t,(e=>e.name===o)).bind((t=>t.memento.getOpt(e))),JJ=(e,t)=>{const o=t.map((e=>e.footerButtons)).getOr([]),n=W(o,(e=>"start"===e.align)),r=(e,t)=>ZA.sketch({dom:{tag:"div",classes:[`tox-dialog__footer-${e}`]},components:U(t,(e=>e.memento.asSpec()))}),s=r("start",n.pass),a=r("end",n.fail);return[s,a]},QJ=(e,t,o)=>{const n=(e,t)=>{const n=U(t.buttons,(e=>{const t=BC(YJ(e,o));return{name:e.name,align:e.align,memento:t}})),r=t=>XJ(e,n,t);return R.some({lookupByName:r,footerButtons:n})};return{dom:MV('<div class="tox-dialog__footer"></div>'),components:[],behaviours:Rm([pj.config({channel:`${pX}-${t}`,initialData:e,updateState:n,renderComponents:JJ})])}},eQ=(e,t,o)=>QJ(e,t,o),tQ=(e,t,o)=>tK.parts.footer(QJ(e,t,o)),oQ=(e,t)=>{const o=e.getRoot();if(o.getSystem().isConnected()){const o=Rb.getCurrent(e.getFormWrapper()).getOr(e.getFormWrapper());return yB.getField(o,t).orThunk((()=>{const o=e.getFooter(),n=pj.getState(o).get();return n.bind((e=>e.lookupByName(t)))}))}return R.none()},nQ=(e,t)=>{const o=e.getRoot();return pj.getState(o).get().map((e=>_s(ks("data",e.dataValidator,t)))).getOr(t)},rQ=(e,t,o)=>{const n=t=>{const o=e.getRoot();o.getSystem().isConnected()&&t(o)},r=()=>{const t=e.getRoot(),n=t.getSystem().isConnected()?e.getFormWrapper():t,r=pf.getValue(n),s=pe(o,(e=>e.get()));return{...r,...s}},s=t=>{n((n=>{const r=h.getData(),s=Or(r,t),a=nQ(e,s),i=e.getFormWrapper();pf.setValue(i,a),he(o,((e,t)=>{_e(s,t)&&e.set(s[t])}))}))},a=(t,o)=>{oQ(e,t).each(o?Jb.enable:Jb.disable)},l=t=>{oQ(e,t).each(fx.focus)},c=e=>{if(!i(e))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");n((t=>{Ti(t,mM,{message:e})}))},d=()=>{n((e=>{Oi(e,uM)}))},m=t=>{n((o=>{const n=e.getBody(),r=pj.getState(n);r.get().exists((e=>e.isTabPanel()))&&Rb.getCurrent(n).each((e=>{eX.showTab(e,t)}))}))},u=o=>{n((n=>{const r=e.getId(),s=t(o);n.getSystem().broadcastOn([`${uX}-${r}`],s),n.getSystem().broadcastOn([`${gX}-${r}`],s.internalDialog),n.getSystem().broadcastOn([`${hX}-${r}`],s.internalDialog),n.getSystem().broadcastOn([`${pX}-${r}`],s.internalDialog),h.setData(s.initialData)}))},g=()=>{n((e=>{Oi(e,iM)}))},h={getData:r,setData:s,setEnabled:a,focus:l,block:c,unblock:d,showTab:m,redial:u,close:g};return h},sQ=e=>{switch(e){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}},aQ=(e,t,o)=>{const n=cl("dialog"),r=e.internalDialog,s=FJ(r.title,n,o),a=yX({body:r.body,initialData:r.initialData},n,o),i=jJ(r.buttons),l=$J(i),c=tQ({buttons:i},n,o),d=KJ.initDialog((()=>p),ZJ((()=>g),o.shared.providers,t),o.shared.getSink),m=sQ(r.size),u={id:n,header:s,body:a,footer:R.some(c),extraClasses:m,extraBehaviours:[],extraStyles:{}},g=UJ(u,e,d,o),h=(()=>{const e=()=>{const e=tK.getBody(g);return Rb.getCurrent(e).getOr(e)};return{getId:S(n),getRoot:S(g),getBody:()=>tK.getBody(g),getFooter:()=>tK.getFooter(g),getFormWrapper:e}})(),p=rQ(h,t.redial,l);return{dialog:g,instanceApi:p}},iQ=(e,t,o,n)=>{const r=cl("dialog"),s=cl("dialog-label"),a=cl("dialog-content"),i=e.internalDialog,l=(e,t)=>R.some(t),c=BC(PJ({title:i.title,draggable:!0},r,s,o.shared.providers)),d=BC(vX({body:i.body,initialData:i.initialData},r,a,o,n)),m=jJ(i.buttons),u=$J(m),g=BC(eQ({buttons:m},r,o)),h=KJ.initDialog((()=>f),{onBlock:e=>{EV.block(p,((t,n)=>VJ(e.message,n,o.shared.providers)))},onUnblock:()=>{EV.unblock(p)},onClose:()=>t.closeWindow()},o.shared.getSink),p=qc({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:{role:"dialog",["aria-labelledby"]:s,["aria-describedby"]:a}},eventOrder:{[ri()]:[pj.name(),zm.name()],[si()]:["execute-on-form"],[fi()]:["reflecting","execute-on-form"]},behaviours:Rm([$w.config({mode:"cyclic",onEscape:e=>(Oi(e,iM),R.some(!0)),useTabstopAt:e=>!tL(e)&&("button"!==ut(e)||"disabled"!==oo(e,"disabled"))}),pj.config({channel:`${uX}-${r}`,updateState:l,initialData:e}),fx.config({}),ix("execute-on-form",h.concat([Wi(Za(),((e,t)=>{$w.focusIn(e)}))])),EV.config({getRoot:()=>R.some(p)}),sx.config({}),PB.memory({})]),components:[c.asSpec(),d.asSpec(),g.asSpec()]}),f=rQ({getId:S(r),getRoot:S(p),getFooter:()=>g.get(p),getBody:()=>d.get(p),getFormWrapper:()=>{const e=d.get(p);return Rb.getCurrent(e).getOr(e)}},t.redial,u);return{dialog:p,instanceApi:f}};var lQ=tinymce.util.Tools.resolve("tinymce.util.URI");const cQ=e=>{const t=t=>{e.getSystem().isConnected()&&t(e)},o=e=>{if(!i(e))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");t((t=>{Ti(t,mM,{message:e})}))},n=()=>{t((e=>{Oi(e,uM)}))},r=()=>{t((e=>{Oi(e,iM)}))},s=e=>{t((t=>{t.getSystem().broadcastOn([fX],e)}))};return{block:o,unblock:n,close:r,sendMessage:s}},dQ=["insertContent","setContent","execCommand","close","block","unblock"],mQ=e=>l(e)&&-1!==dQ.indexOf(e.mceAction),uQ=e=>!mQ(e)&&l(e)&&_e(e,"mceAction"),gQ=(e,t,o)=>{switch(o.mceAction){case"insertContent":e.insertContent(o.content);break;case"setContent":e.setContent(o.content);break;case"execCommand":const n=!!u(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();break}},hQ=(e,t,o,n)=>{const r=cl("dialog"),s=FJ(e.title,r,n),a=wX(e),i=e.buttons.bind((e=>0===e.length?R.none():R.some(tQ({buttons:e},r,n)))),l=KJ.initUrlDialog((()=>v),ZJ((()=>b),n.shared.providers,t)),c={...e.height.fold((()=>({})),(e=>({height:e+"px","max-height":e+"px"}))),...e.width.fold((()=>({})),(e=>({width:e+"px","max-width":e+"px"})))},d=e.width.isNone()&&e.height.isNone()?["tox-dialog--width-lg"]:[],m=new lQ(e.url,{base_uri:new lQ(window.location.href)}),u=`${m.protocol}://${m.host}${m.port?":"+m.port:""}`,g=wu(),h=[ix("messages",[qi((()=>{const t=Su(Qe.fromDom(window),"message",(t=>{if(m.isSameOrigin(new lQ(t.raw.origin))){const n=t.raw.data;mQ(n)?gQ(o,v,n):uQ(n)&&e.onMessage(v,n)}}));g.set(t)})),Gi(g.clear)]),zm.config({channels:{[fX]:{onReceive:(e,t)=>{nd(e.element,"iframe").each((e=>{const o=e.dom.contentWindow;p(o)&&o.postMessage(t,u)}))}}}})],f={id:r,header:s,body:a,footer:i,extraClasses:d,extraBehaviours:h,extraStyles:c},b=UJ(f,e,l,n),v=cQ(b);return{dialog:b,instanceApi:v}},pQ=e=>{const t=e.shared,o=(o,n)=>{const r=()=>{tK.hide(l),n()},s=BC(ZH({name:"close-alert",text:"OK",primary:!0,buttonType:R.some("primary"),align:"end",enabled:!0,icon:R.none()},"cancel",e)),a=AJ(),i=DJ(r,t.providers),l=qc(BJ({lazySink:()=>t.getSink(),header:EJ(a,i),body:MJ(o,t.providers),footer:R.some(NJ(RJ([],[s.asSpec()]))),onEscape:r,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Ii(lM,r)],eventOrder:{}}));tK.show(l);const c=s.get(l);fx.focus(c)};return{open:o}},fQ=e=>{const t=e.shared,o=(o,n)=>{const r=e=>{tK.hide(c),n(e)},s=BC(ZH({name:"yes",text:"Yes",primary:!0,buttonType:R.some("primary"),align:"end",enabled:!0,icon:R.none()},"submit",e)),a=ZH({name:"no",text:"No",primary:!1,buttonType:R.some("secondary"),align:"end",enabled:!0,icon:R.none()},"cancel",e),i=AJ(),l=DJ((()=>r(!1)),t.providers),c=qc(BJ({lazySink:()=>t.getSink(),header:EJ(i,l),body:MJ(o,t.providers),footer:R.some(NJ(RJ([],[a,s.asSpec()]))),onEscape:()=>r(!1),extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Ii(lM,(()=>r(!1))),Ii(dM,(()=>r(!0)))],eventOrder:{}}));tK.show(c);const d=s.get(c);fx.focus(d)};return{open:o}},bQ=(e,t)=>_s(ks("data",t,e)),vQ=e=>vA(e,".tox-alert-dialog")||vA(e,".tox-confirm-dialog"),yQ=(e,t,o)=>t&&o?[]:[Jz.config({contextual:{lazyContext:()=>R.some(tr(Qe.fromDom(e.getContentAreaContainer()))),fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})],wQ=e=>{const t=e.editor,o=QS(t),n=pQ(e.backstages.dialog),r=fQ(e.backstages.dialog),s=(t,o,n)=>void 0!==o&&"toolbar"===o.inline?c(t,e.backstages.popup.shared.anchors.inlineDialog(),n,o.ariaAttrs):void 0!==o&&"cursor"===o.inline?c(t,e.backstages.popup.shared.anchors.cursor(),n,o.ariaAttrs):l(t,n),a=(e,t)=>i(e,t),i=(o,n)=>{const r=o=>{const r=hQ(o,{closeWindow:()=>{tK.hide(r.dialog),n(r.instanceApi)}},t,e.backstages.dialog);return tK.show(r.dialog),r.instanceApi};return IY.openUrl(r,o)},l=(t,o)=>{const n=(t,n,r)=>{const s=n,a={dataValidator:r,initialData:s,internalDialog:t},i=aQ(a,{redial:IY.redial,closeWindow:()=>{tK.hide(i.dialog),o(i.instanceApi)}},e.backstages.dialog);return tK.show(i.dialog),i.instanceApi.setData(s),i.instanceApi};return IY.open(n,t)},c=(n,r,s,a=!1)=>{const i=(n,i,l)=>{const c=bQ(i,l),d=xu(),m=e.backstages.popup.shared.header.isPositionedAtTop(),u={dataValidator:l,initialData:c,internalDialog:n},g=()=>d.on((e=>{AC.reposition(e),Jz.refresh(e)})),h=iQ(u,{redial:IY.redial,closeWindow:()=>{d.on(AC.hide),t.off("ResizeEditor",g),d.clear(),s(h.instanceApi)}},e.backstages.popup,a),p=qc(AC.sketch({lazySink:e.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{},...m?{}:{fireRepositionEventInstead:{}},inlineBehaviours:Rm([ix("window-manager-inline-events",[Ii(vi(),((e,t)=>{Oi(h.dialog,lM)}))]),...yQ(t,o,m)]),isExtraPart:(e,t)=>vQ(t)}));return d.set(p),AC.showWithin(p,Gc(h.dialog),{anchor:r},R.some(Xt())),o&&m||(Jz.refresh(p),t.on("ResizeEditor",g)),h.instanceApi.setData(c),$w.focusIn(h.dialog),h.instanceApi};return IY.open(i,n)},d=(e,t)=>{r.open(e,t)},m=(e,t)=>{n.open(e,t)},u=e=>{e.close()};return{open:s,openUrl:a,alert:m,close:u,confirm:d}},xQ=e=>{sS(e),DE(e),IW(e)};var CQ=()=>{N.add("silver",(e=>{xQ(e);const{dialogs:t,popups:o,renderUI:n}=GG(e);bA.register(e,o.backstage.shared);const r=wQ({editor:e,backstages:{popup:o.backstage,dialog:t.backstage}}),s=()=>QC(e,{backstage:o.backstage},o.getMothership());return{renderUI:n,getWindowManagerImpl:S(r),getNotificationManagerImpl:s}}))};CQ()})()},5199:function(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-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(e)},n=function(e,t){var o=Array.prototype.slice.call(e);return o.sort(t)},r=function(e,t){return s((function(o,n){return e.eq(t(o),t(n))}))},s=function(e){return{eq:e}},a=s((function(e,t){return e===t})),i=a,l=function(e){return s((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}))},c=function(e,t){return r(l(e),(function(e){return n(e,t)}))},d=function(e){return s((function(t,o){var n=Object.keys(t),r=Object.keys(o);if(!c(i).eq(n,r))return!1;for(var s=n.length,a=0;a<s;a++){var l=n[a];if(!e.eq(t[l],o[l]))return!1}return!0}))},m=s((function(e,n){if(e===n)return!0;var r=t(e),s=t(n);return r===s&&(o(r)?e===n:"array"===r?l(m).eq(e,n):"object"===r&&d(m).eq(e,n))}));const u=Object.getPrototypeOf,g=(e,t,o)=>{var n;return!!o(e,t.prototype)||(null===(n=e.constructor)||void 0===n?void 0:n.name)===t.name},h=e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&g(e,String,((e,t)=>t.isPrototypeOf(e)))?"string":t},p=e=>t=>h(t)===e,f=e=>t=>typeof t===e,b=e=>t=>e===t,v=(e,t)=>w(e)&&g(e,t,((e,t)=>u(e)===t)),y=p("string"),w=p("object"),x=e=>v(e,Object),C=p("array"),S=b(null),k=f("boolean"),_=b(void 0),O=e=>null===e||void 0===e,T=e=>!O(e),E=f("function"),D=f("number"),A=(e,t)=>{if(C(e)){for(let o=0,n=e.length;o<n;++o)if(!t(e[o]))return!1;return!0}return!1},M=()=>{},N=(e,t)=>(...o)=>e(t.apply(null,o)),R=(e,t)=>o=>e(t(o)),B=e=>()=>e,L=e=>e,H=(e,t)=>e===t;function I(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const P=e=>t=>!e(t),z=e=>()=>{throw new Error(e)},F=e=>e(),V=e=>{e()},Z=B(!1),U=B(!0);class j{constructor(e,t){this.tag=e,this.value=t}static some(e){return new j(!0,e)}static none(){return j.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?j.some(e(this.value)):j.none()}bind(e){return this.tag?e(this.value):j.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:j.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&&void 0!==e?e:"Called getOrDie on None")}static from(e){return T(e)?j.some(e):j.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()"}}j.singletonNone=new j(!1);const $=Array.prototype.slice,W=Array.prototype.indexOf,q=Array.prototype.push,G=(e,t)=>W.call(e,t),K=(e,t)=>{const o=G(e,t);return-1===o?j.none():j.some(o)},Y=(e,t)=>G(e,t)>-1,X=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];if(t(n,o))return!0}return!1},J=(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++){const n=e[o];t(n,o)}},ee=(e,t)=>{for(let o=e.length-1;o>=0;o--){const n=e[o];t(n,o)}},te=(e,t)=>{const o=[],n=[];for(let r=0,s=e.length;r<s;r++){const s=e[r],a=t(s,r)?o:n;a.push(s)}return{pass:o,fail:n}},oe=(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},ne=(e,t,o)=>(ee(e,((e,n)=>{o=t(o,e,n)})),o),re=(e,t,o)=>(Q(e,((e,n)=>{o=t(o,e,n)})),o),se=(e,t,o)=>{for(let n=0,r=e.length;n<r;n++){const r=e[n];if(t(r,n))return j.some(r);if(o(r,n))break}return j.none()},ae=(e,t)=>se(e,t,Z),ie=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];if(t(n,o))return j.some(o)}return j.none()},le=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!C(e[o]))throw new Error("Arr.flatten item "+o+" was not an array, input: "+e);q.apply(t,e[o])}return t},ce=(e,t)=>le(J(e,t)),de=(e,t)=>{for(let o=0,n=e.length;o<n;++o){const n=e[o];if(!0!==t(n,o))return!1}return!0},me=e=>{const t=$.call(e,0);return t.reverse(),t},ue=(e,t)=>oe(e,(e=>!Y(t,e))),ge=(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},he=(e,t)=>{const o=$.call(e,0);return o.sort(t),o},pe=(e,t)=>t>=0&&t<e.length?j.some(e[t]):j.none(),fe=e=>pe(e,0),be=e=>pe(e,e.length-1),ve=E(Array.from)?Array.from:e=>$.call(e),ye=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome())return n}return j.none()},we=(e,t)=>{const o=[],n=E(t)?e=>X(o,(o=>t(o,e))):e=>Y(o,e);for(let r=0,s=e.length;r<s;r++){const t=e[r];n(t)||o.push(t)}return o},xe=Object.keys,Ce=Object.hasOwnProperty,Se=(e,t)=>{const o=xe(e);for(let n=0,r=o.length;n<r;n++){const r=o[n],s=e[r];t(s,r)}},ke=(e,t)=>_e(e,((e,o)=>({k:o,v:t(e,o)}))),_e=(e,t)=>{const o={};return Se(e,((e,n)=>{const r=t(e,n);o[r.k]=r.v})),o},Oe=e=>(t,o)=>{e[o]=t},Te=(e,t,o,n)=>{Se(e,((e,r)=>{(t(e,r)?o:n)(e,r)}))},Ee=(e,t)=>{const o={},n={};return Te(e,t,Oe(o),Oe(n)),{t:o,f:n}},De=(e,t)=>{const o={};return Te(e,t,Oe(o),M),o},Ae=(e,t)=>{const o=[];return Se(e,((e,n)=>{o.push(t(e,n))})),o},Me=e=>Ae(e,L),Ne=(e,t)=>Re(e,t)?j.from(e[t]):j.none(),Re=(e,t)=>Ce.call(e,t),Be=(e,t)=>Re(e,t)&&void 0!==e[t]&&null!==e[t],Le=(e,t,o=m)=>d(o).eq(e,t),He=e=>{const t={};return Q(e,(e=>{t[e]={}})),xe(t)},Ie=e=>void 0!==e.length,Pe=Array.isArray,ze=e=>{if(Pe(e))return e;{const t=[];for(let o=0,n=e.length;o<n;o++)t[o]=e[o];return t}},Fe=(e,t,o)=>{if(!e)return!1;if(o=o||e,Ie(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(Re(e,n)&&!1===t.call(o,e[n],n,e))return!1;return!0},Ve=(e,t)=>{const o=[];return Fe(e,((n,r)=>{o.push(t(n,r,e))})),o},Ze=(e,t)=>{const o=[];return Fe(e,((n,r)=>{t&&!t(n,r,e)||o.push(n)})),o},Ue=(e,t)=>{if(e)for(let o=0,n=e.length;o<n;o++)if(e[o]===t)return o;return-1},je=(e,t,o,n)=>{let r=_(o)?e[0]:o;for(let s=0;s<e.length;s++)r=t.call(n,r,e[s],s);return r},$e=(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},We=e=>e[e.length-1],qe=e=>{let t,o=!1;return(...n)=>(o||(o=!0,t=e.apply(null,n)),t)},Ge=(e,t,o,n)=>{const r=e.isiOS()&&!0===/ipad/i.test(o),s=e.isiOS()&&!r,a=e.isiOS()||e.isAndroid(),i=a||n("(pointer:coarse)"),l=r||!s&&a&&n("(min-device-width:768px)"),c=s||a&&!l,d=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),m=!c&&!l&&!d;return{isiPad:B(r),isiPhone:B(s),isTablet:B(l),isPhone:B(c),isTouch:B(i),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:B(d),isDesktop:B(m)}},Ke=(e,t)=>{for(let o=0;o<e.length;o++){const n=e[o];if(n.test(t))return n}},Ye=(e,t)=>{const o=Ke(e,t);if(!o)return{major:0,minor:0};const n=e=>Number(t.replace(o,"$"+e));return Qe(n(1),n(2))},Xe=(e,t)=>{const o=String(t).toLowerCase();return 0===e.length?Je():Ye(e,o)},Je=()=>Qe(0,0),Qe=(e,t)=>({major:e,minor:t}),et={nu:Qe,detect:Xe,unknown:Je},tt=(e,t)=>ye(t.brands,(t=>{const o=t.brand.toLowerCase();return ae(e,(e=>{var t;return o===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((e=>({current:e.name,version:et.nu(parseInt(t.version,10),0)})))})),ot=(e,t)=>{const o=String(t).toLowerCase();return ae(e,(e=>e.search(o)))},nt=(e,t)=>ot(e,t).map((e=>{const o=et.detect(e.versionRegexes,t);return{current:e.name,version:o}})),rt=(e,t)=>ot(e,t).map((e=>{const o=et.detect(e.versionRegexes,t);return{current:e.name,version:o}})),st=(e,t)=>e.substring(t),at=(e,t,o)=>""===t||e.length>=t.length&&e.substr(o,o+t.length)===t,it=(e,t)=>ct(e,t)?st(e,t.length):e,lt=(e,t,o=0,n)=>{const r=e.indexOf(t,o);return-1!==r&&(!!_(n)||r+t.length<=n)},ct=(e,t)=>at(e,t,0),dt=(e,t)=>at(e,t,e.length-t.length),mt=e=>t=>t.replace(e,""),ut=mt(/^\s+|\s+$/g),gt=mt(/^\s+/g),ht=mt(/\s+$/g),pt=e=>e.length>0,ft=e=>!pt(e),bt=(e,t)=>t<=0?"":new Array(t+1).join(e),vt=(e,t=10)=>{const o=parseInt(e,t);return isNaN(o)?j.none():j.some(o)},yt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,wt=e=>t=>lt(t,e),xt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>lt(e,"edge/")&&lt(e,"chrome")&&lt(e,"safari")&&lt(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,yt],search:e=>lt(e,"chrome")&&!lt(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>lt(e,"msie")||lt(e,"trident")},{name:"Opera",versionRegexes:[yt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:wt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:wt("firefox")},{name:"Safari",versionRegexes:[yt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(lt(e,"safari")||lt(e,"mobile/"))&&lt(e,"applewebkit")}],Ct=[{name:"Windows",search:wt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>lt(e,"iphone")||lt(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:wt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:wt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:wt("linux"),versionRegexes:[]},{name:"Solaris",search:wt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:wt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:wt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],St={browsers:B(xt),oses:B(Ct)},kt="Edge",_t="Chromium",Ot="IE",Tt="Opera",Et="Firefox",Dt="Safari",At=()=>Mt({current:void 0,version:et.unknown()}),Mt=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isEdge:n(kt),isChromium:n(_t),isIE:n(Ot),isOpera:n(Tt),isFirefox:n(Et),isSafari:n(Dt)}},Nt={unknown:At,nu:Mt,edge:B(kt),chromium:B(_t),ie:B(Ot),opera:B(Tt),firefox:B(Et),safari:B(Dt)},Rt="Windows",Bt="iOS",Lt="Android",Ht="Linux",It="macOS",Pt="Solaris",zt="FreeBSD",Ft="ChromeOS",Vt=()=>Zt({current:void 0,version:et.unknown()}),Zt=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isWindows:n(Rt),isiOS:n(Bt),isAndroid:n(Lt),isMacOS:n(It),isLinux:n(Ht),isSolaris:n(Pt),isFreeBSD:n(zt),isChromeOS:n(Ft)}},Ut={unknown:Vt,nu:Zt,windows:B(Rt),ios:B(Bt),android:B(Lt),linux:B(Ht),macos:B(It),solaris:B(Pt),freebsd:B(zt),chromeos:B(Ft)},jt=(e,t,o)=>{const n=St.browsers(),r=St.oses(),s=t.bind((e=>tt(n,e))).orThunk((()=>nt(n,e))).fold(Nt.unknown,Nt.nu),a=rt(r,e).fold(Ut.unknown,Ut.nu),i=Ge(a,s,e,o);return{browser:s,os:a,deviceType:i}},$t={detect:jt},Wt=e=>window.matchMedia(e).matches;let qt=qe((()=>$t.detect(navigator.userAgent,j.from(navigator.userAgentData),Wt)));const Gt=()=>qt(),Kt=navigator.userAgent,Yt=Gt(),Xt=Yt.browser,Jt=Yt.os,Qt=Yt.deviceType,eo=-1!==Kt.indexOf("Windows Phone"),to={transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",documentMode:Xt.isIE()?document.documentMode||7:10,cacheSuffix:null,container:null,canHaveCSP:!Xt.isIE(),windowsPhone:eo,browser:{current:Xt.current,version:Xt.version,isChromium:Xt.isChromium,isEdge:Xt.isEdge,isFirefox:Xt.isFirefox,isIE:Xt.isIE,isOpera:Xt.isOpera,isSafari:Xt.isSafari},os:{current:Jt.current,version:Jt.version,isAndroid:Jt.isAndroid,isChromeOS:Jt.isChromeOS,isFreeBSD:Jt.isFreeBSD,isiOS:Jt.isiOS,isLinux:Jt.isLinux,isMacOS:Jt.isMacOS,isSolaris:Jt.isSolaris,isWindows:Jt.isWindows},deviceType:{isDesktop:Qt.isDesktop,isiPad:Qt.isiPad,isiPhone:Qt.isiPhone,isPhone:Qt.isPhone,isTablet:Qt.isTablet,isTouch:Qt.isTouch,isWebView:Qt.isWebView}},oo=/^\s*|\s*$/g,no=e=>O(e)?"":(""+e).replace(oo,""),ro=(e,t)=>t?!("array"!==t||!Pe(e))||typeof e===t:void 0!==e,so=(e,t,o={})=>{const n=y(e)?e.split(t||","):e||[];let r=n.length;while(r--)o[n[r]]={};return o},ao=Re,io=(e,...t)=>{for(let o=0;o<t.length;o++){const n=t[o];for(const t in n)if(Re(n,t)){const o=n[t];void 0!==o&&(e[t]=o)}}return e},lo=function(e,t,o,n){n=n||this,e&&(o&&(e=e[o]),Fe(e,((e,r)=>!1!==t.call(n,e,r,o)&&(lo(e,t,o,n),!0))))},co=(e,t=window)=>{const o=e.split(".");for(let n=0,r=o.length;n<r;n++)if(t=t[o[n]],!t)break;return t},mo=(e,t)=>C(e)?e:""===e?[]:Ve(e.split(t||","),no),uo=e=>{const t=to.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e},go={trim:no,isArray:Pe,is:ro,toArray:ze,makeMap:so,each:Fe,map:Ve,grep:Ze,inArray:Ue,hasOwn:ao,extend:io,walk:lo,resolve:co,explode:mo,_addCacheSuffix:uo},ho=(e,t,o=H)=>e.exists((e=>o(e,t))),po=e=>{const t=[],o=e=>{t.push(e)};for(let n=0;n<e.length;n++)e[n].each(o);return t},fo=(e,t,o)=>e.isSome()&&t.isSome()?j.some(o(e.getOrDie(),t.getOrDie())):j.none(),bo=(e,t,o,n)=>e.isSome()&&t.isSome()&&o.isSome()?j.some(n(e.getOrDie(),t.getOrDie(),o.getOrDie())):j.none(),vo=(e,t)=>e?j.some(t):j.none();"undefined"!==typeof window?window:Function("return this;")();const yo=8,wo=9,xo=11,Co=1,So=3,ko=e=>{const t=e.dom.nodeName;return t.toLowerCase()},_o=e=>e.dom.nodeType,Oo=e=>t=>_o(t)===e,To=e=>_o(e)===yo||"#comment"===ko(e),Eo=Oo(Co),Do=Oo(So),Ao=Oo(wo),Mo=Oo(xo),No=e=>t=>Eo(t)&&ko(t)===e,Ro=(e,t,o)=>{if(!(y(o)||k(o)||D(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+"")},Bo=(e,t,o)=>{Ro(e.dom,t,o)},Lo=(e,t)=>{const o=e.dom;Se(t,((e,t)=>{Ro(o,t,e)}))},Ho=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},Io=(e,t)=>j.from(Ho(e,t)),Po=(e,t)=>{const o=e.dom;return!(!o||!o.hasAttribute)&&o.hasAttribute(t)},zo=(e,t)=>{e.dom.removeAttribute(t)},Fo=e=>{const t=e.dom.attributes;return void 0===t||null===t||0===t.length},Vo=e=>re(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}),Zo=(e,t)=>{const o=Ho(e,t);return void 0===o||""===o?[]:o.split(" ")},Uo=(e,t,o)=>{const n=Zo(e,t),r=n.concat([o]);return Bo(e,t,r.join(" ")),!0},jo=(e,t,o)=>{const n=oe(Zo(e,t),(e=>e!==o));return n.length>0?Bo(e,t,n.join(" ")):zo(e,t),!1},$o=e=>void 0!==e.dom.classList,Wo=e=>Zo(e,"class"),qo=(e,t)=>Uo(e,"class",t),Go=(e,t)=>jo(e,"class",t),Ko=(e,t)=>Y(Wo(e),t)?Go(e,t):qo(e,t),Yo=(e,t)=>{$o(e)?e.dom.classList.add(t):qo(e,t)},Xo=e=>{const t=$o(e)?e.dom.classList:Wo(e);0===t.length&&zo(e,"class")},Jo=(e,t)=>{if($o(e)){const o=e.dom.classList;o.remove(t)}else Go(e,t);Xo(e)},Qo=(e,t)=>{const o=$o(e)?e.dom.classList.toggle(t):Ko(e,t);return Xo(e),o},en=(e,t)=>$o(e)&&e.dom.classList.contains(t),tn=e=>void 0!==e.style&&E(e.style.getPropertyValue),on=(e,t)=>{const o=t||document,n=o.createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return sn(n.childNodes[0])},nn=(e,t)=>{const o=t||document,n=o.createElement(e);return sn(n)},rn=(e,t)=>{const o=t||document,n=o.createTextNode(e);return sn(n)},sn=e=>{if(null===e||void 0===e)throw new Error("Node cannot be null or undefined");return{dom:e}},an=(e,t,o)=>j.from(e.dom.elementFromPoint(t,o)).map(sn),ln={fromHtml:on,fromTag:nn,fromText:rn,fromDom:sn,fromPoint:an},cn=(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},dn=(e,t)=>{const o=e.dom;if(o.nodeType!==Co)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")}},mn=e=>e.nodeType!==Co&&e.nodeType!==wo&&e.nodeType!==xo||0===e.childElementCount,un=(e,t)=>{const o=void 0===t?document:t.dom;return mn(o)?[]:J(o.querySelectorAll(e),ln.fromDom)},gn=(e,t)=>{const o=void 0===t?document:t.dom;return mn(o)?j.none():j.from(o.querySelector(e)).map(ln.fromDom)},hn=(e,t)=>e.dom===t.dom,pn=(e,t)=>{const o=e.dom,n=t.dom;return o!==n&&o.contains(n)},fn=e=>ln.fromDom(e.dom.ownerDocument),bn=e=>Ao(e)?e:fn(e),vn=e=>ln.fromDom(bn(e).dom.documentElement),yn=e=>ln.fromDom(bn(e).dom.defaultView),wn=e=>j.from(e.dom.parentNode).map(ln.fromDom),xn=e=>j.from(e.dom.parentElement).map(ln.fromDom),Cn=(e,t)=>{const o=E(t)?t:Z;let n=e.dom;const r=[];while(null!==n.parentNode&&void 0!==n.parentNode){const e=n.parentNode,t=ln.fromDom(e);if(r.push(t),!0===o(t))break;n=e}return r},Sn=e=>{const t=t=>oe(t,(t=>!hn(e,t)));return wn(e).map(En).map(t).getOr([])},kn=e=>j.from(e.dom.previousSibling).map(ln.fromDom),_n=e=>j.from(e.dom.nextSibling).map(ln.fromDom),On=e=>me(cn(e,kn)),Tn=e=>cn(e,_n),En=e=>J(e.dom.childNodes,ln.fromDom),Dn=(e,t)=>{const o=e.dom.childNodes;return j.from(o[t]).map(ln.fromDom)},An=e=>Dn(e,0),Mn=e=>Dn(e,e.dom.childNodes.length-1),Nn=e=>e.dom.childNodes.length,Rn=e=>{const t=e.dom.head;if(null===t||void 0===t)throw new Error("Head is not available yet");return ln.fromDom(t)},Bn=e=>Mo(e)&&T(e.dom.host),Ln=E(Element.prototype.attachShadow)&&E(Node.prototype.getRootNode),Hn=B(Ln),In=Ln?e=>ln.fromDom(e.dom.getRootNode()):bn,Pn=e=>Bn(e)?e:Rn(bn(e)),zn=e=>Bn(e)?e:ln.fromDom(bn(e).dom.body),Fn=e=>{const t=In(e);return Bn(t)?j.some(t):j.none()},Vn=e=>ln.fromDom(e.dom.host),Zn=e=>{if(Hn()&&T(e.target)){const t=ln.fromDom(e.target);if(Eo(t)&&Un(t)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return fe(t)}}return j.from(e.target)},Un=e=>T(e.dom.shadowRoot),jn=e=>{const t=Do(e)?e.dom.parentNode:e.dom;if(void 0===t||null===t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return Fn(ln.fromDom(t)).fold((()=>o.body.contains(t)),R(jn,Vn))},$n=(e,t,o)=>{if(!y(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);tn(e)&&e.style.setProperty(t,o)},Wn=(e,t)=>{tn(e)&&e.style.removeProperty(t)},qn=(e,t,o)=>{const n=e.dom;$n(n,t,o)},Gn=(e,t)=>{const o=e.dom;Se(t,((e,t)=>{$n(o,t,e)}))},Kn=(e,t)=>{const o=e.dom,n=window.getComputedStyle(o),r=n.getPropertyValue(t);return""!==r||jn(e)?r:Yn(o,t)},Yn=(e,t)=>tn(e)?e.style.getPropertyValue(t):"",Xn=(e,t)=>{const o=e.dom,n=Yn(o,t);return j.from(n).filter((e=>e.length>0))},Jn=e=>{const t={},o=e.dom;if(tn(o))for(let n=0;n<o.style.length;n++){const e=o.style.item(n);t[e]=o.style[e]}return t},Qn=(e,t)=>{const o=e.dom;Wn(o,t),ho(Io(e,"style").map(ut),"")&&zo(e,"style")},er=e=>e.dom.offsetWidth,tr=(e,t)=>{const o=wn(e);o.each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},or=(e,t)=>{const o=_n(e);o.fold((()=>{const o=wn(e);o.each((e=>{rr(e,t)}))}),(e=>{tr(e,t)}))},nr=(e,t)=>{const o=An(e);o.fold((()=>{rr(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))},rr=(e,t)=>{e.dom.appendChild(t.dom)},sr=(e,t)=>{tr(e,t),rr(t,e)},ar=(e,t)=>{Q(t,((o,n)=>{const r=0===n?e:t[n-1];or(r,o)}))},ir=(e,t)=>{Q(t,(t=>{rr(e,t)}))},lr=e=>{e.dom.textContent="",Q(En(e),(e=>{cr(e)}))},cr=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},dr=e=>{const t=En(e);t.length>0&&ar(e,t),cr(e)},mr=(e,t)=>{const o=t||document,n=o.createElement("div");return n.innerHTML=e,En(ln.fromDom(n))},ur=e=>J(e,ln.fromDom),gr=e=>e.dom.innerHTML,hr=(e,t)=>{const o=fn(e),n=o.dom,r=ln.fromDom(n.createDocumentFragment()),s=mr(t,n);ir(r,s),lr(e),rr(e,r)},pr=e=>{const t=ln.fromTag("div"),o=ln.fromDom(e.dom.cloneNode(!0));return rr(t,o),gr(t)},fr=(e,t,o,n,r,s,a)=>({target:e,x:t,y:o,stop:n,prevent:r,kill:s,raw:a}),br=e=>{const t=ln.fromDom(Zn(e).getOr(e.target)),o=()=>e.stopPropagation(),n=()=>e.preventDefault(),r=N(n,o);return fr(t,e.clientX,e.clientY,o,n,r,e)},vr=(e,t)=>o=>{e(o)&&t(br(o))},yr=(e,t,o,n,r)=>{const s=vr(o,n);return e.dom.addEventListener(t,s,r),{unbind:I(xr,e,t,s,r)}},wr=(e,t,o,n)=>yr(e,t,o,n,!1),xr=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)},Cr=(e,t)=>{const o=(o,n)=>Cr(e+o,t+n);return{left:e,top:t,translate:o}},Sr=Cr,kr=e=>{const t=e.getBoundingClientRect();return Sr(t.left,t.top)},_r=(e,t)=>void 0!==e?e:void 0!==t?t:0,Or=e=>{const t=e.dom.ownerDocument,o=t.body,n=t.defaultView,r=t.documentElement;if(o===e.dom)return Sr(o.offsetLeft,o.offsetTop);const s=_r(null===n||void 0===n?void 0:n.pageYOffset,r.scrollTop),a=_r(null===n||void 0===n?void 0:n.pageXOffset,r.scrollLeft),i=_r(r.clientTop,o.clientTop),l=_r(r.clientLeft,o.clientLeft);return Tr(e).translate(a-l,s-i)},Tr=e=>{const t=e.dom,o=t.ownerDocument,n=o.body;return n===t?Sr(n.offsetLeft,n.offsetTop):jn(e)?kr(t):Sr(0,0)},Er=e=>{const t=void 0!==e?e.dom:document,o=t.body.scrollLeft||t.documentElement.scrollLeft,n=t.body.scrollTop||t.documentElement.scrollTop;return Sr(o,n)},Dr=(e,t,o)=>{const n=void 0!==o?o.dom:document,r=n.defaultView;r&&r.scrollTo(e,t)},Ar=(e,t)=>{const o=Gt().browser.isSafari();o&&E(e.dom.scrollIntoViewIfNeeded)?e.dom.scrollIntoViewIfNeeded(!1):e.dom.scrollIntoView(t)},Mr=e=>{const t=void 0===e?window:e;return Gt().browser.isFirefox()?j.none():j.from(t.visualViewport)},Nr=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n}),Rr=e=>{const t=void 0===e?window:e,o=t.document,n=Er(ln.fromDom(o));return Mr(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)))},Br=(e,t)=>oe(En(e),t),Lr=(e,t)=>{let o=[];return Q(En(e),(e=>{t(e)&&(o=o.concat([e])),o=o.concat(Lr(e,t))})),o};var Hr=(e,t,o,n,r)=>e(o,n)?j.some(o):E(r)&&r(o)?j.none():t(o,n,r);const Ir=(e,t,o)=>{let n=e.dom;const r=E(o)?o:Z;while(n.parentNode){n=n.parentNode;const e=ln.fromDom(n);if(t(e))return j.some(e);if(r(e))break}return j.none()},Pr=(e,t,o)=>{const n=(e,t)=>t(e);return Hr(n,Ir,e,t,o)},zr=(e,t)=>{const o=e.dom;return o.parentNode?Fr(ln.fromDom(o.parentNode),(o=>!hn(e,o)&&t(o))):j.none()},Fr=(e,t)=>{const o=e=>t(ln.fromDom(e)),n=ae(e.dom.childNodes,o);return n.map(ln.fromDom)},Vr=(e,t)=>{const o=e=>{for(let n=0;n<e.childNodes.length;n++){const r=ln.fromDom(e.childNodes[n]);if(t(r))return j.some(r);const s=o(e.childNodes[n]);if(s.isSome())return s}return j.none()};return o(e.dom)},Zr=(e,t,o)=>Ir(e,(e=>dn(e,t)),o),Ur=(e,t)=>gn(t,e),jr=(e,t,o)=>{const n=(e,t)=>dn(e,t);return Hr(n,Zr,e,t,o)},$r=(e,t,o)=>Zr(e,t,o).isSome();class Wr{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 qr=e=>t=>!!t&&t.nodeType===e,Gr=e=>!!e&&!Object.getPrototypeOf(e),Kr=qr(1),Yr=e=>{const t=e.toLowerCase();return e=>T(e)&&e.nodeName.toLowerCase()===t},Xr=e=>{const t=e.map((e=>e.toLowerCase()));return e=>{if(e&&e.nodeName){const o=e.nodeName.toLowerCase();return Y(t,o)}return!1}},Jr=(e,t)=>{const o=t.toLowerCase().split(" ");return t=>{if(Kr(t)){const n=t.ownerDocument.defaultView;if(n)for(let r=0;r<o.length;r++){const s=n.getComputedStyle(t,null),a=s?s.getPropertyValue(e):null;if(a===o[r])return!0}}return!1}},Qr=e=>t=>Kr(t)&&t.hasAttribute(e),es=(e,t)=>o=>Kr(o)&&o.getAttribute(e)===t,ts=e=>Kr(e)&&e.hasAttribute("data-mce-bogus"),os=e=>Kr(e)&&"all"===e.getAttribute("data-mce-bogus"),ns=e=>Kr(e)&&"TABLE"===e.tagName,rs=e=>t=>{if(Kr(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1},ss=Xr(["textarea","input"]),as=qr(3),is=qr(4),ls=qr(7),cs=qr(8),ds=qr(9),ms=qr(11),us=Yr("br"),gs=Yr("img"),hs=rs("true"),ps=rs("false"),fs=Xr(["td","th"]),bs=Xr(["td","th","caption"]),vs=Xr(["video","audio","object","embed"]),ys=Yr("li"),ws="\ufeff",xs=" ",Cs=e=>e===ws,Ss=e=>e.replace(/\uFEFF/g,""),ks=(e,t)=>un(t,e),_s=(e,t)=>{const o=o=>{if(!e(o))throw new Error("Can only get "+t+" value of a "+t+" node");return n(o).getOr("")},n=t=>e(t)?j.from(t.dom.nodeValue):j.none(),r=(o,n)=>{if(!e(o))throw new Error("Can only set raw "+t+" value of a "+t+" node");o.dom.nodeValue=n};return{get:o,getOption:n,set:r}},Os=_s(Do,"text"),Ts=e=>Os.get(e),Es=e=>Os.getOption(e),Ds=["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"],As=["td","th"],Ms=["thead","tbody","tfoot"],Ns=["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"],Rs=["h1","h2","h3","h4","h5","h6"],Bs=["li","dd","dt"],Ls=["ul","ol","dl"],Hs=["pre","script","textarea","style"],Is=["pre"].concat(Rs),Ps=e=>{let t;return o=>(t=t||ge(e,U),Re(t,ko(o)))},zs=Ps(Ds),Fs=e=>"table"===ko(e),Vs=e=>Eo(e)&&!zs(e),Zs=e=>Eo(e)&&"br"===ko(e),Us=Ps(Ns),js=Ps(Ls),$s=Ps(Bs),Ws=Ps(Ms),qs=Ps(As),Gs=Ps(Hs),Ks=Ps(Is),Ys=e=>Ks(e)||Vs(e),Xs=e=>{const t=[];let o=e.dom;while(o)t.push(ln.fromDom(o)),o=o.lastChild;return t},Js=e=>{const t=ks(e,"br"),o=oe(Xs(e).slice(-1),Zs);t.length===o.length&&Q(o,cr)},Qs=()=>{const e=ln.fromTag("br");return Bo(e,"data-mce-bogus","1"),e},ea=e=>{lr(e),rr(e,Qs())},ta=e=>{Mn(e).each((t=>{kn(t).each((o=>{zs(e)&&Zs(t)&&zs(o)&&cr(t)}))}))},oa=ws,na=Cs,ra=Ss,sa=Kr,aa=as,ia=e=>(aa(e)&&(e=e.parentNode),sa(e)&&e.hasAttribute("data-mce-caret")),la=e=>aa(e)&&na(e.data),ca=e=>ia(e)||la(e),da=e=>e.firstChild!==e.lastChild||!us(e.firstChild),ma=(e,t)=>{var o;const n=null!==(o=e.ownerDocument)&&void 0!==o?o:document,r=n.createTextNode(oa),s=e.parentNode;if(t){const t=e.previousSibling;if(aa(t)){if(ca(t))return t;if(fa(t))return t.splitText(t.data.length-1)}null===s||void 0===s||s.insertBefore(r,e)}else{const t=e.nextSibling;if(aa(t)){if(ca(t))return t;if(pa(t))return t.splitText(1),t}e.nextSibling?null===s||void 0===s||s.insertBefore(r,e.nextSibling):null===s||void 0===s||s.appendChild(r)}return r},ua=e=>{const t=e.container();return!!as(t)&&(t.data.charAt(e.offset())===oa||e.isAtStart()&&la(t.previousSibling))},ga=e=>{const t=e.container();return!!as(t)&&(t.data.charAt(e.offset()-1)===oa||e.isAtEnd()&&la(t.nextSibling))},ha=(e,t,o)=>{var n;const r=null!==(n=t.ownerDocument)&&void 0!==n?n:document,s=r.createElement(e);s.setAttribute("data-mce-caret",o?"before":"after"),s.setAttribute("data-mce-bogus","all"),s.appendChild(Qs().dom);const a=t.parentNode;return o?null===a||void 0===a||a.insertBefore(s,t):t.nextSibling?null===a||void 0===a||a.insertBefore(s,t.nextSibling):null===a||void 0===a||a.appendChild(s),s},pa=e=>aa(e)&&e.data[0]===oa,fa=e=>aa(e)&&e.data[e.data.length-1]===oa,ba=e=>{var t;const o=e.getElementsByTagName("br"),n=o[o.length-1];ts(n)&&(null===(t=n.parentNode)||void 0===t||t.removeChild(n))},va=e=>e&&e.hasAttribute("data-mce-caret")?(ba(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,ya=e=>ia(e.startContainer),wa=hs,xa=ps,Ca=us,Sa=as,ka=Xr(["script","style","textarea"]),_a=Xr(["img","input","textarea","hr","iframe","video","audio","object","embed"]),Oa=Xr(["table"]),Ta=ca,Ea=e=>!Ta(e)&&(Sa(e)?!ka(e.parentNode):_a(e)||Ca(e)||Oa(e)||Aa(e)),Da=e=>Kr(e)&&"true"===e.getAttribute("unselectable"),Aa=e=>!Da(e)&&xa(e),Ma=(e,t)=>{for(let o=e.parentNode;o&&o!==t;o=o.parentNode){if(Aa(o))return!1;if(wa(o))return!0}return!0},Na=e=>!!Aa(e)&&!re(ve(e.getElementsByTagName("*")),((e,t)=>e||wa(t)),!1),Ra=e=>_a(e)||Na(e),Ba=(e,t)=>Ea(e)&&Ma(e,t),La=/^[ \t\r\n]*$/,Ha=e=>La.test(e),Ia=e=>-1!==" \f\t\v".indexOf(e),Pa=e=>"\n"===e||"\r"===e,za=(e,t)=>t<e.length&&t>=0&&Pa(e[t]),Fa=(e,t=4,o=!0,n=!0)=>{const r=bt(" ",t),s=e.replace(/\t/g,r),a=re(s,((e,t)=>Ia(t)||t===xs?e.pcIsSpace||""===e.str&&o||e.str.length===s.length-1&&n||za(s,e.str.length+1)?{pcIsSpace:!1,str:e.str+xs}:{pcIsSpace:!0,str:e.str+" "}:{pcIsSpace:Pa(t),str:e.str+t}),{pcIsSpace:!1,str:""});return a.str},Va=(e,t)=>{const o=ln.fromDom(t),n=ln.fromDom(e);return $r(n,"pre,code",I(hn,o))},Za=(e,t)=>as(e)&&Ha(e.data)&&!Va(e,t),Ua=e=>Kr(e)&&"A"===e.nodeName&&!e.hasAttribute("href")&&(e.hasAttribute("name")||e.hasAttribute("id")),ja=(e,t)=>Ea(e)&&!Za(e,t)||Ua(e)||$a(e),$a=Qr("data-mce-bookmark"),Wa=Qr("data-mce-bogus"),qa=es("data-mce-bogus","all"),Ga=(e,t)=>{let o=0;if(ja(e,e))return!1;{let n=e.firstChild;if(!n)return!0;const r=new Wr(n,e);do{if(t){if(qa(n)){n=r.next(!0);continue}if(Wa(n)){n=r.next();continue}}if(us(n))o++,n=r.next();else{if(ja(n,e))return!1;n=r.next()}}while(n);return o<=1}},Ka=(e,t=!0)=>Ga(e.dom,t),Ya="data-mce-block",Xa=e=>oe(xe(e),(e=>!/[A-Z]/.test(e))),Ja=e=>Xa(e).join(","),Qa=(e,t)=>T(t.querySelector(e))?(t.setAttribute(Ya,"true"),"inline-boundary"===t.getAttribute("data-mce-selected")&&t.removeAttribute("data-mce-selected"),!0):(t.removeAttribute(Ya),!1),ei=(e,t)=>{const o=Ja(e.getTransparentElements()),n=Ja(e.getBlockElements());return oe(t.querySelectorAll(o),(e=>Qa(n,e)))},ti=(e,t)=>{var o;const n=t?"lastChild":"firstChild";for(let r=e[n];r;r=r[n])if(Ka(ln.fromDom(r)))return void(null===(o=r.parentNode)||void 0===o||o.removeChild(r))},oi=(e,t)=>{const o=document.createRange(),n=e.parentNode;if(n){o.setStartBefore(e),o.setEndBefore(t);const r=o.extractContents();ti(r,!0),o.setStartAfter(t),o.setEndAfter(e);const s=o.extractContents();ti(s,!1),Ka(ln.fromDom(r))||n.insertBefore(r,e),Ka(ln.fromDom(t))||n.insertBefore(t,e),Ka(ln.fromDom(s))||n.insertBefore(s,e),n.removeChild(e)}},ni=(e,t,o)=>{const n=e.getBlockElements(),r=ln.fromDom(t),s=e=>ko(e)in n,a=e=>hn(e,r);Q(ur(o),(t=>{Ir(t,s,a).each((o=>{const n=Br(t,(t=>s(t)&&!e.isValidChild(ko(o),ko(t))));if(n.length>0){const t=xn(o);Q(n,(e=>{Ir(e,s,a).each((t=>{oi(t.dom,e.dom)}))})),t.each((t=>ei(e,t.dom)))}}))}))},ri=(e,t)=>{const o=ei(e,t);ni(e,t,o)},si=(e,t)=>{if(ci(e,t)){const o=Ja(e.getBlockElements());Qa(o,t)}},ai=(e,t,o)=>{const n=e=>hn(e,ln.fromDom(t)),r=Cn(ln.fromDom(o),n);pe(r,r.length-2).filter(Eo).fold((()=>ri(e,t)),(t=>ri(e,t.dom)))},ii=e=>e.hasAttribute(Ya),li=(e,t)=>Re(e.getTransparentElements(),t),ci=(e,t)=>Kr(t)&&li(e,t.nodeName),di=(e,t)=>ci(e,t)&&ii(t),mi=(e,t)=>1===t.type&&li(e,t.name)&&y(t.attr(Ya)),ui=(e,t)=>1===t.type&&li(e,t.name)&&_(t.attr(Ya)),gi=Gt().browser,hi=e=>ae(e,Eo),pi=e=>gi.isFirefox()&&"table"===ko(e)?hi(En(e)).filter((e=>"caption"===ko(e))).bind((e=>hi(Tn(e)).map((t=>{const o=t.dom.offsetTop,n=e.dom.offsetTop,r=e.dom.offsetHeight;return o<=n?-r:0})))).getOr(0):0,fi=(e,t)=>e.children&&Y(e.children,t),bi=(e,t,o)=>{let n=0,r=0;const s=e.ownerDocument;if(o=o||e,t){if(o===e&&t.getBoundingClientRect&&"static"===Kn(ln.fromDom(e),"position")){const o=t.getBoundingClientRect();return n=o.left+(s.documentElement.scrollLeft||e.scrollLeft)-s.documentElement.clientLeft,r=o.top+(s.documentElement.scrollTop||e.scrollTop)-s.documentElement.clientTop,{x:n,y:r}}let a=t;while(a&&a!==o&&a.nodeType&&!fi(a,o)){const e=a;n+=e.offsetLeft||0,r+=e.offsetTop||0,a=e.offsetParent}a=t.parentNode;while(a&&a!==o&&a.nodeType&&!fi(a,o))n-=a.scrollLeft||0,r-=a.scrollTop||0,a=a.parentNode;r+=pi(ln.fromDom(t))}return{x:n,y:r}},vi=(e,t={})=>{let o=0;const n={},r=ln.fromDom(e),s=bn(r),a=e=>{t.referrerPolicy=e},i=e=>{t.contentCssCors=e},l=e=>{rr(Pn(r),e)},c=e=>{const t=Pn(r);Ur(t,"#"+e).each(cr)},d=e=>Ne(n,e).getOrThunk((()=>({id:"mce-u"+o++,passed:[],failed:[],count:0}))),m=e=>new Promise(((o,r)=>{let a;const i=go._addCacheSuffix(e),c=d(i);n[i]=c,c.count++;const m=(e,t)=>{Q(e,V),c.status=t,c.passed=[],c.failed=[],a&&(a.onload=null,a.onerror=null,a=null)},u=()=>m(c.passed,2),g=()=>m(c.failed,3);if(o&&c.passed.push(o),r&&c.failed.push(r),1===c.status)return;if(2===c.status)return void u();if(3===c.status)return void g();c.status=1;const h=ln.fromTag("link",s.dom);Lo(h,{rel:"stylesheet",type:"text/css",id:c.id}),t.contentCssCors&&Bo(h,"crossOrigin","anonymous"),t.referrerPolicy&&Bo(h,"referrerpolicy",t.referrerPolicy),a=h.dom,a.onload=u,a.onerror=g,l(h),Bo(h,"href",i)})),u=e=>{const t=Promise.allSettled(J(e,(e=>m(e).then(B(e)))));return t.then((e=>{const t=te(e,(e=>"fulfilled"===e.status));return t.fail.length>0?Promise.reject(J(t.fail,(e=>e.reason))):J(t.pass,(e=>e.value))}))},g=e=>{const t=go._addCacheSuffix(e);Ne(n,t).each((e=>{const o=--e.count;0===o&&(delete n[t],c(e.id))}))},h=e=>{Q(e,(e=>{g(e)}))};return{load:m,loadAll:u,unload:g,unloadAll:h,_setReferrerPolicy:a,_setContentCssCors:i}},yi=()=>{const e=new WeakMap,t=(t,o)=>{const n=In(t),r=n.dom;return j.from(e.get(r)).getOrThunk((()=>{const t=vi(r,o);return e.set(r,t),t}))};return{forElement:t}},wi=yi(),xi=e=>"span"===e.nodeName.toLowerCase(),Ci=(e,t)=>T(e)&&(ja(e,t)||Vs(ln.fromDom(e))),Si=(e,t)=>{const o=new Wr(e,t).prev(!1),n=new Wr(e,t).next(!1),r=_(o)||Ci(o,t),s=_(n)||Ci(n,t);return r&&s},ki=e=>xi(e)&&"bookmark"===e.getAttribute("data-mce-type"),_i=(e,t)=>as(e)&&e.data.length>0&&Si(e,t),Oi=e=>!!Kr(e)&&e.childNodes.length>0,Ti=e=>ms(e)||ds(e),Ei=(e,t,o)=>{var n;const r=o||t;if(Kr(t)&&ki(t))return t;const s=t.childNodes;for(let a=s.length-1;a>=0;a--)Ei(e,s[a],r);if(Kr(t)){const e=t.childNodes;1===e.length&&ki(e[0])&&(null===(n=t.parentNode)||void 0===n||n.insertBefore(e[0],t))}return Ti(t)||ja(t,r)||Oi(t)||_i(t,r)||e.remove(t),t},Di=go.makeMap,Ai=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Mi=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ni=/[<>&\"\']/g,Ri=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Bi={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:"Ÿ"},Li={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},Hi={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"},Ii=e=>{const t=ln.fromTag("div").dom;return t.innerHTML=e,t.textContent||t.innerText||e},Pi=(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(!Li[r]){const t="&"+n[e+1]+";";o[r]=t,o[t]=r}}return o}},zi=Pi("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),Fi=(e,t)=>e.replace(t?Ai:Mi,(e=>Li[e]||e)),Vi=e=>(""+e).replace(Ni,(e=>Li[e]||e)),Zi=(e,t)=>e.replace(t?Ai:Mi,(e=>e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":Li[e]||"&#"+e.charCodeAt(0)+";")),Ui=(e,t,o)=>{const n=o||zi;return e.replace(t?Ai:Mi,(e=>Li[e]||n[e]||e))},ji=(e,t)=>{const o=Pi(t)||zi,n=(e,t)=>e.replace(t?Ai:Mi,(e=>void 0!==Li[e]?Li[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)=>Ui(e,t,o),s=Di(e.replace(/\+/g,","));return s.named&&s.numeric?n:s.named?t?r:Ui:s.numeric?Zi:Fi},$i=e=>e.replace(Ri,((e,t)=>t?(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10),t>65535?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):Bi[t]||String.fromCharCode(t)):Hi[e]||zi[e]||Ii(e))),Wi={encodeRaw:Fi,encodeAllRaw:Vi,encodeNumeric:Zi,encodeNamed:Ui,getEncodeFunc:ji,decode:$i},qi={},Gi={},Ki={},Yi=go.makeMap,Xi=go.each,Ji=go.extend,Qi=go.explode,el=go.inArray,tl=(e,t)=>(e=go.trim(e),e?e.split(t||" "):[]),ol=(e,t={})=>{const o=Yi(e," ",Yi(e.toUpperCase()," "));return Ji(o,t)},nl=e=>ol("td th li dt dd figcaption caption details summary",e.getTextBlockElements()),rl=e=>{const t={};let o,n,r,s;const a=(e,n="",r="")=>{const s=tl(r),a=tl(e);let i=a.length;while(i--){const e=tl([o,n].join(" "));t[a[i]]={attributes:ge(e,(()=>({}))),attributesOrder:e,children:ge(s,B(Ki))}}},i=(e,o)=>{const n=tl(e),r=tl(o);let s=n.length;while(s--){const e=t[n[s]];for(let t=0,o=r.length;t<o;t++)e.attributes[r[t]]={},e.attributesOrder.push(r[t])}};if(qi[e])return qi[e];if(o="id accesskey class dir lang style tabindex title role",n="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",r="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){const e="a ins del canvas map";o+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",n+=" article aside details dialog figure main header footer hgroup section nav "+e,r+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"}if("html5-strict"!==e){o+=" xml:lang";const e="acronym applet basefont big font strike tt";r=[r,e].join(" "),Xi(tl(e),(e=>{a(e,"",r)}));const t="center dir isindex noframes";n=[n,t].join(" "),s=[n,r].join(" "),Xi(tl(t),(e=>{a(e,"",s)}))}return s=s||[n,r].join(" "),a("html","manifest","head body"),a("head","","base command link meta noscript script style title"),a("title hr noscript br"),a("base","href target"),a("link","href rel media hreflang type sizes hreflang"),a("meta","name http-equiv content charset"),a("style","media type scoped"),a("script","src async defer type charset"),a("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",s),a("address dt dd div caption","",s),a("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","",r),a("blockquote","cite",s),a("ol","reversed start type","li"),a("ul","","li"),a("li","value",s),a("dl","","dt dd"),a("a","href target rel media hreflang type",s),a("q","cite",r),a("ins del","cite datetime",s),a("img","src sizes srcset alt usemap ismap width height"),a("iframe","src name width height",s),a("embed","src type width height"),a("object","data type typemustmatch name usemap form width height",[s,"param"].join(" ")),a("param","name value"),a("map","name",[s,"area"].join(" ")),a("area","alt coords shape href target rel media hreflang type"),a("table","border","caption colgroup thead tfoot tbody tr"+("html4"===e?" col":"")),a("colgroup","span","col"),a("col","span"),a("tbody thead tfoot","","tr"),a("tr","","td th"),a("td","colspan rowspan headers",s),a("th","colspan rowspan headers scope abbr",s),a("form","accept-charset action autocomplete enctype method name novalidate target",s),a("fieldset","disabled form name",[s,"legend"].join(" ")),a("label","form for",r),a("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"),a("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===e?s:r),a("select","disabled form multiple name required size","option optgroup"),a("optgroup","disabled label","option"),a("option","disabled label selected value"),a("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),a("menu","type label",[s,"li"].join(" ")),a("noscript","",s),"html4"!==e&&(a("wbr"),a("ruby","",[r,"rt rp"].join(" ")),a("figcaption","",s),a("mark rt rp summary bdi","",r),a("canvas","width height",s),a("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[s,"track source"].join(" ")),a("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[s,"track source"].join(" ")),a("picture","","img source"),a("source","src srcset type media sizes"),a("track","kind src srclang label default"),a("datalist","",[r,"option"].join(" ")),a("article section nav aside main header footer","",s),a("hgroup","","h1 h2 h3 h4 h5 h6"),a("figure","",[s,"figcaption"].join(" ")),a("time","datetime",r),a("dialog","open",s),a("command","type label icon disabled checked radiogroup command"),a("output","for form name",r),a("progress","value max",r),a("meter","value min max low high optimum",r),a("details","open",[s,"summary"].join(" ")),a("keygen","autofocus challenge disabled form keytype name")),"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")),"html4"!==e&&Q([t.video,t.audio],(e=>{delete e.children.audio,delete e.children.video})),Xi(tl("a form meter progress dfn"),(e=>{t[e]&&delete t[e].children[e]})),delete t.caption.children.table,delete t.script,qi[e]=t,t},sl=(e,t)=>{if(e){const o={};return y(e)&&(e={"*":e}),Xi(e,((e,n)=>{o[n]=o[n.toUpperCase()]="map"===t?Yi(e,/[, ]/):Qi(e,/[, ]/)})),o}},al=(e={})=>{var t;const o={},n={};let r=[];const s={},a={},i=(t,o,n)=>{const r=e[t];if(r)return Yi(r,/[, ]/,Yi(r.toUpperCase(),/[, ]/));{let e=Gi[t];return e||(e=ol(o,n),Gi[t]=e),e}},l=null!==(t=e.schema)&&void 0!==t?t:"html5",c=rl(l);!1===e.verify_html&&(e.valid_elements="*[*]");const d=sl(e.valid_styles),m=sl(e.invalid_styles,"map"),u=sl(e.valid_classes,"map"),g=i("whitespace_elements","pre script noscript style textarea video audio iframe object code"),h=i("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),p=i("void_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),f=i("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls allowfullscreen"),b="td th iframe video audio object script code",v=i("non_empty_elements",b+" pre",p),y=i("move_caret_before_on_enter_elements",b+" table",p),w=i("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),x=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",w),C=i("text_inline_elements","span strong b em i font s strike u var cite dfn code mark q sup sub samp"),S=i("transparent_elements","a ins del canvas map");Xi("script noscript iframe noframes noembed title style textarea xmp plaintext".split(" "),(e=>{a[e]=new RegExp("</"+e+"[^>]*>","gi")}));const k=e=>new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$"),_=e=>{const t=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/,n=/^([!\-])?(\w+[\\:]:\w+|[^=~<]+)?(?:([=~<])(.*))?$/,s=/[*?+]/;if(e){const a=tl(e,",");let i,l;o["@"]&&(i=o["@"].attributes,l=o["@"].attributesOrder);for(let e=0,c=a.length;e<c;e++){let c=t.exec(a[e]);if(c){const e=c[1],t=c[2],a=c[3],d=c[5],m={},u=[],g={attributes:m,attributesOrder:u};if("#"===e&&(g.paddEmpty=!0),"-"===e&&(g.removeEmpty=!0),"!"===c[4]&&(g.removeEmptyAttrs=!0),i&&(Se(i,((e,t)=>{m[t]=e})),l&&u.push(...l)),d){const e=tl(d,"|");for(let t=0,o=e.length;t<o;t++)if(c=n.exec(e[t]),c){const e={},t=c[1],o=c[2].replace(/[\\:]:/g,":"),n=c[3],r=c[4];if("!"===t&&(g.attributesRequired=g.attributesRequired||[],g.attributesRequired.push(o),e.required=!0),"-"===t){delete m[o],u.splice(el(u,o),1);continue}if(n&&("="===n&&(g.attributesDefault=g.attributesDefault||[],g.attributesDefault.push({name:o,value:r}),e.defaultValue=r),"~"===n&&(g.attributesForced=g.attributesForced||[],g.attributesForced.push({name:o,value:r}),e.forcedValue=r),"<"===n&&(e.validValues=Yi(r,"?"))),s.test(o)){const t=e;g.attributePatterns=g.attributePatterns||[],t.pattern=k(o),g.attributePatterns.push(t)}else m[o]||u.push(o),m[o]=e}}if(i||"@"!==t||(i=m,l=u),a&&(g.outputName=t,o[a]=g),s.test(t)){const e=g;e.pattern=k(t),r.push(e)}else o[t]=g}}}},O=e=>{r=[],Q(xe(o),(e=>{delete o[e]})),_(e),Xi(c,((e,t)=>{n[t]=e.children}))},T=e=>{const t=/^(~)?(.+)$/;e&&(delete Gi.text_block_elements,delete Gi.block_elements,Xi(tl(e,","),(e=>{const r=t.exec(e);if(r){const e="~"===r[1],t=e?"span":"div",a=r[2];if(n[a]=n[t],s[a]=t,v[a.toUpperCase()]={},v[a]={},e||(x[a.toUpperCase()]={},x[a]={}),!o[a]){let e=o[t];e=Ji({},e),delete e.removeEmptyAttrs,delete e.removeEmpty,o[a]=e}Xi(n,((e,o)=>{e[t]&&(n[o]=e=Ji({},n[o]),e[a]=e[t])}))}})))},E=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]+)\[([^\]]+)]$/;delete qi[l],e&&Xi(tl(e,","),(e=>{const o=t.exec(e);if(o){const e=o[1];let t;t=e?n[o[2]]:n[o[2]]={"#comment":{}},t=n[o[2]],Xi(tl(o[3],"|"),(o=>{"-"===e?delete t[o]:t[o]={}}))}}))},D=e=>{const t=o[e];if(t)return t;let n=r.length;while(n--){const t=r[n];if(t.pattern.test(e))return t}};e.valid_elements?O(e.valid_elements):(Xi(c,((e,t)=>{o[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},n[t]=e.children})),Xi(tl("strong/b em/i"),(e=>{const t=tl(e,"/");o[t[1]].outputName=t[0]})),Xi(C,((t,n)=>{o[n]&&(e.padd_empty_block_inline_children&&(o[n].paddInEmptyBlock=!0),o[n].removeEmpty=!0)})),Xi(tl("ol ul blockquote a table tbody"),(e=>{o[e]&&(o[e].removeEmpty=!0)})),Xi(tl("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),(e=>{o[e].paddEmpty=!0})),Xi(tl("span"),(e=>{o[e].removeEmptyAttrs=!0}))),T(e.custom_elements),E(e.valid_children),_(e.extended_valid_elements),E("+ol[ul|ol],+ul[ul|ol]"),Xi({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=tl(e))})),e.invalid_elements&&Xi(Qi(e.invalid_elements),(e=>{o[e]&&delete o[e]})),D("span")||_("span[!data-mce-type|*]");const A=B(d),M=B(m),N=B(u),R=B(f),L=B(x),H=B(w),I=B(C),P=B(Object.seal(p)),z=B(h),F=B(v),V=B(y),Z=B(g),U=B(S),j=B(Object.seal(a)),$=(e,t)=>{const o=n[e.toLowerCase()];return!(!o||!o[t.toLowerCase()])},W=(e,t)=>{const o=D(e);if(o){if(!t)return!0;{if(o.attributes[t])return!0;const e=o.attributePatterns;if(e){let o=e.length;while(o--)if(e[o].pattern.test(t))return!0}}}return!1},q=B(s);return{type:l,children:n,elements:o,getValidStyles:A,getValidClasses:N,getBlockElements:L,getInvalidStyles:M,getVoidElements:P,getTextBlockElements:H,getTextInlineElements:I,getBoolAttrs:R,getElementRule:D,getSelfClosingElements:z,getNonEmptyElements:F,getMoveCaretBeforeOnEnterElements:V,getWhitespaceElements:Z,getTransparentElements:U,getSpecialElements:j,isValidChild:$,isValid:W,getCustomElements:q,addValidElements:_,setValidElements:O,addCustomElements:T,addValidChildren:E}},il=(e={},t)=>{const o=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,n=/\s*([^:]+):\s*([^;]+);?/g,r=/\s+$/,s={};let a,i;const l=ws;t&&(a=t.getValidStyles(),i=t.getInvalidStyles());const c=("\\\" \\' \\; \\: ; : "+l).split(" ");for(let m=0;m<c.length;m++)s[c[m]]=l+m,s[l+m]=c[m];const d={parse:t=>{const a={};let i=!1;const c=e.url_converter,m=e.url_converter_scope||d,u=(e,t,o)=>{const n=a[e+"-top"+t];if(!n)return;const r=a[e+"-right"+t];if(!r)return;const s=a[e+"-bottom"+t];if(!s)return;const i=a[e+"-left"+t];if(!i)return;const l=[n,r,s,i];let c=l.length-1;while(c--)if(l[c]!==l[c+1])break;c>-1&&o||(a[e+t]=-1===c?l[0]:l.join(" "),delete a[e+"-top"+t],delete a[e+"-right"+t],delete a[e+"-bottom"+t],delete a[e+"-left"+t])},g=e=>{const t=a[e];if(!t)return;const o=t.split(" ");let n=o.length;while(n--)if(o[n]!==o[0])return!1;return a[e]=o[0],!0},h=(e,t,o,n)=>{g(t)&&g(o)&&g(n)&&(a[e]=a[t]+" "+a[o]+" "+a[n],delete a[t],delete a[o],delete a[n])},p=e=>(i=!0,s[e]),f=(e,t)=>(i&&(e=e.replace(/\uFEFF[0-9]/g,(e=>s[e]))),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e),b=e=>String.fromCharCode(parseInt(e.slice(1),16)),v=e=>e.replace(/\\[0-9a-f]+/gi,b),y=(t,o,n,r,s,a)=>{if(s=s||a,s)return s=f(s),"'"+s.replace(/\'/g,"\\'")+"'";if(o=f(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 s;t=t.replace(/[\u0000-\u001F]/g,""),t=t.replace(/\\[\"\';:\uFEFF]/g,p).replace(/\"[^\"]+\"|\'[^\']+\'/g,(e=>e.replace(/[;:]/g,p)));while(s=n.exec(t)){n.lastIndex=s.index+s[0].length;let t=s[1].replace(r,"").toLowerCase(),c=s[2].replace(r,"");if(t&&c){if(t=v(t),c=v(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()),c=c.replace(o,y),a[t]=i?f(c,!0):c}}u("border","",!0),u("border","-width"),u("border","-color"),u("border","-style"),u("padding",""),u("margin",""),h("border","border-width","border-style","border-color"),"medium none"===a.border&&delete a.border,"none"===a["border-image"]&&delete a["border-image"]}return a},serialize:(e,t)=>{let o="";const n=(t,n)=>{const r=n[t];if(r)for(let s=0,a=r.length;s<a;s++){const t=r[s],n=e[t];n&&(o+=(o.length>0?" ":"")+t+": "+n+";")}},r=(e,t)=>{if(!i||!t)return!0;let o=i["*"];return(!o||!o[e])&&(o=i[t],!(o&&o[e]))};return t&&a?(n("*",a),n(t,a)):Se(e,((e,n)=>{e&&r(n,t)&&(o+=(o.length>0?" ":"")+n+": "+e+";")})),o}};return d},ll={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},cl=e=>e instanceof Event||E(e.initEvent),dl=e=>e.isDefaultPrevented===U||e.isDefaultPrevented===Z,ml=e=>O(e.preventDefault)||cl(e),ul=(e,t)=>{const o=null!==t&&void 0!==t?t:{};for(const n in e)Re(ll,n)||(o[n]=e[n]);return T(e.composedPath)&&(o.composedPath=()=>e.composedPath()),o},gl=(e,t,o,n)=>{var r;const s=ul(t,n);return s.type=e,O(s.target)&&(s.target=null!==(r=s.srcElement)&&void 0!==r?r:o),ml(t)&&(s.preventDefault=()=>{s.defaultPrevented=!0,s.isDefaultPrevented=U,E(t.preventDefault)&&t.preventDefault()},s.stopPropagation=()=>{s.cancelBubble=!0,s.isPropagationStopped=U,E(t.stopPropagation)&&t.stopPropagation()},s.stopImmediatePropagation=()=>{s.isImmediatePropagationStopped=U,s.stopPropagation()},dl(s)||(s.isDefaultPrevented=!0===s.defaultPrevented?U:Z,s.isPropagationStopped=!0===s.cancelBubble?U:Z,s.isImmediatePropagationStopped=Z)),s},hl="mce-data-",pl=/^(?:mouse|contextmenu)|click/,fl=(e,t,o,n)=>{e.addEventListener(t,o,n||!1)},bl=(e,t,o,n)=>{e.removeEventListener(t,o,n||!1)},vl=e=>T(e)&&pl.test(e.type),yl=(e,t)=>{const o=gl(e.type,e,document,t);if(vl(e)&&_(e.pageX)&&!_(e.clientX)){const t=o.target.ownerDocument||document,n=t.documentElement,r=t.body,s=o;s.pageX=e.clientX+(n&&n.scrollLeft||r&&r.scrollLeft||0)-(n&&n.clientLeft||r&&r.clientLeft||0),s.pageY=e.clientY+(n&&n.scrollTop||r&&r.scrollTop||0)-(n&&n.clientTop||r&&r.clientTop||0)}return o},wl=(e,t,o)=>{const n=e.document,r={type:"ready"};if(o.domLoaded)return void t(r);const s=()=>"complete"===n.readyState||"interactive"===n.readyState&&n.body,a=()=>{bl(e,"DOMContentLoaded",a),bl(e,"load",a),o.domLoaded||(o.domLoaded=!0,t(r)),e=null};s()?a():fl(e,"DOMContentLoaded",a),o.domLoaded||fl(e,"load",a)};class xl{constructor(){this.domLoaded=!1,this.events={},this.count=1,this.expando=hl+(+new Date).toString(32),this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}bind(e,t,o,n){const r=this;let s;const a=window,i=e=>{r.executeHandlers(yl(e||a.event),l)};if(!e||as(e)||cs(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;while(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,yl({type:t})):(r.hasFocusIn||"focusin"!==t&&"focusout"!==t||(u=!0,g="focusin"===t?"focus":"blur",m=e=>{const t=yl(e||a.event);t.type="focus"===t.type?"focusin":"focusout",r.executeHandlers(t,l)}),s=r.events[l][t],s?"ready"===t&&r.domLoaded?o(yl({type:t})):s.push({func:o,scope:n}):(r.events[l][t]=s=[{func:o,scope:n}],s.fakeName=g,s.capture=u,s.nativeHandler=m,"ready"===t?wl(e,m,r):fl(e,g||t,m,u)))}return e=s=null,o}unbind(e,t,o){if(!e||as(e)||cs(e))return this;const n=e[this.expando];if(n){let s=this.events[n];if(t){const n=t.split(" ");let r=n.length;while(r--){const t=n[r],a=s[t];if(a){if(o){let e=a.length;while(e--)if(a[e].func===o){const o=a.nativeHandler,n=a.fakeName,r=a.capture,i=a.slice(0,e).concat(a.slice(e+1));i.nativeHandler=o,i.fakeName=n,i.capture=r,s[t]=i}}o&&0!==a.length||(delete s[t],bl(e,a.fakeName||t,a.nativeHandler,a.capture))}}}else Se(s,((t,o)=>{bl(e,t.fakeName||o,t.nativeHandler,t.capture)})),s={};for(const e in s)if(Re(s,e))return this;delete this.events[n];try{delete e[this.expando]}catch(r){e[this.expando]=null}}return this}fire(e,t,o){return this.dispatch(e,t,o)}dispatch(e,t,o){if(!e||as(e)||cs(e))return this;const n=yl({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||as(e)||cs(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;while(o--)e=t[o],e[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 r=0,s=n.length;r<s;r++){const t=n[r];if(t&&!1===t.func.call(t.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return}}}xl.Event=new xl;const Cl=go.each,Sl=go.grep,kl="data-mce-style",_l=go.makeMap("fill-opacity font-weight line-height opacity orphans widows z-index zoom"," "),Ol=(e,t,o)=>{O(o)||""===o?zo(e,t):Bo(e,t,o)},Tl=e=>e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase())),El=(e,t)=>{let o=0;if(e)for(let n=e.nodeType,r=e.previousSibling;r;r=r.previousSibling){const e=r.nodeType;(!t||!as(r)||e!==n&&r.data.length)&&(o++,n=e)}return o},Dl=(e,t)=>{const o=Ho(t,"style"),n=e.serialize(e.parse(o),ko(t));Ol(t,kl,n)},Al=(e,t)=>D(e)?Re(_l,t)?e+"":e+"px":e,Ml=(e,t,o)=>{const n=Tl(t);O(o)||""===o?Qn(e,n):qn(e,n,Al(o,n))},Nl=(e,t,o)=>{const n=t.keep_values,r={set:(e,n,r)=>{const s=ln.fromDom(e);E(t.url_converter)&&T(n)&&(n=t.url_converter.call(t.url_converter_scope||o(),String(n),r,e));const a="data-mce-"+r;Ol(s,a,n),Ol(s,r,n)},get:(e,t)=>{const o=ln.fromDom(e);return Ho(o,"data-mce-"+t)||Ho(o,t)}},s={style:{set:(t,o)=>{const r=ln.fromDom(t);n&&Ol(r,kl,o),zo(r,"style"),y(o)&&Gn(r,e.parse(o))},get:t=>{const o=ln.fromDom(t),n=Ho(o,kl)||Ho(o,"style");return e.serialize(e.parse(n),ko(o))}}};return n&&(s.href=s.src=r),s},Rl=(e,t={})=>{const o={},n=window,r={};let s=0;const a=!0,i=!0,l=wi.forElement(ln.fromDom(e),{contentCssCors:t.contentCssCors,referrerPolicy:t.referrerPolicy}),c=[],d=t.schema?t.schema:al({}),m=il({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),u=t.ownEvents?new xl:xl.Event,g=d.getBlockElements(),h=e=>y(e)?Re(g,e):Kr(e)&&(Re(g,e.nodeName)||di(d,e)),p=t=>t&&e&&y(t)?e.getElementById(t):t,f=e=>{const t=p(e);return T(t)?ln.fromDom(t):null},b=(e,t,o="")=>{let n;const r=f(e);if(T(r)&&Eo(r)){const e=Fe[t];n=e&&e.get?e.get(r.dom,t):Ho(r,t)}return T(n)?n:o},v=e=>{const t=p(e);return O(t)?[]:t.attributes},w=(e,o,n)=>{j(e,(e=>{if(Kr(e)){const r=ln.fromDom(e),s=""===n?null:n,a=Ho(r,o),i=Fe[o];i&&i.set?i.set(r.dom,s,o):Ol(r,o,s),a!==s&&t.onSetAttrib&&t.onSetAttrib({attrElm:r.dom,attrName:o,attrValue:s})}}))},x=(e,t)=>e.cloneNode(t),S=()=>t.root_element||e.body,k=e=>{const t=Rr(e);return{x:t.x,y:t.y,w:t.width,h:t.height}},_=(t,o)=>bi(e.body,p(t),o),D=(e,o,n)=>{j(e,(e=>{const r=ln.fromDom(e);Ml(r,o,n),t.update_styles&&Dl(m,r)}))},A=(e,o)=>{j(e,(e=>{const n=ln.fromDom(e);Se(o,((e,t)=>{Ml(n,t,e)})),t.update_styles&&Dl(m,n)}))},N=(e,t,o)=>{const n=p(e);if(!O(n)&&Kr(n))return o?Kn(ln.fromDom(n),Tl(t)):(t=t.replace(/-(\D)/g,((e,t)=>t.toUpperCase())),"float"===t&&(t="cssFloat"),n.style?n.style[t]:void 0)},R=e=>{const t=p(e);if(!t)return{w:0,h:0};let o=N(t,"width"),n=N(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}},L=e=>{const t=p(e),o=_(t),n=R(t);return{x:o.x,y:o.y,w:n.w,h:n.h}},H=(e,t)=>{if(!e)return!1;const o=C(e)?e:[e];return X(o,(e=>dn(ln.fromDom(e),t)))},I=(e,t,o,n)=>{const r=[];let s=p(e);n=void 0===n;const a=o||("BODY"!==S().nodeName?S().parentNode:null);if(y(t))if("*"===t)t=Kr;else{const e=t;t=t=>H(t,e)}while(s){if(s===a||O(s.nodeType)||ds(s)||ms(s))break;if(!t||t(s)){if(!n)return[s];r.push(s)}s=s.parentNode}return n?r:null},P=(e,t,o)=>{const n=I(e,t,o,!1);return n&&n.length>0?n[0]:null},z=(e,t,o)=>{let n=t;if(e){y(t)&&(n=e=>H(e,t));for(let t=e[o];t;t=t[o])if(E(n)&&n(t))return t}return null},F=(e,t)=>z(e,t,"nextSibling"),V=(e,t)=>z(e,t,"previousSibling"),Z=e=>E(e.querySelectorAll),U=(o,n)=>{var r,s;const a=null!==(s=null!==(r=p(n))&&void 0!==r?r:t.root_element)&&void 0!==s?s:e;return Z(a)?ve(a.querySelectorAll(o)):[]},j=function(e,t,o){const n=null!==o&&void 0!==o?o:this;if(C(e)){const o=[];return Cl(e,((e,r)=>{const s=p(e);s&&o.push(t.call(n,s,r))})),o}{const o=p(e);return!!o&&t.call(n,o)}},$=(e,t)=>{j(e,(e=>{Se(t,((t,o)=>{w(e,o,t)}))}))},W=(e,t)=>{j(e,(e=>{const o=ln.fromDom(e);hr(o,t)}))},q=(t,o,n,r,s)=>j(t,(t=>{const a=y(o)?e.createElement(o):o;return T(n)&&$(a,n),r&&(!y(r)&&r.nodeType?a.appendChild(r):y(r)&&W(a,r)),s?a:t.appendChild(a)})),G=(t,o,n)=>q(e.createElement(t),t,o,n,!0),K=Wi.decode,Y=Wi.encodeAllRaw,J=(e,t,o="")=>{let n="<"+e;for(const r in t)Be(t,r)&&(n+=" "+r+'="'+Y(t[r])+'"');return ft(o)&&Re(d.getVoidElements(),e)?n+" />":n+">"+o+"</"+e+">"},ee=t=>{const o=e.createElement("div"),n=e.createDocumentFragment();let r;n.appendChild(o),t&&(o.innerHTML=t);while(r=o.firstChild)n.appendChild(r);return n.removeChild(o),n},te=(e,t)=>j(e,(e=>{const o=ln.fromDom(e);return t&&Q(En(o),(e=>{Do(e)&&0===e.dom.length?cr(e):tr(o,e)})),cr(o),o.dom})),oe=e=>j(e,(e=>{const t=e.attributes;for(let o=t.length-1;o>=0;o--)e.removeAttributeNode(t.item(o))})),ne=e=>m.parse(e),re=(e,t)=>m.serialize(e,t),se=t=>{if(ze!==Rl.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))},ae=e=>{e||(e=""),Q(e.split(","),(e=>{r[e]=!0,l.load(e).catch(M)}))},ie=(e,t,o)=>{j(e,(e=>{if(Kr(e)){const n=ln.fromDom(e),r=t.split(" ");Q(r,(e=>{if(T(o)){const t=o?Yo:Jo;t(n,e)}else Qo(n,e)}))}}))},le=(e,t)=>{ie(e,t,!0)},ce=(e,t)=>{ie(e,t,!1)},me=(e,t)=>{const o=f(e),n=t.split(" ");return T(o)&&de(n,(e=>en(o,e)))},ue=e=>{j(e,(e=>Qn(ln.fromDom(e),"display")))},ge=e=>{j(e,(e=>qn(ln.fromDom(e),"display","none")))},he=e=>{const t=f(e);return T(t)&&ho(Xn(t,"display"),"none")},pe=e=>(e||"mce_")+s++,fe=e=>{const t=f(e);return T(t)?Kr(t.dom)?t.dom.outerHTML:pr(t):""},be=(e,t)=>{j(e,(e=>{Kr(e)&&(e.outerHTML=t)}))},ye=(e,t)=>{const o=p(t);return j(e,(e=>{const t=null===o||void 0===o?void 0:o.parentNode,n=null===o||void 0===o?void 0:o.nextSibling;return t&&(n?t.insertBefore(e,n):t.appendChild(e)),e}))},we=(e,t,o)=>j(t,(n=>{var r;const s=C(t)?e.cloneNode(!0):e;return o&&Cl(Sl(n.childNodes),(e=>{s.appendChild(e)})),null===(r=n.parentNode)||void 0===r||r.replaceChild(s,n),n})),xe=(e,t)=>{if(e.nodeName!==t.toUpperCase()){const o=G(t);return Cl(v(e),(t=>{w(o,t.nodeName,b(e,t.nodeName))})),we(o,e,!0),o}return e},Ce=(e,t)=>{let o=e;while(o){let e=t;while(e&&o!==e)e=e.parentNode;if(o===e)break;o=o.parentNode}return!o&&e.ownerDocument?e.ownerDocument.documentElement:o},ke=e=>{if(Kr(e)){const t="a"===e.nodeName.toLowerCase()&&!b(e,"href")&&b(e,"id");if(b(e,"name")||b(e,"data-mce-bookmark")||t)return!0}return!1},_e=(e,t)=>{let o=0;if(ke(e))return!1;const n=e.firstChild;if(n){const r=new Wr(n,e),s=d?d.getWhitespaceElements():{},a=t||(d?d.getNonEmptyElements():null);let i=n;do{if(Kr(i)){const e=i.getAttribute("data-mce-bogus");if(e){i=r.next("all"===e);continue}const t=i.nodeName.toLowerCase();if(a&&a[t]){if("br"===t){o++,i=r.next();continue}return!1}if(ke(i))return!1}if(cs(i))return!1;if(as(i)&&!Ha(i.data))return!1;if(as(i)&&i.parentNode&&s[i.parentNode.nodeName]&&Ha(i.data))return!1;i=r.next()}while(i)}return o<=1},Oe=()=>e.createRange(),Te=(e,t,o)=>{let n,r,s=Oe();if(e&&t&&e.parentNode&&t.parentNode){const a=e.parentNode;return s.setStart(a,El(e)),s.setEnd(t.parentNode,El(t)),n=s.extractContents(),s=Oe(),s.setStart(t.parentNode,El(t)+1),s.setEnd(a,El(e)+1),r=s.extractContents(),a.insertBefore(Ei(ze,n),e),o?a.insertBefore(o,e):a.insertBefore(t,e),a.insertBefore(Ei(ze,r),e),te(e),o||t}},Ee=(o,r,s,a)=>{if(C(o)){let e=o.length;const t=[];while(e--)t[e]=Ee(o[e],r,s,a);return t}return!t.collect||o!==e&&o!==n||c.push([o,r,s,a]),u.bind(o,r,s,a||ze)},De=(t,o,r)=>{if(C(t)){let e=t.length;const n=[];while(e--)n[e]=De(t[e],o,r);return n}if(c.length>0&&(t===e||t===n)){let e=c.length;while(e--){const[n,s,a]=c[e];t!==n||o&&o!==s||r&&r!==a||u.unbind(n,s,a)}}return u.unbind(t,o,r)},Ae=(e,t,o)=>u.dispatch(e,t,o),Me=(e,t,o)=>u.dispatch(e,t,o),Ne=e=>{if(e&&Kr(e)){const t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},Le=e=>{const t=S();let o=null;for(let n=e;n&&n!==t;n=n.parentNode)if(o=Ne(n),null!==o)break;return o},He=()=>{if(c.length>0){let e=c.length;while(e--){const[t,o,n]=c[e];u.unbind(t,o,n)}}Se(r,((e,t)=>{l.unload(t),delete r[t]}))},Ie=(e,t)=>e===t||t.contains(e),Pe=e=>"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset,ze={doc:e,settings:t,win:n,files:r,stdMode:a,boxModel:i,styleSheetLoader:l,boundEvents:c,styles:m,schema:d,events:u,isBlock:h,root:null,clone:x,getRoot:S,getViewPort:k,getRect:L,getSize:R,getParent:P,getParents:I,get:p,getNext:F,getPrev:V,select:U,is:H,add:q,create:G,createHTML:J,createFragment:ee,remove:te,setStyle:D,getStyle:N,setStyles:A,removeAllAttribs:oe,setAttrib:w,setAttribs:$,getAttrib:b,getPos:_,parseStyle:ne,serializeStyle:re,addStyle:se,loadCSS:ae,addClass:le,removeClass:ce,hasClass:me,toggleClass:ie,show:ue,hide:ge,isHidden:he,uniqueId:pe,setHTML:W,getOuterHTML:fe,setOuterHTML:be,decode:K,encode:Y,insertAfter:ye,replace:we,rename:xe,findCommonAncestor:Ce,run:j,getAttribs:v,isEmpty:_e,createRng:Oe,nodeIndex:El,split:Te,bind:Ee,unbind:De,fire:Me,dispatch:Ae,getContentEditable:Ne,getContentEditableParent:Le,destroy:He,isChildOf:Ie,dumpRng:Pe},Fe=Nl(m,t,B(ze));return ze};Rl.DOM=Rl(document),Rl.nodeIndex=El;const Bl=Rl.DOM,Ll=0,Hl=1,Il=2,Pl=3;class zl{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=Bl;let r;const s=()=>{n.remove(l),r&&(r.onerror=r.onload=r=null)},a=()=>{s(),t()},i=()=>{s(),o("Failed to load script: "+e)},l=n.uniqueId();r=document.createElement("script"),r.id=l,r.type="text/javascript",r.src=go._addCacheSuffix(e),this.settings.referrerPolicy&&n.setAttrib(r,"referrerpolicy",this.settings.referrerPolicy),r.onload=a,r.onerror=i,(document.getElementsByTagName("head")[0]||document.body).appendChild(r)}))}isDone(e){return this.states[e]===Il}markDone(e){this.states[e]=Il}add(e){const t=this;t.queue.push(e);const o=t.states[e];return void 0===o&&(t.states[e]=Ll),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)=>{Ne(t.scriptLoadedCallbacks,o).each((t=>{Q(t,(t=>t[e](o)))})),delete t.scriptLoadedCallbacks[o]},n=e=>{const t=oe(e,(e=>"rejected"===e.status));return t.length>0?Promise.reject(ce(t,(({reason:e})=>C(e)?e:[e]))):Promise.resolve()},r=e=>Promise.allSettled(J(e,(e=>t.states[e]===Il?(o("resolve",e),Promise.resolve()):t.states[e]===Pl?(o("reject",e),Promise.reject(e)):(t.states[e]=Hl,t.loadScript(e).then((()=>{t.states[e]=Il,o("resolve",e);const s=t.queue;return s.length>0?(t.queue=[],r(s).then(n)):Promise.resolve()}),(()=>(t.states[e]=Pl,o("reject",e),Promise.reject(e)))))))),s=e=>(t.loading=!0,r(e).then((e=>{t.loading=!1;const o=t.queueLoadedCallbacks.shift();return j.from(o).each(V),n(e)}))),a=He(e);return t.loading?new Promise(((e,o)=>{t.queueLoadedCallbacks.push((()=>s(a).then(e,o)))})):s(a)}}zl.ScriptLoader=new zl;const Fl=e=>{let t=e;const o=()=>t,n=e=>{t=e};return{get:o,set:n}},Vl=e=>w(e)&&Re(e,"raw"),Zl=e=>C(e)&&e.length>1,Ul={},jl=Fl("en"),$l=()=>Ne(Ul,jl.get()),Wl=()=>ke(Ul,(e=>({...e}))),ql=e=>{e&&jl.set(e)},Gl=()=>jl.get(),Kl=(e,t)=>{let o=Ul[e];o||(Ul[e]=o={}),Se(t,((e,t)=>{o[t.toLowerCase()]=e}))},Yl=e=>{const t=$l().getOr({}),o=e=>E(e)?Object.prototype.toString.call(e):n(e)?"":""+e,n=e=>""===e||null===e||void 0===e,r=e=>{const n=o(e);return Ne(t,n.toLowerCase()).map(o).getOr(n)},s=e=>e.replace(/{context:\w+}$/,"");if(n(e))return"";if(Vl(e))return o(e.raw);if(Zl(e)){const t=e.slice(1),n=r(e[0]).replace(/\{([0-9]+)\}/g,((e,n)=>Re(t,n)?o(t[n]):e));return s(n)}return s(r(e))},Xl=()=>$l().bind((e=>Ne(e,"_dir"))).exists((e=>"rtl"===e)),Jl=e=>Re(Ul,e),Ql={getData:Wl,setCode:ql,getCode:Gl,add:Kl,translate:Yl,isRtl:Xl,hasCode:Jl},ec=()=>{const e=[],t={},o={},n=[],r=(e,t)=>{const o=oe(n,(o=>o.name===e&&o.state===t));Q(o,(e=>e.resolve()))},s=e=>Re(t,e),a=e=>Re(o,e),i=e=>{if(o[e])return o[e].instance},l=(e,o)=>{const n=Ql.getCode(),r=","+(o||"")+",";!n||o&&-1===r.indexOf(","+n+",")||zl.ScriptLoader.add(t[e]+"/langs/"+n+".js")},c=(e,t)=>{!1!==ec.languageLoad&&(s(e)?l(e,t):h(e,"loaded").then((()=>l(e,t))))},d=(t,n)=>(e.push(n),o[t]={instance:n},r(t,"added"),n),m=e=>{delete t[e],delete o[e]},u=(e,t)=>y(t)?y(e)?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}:t,g=(e,n)=>{if(t[e])return Promise.resolve();let s=y(n)?n:n.prefix+n.resource+n.suffix;0!==s.indexOf("/")&&-1===s.indexOf("://")&&(s=ec.baseURL+"/"+s),t[e]=s.substring(0,s.lastIndexOf("/"));const a=()=>(r(e,"loaded"),Promise.resolve());return o[e]?a():zl.ScriptLoader.add(s).then(a)},h=(e,t="added")=>"added"===t&&a(e)||"loaded"===t&&s(e)?Promise.resolve():new Promise((o=>{n.push({name:e,state:t,resolve:o})}));return{items:e,urls:t,lookup:o,get:i,requireLangPack:c,add:d,remove:m,createUrl:u,load:g,waitFor:h}};ec.languageLoad=!0,ec.baseURL="",ec.PluginManager=ec(),ec.ThemeManager=ec(),ec.ModelManager=ec();const tc=e=>{const t=Fl(j.none()),o=()=>t.get().each(e),n=()=>{o(),t.set(j.none())},r=()=>t.get().isSome(),s=()=>t.get(),a=e=>{o(),t.set(j.some(e))};return{clear:n,isSet:r,get:s,set:a}},oc=e=>{const t=Fl(j.none()),o=()=>t.get().each((e=>clearInterval(e))),n=()=>{o(),t.set(j.none())},r=()=>t.get().isSome(),s=()=>t.get(),a=n=>{o(),t.set(j.some(setInterval(n,e)))};return{clear:n,isSet:r,get:s,set:a}},nc=()=>{const e=tc(M),t=t=>e.get().each(t);return{...e,on:t}},rc=(e,t)=>{let o=null;const n=()=>{S(o)||(clearTimeout(o),o=null)},r=(...n)=>{S(o)&&(o=setTimeout((()=>{o=null,e.apply(null,n)}),t))};return{cancel:n,throttle:r}},sc=(e,t)=>{let o=null;const n=()=>{S(o)||(clearTimeout(o),o=null)},r=(...r)=>{n(),o=setTimeout((()=>{o=null,e.apply(null,r)}),t)};return{cancel:n,throttle:r}},ac=B("mce-annotation"),ic=B("data-mce-annotation"),lc=B("data-mce-annotation-uid"),cc=B("data-mce-annotation-active"),dc=B("data-mce-annotation-classes"),mc=B("data-mce-annotation-attrs"),uc=e=>t=>hn(t,e),gc=(e,t)=>{const o=e.selection.getRng(),n=ln.fromDom(o.startContainer),r=ln.fromDom(e.getBody()),s=t.fold((()=>"."+ac()),(e=>`[${ic()}="${e}"]`)),a=Dn(n,o.startOffset).getOr(n),i=jr(a,s,uc(r));return i.bind((t=>Io(t,`${lc()}`).bind((o=>Io(t,`${ic()}`).map((t=>{const n=fc(e,o);return{uid:o,name:t,elements:n}}))))))},hc=e=>Eo(e)&&en(e,ac()),pc=(e,t)=>Po(e,"data-mce-bogus")||$r(e,'[data-mce-bogus="all"]',uc(t)),fc=(e,t)=>{const o=ln.fromDom(e.getBody()),n=ks(o,`[${lc()}="${t}"]`);return oe(n,(e=>!pc(e,o)))},bc=(e,t)=>{const o=ln.fromDom(e.getBody()),n=ks(o,`[${ic()}="${t}"]`),r={};return Q(n,(e=>{if(!pc(e,o)){const t=Ho(e,lc()),o=Ne(r,t).getOr([]);r[t]=o.concat([e])}})),r},vc=(e,t)=>{const o=Fl({}),n=()=>({listeners:[],previous:nc()}),r=(e,t)=>{s(e,(e=>(t(e),e)))},s=(e,t)=>{const r=o.get(),s=Ne(r,e).getOrThunk(n),a=t(s);r[e]=a,o.set(r)},a=(e,t,o)=>{r(e,(n=>{Q(n.listeners,(n=>n(!0,e,{uid:t,nodes:J(o,(e=>e.dom))})))}))},i=e=>{r(e,(t=>{Q(t.listeners,(t=>t(!1,e)))}))},l=(t,o)=>{Q(fc(e,t),(e=>{o?Bo(e,cc(),"true"):zo(e,cc())}))},c=sc((()=>{const o=he(t.getNames());Q(o,(t=>{s(t,(o=>{const n=o.previous.get();return gc(e,j.some(t)).fold((()=>{n.each((e=>{i(t),o.previous.clear(),l(e,!1)}))}),(({uid:e,name:t,elements:r})=>{ho(n,e)||(n.each((e=>l(e,!1))),a(t,e,r),o.previous.set(e),l(e,!0))})),{previous:o.previous,listeners:o.listeners}}))}))}),30);e.on("remove",(()=>{c.cancel()})),e.on("NodeChange",(()=>{c.throttle()}));const d=(e,t)=>{s(e,(e=>({previous:e.previous,listeners:e.listeners.concat([t])})))};return{addListener:d}},yc=(e,t)=>{const o=ic(),n=e=>j.from(e.attr(o)).bind(t.lookup),r=e=>{var t,o;e.attr(lc(),null),e.attr(ic(),null),e.attr(cc(),null);const n=j.from(e.attr(mc())).map((e=>e.split(","))).getOr([]),r=j.from(e.attr(dc())).map((e=>e.split(","))).getOr([]);Q(n,(t=>e.attr(t,null)));const s=null!==(o=null===(t=e.attr("class"))||void 0===t?void 0:t.split(" "))&&void 0!==o?o:[],a=ue(s,[ac()].concat(r));e.attr("class",a.length>0?a.join(" "):null),e.attr(dc(),null),e.attr(mc(),null)};e.serializer.addTempAttr(cc()),e.serializer.addAttributeFilter(o,(e=>{for(const t of e)n(t).each((e=>{!1===e.persistent&&("span"===t.name?t.unwrap():r(t))}))}))},wc=()=>{const e={},t=(t,o)=>{e[t]={name:t,settings:o}},o=t=>Ne(e,t).map((e=>e.settings)),n=()=>xe(e);return{register:t,lookup:o,getNames:n}};let xc=0;const Cc=e=>{const t=new Date,o=t.getTime(),n=Math.floor(1e9*Math.random());return xc++,e+"_"+n+xc+String(o)},Sc=(e,t)=>{Q(t,(t=>{Yo(e,t)}))},kc=(e,t)=>{Q(t,(t=>{Jo(e,t)}))},_c=(e,t)=>ln.fromDom(e.dom.cloneNode(t)),Oc=e=>_c(e,!1),Tc=e=>_c(e,!0),Ec=(e,t)=>{const o=ln.fromTag(t),n=Vo(e);return Lo(o,n),o},Dc=(e,t)=>{const o=Ec(e,t);or(e,o);const n=En(e);return ir(o,n),cr(e),o},Ac=(e,t,o=Z)=>{const n=new Wr(e,t),r=e=>{let t;do{t=n[e]()}while(t&&!as(t)&&!o(t));return j.from(t).filter(as)};return{current:()=>j.from(n.current()).filter(as),next:()=>r("next"),prev:()=>r("prev"),prev2:()=>r("prev2")}},Mc=(e,t)=>{const o=t||(t=>e.isBlock(t)||us(t)||ps(t)),n=(e,t,o,r)=>{if(as(e)){const o=r(e,t,e.data);if(-1!==o)return j.some({container:e,offset:o})}return o().bind((e=>n(e.container,e.offset,o,r)))},r=(t,r,s,a)=>{const i=Ac(t,null!==a&&void 0!==a?a:e.getRoot(),o);return n(t,r,(()=>i.prev().map((e=>({container:e,offset:e.length})))),s).getOrNull()},s=(t,r,s,a)=>{const i=Ac(t,null!==a&&void 0!==a?a:e.getRoot(),o);return n(t,r,(()=>i.next().map((e=>({container:e,offset:0})))),s).getOrNull()};return{backwards:r,forwards:s}},Nc=Math.round,Rc=e=>e?{left:Nc(e.left),top:Nc(e.top),bottom:Nc(e.bottom),right:Nc(e.right),width:Nc(e.width),height:Nc(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0},Bc=(e,t)=>(e=Rc(e),t||(e.left=e.left+e.width),e.right=e.left,e.width=0,e),Lc=(e,t)=>e.left===t.left&&e.top===t.top&&e.bottom===t.bottom&&e.right===t.right,Hc=(e,t,o)=>e>=0&&e<=Math.min(t.height,o.height)/2,Ic=(e,t)=>{const o=Math.min(t.height/2,e.height/2);return e.bottom-o<t.top||!(e.top>t.bottom)&&Hc(t.top-e.bottom,e,t)},Pc=(e,t)=>e.top>t.bottom||!(e.bottom<t.top)&&Hc(t.bottom-e.top,e,t),zc=(e,t,o)=>t>=e.left&&t<=e.right&&o>=e.top&&o<=e.bottom,Fc=e=>re(e,((e,t)=>e.fold((()=>j.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),s=Math.max(t.bottom,e.bottom);return j.some({top:n,right:r,bottom:s,left:o,width:r-o,height:s-n})}))),j.none()),Vc=(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))},Zc=(e,t)=>Math.max(0,Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top)),Uc=(e,t,o)=>Math.min(Math.max(e,t),o),jc=e=>{const t=e.startContainer,o=e.startOffset;return t===e.endContainer&&t.hasChildNodes()&&e.endOffset===o+1?t.childNodes[o]:null},$c=(e,t)=>{if(Kr(e)&&e.hasChildNodes()){const o=e.childNodes,n=Uc(t,0,o.length-1);return o[n]}return e},Wc=(e,t)=>t<0&&Kr(e)&&e.hasChildNodes()?void 0:$c(e,t),qc=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿‌-‍⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),Gc=e=>y(e)&&e.charCodeAt(0)>=768&&qc.test(e),Kc=(...e)=>t=>{for(let o=0;o<e.length;o++)if(e[o](t))return!0;return!1},Yc=(...e)=>t=>{for(let o=0;o<e.length;o++)if(!e[o](t))return!1;return!0},Xc=Kr,Jc=Ea,Qc=Jr("display","block table"),ed=Jr("float","left right"),td=Yc(Xc,Jc,P(ed)),od=P(Jr("white-space","pre pre-line pre-wrap")),nd=as,rd=us,sd=Rl.nodeIndex,ad=Wc,id=e=>e?e.createRange():Rl.DOM.createRng(),ld=e=>y(e)&&/[\r\n\t ]/.test(e),cd=e=>!!e.setStart&&!!e.setEnd,dd=e=>{const t=e.startContainer,o=e.startOffset;if(ld(e.toString())&&od(t.parentNode)&&as(t)){const e=t.data;if(ld(e[o-1])||ld(e[o+1]))return!0}return!1},md=e=>{const t=e.ownerDocument,o=id(t),n=t.createTextNode(xs),r=e.parentNode;r.insertBefore(n,e),o.setStart(n,0),o.setEnd(n,1);const s=Rc(o.getBoundingClientRect());return r.removeChild(n),s},ud=e=>{const t=e.startContainer,o=e.endContainer,n=e.startOffset,r=e.endOffset;if(t===o&&as(o)&&0===n&&1===r){const t=e.cloneRange();return t.setEndAfter(o),hd(t)}return null},gd=e=>0===e.left&&0===e.right&&0===e.top&&0===e.bottom,hd=e=>{var t;let o;const n=e.getClientRects();return o=n.length>0?Rc(n[0]):Rc(e.getBoundingClientRect()),!cd(e)&&rd(e)&&gd(o)?md(e):gd(o)&&cd(e)&&null!==(t=ud(e))&&void 0!==t?t:o},pd=(e,t)=>{const o=Bc(e,t);return o.width=1,o.right=o.left+1,o},fd=e=>{const t=[],o=e=>{0!==e.height&&(t.length>0&&Lc(e,t[t.length-1])||t.push(e))},n=(e,t)=>{const n=id(e.ownerDocument);if(t<e.data.length){if(Gc(e.data[t]))return;if(Gc(e.data[t-1])&&(n.setStart(e,t),n.setEnd(e,t+1),!dd(n)))return void o(pd(hd(n),!1))}t>0&&(n.setStart(e,t-1),n.setEnd(e,t),dd(n)||o(pd(hd(n),!1))),t<e.data.length&&(n.setStart(e,t),n.setEnd(e,t+1),dd(n)||o(pd(hd(n),!0)))},r=e.container(),s=e.offset();if(nd(r))return n(r,s),t;if(Xc(r))if(e.isAtEnd()){const e=ad(r,s);nd(e)&&n(e,e.data.length),td(e)&&!rd(e)&&o(pd(hd(e),!1))}else{const a=ad(r,s);if(nd(a)&&n(a,0),td(a)&&e.isAtEnd())return o(pd(hd(a),!1)),t;const i=ad(e.container(),e.offset()-1);td(i)&&!rd(i)&&(Qc(i)||Qc(a)||!td(a))&&o(pd(hd(i),!1)),td(a)&&o(pd(hd(a),!0))}return t},bd=(e,t,o)=>{const n=()=>(nd(e),0===t),r=()=>nd(e)?t>=e.data.length:t>=e.childNodes.length,s=()=>{const o=id(e.ownerDocument);return o.setStart(e,t),o.setEnd(e,t),o},a=()=>(o||(o=fd(bd(e,t))),o),i=()=>a().length>0,l=o=>o&&e===o.container()&&t===o.offset(),c=o=>ad(e,o?t-1:t);return{container:B(e),offset:B(t),toRange:s,getClientRects:a,isVisible:i,isAtStart:n,isAtEnd:r,isEqual:l,getNode:c}};bd.fromRangeStart=e=>bd(e.startContainer,e.startOffset),bd.fromRangeEnd=e=>bd(e.endContainer,e.endOffset),bd.after=e=>bd(e.parentNode,sd(e)+1),bd.before=e=>bd(e.parentNode,sd(e)),bd.isAbove=(e,t)=>fo(fe(t.getClientRects()),be(e.getClientRects()),Ic).getOr(!1),bd.isBelow=(e,t)=>fo(be(t.getClientRects()),fe(e.getClientRects()),Pc).getOr(!1),bd.isAtStart=e=>!!e&&e.isAtStart(),bd.isAtEnd=e=>!!e&&e.isAtEnd(),bd.isTextPosition=e=>!!e&&as(e.container()),bd.isElementPosition=e=>!bd.isTextPosition(e);const vd=(e,t)=>{as(t)&&0===t.data.length&&e.remove(t)},yd=(e,t,o)=>{t.insertNode(o),vd(e,o.previousSibling),vd(e,o.nextSibling)},wd=(e,t,o)=>{const n=j.from(o.firstChild),r=j.from(o.lastChild);t.insertNode(o),n.each((t=>vd(e,t.previousSibling))),r.each((t=>vd(e,t.nextSibling)))},xd=(e,t,o)=>{ms(o)?wd(e,t,o):yd(e,t,o)},Cd=as,Sd=ts,kd=Rl.nodeIndex,_d=e=>{const t=e.parentNode;return Sd(t)?_d(t):t},Od=e=>e?je(e.childNodes,((e,t)=>(Sd(t)&&"BR"!==t.nodeName?e=e.concat(Od(t)):e.push(t),e)),[]):[],Td=(e,t)=>{let o=e;while(o=o.previousSibling){if(!Cd(o))break;t+=o.data.length}return t},Ed=e=>t=>e===t,Dd=e=>{let t,o;t=Od(_d(e)),o=$e(t,Ed(e),e),t=t.slice(0,o+1);const n=je(t,((e,o,n)=>(Cd(o)&&Cd(t[n-1])&&e++,e)),0);return t=Ze(t,Xr([e.nodeName])),o=$e(t,Ed(e),e),o-n},Ad=e=>{const t=Cd(e)?"text()":e.nodeName.toLowerCase();return t+"["+Dd(e)+"]"},Md=(e,t,o)=>{const n=[];for(let r=t.parentNode;r&&r!==e;r=r.parentNode){if(o&&o(r))break;n.push(r)}return n},Nd=(e,t)=>{let o,n=[],r=t.container(),s=t.offset();if(Cd(r))o=Td(r,s);else{const e=r.childNodes;s>=e.length?(o="after",s=e.length-1):o="before",r=e[s]}n.push(Ad(r));let a=Md(e,r);return a=Ze(a,P(ts)),n=n.concat(Ve(a,(e=>Ad(e)))),n.reverse().join("/")+","+o},Rd=(e,t,o)=>{let n=Od(e);return n=Ze(n,((e,t)=>!Cd(e)||!Cd(n[t-1]))),n=Ze(n,Xr([t])),n[o]},Bd=(e,t)=>{let o=e,n=0;while(Cd(o)){const r=o.data.length;if(t>=n&&t<=n+r){e=o,t-=n;break}if(!Cd(o.nextSibling)){e=o,t=r;break}n+=r,o=o.nextSibling}return Cd(e)&&t>e.data.length&&(t=e.data.length),bd(e,t)},Ld=(e,t)=>{if(!t)return null;const o=t.split(","),n=o[0].split("/"),r=o.length>1?o[1]:"before",s=je(n,((e,t)=>{const o=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t);return o?("text()"===o[1]&&(o[1]="#text"),Rd(e,o[1],parseInt(o[2],10))):null}),e);if(!s)return null;if(!Cd(s)&&s.parentNode){let e;return e="after"===r?kd(s)+1:kd(s),bd(s.parentNode,e)}return Bd(s,parseInt(r,10))},Hd=ps,Id=(e,t,o)=>{let n=e(t.data.slice(0,o)).length;for(let r=t.previousSibling;r&&as(r);r=r.previousSibling)n+=e(r.data).length;return n},Pd=(e,t,o,n,r)=>{const s=r?n.startContainer:n.endContainer;let a=r?n.startOffset:n.endOffset;const i=[],l=e.getRoot();if(as(s))i.push(o?Id(t,s,a):a);else{let t=0;const n=s.childNodes;a>=n.length&&n.length&&(t=1,a=Math.max(0,n.length-1)),i.push(e.nodeIndex(n[a],o)+t)}for(let c=s;c&&c!==l;c=c.parentNode)i.push(e.nodeIndex(c,o));return i},zd=(e,t,o,n)=>{const r=t.dom,s=Pd(r,e,o,n,!0),a=t.isForward(),i=ya(n)?{isFakeCaret:!0}:{};if(t.isCollapsed())return{start:s,forward:a,...i};{const t=Pd(r,e,o,n,!1);return{start:s,end:t,forward:a,...i}}},Fd=(e,t,o)=>{let n=0;return go.each(e.select(t),(e=>"all"===e.getAttribute("data-mce-bogus")?void 0:e!==o&&void n++)),n},Vd=(e,t)=>{let o=t?e.startContainer:e.endContainer,n=t?e.startOffset:e.endOffset;if(Kr(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))}},Zd=e=>(Vd(e,!0),Vd(e,!1),e),Ud=(e,t)=>{if(Kr(e)&&(e=$c(e,t),Hd(e)))return e;if(ca(e)){as(e)&&ia(e)&&(e=e.parentNode);let t=e.previousSibling;if(Hd(t))return t;if(t=e.nextSibling,Hd(t))return t}},jd=e=>Ud(e.startContainer,e.startOffset)||Ud(e.endContainer,e.endOffset),$d=(e,t,o)=>{const n=o.getNode(),r=o.getRng();if("IMG"===n.nodeName||Hd(n)){const e=n.nodeName;return{name:e,index:Fd(o.dom,e,n)}}const s=jd(r);if(s){const e=s.tagName;return{name:e,index:Fd(o.dom,e,s)}}return zd(e,o,t,r)},Wd=e=>{const t=e.getRng();return{start:Nd(e.dom.getRoot(),bd.fromRangeStart(t)),end:Nd(e.dom.getRoot(),bd.fromRangeEnd(t)),forward:e.isForward()}},qd=e=>({rng:e.getRng(),forward:e.isForward()}),Gd=(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)},Kd=(e,t)=>{const o=e.dom;let n=e.getRng();const r=o.uniqueId(),s=e.isCollapsed(),a=e.getNode(),i=a.nodeName,l=e.isForward();if("IMG"===i)return{name:i,index:Fd(o,i,a)};const c=Zd(n.cloneRange());if(!s){c.collapse(!1);const e=Gd(o,r+"_end",t);xd(o,c,e)}n=Zd(n),n.collapse(!0);const d=Gd(o,r+"_start",t);return xd(o,n,d),e.moveToBookmark({id:r,keep:!0,forward:l}),{id:r,forward:l}},Yd=(e,t,o=!1)=>2===t?$d(ra,o,e):3===t?Wd(e):t?qd(e):Kd(e,!1),Xd=I($d,L,!0),Jd=e=>{const t=t=>t(e),o=B(e),n=()=>r,r={tag:!0,inner:e,fold:(t,o)=>o(e),isValue:U,isError:Z,map:t=>tm.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:()=>j.some(e)};return r},Qd=e=>{const t=()=>o,o={tag:!1,inner:e,fold:(t,o)=>t(e),isValue:Z,isError:U,map:t,mapError:t=>tm.error(t(e)),bind:t,exists:Z,forall:U,getOr:L,or:L,getOrThunk:F,orThunk:F,getOrDie:z(String(e)),each:M,toOptional:j.none};return o},em=(e,t)=>e.fold((()=>Qd(t)),Jd),tm={value:Jd,error:Qd,fromOption:em},om=e=>{if(!C(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 s=xe(n);if(1!==s.length)throw new Error("one and only one name per case");const a=s[0],i=n[a];if(void 0!==o[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!C(i))throw new Error("case arguments must be an array");t.push(a),o[a]=(...o)=>{const n=o.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+i.length+" ("+i+"), got "+n);const s=e=>{const n=xe(e);if(t.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","));const r=de(t,(e=>Y(n,e)));if(!r)throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,o)};return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);const n=t[r];return n.apply(null,o)},match:s,log:e=>{console.log(e,{constructors:t,constructor:a,params:o})}}}})),o},nm={generate:om};nm.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const rm=e=>{const t=[],o=[];return Q(e,(e=>{e.fold((e=>{t.push(e)}),(e=>{o.push(e)}))})),{errors:t,values:o}},sm=e=>"inline-command"===e.type||"inline-format"===e.type,am=e=>"block-command"===e.type||"block-format"===e.type,im=e=>{const t=t=>tm.error({message:t,pattern:e}),o=(o,n,r)=>{if(void 0!==e.format){let r;if(C(e.format)){if(!de(e.format,y))return t(o+" pattern has non-string items in the `format` array");r=e.format}else{if(!y(e.format))return t(o+" pattern has non-string `format` parameter");r=[e.format]}return tm.value(n(r))}return void 0!==e.cmd?y(e.cmd)?tm.value(r(e.cmd,e.value)):t(o+" pattern has non-string `cmd` parameter"):t(o+" pattern is missing both `format` and `cmd` parameters")};if(!w(e))return t("Raw pattern is not an object");if(!y(e.start))return t("Raw pattern is missing `start` parameter");if(void 0!==e.end){if(!y(e.end))return t("Inline pattern has non-string `end` parameter");if(0===e.start.length&&0===e.end.length)return t("Inline pattern has empty `start` and `end` parameters");let n=e.start,r=e.end;return 0===r.length&&(r=n,n=""),o("Inline",(e=>({type:"inline-format",start:n,end:r,format:e})),((e,t)=>({type:"inline-command",start:n,end:r,cmd:e,value:t})))}return void 0!==e.replacement?y(e.replacement)?0===e.start.length?t("Replacement pattern has empty `start` parameter"):tm.value({type:"inline-command",start:"",end:e.start,cmd:"mceInsertContent",value:e.replacement}):t("Replacement pattern has non-string `replacement` parameter"):0===e.start.length?t("Block pattern has empty `start` parameter"):o("Block",(t=>({type:"block-format",start:e.start,format:t[0]})),((t,o)=>({type:"block-command",start:e.start,cmd:t,value:o})))},lm=e=>oe(e,am),cm=e=>oe(e,sm),dm=(e,t)=>({inlinePatterns:cm(e),blockPatterns:lm(e),dynamicPatternsLookup:t}),mm=e=>{const t=rm(J(e,im));return Q(t.errors,(e=>console.error(e.message,e.pattern))),t.values},um=e=>t=>{const o=e(t);return mm(o)},gm=Gt().deviceType,hm=gm.isTouch(),pm=Rl.DOM,fm=e=>{const t=e.indexOf("=")>0?e.split(/[;,](?![^=;,]*(?:[;,]|$))/):e.split(",");return re(t,((e,t)=>{const o=t.split("="),n=o[0],r=o.length>1?o[1]:n;return e[ut(n)]=ut(r),e}),{})},bm=e=>v(e,RegExp),vm=e=>t=>t.options.get(e),ym=e=>y(e)||w(e),wm=(e,t="")=>o=>{const n=y(o);if(n){if(-1!==o.indexOf("=")){const r=fm(o);return{value:Ne(r,e.id).getOr(t),valid:n}}return{value:o,valid:n}}return{valid:!1,message:"Must be a string."}},xm=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:wm(e,"tinymce"),default:"tinymce"}),t("body_class",{processor:wm(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=y(e)&&pt(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=Y(["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=>k(e)||y(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,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,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||y(e)||A(e,y);return t?y(e)?{value:J(e.split(","),ut),valid:t}:C(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:bu(e)?[]:["default"]}),t("content_style",{processor:"string"}),t("content_css_cors",{processor:"boolean",default:!1}),t("font_css",{processor:e=>{const t=y(e)||A(e,y);if(t){const o=C(e)?e:J(e.split(","),ut);return{value:o,valid:t}}return{valid:!1,message:"Must be a string or an array of strings."}},default:[]}),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=k(e)||y(e);return t?!1===e||gm.isiPhone()||gm.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:!hm}),t("resize_img_proportional",{processor:"boolean",default:!0}),t("event_root",{processor:"object"}),t("service_message",{processor:"string"}),t("theme",{processor:e=>!1===e||y(e)||E(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||y(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("readonly",{processor:"boolean",default:!1}),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. 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_script_urls",{processor:"boolean",default:!1}),t("allow_unsafe_link_target",{processor:"boolean",default:!1}),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"}),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:"string"}),t("extended_valid_elements",{processor:"string"}),t("invalid_elements",{processor:"string"}),t("invalid_styles",{processor:ym}),t("valid_children",{processor:"string"}),t("valid_classes",{processor:ym}),t("valid_elements",{processor:"string"}),t("valid_styles",{processor:ym}),t("verify_html",{processor:"boolean",default:!0}),t("auto_focus",{processor:e=>y(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("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=>{if(A(e,w)||!1===e){const t=!1===e?[]:e;return{value:mm(t),valid:!0}}return{valid:!1,message:"Must be an array of objects or false."}},default:[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"####",format:"h4"},{start:"#####",format:"h5"},{start:"######",format:"h6"},{start:"1. ",cmd:"InsertOrderedList"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"}]}),t("text_patterns_lookup",{processor:e=>E(e)?{value:um(e),valid:!0}:{valid:!1,message:"Must be a single function"},default:e=>[]}),t("noneditable_class",{processor:"string",default:"mceNonEditable"}),t("editable_class",{processor:"string",default:"mceEditable"}),t("noneditable_regexp",{processor:e=>A(e,bm)?{value:e,valid:!0}:bm(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}),e.on("ScriptsLoaded",(()=>{t("directionality",{processor:"string",default:Ql.isRtl()?"rtl":void 0}),t("placeholder",{processor:"string",default:pm.getAttrib(e.getElement(),"placeholder")})}))},Cm=vm("iframe_attrs"),Sm=vm("doctype"),km=vm("document_base_url"),_m=vm("body_id"),Om=vm("body_class"),Tm=vm("content_security_policy"),Em=vm("br_in_pre"),Dm=vm("forced_root_block"),Am=vm("forced_root_block_attrs"),Mm=vm("newline_behavior"),Nm=vm("br_newline_selector"),Rm=vm("no_newline_selector"),Bm=vm("keep_styles"),Lm=vm("end_container_on_empty_block"),Hm=vm("automatic_uploads"),Im=vm("images_reuse_filename"),Pm=vm("images_replace_blob_uris"),zm=vm("icons"),Fm=vm("icons_url"),Vm=vm("images_upload_url"),Zm=vm("images_upload_base_path"),Um=vm("images_upload_credentials"),jm=vm("images_upload_handler"),$m=vm("content_css_cors"),Wm=vm("referrer_policy"),qm=vm("language"),Gm=vm("language_url"),Km=vm("indent_use_margin"),Ym=vm("indentation"),Xm=vm("content_css"),Jm=vm("content_style"),Qm=vm("font_css"),eu=vm("directionality"),tu=vm("inline_boundaries_selector"),ou=vm("object_resizing"),nu=vm("resize_img_proportional"),ru=vm("placeholder"),su=vm("event_root"),au=vm("service_message"),iu=vm("theme"),lu=vm("theme_url"),cu=vm("model"),du=vm("model_url"),mu=vm("inline_boundaries"),uu=vm("formats"),gu=vm("preview_styles"),hu=vm("format_empty_lines"),pu=vm("format_noneditable_selector"),fu=vm("custom_ui_selector"),bu=vm("inline"),vu=vm("hidden_input"),yu=vm("submit_patch"),wu=vm("add_form_submit_trigger"),xu=vm("add_unload_trigger"),Cu=vm("custom_undo_redo_levels"),Su=vm("disable_nodechange"),ku=vm("readonly"),_u=vm("content_css_cors"),Ou=vm("plugins"),Tu=vm("external_plugins"),Eu=vm("block_unsupported_drop"),Du=vm("visual"),Au=vm("visual_table_class"),Mu=vm("visual_anchor_class"),Nu=vm("iframe_aria_text"),Ru=vm("setup"),Bu=vm("init_instance_callback"),Lu=vm("urlconverter_callback"),Hu=vm("auto_focus"),Iu=vm("browser_spellcheck"),Pu=vm("protect"),zu=vm("paste_block_drop"),Fu=vm("paste_data_images"),Vu=vm("paste_preprocess"),Zu=vm("paste_postprocess"),Uu=vm("paste_webkit_styles"),ju=vm("paste_remove_styles_if_webkit"),$u=vm("paste_merge_formats"),Wu=vm("smart_paste"),qu=vm("paste_as_text"),Gu=vm("paste_tab_spaces"),Ku=vm("allow_html_data_urls"),Yu=vm("text_patterns"),Xu=vm("text_patterns_lookup"),Ju=vm("noneditable_class"),Qu=vm("editable_class"),eg=vm("noneditable_regexp"),tg=vm("preserve_cdata"),og=e=>e.options.isSet("text_patterns_lookup"),ng=e=>go.explode(e.options.get("font_size_style_values")),rg=e=>go.explode(e.options.get("font_size_classes")),sg=e=>"xml"===e.options.get("encoding"),ag=e=>go.explode(e.options.get("images_file_types")),ig=vm("table_tab_navigation"),lg=Kr,cg=as,dg=e=>{const t=e.parentNode;t&&t.removeChild(e)},mg=e=>{const t=ra(e);return{count:e.length-t.length,text:t}},ug=e=>{let t;while(-1!==(t=e.data.lastIndexOf(oa)))e.deleteData(t,1)},gg=(e,t)=>(yg(e),t),hg=(e,t)=>{const o=mg(e.data.substr(0,t.offset())),n=mg(e.data.substr(t.offset())),r=o.text+n.text;return r.length>0?(ug(e),bd(e,t.offset()-o.count)):t},pg=(e,t)=>{const o=t.container(),n=K(ve(o.childNodes),e).map((e=>e<t.offset()?bd(o,t.offset()-1):t)).getOr(t);return yg(e),n},fg=(e,t)=>cg(e)&&t.container()===e?hg(e,t):gg(e,t),bg=(e,t)=>t.container()===e.parentNode?pg(e,t):gg(e,t),vg=(e,t)=>bd.isTextPosition(t)?fg(e,t):bg(e,t),yg=e=>{lg(e)&&ca(e)&&(da(e)?e.removeAttribute("data-mce-caret"):dg(e)),cg(e)&&(ug(e),0===e.data.length&&dg(e))},wg=ps,xg=vs,Cg=fs,Sg="*[contentEditable=false],video,audio,embed,object",kg=(e,t,o)=>{const n=Bc(t.getBoundingClientRect(),o);let r,s;if("BODY"===e.tagName){const t=e.ownerDocument.documentElement;r=e.scrollLeft||t.scrollLeft,s=e.scrollTop||t.scrollTop}else{const t=e.getBoundingClientRect();r=e.scrollLeft-t.left,s=e.scrollTop-t.top}n.left+=r,n.right+=r,n.top+=s,n.bottom+=s,n.width=1;let a=t.offsetWidth-t.clientWidth;return a>0&&(o&&(a*=-1),n.left+=a,n.right+=a),n},_g=e=>{var t,o;const n=ks(ln.fromDom(e),Sg);for(let r=0;r<n.length;r++){const e=n[r].dom;let s=e.previousSibling;if(fa(s)){const e=s.data;1===e.length?null===(t=s.parentNode)||void 0===t||t.removeChild(s):s.deleteData(e.length-1,1)}if(s=e.nextSibling,pa(s)){const e=s.data;1===e.length?null===(o=s.parentNode)||void 0===o||o.removeChild(s):s.deleteData(0,1)}}},Og=(e,t,o,n)=>{const r=nc();let s,a;const i=Dm(e),l=e.dom,c=(e,n)=>{let s;if(d(),Cg(n))return null;if(!o(n))return a=ma(n,e),s=n.ownerDocument.createRange(),Eg(a.nextSibling)?(s.setStart(a,0),s.setEnd(a,0)):(s.setStart(a,1),s.setEnd(a,1)),s;{const o=ha(i,n,e),c=kg(t,n,e);l.setStyle(o,"top",c.top),a=o;const d=l.create("div",{class:"mce-visual-caret","data-mce-bogus":"all"});l.setStyles(d,{...c}),l.add(t,d),r.set({caret:d,element:n,before:e}),e&&l.addClass(d,"mce-visual-caret-before"),m(),s=n.ownerDocument.createRange(),s.setStart(o,0),s.setEnd(o,0)}return s},d=()=>{_g(t),a&&(yg(a),a=null),r.on((e=>{l.remove(e.caret),r.clear()})),s&&(clearInterval(s),s=void 0)},m=()=>{s=setInterval((()=>{r.on((e=>{n()?l.toggleClass(e.caret,"mce-visual-caret-hidden"):l.addClass(e.caret,"mce-visual-caret-hidden")}))}),500)},u=()=>{r.on((e=>{const o=kg(t,e.element,e.before);l.setStyles(e.caret,{...o})}))},g=()=>clearInterval(s),h=()=>".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;}";return{show:c,hide:d,getCss:h,reposition:u,destroy:g}},Tg=()=>to.browser.isFirefox(),Eg=e=>wg(e)||xg(e),Dg=e=>Eg(e)||ns(e)&&Tg(),Ag=hs,Mg=ps,Ng=vs,Rg=Jr("display","block table table-cell table-caption list-item"),Bg=ca,Lg=ia,Hg=Kr,Ig=as,Pg=Ea,zg=e=>e>0,Fg=e=>e<0,Vg=(e,t)=>{let o;while(o=e(t))if(!Lg(o))return o;return null},Zg=(e,t,o,n,r)=>{const s=new Wr(e,n),a=Mg(e)||Lg(e);let i;if(Fg(t)){if(a&&(i=Vg(s.prev.bind(s),!0),o(i)))return i;while(i=Vg(s.prev.bind(s),r))if(o(i))return i}if(zg(t)){if(a&&(i=Vg(s.next.bind(s),!0),o(i)))return i;while(i=Vg(s.next.bind(s),r))if(o(i))return i}return null},Ug=(e,t)=>{const o=e=>Ag(e.dom),n=e=>e.dom===t;return Ir(ln.fromDom(e),o,n).map((e=>e.dom)).getOr(t)},jg=(e,t)=>{while(e&&e!==t){if(Rg(e))return e;e=e.parentNode}return null},$g=(e,t,o)=>jg(e.container(),o)===jg(t.container(),o),Wg=(e,t)=>{if(!t)return j.none();const o=t.container(),n=t.offset();return Hg(o)?j.from(o.childNodes[n+e]):j.none()},qg=(e,t)=>{var o;const n=null!==(o=t.ownerDocument)&&void 0!==o?o:document,r=n.createRange();return e?(r.setStartBefore(t),r.setEndBefore(t)):(r.setStartAfter(t),r.setEndAfter(t)),r},Gg=(e,t,o)=>jg(t,e)===jg(o,e),Kg=(e,t,o)=>{const n=e?"previousSibling":"nextSibling";let r=o;while(r&&r!==t){let e=r[n];if(e&&Bg(e)&&(e=e[n]),Mg(e)||Ng(e)){if(Gg(t,e,r))return e;break}if(Pg(e))break;r=r.parentNode}return null},Yg=I(qg,!0),Xg=I(qg,!1),Jg=(e,t,o)=>{let n;const r=I(Kg,!0,t),s=I(Kg,!1,t),a=o.startContainer,i=o.startOffset;if(ia(a)){const e=Ig(a)?a.parentNode:a,t=e.getAttribute("data-mce-caret");if("before"===t&&(n=e.nextSibling,Dg(n)))return Yg(n);if("after"===t&&(n=e.previousSibling,Dg(n)))return Xg(n)}if(!o.collapsed)return o;if(as(a)){if(Bg(a)){if(1===e){if(n=s(a),n)return Yg(n);if(n=r(a),n)return Xg(n)}if(-1===e){if(n=r(a),n)return Xg(n);if(n=s(a),n)return Yg(n)}return o}if(fa(a)&&i>=a.data.length-1)return 1===e&&(n=s(a),n)?Yg(n):o;if(pa(a)&&i<=1)return-1===e&&(n=r(a),n)?Xg(n):o;if(i===a.data.length)return n=s(a),n?Yg(n):o;if(0===i)return n=r(a),n?Xg(n):o}return o},Qg=(e,t)=>Wg(e?0:-1,t).filter(Mg),eh=(e,t,o)=>{const n=Jg(e,t,o);return-1===e?bd.fromRangeStart(n):bd.fromRangeEnd(n)},th=e=>j.from(e.getNode()).map(ln.fromDom),oh=e=>j.from(e.getNode(!0)).map(ln.fromDom),nh=(e,t)=>{let o=t;while(o=e(o))if(o.isVisible())return o;return o},rh=(e,t)=>{const o=$g(e,t);return!(o||!us(e.getNode()))||o};var sh;(function(e){e[e["Backwards"]=-1]="Backwards",e[e["Forwards"]=1]="Forwards"})(sh||(sh={}));const ah=ps,ih=as,lh=Kr,ch=us,dh=Ea,mh=Ra,uh=Ba,gh=(e,t)=>{const o=[];let n=e;while(n&&n!==t)o.push(n),n=n.parentNode;return o},hh=(e,t)=>e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null,ph=(e,t)=>{if(zg(e)){if(dh(t.previousSibling)&&!ih(t.previousSibling))return bd.before(t);if(ih(t))return bd(t,0)}if(Fg(e)){if(dh(t.nextSibling)&&!ih(t.nextSibling))return bd.after(t);if(ih(t))return bd(t,t.data.length)}return Fg(e)?ch(t)?bd.before(t):bd.after(t):bd.before(t)},fh=(e,t)=>{const o=t.nextSibling;return o&&dh(o)?ih(o)?bd(o,0):bd.before(o):bh(sh.Forwards,bd.after(t),e)},bh=(e,t,o)=>{let n,r,s,a;if(!lh(o)||!t)return null;if(t.isEqual(bd.after(o))&&o.lastChild){if(a=bd.after(o.lastChild),Fg(e)&&dh(o.lastChild)&&lh(o.lastChild))return ch(o.lastChild)?bd.before(o.lastChild):a}else a=t;const i=a.container();let l=a.offset();if(ih(i)){if(Fg(e)&&l>0)return bd(i,--l);if(zg(e)&&l<i.length)return bd(i,++l);n=i}else{if(Fg(e)&&l>0&&(r=hh(i,l-1),dh(r)))return!mh(r)&&(s=Zg(r,e,uh,r),s)?ih(s)?bd(s,s.data.length):bd.after(s):ih(r)?bd(r,r.data.length):bd.before(r);if(zg(e)&&l<i.childNodes.length&&(r=hh(i,l),dh(r)))return ch(r)?fh(o,r):!mh(r)&&(s=Zg(r,e,uh,r),s)?ih(s)?bd(s,0):bd.before(s):ih(r)?bd(r,0):bd.after(r);n=r||a.getNode()}if(n&&(zg(e)&&a.isAtEnd()||Fg(e)&&a.isAtStart())&&(n=Zg(n,e,U,o,!0),uh(n,o)))return ph(e,n);r=n?Zg(n,e,uh,o):n;const c=We(oe(gh(i,o),ah));return!c||r&&c.contains(r)?r?ph(e,r):null:(a=zg(e)?bd.after(c):bd.before(c),a)},vh=e=>({next:t=>bh(sh.Forwards,t,e),prev:t=>bh(sh.Backwards,t,e)}),yh=(e,t,o)=>{const n=e?bd.before(o):bd.after(o);return Oh(e,t,n)},wh=e=>us(e)?bd.before(e):bd.after(e),xh=e=>bd.isTextPosition(e)?0===e.offset():Ea(e.getNode()),Ch=e=>{if(bd.isTextPosition(e)){const t=e.container();return e.offset()===t.data.length}return Ea(e.getNode(!0))},Sh=(e,t)=>!bd.isTextPosition(e)&&!bd.isTextPosition(t)&&e.getNode()===t.getNode(!0),kh=e=>!bd.isTextPosition(e)&&us(e.getNode()),_h=(e,t,o)=>e?!Sh(t,o)&&!kh(t)&&Ch(t)&&xh(o):!Sh(o,t)&&xh(t)&&Ch(o),Oh=(e,t,o)=>{const n=vh(t);return j.from(e?n.next(o):n.prev(o))},Th=(e,t,o)=>Oh(e,t,o).bind((n=>$g(o,n,t)&&_h(e,o,n)?Oh(e,t,n):j.some(n))),Eh=(e,t,o,n)=>Th(e,t,o).bind((o=>n(o)?Eh(e,t,o,n):j.some(o))),Dh=(e,t)=>{const o=e?t.firstChild:t.lastChild;return as(o)?j.some(bd(o,e?0:o.data.length)):o?Ea(o)?j.some(e?bd.before(o):wh(o)):yh(e,t,o):j.none()},Ah=I(Oh,!0),Mh=I(Oh,!1),Nh=I(Dh,!0),Rh=I(Dh,!1),Bh="_mce_caret",Lh=e=>Kr(e)&&e.id===Bh,Hh=(e,t)=>{let o=t;while(o&&o!==e){if(Lh(o))return o;o=o.parentNode}return null},Ih=e=>y(e.start),Ph=e=>Re(e,"rng"),zh=e=>Re(e,"id"),Fh=e=>Re(e,"name"),Vh=e=>go.isArray(e.start),Zh=e=>!(!Fh(e)&&k(e.forward))||e.forward,Uh=(e,t)=>(Kr(t)&&e.isBlock(t)&&!t.innerHTML&&(t.innerHTML='<br data-mce-bogus="1" />'),t),jh=(e,t)=>{const o=j.from(Ld(e.getRoot(),t.start)),n=j.from(Ld(e.getRoot(),t.end));return fo(o,n,((o,n)=>{const r=e.createRng();return r.setStart(o.container(),o.offset()),r.setEnd(n.container(),n.offset()),{range:r,forward:Zh(t)}}))},$h=(e,t)=>{var o;const n=null!==(o=e.ownerDocument)&&void 0!==o?o:document,r=n.createTextNode(oa);e.appendChild(r),t.setStart(r,0),t.setEnd(r,0)},Wh=e=>!e.hasChildNodes(),qh=(e,t)=>Rh(e).fold(Z,(e=>(t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0))),Gh=(e,t,o)=>!(!Wh(t)||!Hh(e,t))&&($h(t,o),!0),Kh=(e,t,o,n)=>{const r=o[t?"start":"end"],s=e.getRoot();if(r){let e=s,o=r[0];for(let t=r.length-1;e&&t>=1;t--){const o=e.childNodes;if(Gh(s,e,n))return!0;if(r[t]>o.length-1)return!!Gh(s,e,n)||qh(e,n);e=o[r[t]]}as(e)&&(o=Math.min(r[0],e.data.length)),Kr(e)&&(o=Math.min(r[0],e.childNodes.length)),t?n.setStart(e,o):n.setEnd(e,o)}return!0},Yh=e=>as(e)&&e.data.length>0,Xh=(e,t,o)=>{const n=e.get(o.id+"_"+t),r=null===n||void 0===n?void 0:n.parentNode,s=o.keep;if(n&&r){let a,i;if("start"===t?s?n.hasChildNodes()?(a=n.firstChild,i=1):Yh(n.nextSibling)?(a=n.nextSibling,i=0):Yh(n.previousSibling)?(a=n.previousSibling,i=n.previousSibling.data.length):(a=r,i=e.nodeIndex(n)+1):(a=r,i=e.nodeIndex(n)):s?n.hasChildNodes()?(a=n.firstChild,i=1):Yh(n.previousSibling)?(a=n.previousSibling,i=n.previousSibling.data.length):(a=r,i=e.nodeIndex(n)):(a=r,i=e.nodeIndex(n)),!s){const r=n.previousSibling,s=n.nextSibling;let l;go.each(go.grep(n.childNodes),(e=>{as(e)&&(e.data=e.data.replace(/\uFEFF/g,""))}));while(l=e.get(o.id+"_"+t))e.remove(l,!0);if(as(s)&&as(r)&&!to.browser.isOpera()){const t=r.data.length;r.appendData(s.data),e.remove(s),a=r,i=t}}return j.some(bd(a,i))}return j.none()},Jh=(e,t)=>{const o=e.createRng();return Kh(e,!0,t,o)&&Kh(e,!1,t,o)?j.some({range:o,forward:Zh(t)}):j.none()},Qh=(e,t)=>{const o=Xh(e,"start",t),n=Xh(e,"end",t);return fo(o,n.or(o),((o,n)=>{const r=e.createRng();return r.setStart(Uh(e,o.container()),o.offset()),r.setEnd(Uh(e,n.container()),n.offset()),{range:r,forward:Zh(t)}}))},ep=(e,t)=>j.from(e.select(t.name)[t.index]).map((t=>{const o=e.createRng();return o.selectNode(t),{range:o,forward:!0}})),tp=(e,t)=>{const o=e.dom;if(t){if(Vh(t))return Jh(o,t);if(Ih(t))return jh(o,t);if(zh(t))return Qh(o,t);if(Fh(t))return ep(o,t);if(Ph(t))return j.some({range:t.rng,forward:Zh(t)})}return j.none()},op=(e,t,o)=>Yd(e,t,o),np=(e,t)=>{tp(e,t).each((({range:t,forward:o})=>{e.setRng(t,o)}))},rp=e=>Kr(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type"),sp=e=>t=>e===t,ap=sp(xs),ip=e=>""!==e&&-1!==" \f\n\r\t\v".indexOf(e),lp=e=>!ip(e)&&!ap(e)&&!Cs(e),cp=e=>({value:e}),dp=e=>{const t=e.toString(16);return(1===t.length?"0"+t:t).toUpperCase()},mp=e=>{const t=dp(e.red)+dp(e.green)+dp(e.blue);return cp(t)},up=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,gp=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,hp=(e,t,o,n)=>({red:e,green:t,blue:o,alpha:n}),pp=(e,t,o,n)=>{const r=parseInt(e,10),s=parseInt(t,10),a=parseInt(o,10),i=parseFloat(n);return hp(r,s,a,i)},fp=e=>{if("transparent"===e)return j.some(hp(0,0,0,0));const t=up.exec(e);if(null!==t)return j.some(pp(t[1],t[2],t[3],"1"));const o=gp.exec(e);return null!==o?j.some(pp(o[1],o[2],o[3],o[4])):j.none()},bp=e=>fp(e).map(mp).map((e=>"#"+e.value)).getOr(e),vp=e=>{const t=[];if(e)for(let o=0;o<e.rangeCount;o++)t.push(e.getRangeAt(o));return t},yp=e=>ce(e,(e=>{const t=jc(e);return t?[ln.fromDom(t)]:[]})),wp=e=>vp(e).length>1,xp=e=>oe(yp(e),qs),Cp=e=>ks(e,"td[data-mce-selected],th[data-mce-selected]"),Sp=(e,t)=>{const o=Cp(t);return o.length>0?o:xp(e)},kp=e=>Sp(vp(e.selection.getSel()),ln.fromDom(e.getBody())),_p=(e,t)=>Zr(e,"table",t),Op=e=>{const t=e.startContainer,o=e.startOffset;return as(t)?0===o?j.some(ln.fromDom(t)):j.none():j.from(t.childNodes[o]).map(ln.fromDom)},Tp=e=>{const t=e.endContainer,o=e.endOffset;return as(t)?o===t.data.length?j.some(ln.fromDom(t)):j.none():j.from(t.childNodes[o-1]).map(ln.fromDom)},Ep=e=>An(e).fold(B([e]),(t=>[e].concat(Ep(t)))),Dp=e=>Mn(e).fold(B([e]),(t=>"br"===ko(t)?kn(t).map((t=>[e].concat(Dp(t)))).getOr([]):[e].concat(Dp(t)))),Ap=(e,t)=>fo(Op(t),Tp(t),((t,o)=>{const n=ae(Ep(e),I(hn,t)),r=ae(Dp(e),I(hn,o));return n.isSome()&&r.isSome()})).getOr(!1),Mp=(e,t,o,n)=>{const r=o,s=new Wr(o,r),a=De(e.schema.getMoveCaretBeforeOnEnterElements(),((e,t)=>!Y(["td","th","table"],t.toLowerCase())));let i=o;do{if(as(i)&&0!==go.trim(i.data).length)return void(n?t.setStart(i,0):t.setEnd(i,i.data.length));if(a[i.nodeName])return void(n?t.setStartBefore(i):"BR"===i.nodeName?t.setEndBefore(i):t.setEndAfter(i))}while(i=n?s.next():s.prev());"BODY"===r.nodeName&&(n?t.setStart(r,0):t.setEnd(r,r.childNodes.length))},Np=e=>{const t=e.selection.getSel();return T(t)&&t.rangeCount>0},Rp=(e,t)=>{const o=kp(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)},Bp=(e,t,o)=>{const n=Kd(e,t);o(n),e.moveToBookmark(n)},Lp=e=>D(null===e||void 0===e?void 0:e.nodeType),Hp=e=>Kr(e)&&!rp(e)&&!Lh(e)&&!ts(e),Ip=(e,t)=>{if(Hp(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},Pp=e=>!0===e.isContentEditable,zp=(e,t,o)=>{const{selection:n,dom:r}=e,s=n.getNode(),a=ps(s);Bp(n,!0,(()=>{t()}));const i=a&&ps(s);i&&r.isChildOf(s,e.getBody())?e.selection.select(s):o(n.getStart())&&Fp(r,n)},Fp=(e,t)=>{var o,n;const r=t.getRng(),{startContainer:s,startOffset:a}=r,i=t.getNode();if(!Ip(e,i)&&Kr(s)){const i=s.childNodes,l=e.getRoot();let c;if(a<i.length){const t=i[a];c=new Wr(t,null!==(o=e.getParent(t,e.isBlock))&&void 0!==o?o:l)}else{const t=i[i.length-1];c=new Wr(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(as(o)&&!jp(o))return r.setStart(o,0),void t.setRng(r)}}},Vp=(e,t,o)=>{if(e){const n=t?"nextSibling":"previousSibling";for(e=o?e:e[n];e;e=e[n])if(Kr(e)||!jp(e))return e}},Zp=(e,t)=>!!e.getTextBlockElements()[t.nodeName.toLowerCase()]||di(e,t),Up=(e,t,o)=>e.schema.isValidChild(t,o),jp=(e,t=!1)=>{if(T(e)&&as(e)){const o=t?e.data.replace(/ /g," "):e.data;return Ha(o)}return!1},$p=e=>T(e)&&as(e)&&0===e.length,Wp=(e,t)=>{const o="[data-mce-cef-wrappable]",n=pu(e),r=ft(n)?o:`${o},${n}`;return dn(ln.fromDom(t),r)},qp=(e,t)=>{const o=e.dom;return Hp(t)&&"false"===o.getContentEditable(t)&&Wp(e,t)&&0===o.select('[contenteditable="true"]',t).length},Gp=(e,t)=>E(e)?e(t):(T(t)&&(e=e.replace(/%(\w+)/g,((e,o)=>t[o]||e))),e),Kp=(e,t)=>(e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()===t.toLowerCase()),Yp=(e,t)=>{if(O(e))return null;{let o=String(e);return"color"!==t&&"backgroundColor"!==t||(o=bp(o)),"fontWeight"===t&&700===e&&(o="bold"),"fontFamily"===t&&(o=o.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),o}},Xp=(e,t,o)=>{const n=e.getStyle(t,o);return Yp(n,o)},Jp=(e,t)=>{let o;return e.getParent(t,(t=>!!Kr(t)&&(o=e.getStyle(t,"text-decoration"),!!o&&"none"!==o))),o},Qp=(e,t,o)=>e.getParents(t,o,e.getRoot()),ef=(e,t,o)=>{const n=e.formatter.get(t);return T(n)&&X(n,o)},tf=(e,t)=>{const o=e=>{const t=e=>E(e)||e.length>1&&"%"===e.charAt(0);return X(["styles","attributes"],(o=>Ne(e,o).exists((e=>{const o=C(e)?e:Me(e);return X(o,t)}))))};return ef(e,t,o)},of=(e,t,o)=>{const n=["inline","block","selector","attributes","styles","classes"],r=e=>De(e,((e,t)=>X(n,(e=>e===t))));return ef(e,t,(t=>{const n=r(t);return ef(e,o,(e=>{const t=r(e);return Le(n,t)}))}))},nf=e=>Be(e,"block"),rf=e=>nf(e)&&!0===e.wrapper,sf=e=>nf(e)&&!0!==e.wrapper,af=e=>Be(e,"selector"),lf=e=>Be(e,"inline"),cf=e=>af(e)&&lf(e)&&ho(Ne(e,"mixed"),!0),df=e=>af(e)&&!1!==e.expand&&!lf(e),mf=rp,uf=Qp,gf=jp,hf=Zp,pf=e=>us(e)&&e.getAttribute("data-mce-bogus")&&!e.nextSibling,ff=(e,t)=>{let o=t;while(o){if(Kr(o)&&e.getContentEditable(o))return"false"===e.getContentEditable(o)?o:t;o=o.parentNode}return t},bf=(e,t,o,n)=>{const r=t.data;if(e){for(let s=o;s>0;s--)if(n(r.charAt(s-1)))return s}else for(let s=o;s<r.length;s++)if(n(r.charAt(s)))return s;return-1},vf=(e,t,o)=>bf(e,t,o,(e=>ap(e)||ip(e))),yf=(e,t,o)=>bf(e,t,o,lp),wf=(e,t,o,n,r,s)=>{let a;const i=e.getParent(o,e.isBlock)||t,l=(t,o,n)=>{const s=Mc(e),l=r?s.backwards:s.forwards;return j.from(l(t,o,((e,t)=>mf(e.parentNode)?-1:(a=e,n(r,e,t))),i))},c=l(o,n,vf);return c.bind((e=>s?l(e.container,e.offset+(r?-1:0),yf):j.some(e))).orThunk((()=>a?j.some({container:a,offset:r?0:a.length}):j.none()))},xf=(e,t,o,n,r)=>{const s=n[r];as(n)&&ft(n.data)&&s&&(n=s);const a=uf(e,n);for(let i=0;i<a.length;i++)for(let n=0;n<t.length;n++){const r=t[n];if((!T(r.collapsed)||r.collapsed===o.collapsed)&&(af(r)&&e.is(a[i],r.selector)))return a[i]}return n},Cf=(e,t,o,n)=>{var r;let s=o;const a=e.getRoot(),i=t[0];if(nf(i)&&(s=i.wrapper?null:e.getParent(o,i.block,a)),!s){const t=null!==(r=e.getParent(o,"LI,TD,TH"))&&void 0!==r?r:a;s=e.getParent(as(o)?o.parentNode:o,(t=>t!==a&&hf(e.schema,t)),t)}if(s&&nf(i)&&i.wrapper&&(s=uf(e,s,"ul,ol").reverse()[0]||s),!s){s=o;while(s&&s[n]&&!e.isBlock(s[n]))if(s=s[n],Kp(s,"br"))break}return s||o},Sf=(e,t,o,n)=>{const r=o.parentNode;return!T(o[n])&&(!(r!==t&&!O(r)&&!e.isBlock(r))||Sf(e,t,r,n))},kf=(e,t,o,n,r)=>{let s=o;const a=r?"previousSibling":"nextSibling",i=e.getRoot();if(as(o)&&!gf(o)&&(r?n>0:n<o.data.length))return o;while(s){if(!t[0].block_expand&&e.isBlock(s))return s;for(let t=s[a];t;t=t[a]){const o=as(t)&&!Sf(e,i,t,a);if(!mf(t)&&!pf(t)&&!gf(t,o))return s}if(s===i||s.parentNode===i){o=s;break}s=s.parentNode}return o},_f=e=>mf(e.parentNode)||mf(e),Of=(e,t,o,n=!1)=>{let{startContainer:r,startOffset:s,endContainer:a,endOffset:i}=t;const l=o[0];if(Kr(r)&&r.hasChildNodes()&&(r=$c(r,s),as(r)&&(s=0)),Kr(a)&&a.hasChildNodes()&&(a=$c(a,t.collapsed?i:i-1),as(a)&&(i=a.data.length)),r=ff(e,r),a=ff(e,a),_f(r)&&(r=mf(r)?r:r.parentNode,r=t.collapsed?r.previousSibling||r:r.nextSibling||r,as(r)&&(s=t.collapsed?r.length:0)),_f(a)&&(a=mf(a)?a:a.parentNode,a=t.collapsed?a.nextSibling||a:a.previousSibling||a,as(a)&&(i=t.collapsed?0:a.length)),t.collapsed){const t=wf(e,e.getRoot(),r,s,!0,n);t.each((({container:e,offset:t})=>{r=e,s=t}));const o=wf(e,e.getRoot(),a,i,!1,n);o.each((({container:e,offset:t})=>{a=e,i=t}))}return(lf(l)||l.block_expand)&&(lf(l)&&as(r)&&0!==s||(r=kf(e,o,r,s,!0)),lf(l)&&as(a)&&i!==a.data.length||(a=kf(e,o,a,i,!1))),df(l)&&(r=xf(e,o,t,r,"previousSibling"),a=xf(e,o,t,a,"nextSibling")),(nf(l)||af(l))&&(r=Cf(e,o,r,"previousSibling"),a=Cf(e,o,a,"nextSibling"),nf(l)&&(e.isBlock(r)||(r=kf(e,o,r,s,!0)),e.isBlock(a)||(a=kf(e,o,a,i,!1)))),Kr(r)&&r.parentNode&&(s=e.nodeIndex(r),r=r.parentNode),Kr(a)&&a.parentNode&&(i=e.nodeIndex(a)+1,a=a.parentNode),{startContainer:r,startOffset:s,endContainer:a,endOffset:i}},Tf=(e,t,o)=>{var n;const r=t.startOffset,s=$c(t.startContainer,r),a=t.endOffset,i=$c(t.endContainer,a-1),l=e=>{const t=e[0];as(t)&&t===s&&r>=t.data.length&&e.splice(0,1);const o=e[e.length-1];return 0===a&&e.length>0&&o===i&&as(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 s=e,a=s.parentNode;s&&s!==t;s=a){a=s.parentNode;const t=c(s===e?s:s[r],r);t.length&&(n||t.reverse(),o(l(t)))}};if(s===i)return o(l([s]));const u=null!==(n=e.findCommonAncestor(s,i))&&void 0!==n?n:e.getRoot();if(e.isChildOf(s,i))return m(s,u,!0);if(e.isChildOf(i,s))return m(i,u);const g=d(s,u)||s,h=d(i,u)||i;m(s,g,!0);const p=c(g===s?g:g.nextSibling,"nextSibling",h===i?h.nextSibling:h);p.length&&o(l(p)),m(i,h)},Ef=['pre[class*=language-][contenteditable="false"]',"figure.image","div[data-ephox-embed-iri]","div.tiny-pageembed","div.mce-toc","div[data-mce-toc]"],Df=e=>Do(e)&&Ts(e)===oa,Af=(e,t,o,n)=>wn(t).fold((()=>"skipping"),(r=>"br"===n||Df(t)?"valid":hc(t)?"existing":Lh(t.dom)?"caret":X(Ef,(e=>dn(t,e)))?"valid-block":Up(e,o,n)&&Up(e,ko(r),o)?"valid":"invalid-child")),Mf=(e,t)=>{const o=Of(e.dom,t,[{inline:"span"}]);t.setStart(o.startContainer,o.startOffset),t.setEnd(o.endContainer,o.endOffset),e.selection.setRng(t)},Nf=(e,t,o,n,r,s)=>{const{uid:a=t,...i}=o;Yo(e,ac()),Bo(e,`${lc()}`,a),Bo(e,`${ic()}`,n);const{attributes:l={},classes:c=[]}=r(a,i);if(Lo(e,l),Sc(e,c),s){c.length>0&&Bo(e,`${dc()}`,c.join(","));const t=xe(l);t.length>0&&Bo(e,`${mc()}`,t.join(","))}},Rf=e=>{Jo(e,ac()),zo(e,`${lc()}`),zo(e,`${ic()}`),zo(e,`${cc()}`);const t=Io(e,`${mc()}`).map((e=>e.split(","))).getOr([]),o=Io(e,`${dc()}`).map((e=>e.split(","))).getOr([]);Q(t,(t=>zo(e,t))),kc(e,o),zo(e,`${dc()}`),zo(e,`${mc()}`)},Bf=(e,t,o,n,r)=>{const s=ln.fromTag("span",e);return Nf(s,t,o,n,r,!1),s},Lf=(e,t,o,n,r,s)=>{const a=[],i=Bf(e.getDoc(),o,s,n,r),l=nc(),c=()=>{l.clear()},d=()=>l.get().getOrThunk((()=>{const e=Oc(i);return a.push(e),l.set(e),e})),m=e=>{Q(e,u)},u=t=>{const a=Af(e,t,"span",ko(t));switch(a){case"invalid-child":{c();const e=En(t);m(e),c();break}case"valid-block":c(),Nf(t,o,s,n,r,!0);break;case"valid":{const e=d();sr(t,e);break}}},g=e=>{const t=J(e,ln.fromDom);m(t)};return Tf(e.dom,t,(e=>{c(),g(e)})),a},Hf=(e,t,o,n)=>{e.undoManager.transact((()=>{const r=e.selection,s=r.getRng(),a=kp(e).length>0,i=Cc("mce-annotation");if(s.collapsed&&!a&&Mf(e,s),r.getRng().collapsed&&!a){const s=Bf(e.getDoc(),i,n,t,o.decorate);hr(s,xs),r.getRng().insertNode(s.dom),r.select(s.dom)}else Bp(r,!1,(()=>{Rp(e,(r=>{Lf(e,r,i,t,o.decorate,n)}))}))}))},If=e=>{const t=wc();yc(e,t);const o=vc(e,t),n=No("span"),r=e=>{Q(e,(e=>{n(e)?dr(e):Rf(e)}))};return{register:(e,o)=>{t.register(e,o)},annotate:(o,n)=>{t.lookup(o).each((t=>{Hf(e,o,t,n)}))},annotationChanged:(e,t)=>{o.addListener(e,t)},remove:t=>{const o=e.selection.getBookmark();gc(e,j.some(t)).each((({elements:e})=>{r(e)})),e.selection.moveToBookmark(o)},removeAll:t=>{const o=e.selection.getBookmark();Se(bc(e,t),((e,t)=>{r(e)})),e.selection.moveToBookmark(o)},getAll:t=>{const o=bc(e,t);return ke(o,(e=>J(e,(e=>e.dom))))}}},Pf=e=>({getBookmark:I(op,e),moveToBookmark:I(np,e)});Pf.isBookmarkNode=rp;const zf=(e,t,o)=>!o.collapsed&&X(o.getClientRects(),(o=>zc(o,e,t))),Ff=(e,t)=>e.dispatch("PreProcess",t),Vf=(e,t)=>e.dispatch("PostProcess",t),Zf=e=>{e.dispatch("remove")},Uf=e=>{e.dispatch("detach")},jf=(e,t)=>{e.dispatch("SwitchMode",{mode:t})},$f=(e,t,o,n,r)=>{e.dispatch("ObjectResizeStart",{target:t,width:o,height:n,origin:r})},Wf=(e,t,o,n,r)=>{e.dispatch("ObjectResized",{target:t,width:o,height:n,origin:r})},qf=e=>{e.dispatch("PreInit")},Gf=e=>{e.dispatch("PostRender")},Kf=e=>{e.dispatch("Init")},Yf=(e,t)=>{e.dispatch("PlaceholderToggle",{state:t})},Xf=(e,t,o)=>{e.dispatch(t,o)},Jf=(e,t,o,n)=>{e.dispatch("FormatApply",{format:t,node:o,vars:n})},Qf=(e,t,o,n)=>{e.dispatch("FormatRemove",{format:t,node:o,vars:n})},eb=(e,t)=>e.dispatch("BeforeSetContent",t),tb=(e,t)=>e.dispatch("SetContent",t),ob=(e,t)=>e.dispatch("BeforeGetContent",t),nb=(e,t)=>e.dispatch("GetContent",t),rb=(e,t)=>{e.dispatch("AutocompleterStart",t)},sb=(e,t)=>{e.dispatch("AutocompleterUpdate",t)},ab=e=>{e.dispatch("AutocompleterEnd")},ib=(e,t,o)=>e.dispatch("PastePreProcess",{content:t,internal:o}),lb=(e,t,o)=>e.dispatch("PastePostProcess",{node:t,internal:o}),cb=(e,t)=>e.dispatch("PastePlainTextToggle",{state:t}),db={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||db.metaKeyPressed(e),metaKeyPressed:e=>to.os.isMacOS()||to.os.isiOS()?e.metaKey:e.ctrlKey&&!e.altKey},mb="data-mce-selected",ub="table,img,figure.image,hr,video,span.mce-preview-object",gb=Math.abs,hb=Math.round,pb={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},fb=e=>"longpress"===e.type||0===e.type.indexOf("touch"),bb=(e,t)=>{const o=t.dom,n=t.getDoc(),r=document,s=t.getBody();let a,i,l,c,d,m,u,g,h,p,f,b,v,y,w,x,C;const S=e=>T(e)&&(gs(e)||o.is(e,"figure.image")),k=e=>vs(e)||o.hasClass(e,"mce-preview-object"),_=(e,t)=>{if(fb(e)){const o=e.touches[0];return S(e.target)&&!zf(o.clientX,o.clientY,t)}return S(e.target)&&!zf(e.clientX,e.clientY,t)},O=e=>{const o=e.target;_(e,t.selection.getRng())&&!e.isDefaultPrevented()&&t.selection.select(o)},E=e=>o.hasClass(e,"mce-preview-object")&&T(e.firstElementChild)?[e,e.firstElementChild]:o.is(e,"figure.image")?[e.querySelector("img")]:[e],D=e=>{const n=ou(t);return!!n&&("false"!==e.getAttribute("data-mce-resize")&&(e!==t.getBody()&&(o.hasClass(e,"mce-preview-object")&&T(e.firstElementChild)?dn(ln.fromDom(e.firstElementChild),n):dn(ln.fromDom(e),n))))},A=e=>k(e)?o.create("img",{src:to.transparentSrc}):e.cloneNode(!0),M=(e,n,r)=>{if(T(r)){const s=E(e);Q(s,(e=>{e.style[n]||!t.schema.isValid(e.nodeName.toLowerCase(),n)?o.setStyle(e,n,r):o.setAttrib(e,n,""+r)}))}},N=(e,t,o)=>{M(e,"width",t),M(e,"height",o)},R=e=>{let n,r,d,_,O;n=e.screenX-m,r=e.screenY-u,y=n*c[2]+p,w=r*c[3]+f,y=y<5?5:y,w=w<5?5:w,d=(S(a)||k(a))&&!1!==nu(t)?!db.modifierPressed(e):db.modifierPressed(e),d&&(gb(n)>gb(r)?(w=hb(y*b),y=hb(w/b)):(y=hb(w/b),w=hb(y*b))),N(i,y,w),_=c.startPos.x+n,O=c.startPos.y+r,_=_>0?_:0,O=O>0?O:0,o.setStyles(l,{left:_,top:O,display:"block"}),l.innerHTML=y+" &times; "+w,c[2]<0&&i.clientWidth<=y&&o.setStyle(i,"left",g+(p-y)),c[3]<0&&i.clientHeight<=w&&o.setStyle(i,"top",h+(f-w)),n=s.scrollWidth-x,r=s.scrollHeight-C,n+r!==0&&o.setStyles(l,{left:_-n,top:O-r}),v||($f(t,a,p,f,"corner-"+c.name),v=!0)},B=()=>{const e=v;v=!1,e&&(M(a,"width",y),M(a,"height",w)),o.unbind(n,"mousemove",R),o.unbind(n,"mouseup",B),r!==n&&(o.unbind(r,"mousemove",R),o.unbind(r,"mouseup",B)),o.remove(i),o.remove(l),o.remove(d),L(a),e&&(Wf(t,a,y,w,"corner-"+c.name),o.setAttrib(a,"style",o.getAttrib(a,"style"))),t.nodeChanged()},L=e=>{F();const g=o.getPos(e,s),h=g.x,v=g.y,S=e.getBoundingClientRect(),k=S.width||S.right-S.left,_=S.height||S.bottom-S.top;a!==e&&(I(),a=e,y=w=0);const O=t.dispatch("ObjectSelected",{target:e});D(e)&&!O.isDefaultPrevented()?Se(pb,((e,t)=>{const g=g=>{const y=E(a)[0];m=g.screenX,u=g.screenY,p=y.clientWidth,f=y.clientHeight,b=f/p,c=e,c.name=t,c.startPos={x:k*e[0]+h,y:_*e[1]+v},x=s.scrollWidth,C=s.scrollHeight,d=o.add(s,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),o.setStyles(d,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),i=A(a),o.addClass(i,"mce-clonedresizable"),o.setAttrib(i,"data-mce-bogus","all"),i.contentEditable="false",o.setStyles(i,{left:h,top:v,margin:0}),N(i,k,_),i.removeAttribute(mb),s.appendChild(i),o.bind(n,"mousemove",R),o.bind(n,"mouseup",B),r!==n&&(o.bind(r,"mousemove",R),o.bind(r,"mouseup",B)),l=o.add(s,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},p+" &times; "+f)};let y=o.get("mceResizeHandle"+t);y&&o.remove(y),y=o.add(s,"div",{id:"mceResizeHandle"+t,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+t+"-resize; margin:0; padding:0"}),o.bind(y,"mousedown",(e=>{e.stopImmediatePropagation(),e.preventDefault(),g(e)})),e.elm=y,o.setStyles(y,{left:k*e[0]+h-y.offsetWidth/2,top:_*e[1]+v-y.offsetHeight/2})})):I(!1)},H=rc(L,0),I=(e=!0)=>{H.cancel(),F(),a&&e&&a.removeAttribute(mb),Se(pb,((e,t)=>{const n=o.get("mceResizeHandle"+t);n&&(o.unbind(n),o.remove(n))}))},P=(e,t)=>o.isChildOf(e,t),z=n=>{if(v||t.removed||t.composing)return;const r="mousedown"===n.type?n.target:e.getNode(),a=jr(ln.fromDom(r),ub).map((e=>e.dom)).getOrUndefined(),i=T(a)?o.getAttrib(a,mb,"1"):"1";if(Q(o.select(`img[${mb}],hr[${mb}]`),(e=>{e.removeAttribute(mb)})),T(a)&&P(a,s)){V();const t=e.getStart(!0);if(P(t,a)&&P(e.getEnd(!0),a))return o.setAttrib(a,mb,i),void H.throttle(a)}I()},F=()=>{Se(pb,(e=>{e.elm&&(o.unbind(e.elm),delete e.elm)}))},V=()=>{try{t.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(e){}};t.on("init",(()=>{V(),t.on("NodeChange ResizeEditor ResizeWindow ResizeContent drop",z),t.on("keyup compositionend",(e=>{a&&"TABLE"===a.nodeName&&z(e)})),t.on("hide blur",I),t.on("contextmenu longpress",O,!0)})),t.on("remove",F);const Z=()=>{H.cancel(),a=i=d=null};return{isResizable:D,showResizeRect:L,hideResizeRect:I,updateResizeRect:z,destroy:Z}},vb=(e,t)=>{t.fold((t=>{e.setStartBefore(t.dom)}),((t,o)=>{e.setStart(t.dom,o)}),(t=>{e.setStartAfter(t.dom)}))},yb=(e,t)=>{t.fold((t=>{e.setEndBefore(t.dom)}),((t,o)=>{e.setEnd(t.dom,o)}),(t=>{e.setEndAfter(t.dom)}))},wb=(e,t,o)=>{const n=e.document.createRange();return vb(n,t),yb(n,o),n},xb=(e,t,o,n,r)=>{const s=e.document.createRange();return s.setStart(t.dom,o),s.setEnd(n.dom,r),s},Cb=nm.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Sb=(e,t,o)=>t(ln.fromDom(o.startContainer),o.startOffset,ln.fromDom(o.endContainer),o.endOffset),kb=(e,t)=>t.match({domRange:e=>({ltr:B(e),rtl:j.none}),relative:(t,o)=>({ltr:qe((()=>wb(e,t,o))),rtl:qe((()=>j.some(wb(e,o,t))))}),exact:(t,o,n,r)=>({ltr:qe((()=>xb(e,t,o,n,r))),rtl:qe((()=>j.some(xb(e,n,r,t,o))))})}),_b=(e,t)=>{const o=t.ltr();if(o.collapsed){const n=t.rtl().filter((e=>!1===e.collapsed));return n.map((e=>Cb.rtl(ln.fromDom(e.endContainer),e.endOffset,ln.fromDom(e.startContainer),e.startOffset))).getOrThunk((()=>Sb(e,Cb.ltr,o)))}return Sb(e,Cb.ltr,o)},Ob=(e,t)=>{const o=kb(e,t);return _b(e,o)};Cb.ltr,Cb.rtl;const Tb=(e,t,o,n)=>({start:e,soffset:t,finish:o,foffset:n}),Eb={create:Tb},Db=(e,t,o)=>{var n,r;return j.from(null===(r=(n=e.dom).caretPositionFromPoint)||void 0===r?void 0:r.call(n,t,o)).bind((t=>{if(null===t.offsetNode)return j.none();const o=e.dom.createRange();return o.setStart(t.offsetNode,t.offset),o.collapse(),j.some(o)}))},Ab=(e,t,o)=>{var n,r;return j.from(null===(r=(n=e.dom).caretRangeFromPoint)||void 0===r?void 0:r.call(n,t,o))},Mb=(()=>document.caretPositionFromPoint?Db:document.caretRangeFromPoint?Ab:j.none)(),Nb=(e,t,o)=>{const n=ln.fromDom(e.document);return Mb(n,t,o).map((e=>Eb.create(ln.fromDom(e.startContainer),e.startOffset,ln.fromDom(e.endContainer),e.endOffset)))},Rb=nm.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Bb=(e,t,o,n)=>e.fold(t,o,n),Lb=e=>e.fold(L,L,L),Hb=Rb.before,Ib=Rb.on,Pb=Rb.after,zb={before:Hb,on:Ib,after:Pb,cata:Bb,getStart:Lb},Fb=nm.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Vb=e=>Fb.exact(e.start,e.soffset,e.finish,e.foffset),Zb=e=>e.match({domRange:e=>ln.fromDom(e.startContainer),relative:(e,t)=>zb.getStart(e),exact:(e,t,o,n)=>e}),Ub=Fb.domRange,jb=Fb.relative,$b=Fb.exact,Wb=e=>{const t=Zb(e);return yn(t)},qb=Eb.create,Gb={domRange:Ub,relative:jb,exact:$b,exactFromRange:Vb,getWin:Wb,range:qb},Kb=(e,t)=>{const o=ko(e);return"input"===o?zb.after(e):Y(["br","img"],o)?0===t?zb.before(e):zb.after(e):zb.on(e,t)},Yb=(e,t)=>{const o=e.fold(zb.before,Kb,zb.after),n=t.fold(zb.before,Kb,zb.after);return Gb.relative(o,n)},Xb=(e,t,o,n)=>{const r=Kb(e,t),s=Kb(o,n);return Gb.relative(r,s)},Jb=e=>e.match({domRange:e=>{const t=ln.fromDom(e.startContainer),o=ln.fromDom(e.endContainer);return Xb(t,e.startOffset,o,e.endOffset)},relative:Yb,exact:Xb}),Qb=(e,t)=>{const o=t||document,n=o.createDocumentFragment();return Q(e,(e=>{n.appendChild(e.dom)})),ln.fromDom(n)},ev=e=>{const t=Gb.getWin(e).dom,o=(e,o,n,r)=>xb(t,e,o,n,r),n=Jb(e);return Ob(t,n).match({ltr:o,rtl:o})},tv=(e,t,o)=>Nb(e,t,o),ov=(e,t,o)=>{const n=yn(ln.fromDom(o));return tv(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()},nv=(e,t)=>T(e)&&T(t)&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset,rv=(e,t,o)=>{let n=e;while(n&&n!==t){if(o(n))return n;n=n.parentNode}return null},sv=(e,t,o)=>null!==rv(e,t,o),av=(e,t,o)=>sv(e,t,(e=>e.nodeName===o)),iv=(e,t)=>ca(e)&&!sv(e,t,Lh),lv=(e,t,o)=>{const n=t.parentNode;if(n){const r=new Wr(t,e.getParent(n,e.isBlock)||e.getRoot());let s;while(s=r[o?"prev":"next"]())if(us(s))return!0}return!1},cv=(e,t)=>{var o;return(null===(o=e.previousSibling)||void 0===o?void 0:o.nodeName)===t},dv=(e,t)=>{let o=t;while(o&&o!==e){if(ps(o))return!0;o=o.parentNode}return!1},mv=(e,t,o,n,r)=>{const s=e.getRoot(),a=e.schema.getNonEmptyElements(),i=r.parentNode;let l,c;if(!i)return j.none();const d=e.getParent(i,e.isBlock)||s;if(n&&us(r)&&t&&e.isEmpty(d))return j.some(bd(i,e.nodeIndex(r)));const m=new Wr(r,d);while(c=m[n?"prev":"next"]()){if("false"===e.getContentEditableParent(c)||iv(c,s))return j.none();if(as(c)&&c.data.length>0)return av(c,s,"A")?j.none():j.some(bd(c,n?c.data.length:0));if(e.isBlock(c)||a[c.nodeName.toLowerCase()])return j.none();l=c}return cs(l)?j.none():o&&l?j.some(bd(l,0)):j.none()},uv=(e,t,o,n)=>{const r=e.getRoot();let s,a=!1,i=o?n.startContainer:n.endContainer,l=o?n.startOffset:n.endOffset;const c=Kr(i)&&l===i.childNodes.length,d=e.schema.getNonEmptyElements();let m=o;if(ca(i))return j.none();if(Kr(i)&&l>i.childNodes.length-1&&(m=!1),ds(i)&&(i=r,l=0),i===r){if(m&&(s=i.childNodes[l>0?l-1:0],s)){if(ca(s))return j.none();if(d[s.nodeName]||ns(s))return j.none()}if(i.hasChildNodes()){if(l=Math.min(!m&&l>0?l-1:l,i.childNodes.length-1),i=i.childNodes[l],l=as(i)&&c?i.data.length:0,!t&&i===r.lastChild&&ns(i))return j.none();if(dv(r,i)||ca(i))return j.none();if(i.hasChildNodes()&&!ns(i)){s=i;const t=new Wr(i,r);do{if(ps(s)||ca(s)){a=!1;break}if(as(s)&&s.data.length>0){l=m?0:s.data.length,i=s,a=!0;break}if(d[s.nodeName.toLowerCase()]&&!bs(s)){l=e.nodeIndex(s),i=s.parentNode,m||l++,a=!0;break}}while(s=m?t.next():t.prev())}}}return t&&(as(i)&&0===l&&mv(e,c,t,!0,i).each((e=>{i=e.container(),l=e.offset(),a=!0})),Kr(i)&&(s=i.childNodes[l],s||(s=i.childNodes[l-1]),!s||!us(s)||cv(s,"A")||lv(e,s,!1)||lv(e,s,!0)||mv(e,c,t,!0,s).each((e=>{i=e.container(),l=e.offset(),a=!0})))),m&&!t&&as(i)&&l===i.data.length&&mv(e,c,t,!1,i).each((e=>{i=e.container(),l=e.offset(),a=!0})),a&&i?j.some(bd(i,l)):j.none()},gv=(e,t)=>{const o=t.collapsed,n=t.cloneRange(),r=bd.fromRangeStart(t);return uv(e,o,!0,n).each((e=>{o&&bd.isAbove(r,e)||n.setStart(e.container(),e.offset())})),o||uv(e,o,!1,n).each((e=>{n.setEnd(e.container(),e.offset())})),o&&n.collapse(!0),nv(t,n)?j.none():j.some(n)},hv=(e,t)=>e.splitText(t),pv=e=>{let t=e.startContainer,o=e.startOffset,n=e.endContainer,r=e.endOffset;if(t===n&&as(t)){if(o>0&&o<t.data.length)if(n=hv(t,o),t=n.previousSibling,r>o){r-=o;const e=hv(n,r).previousSibling;t=n=e,r=e.data.length,o=0}else r=0}else if(as(t)&&o>0&&o<t.data.length&&(t=hv(t,o),o=0),as(n)&&r>0&&r<n.data.length){const e=hv(n,r).previousSibling;n=e,r=e.data.length}return{startContainer:t,startOffset:o,endContainer:n,endOffset:r}},fv=e=>{const t=(t,o)=>Tf(e,t,o),o=pv,n=t=>gv(e,t).fold(Z,(e=>(t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0))),r=(t,o={type:"word"})=>{if("word"===o.type){const o=Of(e,t,[{inline:"span"}]),n=e.createRng();return n.setStart(o.startContainer,o.startOffset),n.setEnd(o.endContainer,o.endOffset),n}return t};return{walk:t,split:o,expand:r,normalize:n}};fv.compareRanges=nv,fv.getCaretRangeFromPoint=ov,fv.getSelectedNode=jc,fv.getNode=$c;const bv=(e,t)=>{const o=(t,o)=>{if(!D(o)&&!o.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+o);const n=t.dom;tn(n)&&(n.style[e]=o+"px")},n=o=>{const n=t(o);if(n<=0||null===n){const t=Kn(o,e);return parseFloat(t)||0}return n},r=n,s=(e,t)=>re(t,((t,o)=>{const n=Kn(e,o),r=void 0===n?0:parseInt(n,10);return isNaN(r)?t:t+r}),0),a=(e,t,o)=>{const n=s(e,o),r=t>n?t-n:0;return r};return{set:o,get:n,getOuter:r,aggregate:s,max:a}},vv=bv("height",(e=>{const t=e.dom;return jn(e)?t.getBoundingClientRect().height:t.offsetHeight})),yv=e=>vv.get(e),wv=()=>ln.fromDom(document),xv=(e,t)=>{const o=e.view(t);return o.fold(B([]),(t=>{const o=e.owner(t),n=xv(e,o);return[t].concat(n)}))},Cv=(e,t)=>{const o=t.owner(e);return xv(t,o)},Sv=e=>{var t;const o=e.dom===document?j.none():j.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement);return o.map(ln.fromDom)},kv=e=>bn(e);var _v=Object.freeze({__proto__:null,view:Sv,owner:kv});const Ov=e=>{const t=wv(),o=Er(t),n=Cv(e,_v),r=Tr(e),s=ne(n,((e,t)=>{const o=Tr(t);return{left:e.left+o.left,top:e.top+o.top}}),{left:0,top:0});return Sr(s.left+r.left+o.left,s.top+r.top+o.top)},Tv=e=>"textarea"===ko(e),Ev=(e,t)=>{const o=e.dispatch("ScrollIntoView",t);return o.isDefaultPrevented()},Dv=(e,t)=>{e.dispatch("AfterScrollIntoView",t)},Av=(e,t)=>{const o=En(e);if(0===o.length||Tv(e))return{element:e,offset:t};if(t<o.length&&!Tv(o[t]))return{element:o[t],offset:0};{const n=o[o.length-1];return Tv(n)?{element:e,offset:t}:"img"===ko(n)?{element:n,offset:1}:Do(n)?{element:n,offset:Ts(n).length}:{element:n,offset:En(n).length}}},Mv=(e,t)=>{const o=Or(e),n=yv(e);return{element:e,bottom:o.top+n,height:n,pos:o,cleanup:t}},Nv=(e,t)=>{const o=Av(e,t),n=ln.fromHtml('<span data-mce-bogus="all" style="display: inline-block;">'+oa+"</span>");return tr(o.element,n),Mv(n,(()=>cr(n)))},Rv=e=>Mv(ln.fromDom(e),M),Bv=(e,t,o,n)=>{Pv(e,((r,s)=>Hv(e,t,o,n)),o)},Lv=(e,t,o,n,r)=>{const s={elm:n.element.dom,alignToTop:r};if(Ev(e,s))return;const a=Er(t).top;o(t,a,n,r),Dv(e,s)},Hv=(e,t,o,n)=>{const r=ln.fromDom(e.getBody()),s=ln.fromDom(e.getDoc());er(r);const a=Nv(ln.fromDom(o.startContainer),o.startOffset);Lv(e,s,t,a,n),a.cleanup()},Iv=(e,t,o,n)=>{const r=ln.fromDom(e.getDoc());Lv(e,r,o,Rv(t),n)},Pv=(e,t,o)=>{const n=o.startContainer,r=o.startOffset,s=o.endContainer,a=o.endOffset;t(ln.fromDom(n),ln.fromDom(s));const i=e.dom.createRng();i.setStart(n,r),i.setEnd(s,a),e.selection.setRng(o)},zv=(e,t,o,n)=>{const r=e.pos;if(o)Dr(r.left,r.top,n);else{const o=r.top-t+e.height;Dr(r.left,o,n)}},Fv=(e,t,o,n,r)=>{const s=o+t,a=n.pos.top,i=n.bottom,l=i-a>=o;if(a<t)zv(n,o,!1!==r,e);else if(a>s){const t=l?!1!==r:!0===r;zv(n,o,t,e)}else i>s&&!l&&zv(n,o,!0===r,e)},Vv=(e,t,o,n)=>{const r=yn(e).dom.innerHeight;Fv(e,t,r,o,n)},Zv=(e,t,o,n)=>{const r=yn(e).dom.innerHeight;Fv(e,t,r,o,n);const s=Ov(o.element),a=Rr(window);s.top<a.y?Ar(o.element,!1!==n):s.top>a.bottom&&Ar(o.element,!0===n)},Uv=(e,t,o)=>Bv(e,Vv,t,o),jv=(e,t,o)=>Iv(e,t,Vv,o),$v=(e,t,o)=>Bv(e,Zv,t,o),Wv=(e,t,o)=>Iv(e,t,Zv,o),qv=(e,t,o)=>{const n=e.inline?jv:Wv;n(e,t,o)},Gv=(e,t,o)=>{const n=e.inline?Uv:$v;n(e,t,o)},Kv=e=>e.dom.focus(),Yv=e=>{const t=In(e).dom;return e.dom===t.activeElement},Xv=(e=wv())=>j.from(e.dom.activeElement).map(ln.fromDom),Jv=e=>Xv(In(e)).filter((t=>e.dom.contains(t.dom))),Qv=(e,t)=>{const o=Do(t)?Ts(t).length:En(t).length+1;return e>o?o:e<0?0:e},ey=e=>Gb.range(e.start,Qv(e.soffset,e.start),e.finish,Qv(e.foffset,e.finish)),ty=(e,t)=>!Gr(t.dom)&&(pn(e,t)||hn(e,t)),oy=e=>t=>ty(e,t.start)&&ty(e,t.finish),ny=e=>e.inline||to.browser.isFirefox(),ry=e=>Gb.range(ln.fromDom(e.startContainer),e.startOffset,ln.fromDom(e.endContainer),e.endOffset),sy=e=>{const t=e.getSelection(),o=t&&0!==t.rangeCount?j.from(t.getRangeAt(0)):j.none();return o.map(ry)},ay=e=>{const t=yn(e);return sy(t.dom).filter(oy(e))},iy=(e,t)=>j.from(t).filter(oy(e)).map(ey),ly=e=>{const t=document.createRange();try{return t.setStart(e.start.dom,e.soffset),t.setEnd(e.finish.dom,e.foffset),j.some(t)}catch(o){return j.none()}},cy=e=>{const t=ny(e)?ay(ln.fromDom(e.getBody())):j.none();e.bookmark=t.isSome()?t:e.bookmark},dy=e=>{const t=e.bookmark?e.bookmark:j.none();return t.bind((t=>iy(ln.fromDom(e.getBody()),t))).bind(ly)},my=e=>{dy(e).each((t=>e.selection.setRng(t)))},uy=e=>{const t=e.className.toString();return-1!==t.indexOf("tox-")||-1!==t.indexOf("mce-")},gy={isEditorUIElement:uy},hy=(e,t)=>(D(t)||(t=0),setTimeout(e,t)),py=(e,t)=>(D(t)||(t=0),setInterval(e,t)),fy={setEditorTimeout:(e,t,o)=>hy((()=>{e.removed||t()}),o),setEditorInterval:(e,t,o)=>{const n=py((()=>{e.removed?clearInterval(n):t()}),o);return n}},by=e=>"nodechange"===e.type&&e.selectionChange,vy=(e,t)=>{const o=()=>{t.throttle()};Rl.DOM.bind(document,"mouseup",o),e.on("remove",(()=>{Rl.DOM.unbind(document,"mouseup",o)}))},yy=(e,t)=>{e.on("mouseup touchend",(e=>{t.throttle()}))},wy=(e,t)=>{yy(e,t),e.on("keyup NodeChange AfterSetSelectionRange",(t=>{by(t)||cy(e)}))},xy=e=>{const t=rc((()=>{cy(e)}),0);e.on("init",(()=>{e.inline&&vy(e,t),wy(e,t)})),e.on("remove",(()=>{t.cancel()}))};let Cy;const Sy=Rl.DOM,ky=e=>Kr(e)&&gy.isEditorUIElement(e),_y=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"))},Oy=(e,t)=>{const o=fu(e),n=Sy.getParent(t,(t=>ky(t)||!!o&&e.dom.is(t,o)));return null!==n},Ty=e=>{try{const t=In(ln.fromDom(e.getElement()));return Xv(t).fold((()=>document.body),(e=>e.dom))}catch(t){return document.body}},Ey=(e,t)=>{const o=t.editor;xy(o),o.on("focusin",(()=>{const t=e.focusedEditor;t!==o&&(t&&t.dispatch("blur",{focusedEditor:o}),e.setActive(o),e.focusedEditor=o,o.dispatch("focus",{blurredEditor:t}),o.focus(!0))})),o.on("focusout",(()=>{fy.setEditorTimeout(o,(()=>{const t=e.focusedEditor;Oy(o,Ty(o))||t!==o||(o.dispatch("blur",{focusedEditor:null}),e.focusedEditor=null)}))})),Cy||(Cy=t=>{const o=e.activeEditor;o&&Zn(t).each((t=>{const n=t;n.ownerDocument===document&&(n===document.body||Oy(o,n)||e.focusedEditor!==o||(o.dispatch("blur",{focusedEditor:null}),e.focusedEditor=null))}))},Sy.bind(document,"focusin",Cy))},Dy=(e,t)=>{e.focusedEditor===t.editor&&(e.focusedEditor=null),!e.activeEditor&&Cy&&(Sy.unbind(document,"focusin",Cy),Cy=null)},Ay=e=>{e.on("AddEditor",I(Ey,e)),e.on("RemoveEditor",I(Dy,e))},My=(e,t)=>e.dom.getParent(t,(t=>"true"===e.dom.getContentEditable(t))),Ny=e=>e.collapsed?j.from($c(e.startContainer,e.startOffset)).map(ln.fromDom):j.none(),Ry=(e,t)=>Ny(t).bind((t=>Ws(t)?j.some(t):pn(e,t)?j.none():j.some(e))),By=(e,t)=>{Ry(ln.fromDom(e.getBody()),t).bind((e=>Nh(e.dom))).fold((()=>{e.selection.normalize()}),(t=>e.selection.setRng(t.toRange())))},Ly=e=>{if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},Hy=e=>Yv(e)||Jv(e).isSome(),Iy=e=>T(e.iframeElement)&&Yv(ln.fromDom(e.iframeElement)),Py=e=>{const t=e.getBody();return t&&Hy(ln.fromDom(t))},zy=e=>{const t=In(ln.fromDom(e.getElement()));return Xv(t).filter((t=>!_y(t.dom)&&Oy(e,t.dom))).isSome()},Fy=e=>e.inline?Py(e):Iy(e),Vy=e=>Fy(e)||zy(e),Zy=e=>{const t=e.selection,o=e.getBody();let n=t.getRng();e.quirks.refreshContentEditable(),T(e.bookmark)&&!Fy(e)&&dy(e).each((t=>{e.selection.setRng(t),n=t}));const r=My(e,t.getNode());if(r&&e.dom.isChildOf(r,o))return Ly(r),By(e,n),void Uy(e);e.inline||(to.browser.isOpera()||Ly(o),e.getWin().focus()),(to.browser.isFirefox()||e.inline)&&(Ly(o),By(e,n)),Uy(e)},Uy=e=>e.editorManager.setActive(e),jy=(e,t)=>{e.removed||(t?Uy(e):Zy(e))},$y=(e,t,o,n,r)=>{const s=o?t.startContainer:t.endContainer,a=o?t.startOffset:t.endOffset;return j.from(s).map(ln.fromDom).map((e=>n&&t.collapsed?e:Dn(e,r(e,a)).getOr(e))).bind((e=>Eo(e)?j.some(e):wn(e).filter(Eo))).map((e=>e.dom)).getOr(e)},Wy=(e,t,o=!1)=>$y(e,t,!0,o,((e,t)=>Math.min(Nn(e),t))),qy=(e,t,o=!1)=>$y(e,t,!1,o,((e,t)=>t>0?t-1:t)),Gy=(e,t)=>{const o=e;while(e&&as(e)&&0===e.length)e=t?e.nextSibling:e.previousSibling;return e||o},Ky=(e,t)=>{if(!t)return e;let o=t.startContainer,n=t.endContainer;const r=t.startOffset,s=t.endOffset;let a=t.commonAncestorContainer;t.collapsed||(o===n&&s-r<2&&o.hasChildNodes()&&(a=o.childNodes[r]),as(o)&&as(n)&&(o=o.length===r?Gy(o.nextSibling,!0):o.parentNode,n=0===s?Gy(n.previousSibling,!1):n.parentNode,o&&o===n&&(a=o)));const i=as(a)?a.parentNode:a;return Kr(i)?i:e},Yy=(e,t,o,n)=>{const r=[],s=e.getRoot(),a=e.getParent(o||Wy(s,t,t.collapsed),e.isBlock),i=e.getParent(n||qy(s,t,t.collapsed),e.isBlock);if(a&&a!==s&&r.push(a),a&&i&&a!==i){let t=a;const o=new Wr(a,s);while((t=o.next())&&t!==i)e.isBlock(t)&&r.push(t)}return i&&a!==i&&i!==s&&r.push(i),r},Xy=(e,t,o)=>j.from(t).bind((t=>j.from(t.parentNode).map((n=>{const r=e.nodeIndex(t),s=e.createRng();return s.setStart(n,r),s.setEnd(n,r+1),o&&(Mp(e,s,t,!0),Mp(e,s,t,!1)),s})))),Jy=(e,t)=>J(t,(t=>{const o=e.dispatch("GetSelectionRange",{range:t});return o.range!==t?o.range:t})),Qy=e=>"img"===ko(e)?1:Es(e).fold((()=>En(e).length),(e=>e.length)),ew=e=>Es(e).filter((e=>0!==e.trim().length||e.indexOf(xs)>-1)).isSome(),tw=["img","br"],ow=e=>{const t=ew(e);return t||Y(tw,ko(e))},nw=e=>Vr(e,ow),rw=e=>sw(e,ow),sw=(e,t)=>{const o=e=>{const n=En(e);for(let r=n.length-1;r>=0;r--){const e=n[r];if(t(e))return j.some(e);const s=o(e);if(s.isSome())return s}return j.none()};return o(e)},aw="[data-mce-autocompleter]",iw=(e,t)=>{if(cw(ln.fromDom(e.getBody())).isNone()){const o=ln.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',e.getDoc());rr(o,ln.fromDom(t.extractContents())),t.insertNode(o.dom),wn(o).each((e=>e.dom.normalize())),rw(o).map((t=>{e.selection.setCursorLocation(t.dom,Qy(t))}))}},lw=e=>jr(e,aw),cw=e=>Ur(e,aw),dw=(e,t)=>cw(t).each((t=>{const o=e.selection.getBookmark();dr(t),e.selection.moveToBookmark(o)})),mw={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},uw=(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}},gw=e=>{var t;const o=null!==(t=e.value)&&void 0!==t?t:"";if(!Ha(o))return!1;const n=e.parent;return!n||"span"===n.name&&!n.attr("style")||!/^[ ]+$/.test(o)},hw=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 pw{constructor(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}static create(e,t){const o=new pw(e,mw[e]||1);return t&&Se(t,((e,t)=>{o.attr(t,e)})),o}replace(e){const t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t}attr(e,t){const o=this;if(!y(e))return T(e)&&Se(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;while(t--)if(n[t].name===e)return n.splice(t,1),o}return o}if(e in n.map){let o=n.length;while(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 pw(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=uw(n,t))n.name===e&&o.push(n);return o}children(){const e=this,t=[];for(let o=e.firstChild;o;o=o.next)t.push(o);return t}empty(){const e=this;if(e.firstChild){const t=[];for(let n=e.firstChild;n;n=uw(n,e))t.push(n);let o=t.length;while(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 s=r.firstChild;if(hw(r))return!1;if(s)do{if(1===s.type){if(s.attr("data-mce-bogus"))continue;if(e[s.name])return!1;if(hw(s))return!1}if(8===s.type)return!1;if(3===s.type&&!gw(s))return!1;if(3===s.type&&s.parent&&t[s.parent.name]&&Ha(null!==(n=s.value)&&void 0!==n?n:""))return!1;if(o&&o(s))return!1}while(s=uw(s,r));return!0}walk(e){return uw(this,null,e)}}const fw=(e,t)=>/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(e.substr(t)),bw=(e,t,o=0)=>{const n=e.toLowerCase();if(-1!==n.indexOf("[if ",o)&&fw(n,o)){const e=n.indexOf("[endif]",o);return n.indexOf(">",e)}if(t){const e=n.indexOf(">",o);return-1!==e?e:n.length}{const t=/--!?>/g;t.lastIndex=o;const r=t.exec(e);return r?r.index+r[0].length:n.length}},vw=(e,t,o)=>{const n=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,r=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,s=e.getVoidElements();let a=1,i=o;while(0!==a){n.lastIndex=i;while(1){const e=n.exec(t);if(null===e)return i;if("!"===e[1]){i=ct(e[2],"--")?bw(t,!1,e.index+3):bw(t,!0,e.index+1);break}{r.lastIndex=n.lastIndex;const o=r.exec(t);if(S(o)||o.index!==n.lastIndex)continue;"/"===e[1]?a-=1:Re(s,e[2])||(a+=1),i=n.lastIndex+o[0].length;break}}}return i},yw=(e,t)=>{const o=new RegExp(["\\s?("+e.join("|")+')="[^"]+"'].join("|"),"gi");return t.replace(o,"")},ww=(e,t)=>{const o=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,n=e.schema;let r=yw(e.getTempAttrs(),t);const s=n.getVoidElements();let a;while(a=o.exec(r)){const e=o.lastIndex,t=a[0].length;let i;i=s[a[1]]?e:vw(n,r,e),r=r.substring(0,e-t)+r.substring(i),o.lastIndex=e-t}return ra(r)},xw=ww,Cw=e=>{const t=ks(e,"[data-mce-bogus]");Q(t,(e=>{const t=Ho(e,"data-mce-bogus");"all"===t?cr(e):Zs(e)?(tr(e,ln.fromText(ws)),cr(e)):dr(e)}))},Sw=e=>{const t=ks(e,"input");Q(t,(e=>{zo(e,"name")}))},kw=(e,t)=>{const o=Dm(e),n=new RegExp(`^(<${o}[^>]*>(&nbsp;|&#160;|\\s| |<br \\/>|)<\\/${o}>[\r\n]*|<br \\/>[\r\n]*)$`);return t.replace(n,"")},_w=(e,t)=>{const o=e.getDoc(),n=In(ln.fromDom(e.getBody())),r=ln.fromTag("div",o);Bo(r,"data-mce-bogus","all"),Gn(r,{position:"fixed",left:"-9999999px",top:"0"}),hr(r,t.innerHTML),Cw(r),Sw(r);const s=zn(n);rr(s,r);const a=ra(r.dom.innerText);return cr(r),a},Ow=(e,t,o)=>{let n;n="raw"===t.format?go.trim(xw(e.serializer,o.innerHTML)):"text"===t.format?_w(e,o):"tree"===t.format?e.serializer.serialize(o,t):kw(e,e.serializer.serialize(o,t));const r="text"!==t.format&&!Gs(ln.fromDom(o));return r&&y(n)?go.trim(n):n},Tw=(e,t)=>j.from(e.getBody()).fold(B("tree"===t.format?new pw("body",11):""),(o=>Ow(e,t,o))),Ew=go.makeMap,Dw=e=>{const t=[];e=e||{};const o=e.indent,n=Ew(e.indent_before||""),r=Ew(e.indent_after||""),s=Wi.getEncodeFunc(e.entity_encoding||"raw",e.entities),a="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 o=0,n=i.length;o<n;o++){const e=i[o];t.push(" ",e.name,'="',s(e.value,!0),'"')}if(t[t.length]=!l||a?">":" />",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:s(e))},cdata:e=>{t.push("<![CDATA[",e,"]]>")},comment:e=>{t.push("\x3c!--",e,"--\x3e")},pi:(e,n)=>{n?t.push("<?",e," ",s(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$/,"")}},Aw=(e={},t=al())=>{const o=Dw(e);e.validate=!("validate"in e)||e.validate;const n=n=>{const r=e.validate,s={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{a(t)}while(t=t.next)}};o.reset();const a=e=>{var n;const i=s[e.type];if(i)i(e);else{const s=e.name,i=s 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(s,l,i),!i){let t=e.firstChild;if(t){"pre"!==s&&"textarea"!==s||3!==t.type||"\n"!==(null===(n=t.value)||void 0===n?void 0:n[0])||o.text("\n",!0);do{a(t)}while(t=t.next)}o.end(s)}}};return 1!==n.type||e.inner?3===n.type?s[3](n):s[11](n):a(n),o.getContent()};return{serialize:n}},Mw=new Set;(()=>{const e=["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-color","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"];Q(e,(e=>{Mw.add(e)}))})();const Nw=["font","text-decoration","text-emphasis"],Rw=(e,t)=>xe(e.parseStyle(e.getAttrib(t,"style"))),Bw=e=>Mw.has(e),Lw=(e,t)=>de(Rw(e,t),(e=>!Bw(e))),Hw=e=>oe(e,(e=>X(Nw,(t=>ct(e,t))))),Iw=(e,t,o)=>{const n=Rw(e,t),r=Rw(e,o),s=n=>{var r,s;const a=null!==(r=e.getStyle(t,n))&&void 0!==r?r:"",i=null!==(s=e.getStyle(o,n))&&void 0!==s?s:"";return pt(a)&&pt(i)&&a!==i};return X(n,(e=>{const t=t=>X(t,(t=>t===e));if(!t(r)&&t(Nw)){const e=Hw(r);return X(e,s)}return s(e)}))},Pw=(e,t,o)=>j.from(o.container()).filter(as).exists((n=>{const r=e?0:-1;return t(n.data.charAt(o.offset()+r))})),zw=I(Pw,!0,ip),Fw=I(Pw,!1,ip),Vw=e=>{const t=e.container();return as(t)&&(0===t.data.length||na(t.data)&&Pf.isBookmarkNode(t.parentNode))},Zw=(e,t)=>o=>Wg(e?0:-1,o).filter(t).isSome(),Uw=e=>gs(e)&&"block"===Kn(ln.fromDom(e),"display"),jw=e=>ps(e)&&!os(e),$w=Zw(!0,Uw),Ww=Zw(!1,Uw),qw=Zw(!0,vs),Gw=Zw(!1,vs),Kw=Zw(!0,ns),Yw=Zw(!1,ns),Xw=Zw(!0,jw),Jw=Zw(!1,jw),Qw=e=>e.slice(0,-1),ex=(e,t,o)=>pn(t,e)?Qw(Cn(e,(e=>o(e)||hn(e,t)))):[],tx=(e,t)=>ex(e,t,Z),ox=(e,t)=>[e].concat(tx(e,t)),nx=(e,t,o)=>Eh(e,t,o,Vw),rx=(e,t)=>ae(ox(ln.fromDom(t.container()),e),zs),sx=(e,t,o)=>nx(e,t.dom,o).forall((e=>rx(t,o).fold((()=>!$g(e,o,t.dom)),(n=>!$g(e,o,t.dom)&&pn(n,ln.fromDom(e.container())))))),ax=(e,t,o)=>rx(t,o).fold((()=>nx(e,t.dom,o).forall((e=>!$g(e,o,t.dom)))),(t=>nx(e,t.dom,o).isNone())),ix=I(ax,!1),lx=I(ax,!0),cx=I(sx,!1),dx=I(sx,!0),mx=e=>th(e).exists(Zs),ux=(e,t,o)=>{const n=oe(ox(ln.fromDom(o.container()),t),zs),r=fe(n).getOr(t);return Oh(e,r.dom,o).filter(mx)},gx=(e,t)=>th(t).exists(Zs)||ux(!0,e,t).isSome(),hx=(e,t)=>oh(t).exists(Zs)||ux(!1,e,t).isSome(),px=I(ux,!1),fx=I(ux,!0),bx=e=>bd.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd(),vx=(e,t)=>{const o=oe(ox(ln.fromDom(t.container()),e),zs);return fe(o).getOr(e)},yx=(e,t)=>bx(t)?Fw(t):Fw(t)||Mh(vx(e,t).dom,t).exists(Fw),wx=(e,t)=>bx(t)?zw(t):zw(t)||Ah(vx(e,t).dom,t).exists(zw),xx=e=>Y(["pre","pre-wrap"],e),Cx=e=>th(e).bind((e=>Pr(e,Eo))).exists((e=>xx(Kn(e,"white-space")))),Sx=(e,t)=>Mh(e.dom,t).isNone(),kx=(e,t)=>Ah(e.dom,t).isNone(),_x=(e,t)=>Sx(e,t)||kx(e,t)||ix(e,t)||lx(e,t)||hx(e,t)||gx(e,t),Ox=e=>T(e)&&ps(e)&&Rg(e),Tx=(e,t)=>o=>Ox(new Wr(o,e)[t]()),Ex=(e,t)=>{const o=Ah(e.dom,t).getOr(t),n=Tx(e.dom,"next");return t.isAtEnd()&&(n(t.container())||n(o.container()))},Dx=(e,t)=>{const o=Mh(e.dom,t).getOr(t),n=Tx(e.dom,"prev");return t.isAtStart()&&(n(t.container())||n(o.container()))},Ax=(e,t)=>!Cx(t)&&(_x(e,t)||yx(e,t)||wx(e,t)),Mx=(e,t)=>!Cx(t)&&(ix(e,t)||cx(e,t)||hx(e,t)||yx(e,t)||Dx(e,t)),Nx=e=>{const t=e.container(),o=e.offset();return as(t)&&o<t.data.length?bd(t,o+1):e},Rx=(e,t)=>!Cx(t)&&(lx(e,t)||dx(e,t)||gx(e,t)||wx(e,t)||Ex(e,t)),Bx=(e,t)=>Mx(e,t)||Rx(e,Nx(t)),Lx=(e,t)=>ap(e.charAt(t)),Hx=(e,t)=>ip(e.charAt(t)),Ix=e=>{const t=e.container();return as(t)&&lt(t.data,xs)},Px=e=>{const t=e.split("");return J(t,((e,o)=>ap(e)&&o>0&&o<t.length-1&&lp(t[o-1])&&lp(t[o+1])?" ":e)).join("")},zx=(e,t,o)=>{const n=t.data,r=bd(t,0);return o||!Lx(n,0)||Bx(e,r)?!!(o&&Hx(n,0)&&Mx(e,r))&&(t.data=xs+n.slice(1),!0):(t.data=" "+n.slice(1),!0)},Fx=e=>{const t=e.data,o=Px(t);return o!==t&&(e.data=o,!0)},Vx=(e,t,o)=>{const n=t.data,r=bd(t,n.length-1);return o||!Lx(n,n.length-1)||Bx(e,r)?!!(o&&Hx(n,n.length-1)&&Rx(e,r))&&(t.data=n.slice(0,-1)+xs,!0):(t.data=n.slice(0,-1)+" ",!0)},Zx=(e,t)=>{const o=t.container();if(!as(o))return j.none();if(Ix(t)){const n=zx(e,o,!1)||Fx(o)||Vx(e,o,!1);return vo(n,t)}if(Bx(e,t)){const n=zx(e,o,!0)||Vx(e,o,!0);return vo(n,t)}return j.none()},Ux=e=>{const t=ln.fromDom(e.getBody());e.selection.isCollapsed()&&Zx(t,bd.fromRangeStart(e.selection.getRng())).each((t=>{e.selection.setRng(t.toRange())}))},jx=(e,t,o)=>{if(0===o)return;const n=ln.fromDom(e),r=Ir(n,zs).getOr(n),s=e.data.slice(t,t+o),a=t+o>=e.data.length&&Rx(r,bd(e,e.data.length)),i=0===t&&Mx(r,bd(e,0));e.replaceData(t,o,Fa(s,4,i,a))},$x=(e,t)=>{const o=e.data.slice(t),n=o.length-gt(o).length;jx(e,t,n)},Wx=(e,t)=>{const o=e.data.slice(0,t),n=o.length-ht(o).length;jx(e,t-n,n)},qx=(e,t,o,n=!0)=>{const r=ht(e.data).length,s=n?e:t,a=n?t:e;return n?s.appendData(a.data):s.insertData(0,a.data),cr(ln.fromDom(a)),o&&$x(s,r),s},Gx=(e,t)=>{const o=e.container(),n=e.offset();return!bd.isTextPosition(e)&&o===t.parentNode&&n>bd.before(t).offset()},Kx=(e,t)=>Gx(t,e)?bd(t.container(),t.offset()-1):t,Yx=e=>as(e)?bd(e,0):bd.before(e),Xx=e=>as(e)?bd(e,e.data.length):bd.after(e),Jx=e=>Ea(e.previousSibling)?j.some(Xx(e.previousSibling)):e.previousSibling?Rh(e.previousSibling):j.none(),Qx=e=>Ea(e.nextSibling)?j.some(Yx(e.nextSibling)):e.nextSibling?Nh(e.nextSibling):j.none(),eC=(e,t)=>j.from(t.previousSibling?t.previousSibling:t.parentNode).bind((t=>Mh(e,bd.before(t)))).orThunk((()=>Ah(e,bd.after(t)))),tC=(e,t)=>Ah(e,bd.after(t)).orThunk((()=>Mh(e,bd.before(t)))),oC=(e,t)=>Jx(t).orThunk((()=>Qx(t))).orThunk((()=>eC(e,t))),nC=(e,t)=>Qx(t).orThunk((()=>Jx(t))).orThunk((()=>tC(e,t))),rC=(e,t,o)=>e?nC(t,o):oC(t,o),sC=(e,t,o)=>rC(e,t,o).map(I(Kx,o)),aC=(e,t,o)=>{o.fold((()=>{e.focus()}),(o=>{e.selection.setRng(o.toRange(),t)}))},iC=e=>t=>t.dom===e,lC=(e,t)=>t&&Re(e.schema.getBlockElements(),ko(t)),cC=e=>{if(Ka(e)){const t=ln.fromHtml('<br data-mce-bogus="1">');return lr(e),rr(e,t),j.some(bd.before(t.dom))}return j.none()},dC=(e,t,o)=>{const n=kn(e).filter(Do),r=_n(e).filter(Do);return cr(e),bo(n,r,t,((e,t,n)=>{const r=e.dom,s=t.dom,a=r.data.length;return qx(r,s,o),n.container()===s?bd(r,a):n})).orThunk((()=>(o&&(n.each((e=>Wx(e.dom,e.dom.length))),r.each((e=>$x(e.dom,0)))),t)))},mC=(e,t)=>Re(e.schema.getTextInlineElements(),ko(t)),uC=(e,t,o,n=!0)=>{const r=sC(t,e.getBody(),o.dom),s=Ir(o,I(lC,e),iC(e.getBody())),a=dC(o,r,mC(e,o));e.dom.isEmpty(e.getBody())?(e.setContent(""),e.selection.setCursorLocation()):s.bind(cC).fold((()=>{n&&aC(e,t,a)}),(o=>{n&&aC(e,t,j.some(o))}))},gC=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,hC=e=>gC.test(e),pC=(e,t)=>dn(ln.fromDom(t),tu(e))&&!di(e.schema,t),fC=e=>{var t;return"rtl"===Rl.DOM.getStyle(e,"direction",!0)||hC(null!==(t=e.textContent)&&void 0!==t?t:"")},bC=(e,t,o)=>oe(Rl.DOM.getParents(o.container(),"*",t),e),vC=(e,t,o)=>{const n=bC(e,t,o);return j.from(n[n.length-1])},yC=(e,t,o)=>{const n=jg(t,e),r=jg(o,e);return T(n)&&n===r},wC=e=>ua(e)||ga(e),xC=(e,t)=>{const o=t.container(),n=t.offset();return e?la(o)?as(o.nextSibling)?bd(o.nextSibling,0):bd.after(o):ua(t)?bd(o,n+1):t:la(o)?as(o.previousSibling)?bd(o.previousSibling,o.previousSibling.data.length):bd.before(o):ga(t)?bd(o,n-1):t},CC=I(xC,!0),SC=I(xC,!1),kC=(e,t)=>{const o=e=>e.stopImmediatePropagation();e.on("beforeinput input",o,!0),e.getDoc().execCommand(t),e.off("beforeinput input",o)},_C=e=>{e.execCommand("delete")},OC=e=>kC(e,"Delete"),TC=e=>kC(e,"ForwardDelete"),EC=e=>t=>ho(wn(t),e,hn),DC=e=>Us(e)||$s(e),AC=(e,t)=>pn(e,t)?Pr(t,DC,EC(e)):j.none(),MC=(e,t=!0)=>{e.dom.isEmpty(e.getBody())&&e.setContent("",{no_selection:!t})},NC=(e,t,o)=>fo(Nh(o),Rh(o),((n,r)=>{const s=xC(!0,n),a=xC(!1,r),i=xC(!1,t);return e?Ah(o,i).exists((e=>e.isEqual(a)&&t.isEqual(s))):Mh(o,i).exists((e=>e.isEqual(s)&&t.isEqual(a)))})).getOr(!0),RC=e=>{const t=To(e)?kn(e):Mn(e);return t.bind(RC).orThunk((()=>j.some(e)))},BC=(e,t,o,n=!0)=>{var r;t.deleteContents();const s=RC(o).getOr(o),a=ln.fromDom(null!==(r=e.dom.getParent(s.dom,e.dom.isBlock))&&void 0!==r?r:o.dom);if(a.dom===e.getBody()?MC(e,n):Ka(a)&&(ea(a),n&&e.selection.setCursorLocation(a.dom,0)),!hn(o,a)){const e=ho(wn(a),o)?[]:Sn(a);Q(e.concat(En(o)),(e=>{hn(e,a)||pn(e,a)||!Ka(e)||cr(e)}))}},LC=e=>t=>hn(e,t),HC=e=>ks(e,"td,th"),IC=(e,t)=>{const o=e=>_p(ln.fromDom(e),t),n=o(e.startContainer),r=o(e.endContainer),s=n.isSome(),a=r.isSome(),i=fo(n,r,hn).getOr(!1),l=!i&&s&&a;return{startTable:n,endTable:r,isStartInTable:s,isEndInTable:a,isSameTable:i,isMultiTable:l}},PC=(e,t)=>({start:e,end:t}),zC=(e,t,o)=>({rng:e,table:t,cells:o}),FC=nm.generate([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),VC=(e,t)=>jr(ln.fromDom(e),"td,th",t),ZC=e=>!hn(e.start,e.end),UC=(e,t)=>_p(e.start,t).bind((o=>_p(e.end,t).bind((e=>vo(hn(o,e),o))))),jC=(e,t)=>!ZC(e)&&UC(e,t).exists((e=>{const t=e.dom.rows;return 1===t.length&&1===t[0].cells.length})),$C=(e,t)=>{const o=VC(e.startContainer,t),n=VC(e.endContainer,t);return fo(o,n,PC)},WC=e=>t=>_p(t,e).bind((e=>be(HC(e)).map((e=>PC(t,e))))),qC=e=>t=>_p(t,e).bind((e=>fe(HC(e)).map((e=>PC(e,t))))),GC=e=>t=>UC(t,e).map((e=>zC(t,e,HC(e)))),KC=(e,t,o,n)=>{if(o.collapsed||!e.forall(ZC))return j.none();if(t.isSameTable){const t=e.bind(GC(n));return j.some({start:t,end:t})}{const e=VC(o.startContainer,n),t=VC(o.endContainer,n),r=e.bind(WC(n)).bind(GC(n)),s=t.bind(qC(n)).bind(GC(n));return j.some({start:r,end:s})}},YC=(e,t)=>ie(e,(e=>hn(e,t))),XC=e=>fo(YC(e.cells,e.rng.start),YC(e.cells,e.rng.end),((t,o)=>e.cells.slice(t,o+1))),JC=(e,t,o)=>e.exists((e=>jC(e,o)&&Ap(e.start,t))),QC=(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},eS=(e,t,o,n)=>KC(e,t,o,n).bind((({start:e,end:t})=>e.or(t))).bind((e=>{const{isSameTable:n}=t,r=XC(e).getOr([]);if(n&&e.cells.length===r.length)return j.some(FC.fullTable(e.table));if(r.length>0){if(n)return j.some(FC.partialTable(r,j.none()));{const e=QC(o,t);return j.some(FC.partialTable(r,j.some({...t,rng:e})))}}return j.none()})),tS=(e,t,o,n)=>KC(e,t,o,n).bind((({start:e,end:n})=>{const r=e.bind(XC).getOr([]),s=n.bind(XC).getOr([]);if(r.length>0&&s.length>0){const e=QC(o,t);return j.some(FC.multiTable(r,s,e))}return j.none()})),oS=(e,t)=>{const o=LC(e),n=$C(t,o),r=IC(t,o);return JC(n,t,o)?n.map((e=>FC.singleCellTable(t,e.start))):r.isMultiTable?tS(n,r,t,o):eS(n,r,t,o)},nS=e=>Q(e,(e=>{zo(e,"contenteditable"),ea(e)})),rS=(e,t)=>j.from(e.dom.getParent(t,e.dom.isBlock)).map(ln.fromDom),sS=(e,t,o)=>{o.each((o=>{t?cr(o):(ea(o),e.selection.setCursorLocation(o.dom,0))}))},aS=(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)),dS(e,r,t,!1).each((e=>e()))},iS=e=>{const t=kp(e),o=ln.fromDom(e.selection.getNode());fs(o.dom)&&Ka(o)?e.selection.setCursorLocation(o.dom,0):e.selection.collapse(!0),t.length>1&&X(t,(e=>hn(e,o)))&&Bo(o,"data-mce-selected","1")},lS=(e,t,o)=>j.some((()=>{const n=e.selection.getRng(),r=o.bind((({rng:o,isStartInTable:r})=>{const s=rS(e,r?o.endContainer:o.startContainer);o.deleteContents(),sS(e,r,s.filter(Ka));const a=r?t[0]:t[t.length-1];return aS(e,a,n,r),Ka(a)?j.none():j.some(r?t.slice(1):t.slice(0,-1))})).getOr(t);nS(r),iS(e)})),cS=(e,t,o,n)=>j.some((()=>{const r=e.selection.getRng(),s=t[0],a=o[o.length-1];aS(e,s,r,!0),aS(e,a,r,!1);const i=Ka(s)?t:t.slice(1),l=Ka(a)?o:o.slice(0,-1);nS(i.concat(l)),n.deleteContents(),iS(e)})),dS=(e,t,o,n=!0)=>j.some((()=>{BC(e,t,o,n)})),mS=(e,t)=>j.some((()=>uC(e,!1,t))),uS=(e,t,o)=>oS(t,o).bind((t=>t.fold(I(dS,e),I(mS,e),I(lS,e),I(cS,e)))),gS=(e,t)=>yS(e,t),hS=(e,t,o,n)=>bS(t,n).fold((()=>uS(e,t,o)),(t=>gS(e,t))),pS=(e,t,o)=>{const n=ln.fromDom(e.getBody()),r=e.selection.getRng();return 0!==o.length?lS(e,o,j.none()):hS(e,n,r,t)},fS=(e,t)=>ae(ox(t,e),qs),bS=(e,t)=>ae(ox(t,e),No("caption")),vS=(e,t,o,n,r)=>Th(o,e.getBody(),r).bind((e=>fS(t,ln.fromDom(e.getNode())).bind((e=>hn(e,n)?j.none():j.some(M))))),yS=(e,t)=>j.some((()=>{ea(t),e.selection.setCursorLocation(t.dom,0)})),wS=(e,t,o,n)=>Nh(e.dom).bind((r=>Rh(e.dom).map((e=>t?o.isEqual(r)&&n.isEqual(e):o.isEqual(e)&&n.isEqual(r))))).getOr(!0),xS=(e,t)=>yS(e,t),CS=(e,t,o)=>bS(e,ln.fromDom(o.getNode())).fold((()=>j.some(M)),(e=>vo(!hn(e,t),M))),SS=(e,t,o,n,r)=>Th(o,e.getBody(),r).fold((()=>j.some(M)),(s=>wS(n,o,r,s)?xS(e,n):CS(t,n,s))),kS=(e,t,o,n)=>{const r=bd.fromRangeStart(e.selection.getRng());return fS(o,n).bind((n=>Ka(n)?yS(e,n):vS(e,o,t,n,r)))},_S=(e,t,o,n)=>{const r=bd.fromRangeStart(e.selection.getRng());return Ka(n)?yS(e,n):SS(e,o,t,n,r)},OS=(e,t)=>e?Kw(t):Yw(t),TS=(e,t)=>{const o=bd.fromRangeStart(e.selection.getRng());return OS(t,o)||Oh(t,e.getBody(),o).exists((e=>OS(t,e)))},ES=(e,t,o)=>{const n=ln.fromDom(e.getBody());return bS(n,o).fold((()=>kS(e,t,n,o).orThunk((()=>vo(TS(e,t),M)))),(o=>_S(e,t,n,o)))},DS=(e,t)=>{const o=ln.fromDom(e.selection.getStart(!0)),n=kp(e);return e.selection.isCollapsed()&&0===n.length?ES(e,t,o):pS(e,o,n)},AS=(e,t)=>{let o=t;while(o&&o!==e){if(hs(o)||ps(o))return o;o=o.parentNode}return null},MS=["data-ephox-","data-mce-","data-alloy-","data-snooker-","_"],NS=go.each,RS=e=>{const t=e.dom,o=new Set(e.serializer.getTempAttrs()),n=(e,o)=>{if(e.nodeName!==o.nodeName||e.nodeType!==o.nodeType)return!1;const n=e=>{const o={};return NS(t.getAttribs(e),(n=>{const s=n.nodeName.toLowerCase();"style"===s||r(s)||(o[s]=t.getAttrib(e,s))})),o},s=(e,t)=>{for(const o in e)if(Re(e,o)){const n=t[o];if(_(n))return!1;if(e[o]!==n)return!1;delete t[o]}for(const o in t)if(Re(t,o))return!1;return!0};if(Kr(e)&&Kr(o)){if(!s(n(e),n(o)))return!1;if(!s(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(o,"style"))))return!1}return!rp(e)&&!rp(o)},r=e=>X(MS,(t=>ct(e,t)))||o.has(e);return{compare:n,isAttributeInternal:r}},BS=(e,t)=>{let o=e;while(o=o.walk())t(o)},LS=(e,t,o,n)=>{const r=o.name;for(let s=0,a=e.length;s<a;s++){const t=e[s];if(t.name===r){const e=n.nodes[r];e?e.nodes.push(o):n.nodes[r]={filter:t,nodes:[o]}}}if(o.attributes)for(let s=0,a=t.length;s<a;s++){const e=t[s],r=e.name;if(r in o.attributes.map){const t=n.attributes[r];t?t.nodes.push(o):n.attributes[r]={filter:e,nodes:[o]}}}},HS=(e,t,o)=>{const n={nodes:{},attributes:{}};return o.firstChild&&BS(o,(o=>{LS(e,t,o,n)})),n},IS=(e,t)=>{const o=(e,o)=>{Se(e,(e=>{const n=ve(e.nodes);Q(e.filter.callbacks,(r=>{for(let t=n.length-1;t>=0;t--){const r=n[t],s=o?void 0!==r.attr(e.filter.name):r.name===e.filter.name;s&&!O(r.parent)||n.splice(t,1)}n.length>0&&r(n,e.filter.name,t)}))}))};o(e.nodes,!1),o(e.attributes,!0)},PS=(e,t,o,n={})=>{const r=HS(e,t,o);IS(r,n)},zS=(e,t,o)=>{if(e.insert&&t(o)){const e=new pw("br",1);e.attr("data-mce-bogus","1"),o.empty().append(e)}else o.empty().append(new pw("#text",3)).value=xs},FS=e=>{var t;return VS(e,"#text")&&(null===(t=null===e||void 0===e?void 0:e.firstChild)||void 0===t?void 0:t.value)===xs},VS=(e,t)=>{const o=null===e||void 0===e?void 0:e.firstChild;return T(o)&&o===e.lastChild&&o.name===t},ZS=(e,t)=>{const o=e.getElementRule(t.name);return!0===(null===o||void 0===o?void 0:o.paddEmpty)},US=(e,t,o,n)=>n.isEmpty(t,o,(t=>ZS(e,t))),jS=(e,t)=>T(e)&&(t(e)||"br"===e.name),$S=(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)&&$S(e,t,o);e.unwrap()}},WS=(e,t,o=M)=>{const n=t.getTextBlockElements(),r=t.getNonEmptyElements(),s=t.getWhitespaceElements(),a=go.makeMap("tr,td,th,tbody,thead,tfoot,table"),i=new Set;for(let l=0;l<e.length;l++){const c=e[l];let d,m,u;if(!c.parent||i.has(c))continue;if(n[c.name]&&"li"===c.parent.name){let e=c.next;while(e){if(!n[e.name])break;e.name="li",i.add(e),c.parent.insert(e,c.parent),e=e.next}c.unwrap();continue}const g=[c];for(d=c.parent;d&&!t.isValidChild(d.name,c.name)&&!a[d.name];d=d.parent)g.push(d);if(d&&g.length>1)if(t.isValidChild(d.name,c.name)){g.reverse(),m=g[0].clone(),o(m);let e=m;for(let n=0;n<g.length-1;n++){t.isValidChild(e.name,g[n].name)?(u=g[n].clone(),o(u),e.append(u)):u=e;for(let e=g[n].firstChild;e&&e!==g[n+1];){const t=e.next;u.append(e),e=t}e=u}US(t,r,s,m)?d.insert(c,g[0],!0):(d.insert(m,g[0],!0),d.insert(c,m)),d=g[0],(US(t,r,s,d)||VS(d,"br"))&&d.empty().remove()}else $S(c,t);else if(c.parent){if("li"===c.name){let e=c.prev;if(e&&("ul"===e.name||"ol"===e.name)){e.append(c);continue}if(e=c.next,e&&("ul"===e.name||"ol"===e.name)&&e.firstChild){e.insert(c,e.firstChild,!0);continue}const t=new pw("ul",1);o(t),c.wrap(t);continue}if(t.isValidChild(c.parent.name,"div")&&t.isValidChild("div",c.name)){const e=new pw("div",1);o(e),c.wrap(e)}else $S(c,t)}}},qS=(e,t)=>{let o=e;while(o){if(o.name===t)return!0;o=o.parent}return!1},GS=(e,t,o=t.parent)=>!(!o||!e.children[t.name]||e.isValidChild(o.name,t.name))||!(!o||"a"!==t.name||!qS(o,"a")),KS=(e,t,o,n)=>{const r=document.createRange();return r.setStart(e,t),r.setEnd(o,n),r},YS=e=>{const t=bd.fromRangeStart(e),o=bd.fromRangeEnd(e),n=e.commonAncestorContainer;return Oh(!1,n,o).map((r=>!$g(t,o,n)&&$g(t,r,n)?KS(t.container(),t.offset(),r.container(),r.offset()):e)).getOr(e)},XS=e=>e.collapsed?e:YS(e),JS=e=>T(e.firstChild)&&e.firstChild===e.lastChild,QS=e=>"br"===e.name||e.value===xs,ek=(e,t)=>{const o=e.getBlockElements();return o[t.name]&&JS(t)&&QS(t.firstChild)},tk=(e,t)=>{const o=e.getNonEmptyElements();return T(t)&&(t.isEmpty(o)||ek(e,t))},ok=(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),tk(e,n)&&(n=null===n||void 0===n?void 0:n.prev),!(!o||o!==n)&&("ul"===o.name||"ol"===o.name)},nk=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},rk=(e,t,o)=>{const n=t.serialize(o),r=e.createFragment(n);return nk(r)},sk=e=>{var t;return oe(null!==(t=null===e||void 0===e?void 0:e.childNodes)&&void 0!==t?t:[],(e=>"LI"===e.nodeName))},ak=e=>e.data===xs||us(e),ik=e=>T(null===e||void 0===e?void 0:e.firstChild)&&e.firstChild===e.lastChild&&ak(e.firstChild),lk=e=>!e.firstChild||ik(e),ck=e=>e.length>0&&lk(e[e.length-1])?e.slice(0,-1):e,dk=(e,t)=>{const o=e.getParent(t,e.isBlock);return o&&"LI"===o.nodeName?o:null},mk=(e,t)=>!!dk(e,t),uk=(e,t)=>{const o=t.cloneRange(),n=t.cloneRange();return o.setStartBefore(e),n.setEndAfter(e),[o.cloneContents(),n.cloneContents()]},gk=(e,t)=>{const o=bd.before(e),n=vh(t),r=n.next(o);return r?r.toRange():null},hk=(e,t)=>{const o=bd.after(e),n=vh(t),r=n.prev(o);return r?r.toRange():null},pk=(e,t,o,n)=>{const r=uk(e,n),s=e.parentNode;return s&&(s.insertBefore(r[0],e),go.each(t,(t=>{s.insertBefore(t,e)})),s.insertBefore(r[1],e),s.removeChild(e)),hk(t[t.length-1],o)},fk=(e,t,o)=>{const n=e.parentNode;return n&&go.each(t,(t=>{n.insertBefore(t,e)})),gk(e,o)},bk=(e,t,o,n)=>(n.insertAfter(t.reverse(),e),hk(t[0],o)),vk=(e,t,o,n)=>{const r=rk(t,e,n),s=dk(t,o.startContainer),a=ck(sk(r.firstChild)),i=1,l=2,c=t.getRoot(),d=e=>{const n=bd.fromRangeStart(o),r=vh(t.getRoot()),a=e===i?r.prev(n):r.next(n),l=null===a||void 0===a?void 0:a.getNode();return!l||dk(t,l)!==s};return s?d(i)?fk(s,a,c):d(l)?bk(s,a,c,t):pk(s,a,c,o):null},yk=["pre"],wk=(e,t,o,n)=>{var r;const s=t.firstChild,a=t.lastChild,i="bookmark"===a.attr("data-mce-type")?a.prev:a,l=s===i,c=Y(yk,s.name);if(l&&c){const t="false"!==s.attr("contenteditable"),a=(null===(r=e.getParent(o,e.isBlock))||void 0===r?void 0:r.nodeName.toLowerCase())===s.name,i=j.from(AS(n,o)).forall(hs);return t&&a&&i}return!1},xk=fs,Ck=(e,t,o)=>{if(T(o)){const n=e.getParent(t.endContainer,xk);return o===n&&Ap(ln.fromDom(o),t)}return!1},Sk=(e,t,o)=>{var n;if("all"===o.getAttribute("data-mce-bogus"))null===(n=o.parentNode)||void 0===n||n.insertBefore(e.dom.createFragment(t),o);else{const n=o.firstChild,r=o.lastChild;!n||n===r&&"BR"===n.nodeName?e.dom.setHTML(o,t):e.selection.setContent(t,{no_events:!0})}},kk=(e,t)=>{j.from(e.getParent(t,"td,th")).map(ln.fromDom).each(ta)},_k=(e,t)=>{const o=e.schema.getTextInlineElements(),n=e.dom;if(t){const t=e.getBody(),r=RS(e);go.each(n.select("*[data-mce-fragment]"),(e=>{const s=T(o[e.nodeName.toLowerCase()]);if(s&&Lw(n,e))for(let o=e.parentElement;T(o)&&o!==t;o=o.parentElement){const t=Iw(n,e,o);if(t)break;if(r.compare(o,e)){n.remove(e,!0);break}}}))}},Ok=e=>{let t=e;while(t=t.walk())1===t.type&&t.attr("data-mce-fragment","1")},Tk=e=>{go.each(e.getElementsByTagName("*"),(e=>{e.removeAttribute("data-mce-fragment")}))},Ek=e=>!!e.getAttribute("data-mce-fragment"),Dk=(e,t)=>T(t)&&!e.schema.getVoidElements()[t.nodeName],Ak=(e,t)=>{var o,n,r;let s;const a=e.dom,i=e.selection;if(!t)return;i.scrollIntoView(t);const l=AS(e.getBody(),t);if(l&&"false"===a.getContentEditable(l))return a.remove(t),void i.select(l);let c=a.createRng();const d=t.previousSibling;if(as(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;as(e)&&(d.appendData(e.data),null===(r=e.parentNode)||void 0===r||r.removeChild(e))}else c.setStartBefore(t),c.setEndBefore(t);const m=t=>{let o=bd.fromRangeStart(t);const n=vh(e.getBody());return o=n.next(o),null===o||void 0===o?void 0:o.toRange()},u=a.getParent(t,a.isBlock);a.remove(t),u&&a.isEmpty(u)&&(lr(ln.fromDom(u)),c.setStart(u,0),c.setEnd(u,0),xk(u)||Ek(u)||!(s=m(c))?a.add(u,a.create("br",{"data-mce-bogus":"1"})):(c=s,a.remove(u))),i.setRng(c)},Mk=e=>{const t=e.dom,o=XS(e.selection.getRng());e.selection.setRng(o);const n=t.getParent(o.startContainer,xk);Ck(t,o,n)?dS(e,o,ln.fromDom(n)):o.startContainer===o.endContainer&&o.endOffset-o.startOffset===1&&as(o.startContainer.childNodes[o.startOffset])?o.deleteContents():e.getDoc().execCommand("Delete",!1)},Nk=(e,t,o)=>{var n,r;const s=e.selection,a=e.dom,i=e.parser,l=o.merge,c=Aw({validate:!0},e.schema),d='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;</span>';-1===t.indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,d);let m=s.getRng();const u=m.startContainer,g=e.getBody();u===g&&s.isCollapsed()&&a.isBlock(g.firstChild)&&Dk(e,g.firstChild)&&a.isEmpty(g.firstChild)&&(m=a.createRng(),m.setStart(g.firstChild,0),m.setEnd(g.firstChild,0),s.setRng(m)),s.isCollapsed()||Mk(e);const h=s.getNode(),p={context:h.nodeName.toLowerCase(),data:o.data,insert:!0},f=i.parse(t,p);if(!0===o.paste&&ok(e.schema,f)&&mk(a,h))return m=vk(c,a,s.getRng(),f),m&&s.setRng(m),t;!0===o.paste&&wk(a,f,h,e.getBody())&&(null===(n=f.firstChild)||void 0===n||n.unwrap()),Ok(f);let b=f.lastChild;if(b&&"mce_marker"===b.attr("id")){const t=b;for(b=b.prev;b;b=b.walk(!0))if(3===b.type||!a.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(h),p.invalid){e.selection.setContent(d);let o,n=s.getNode();const l=e.getBody();ds(n)?n=o=l:o=n;while(o&&o!==l)n=o,o=o.parentNode;t=n===l?l.innerHTML:a.getOuterHTML(n);const m=i.parse(t);for(let e=m;e;e=e.walk())if("mce_marker"===e.attr("id")){e.replace(f);break}const u=f.children(),g=null!==(r=f.parent)&&void 0!==r?r:m;f.unwrap();const h=oe(u,(t=>GS(e.schema,t,g)));WS(h,e.schema),PS(i.getNodeFilters(),i.getAttributeFilters(),m),t=c.serialize(m),n===l?a.setHTML(l,t):a.setOuterHTML(n,t)}else t=c.serialize(f),Sk(e,t,h);return _k(e,l),Ak(e,a.get("mce_marker")),Tk(e.getBody()),kk(a,s.getStart()),ai(e.schema,e.getBody(),s.getStart()),t},Rk=e=>e instanceof pw,Bk=e=>{Fy(e)&&Nh(e.getBody()).each((t=>{const o=t.getNode(),n=ns(o)?Nh(o).getOr(t):t;e.selection.setRng(n.toRange())}))},Lk=(e,t,o)=>{e.dom.setHTML(e.getBody(),t),!0!==o&&Bk(e)},Hk=(e,t,o,n)=>{if(0===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 s=Dm(e);return e.schema.isValidChild(t.nodeName.toLowerCase(),s.toLowerCase())?(o=r,o=e.dom.createHTML(s,Am(e),o)):o||(o=r),Lk(e,o,n.no_selection),{content:o,html:o}}{"raw"!==n.format&&(o=Aw({validate:!1},e.schema).serialize(e.parser.parse(o,{isRootContent:!0,insert:!0})));const r=Gs(ln.fromDom(t))?o:go.trim(o);return Lk(e,r,n.no_selection),{content:r,html:r}}},Ik=(e,t,o,n)=>{PS(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),o);const r=Aw({validate:!1},e.schema).serialize(o),s=Gs(ln.fromDom(t))?r:go.trim(r);return Lk(e,s,n.no_selection),{content:o,html:s}},Pk=(e,t,o)=>j.from(e.getBody()).map((n=>Rk(t)?Ik(e,n,t,o):Hk(e,n,t,o))).getOr({content:t,html:Rk(o.content)?"":o.content}),zk=(e,t)=>zr(e,t).isSome(),Fk=e=>E(e)?e:Z,Vk=(e,t,o)=>{let n=e.dom;const r=Fk(o);while(n.parentNode){n=n.parentNode;const e=ln.fromDom(n),o=t(e);if(o.isSome())return o;if(r(e))break}return j.none()},Zk=(e,t,o)=>{const n=t(e),r=Fk(o);return n.orThunk((()=>r(e)?j.none():Vk(e,t,r)))},Uk=Kp,jk=(e,t,o)=>{const n=e.formatter.get(o);if(n)for(let r=0;r<n.length;r++){const o=n[r];if(af(o)&&!1===o.inherit&&e.dom.is(t,o.selector))return!0}return!1},$k=(e,t,o,n,r)=>{const s=e.dom.getRoot();if(t===s)return!1;const a=e.dom.getParent(t,(t=>!!jk(e,t,o)||(t.parentNode===s||!!Gk(e,t,o,n,!0))));return!!Gk(e,a,o,n,r)},Wk=(e,t,o)=>!(!lf(o)||!Uk(t,o.inline))||(!(!nf(o)||!Uk(t,o.block))||!!af(o)&&(Kr(t)&&e.is(t,o.selector))),qk=(e,t,o,n,r,s)=>{const a=o[n],i="attributes"===n;if(E(o.onmatch))return o.onmatch(t,o,n);if(a)if(Ie(a)){for(let l=0;l<a.length;l++)if(i?e.getAttrib(t,a[l]):Xp(e,t,a[l]))return!0}else for(const l in a)if(Re(a,l)){const n=i?e.getAttrib(t,l):Xp(e,t,l),c=Gp(a[l],s),d=O(n)||ft(n);if(d&&O(c))continue;if(r&&d&&!o.exact)return!1;if((!r||o.exact)&&!Uk(n,Yp(c,l)))return!1}return!0},Gk=(e,t,o,n,r)=>{const s=e.formatter.get(o),a=e.dom;if(s&&Kr(t))for(let i=0;i<s.length;i++){const o=s[i];if(Wk(e.dom,t,o)&&qk(a,t,o,"attributes",r,n)&&qk(a,t,o,"styles",r,n)){const r=o.classes;if(r)for(let o=0;o<r.length;o++)if(!e.dom.hasClass(t,Gp(r[o],n)))return;return o}}},Kk=(e,t,o,n,r)=>{if(n)return $k(e,n,t,o,r);if(n=e.selection.getNode(),$k(e,n,t,o,r))return!0;const s=e.selection.getStart();return!(s===n||!$k(e,s,t,o,r))},Yk=(e,t,o)=>{const n=[],r={},s=e.selection.getStart();return e.dom.getParent(s,(s=>{for(let a=0;a<t.length;a++){const i=t[a];!r[i]&&Gk(e,s,i,o)&&(r[i]=!0,n.push(i))}}),e.dom.getRoot()),n},Xk=(e,t)=>{const o=t=>hn(t,ln.fromDom(e.getBody())),n=(t,o)=>Gk(e,t.dom,o)?j.some(o):j.none();return j.from(e.selection.getStart(!0)).bind((e=>Zk(ln.fromDom(e),(e=>ye(t,(t=>n(e,t)))),o))).getOrNull()},Jk=(e,t)=>{const o=e.formatter.get(t),n=e.dom;if(o){const t=e.selection.getStart(),r=Qp(n,t);for(let e=o.length-1;e>=0;e--){const t=o[e];if(!af(t))return!0;for(let e=r.length-1;e>=0;e--)if(n.is(r[e],t.selector))return!0}}return!1},Qk=(e,t,o)=>re(o,((o,n)=>{const r=tf(e,n);return e.formatter.matchNode(t,n,{},r)?o.concat([n]):o}),[]),e_=oa,t_=(e,t)=>e.importNode(t,!0),o_=e=>{const t=[];let o=e;while(o){if(as(o)&&o.data!==e_||o.childNodes.length>1)return[];Kr(o)&&t.push(o),o=o.firstChild}return t},n_=e=>o_(e).length>0,r_=e=>{if(e){const t=new Wr(e,e);for(let e=t.current();e;e=t.next())if(as(e))return e}return null},s_=e=>{const t=ln.fromTag("span");return Lo(t,{id:Bh,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&rr(t,ln.fromText(e_)),t},a_=e=>{const t=r_(e);return t&&t.data.charAt(0)===e_&&t.deleteData(0,1),t},i_=(e,t,o=!0)=>{const n=e.dom,r=e.selection;if(n_(t))uC(e,!1,ln.fromDom(t),o);else{const e=r.getRng(),o=n.getParent(t,n.isBlock),s=e.startContainer,a=e.startOffset,i=e.endContainer,l=e.endOffset,c=a_(t);n.remove(t,!0),s===c&&a>0&&e.setStart(c,a-1),i===c&&l>0&&e.setEnd(c,l-1),o&&n.isEmpty(o)&&ea(ln.fromDom(o)),r.setRng(e)}},l_=(e,t,o=!0)=>{const n=e.dom,r=e.selection;if(t)i_(e,t,o);else if(t=Hh(e.getBody(),r.getStart()),!t)while(t=n.get(Bh))i_(e,t,!1)},c_=(e,t,o)=>{var n,r;const s=e.dom,a=s.getParent(o,I(Zp,e.schema));a&&s.isEmpty(a)?null===(n=o.parentNode)||void 0===n||n.replaceChild(t,o):(Js(ln.fromDom(o)),s.isEmpty(o)?null===(r=o.parentNode)||void 0===r||r.replaceChild(t,o):s.insertAfter(t,o))},d_=(e,t)=>(e.appendChild(t),t),m_=(e,t)=>{var o;const n=ne(e,((e,t)=>d_(e,t.cloneNode(!1))),t),r=null!==(o=n.ownerDocument)&&void 0!==o?o:document;return d_(n,r.createTextNode(e_))},u_=(e,t,o,n,r,s)=>{const a=e.formatter,i=e.dom,l=oe(xe(a.get()),(e=>e!==n&&!lt(e,"removeformat"))),c=Qk(e,o,l),d=oe(c,(t=>!of(e,t,n)));if(d.length>0){const e=o.cloneNode(!1);return i.add(t,e),a.remove(n,r,e,s),i.remove(e),j.some(e)}return j.none()},g_=(e,t,o)=>{let n;const r=e.selection,s=e.formatter.get(t);if(!s)return;const a=r.getRng();let i=a.startOffset;const l=a.startContainer,c=l.nodeValue;n=Hh(e.getBody(),r.getStart());const d=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(c&&i>0&&i<c.length&&d.test(c.charAt(i))&&d.test(c.charAt(i-1))){const n=r.getBookmark();a.collapse(!0);let i=Of(e.dom,a,s);i=pv(i),e.formatter.apply(t,o,i),r.moveToBookmark(n)}else{let s=n?r_(n):null;n&&(null===s||void 0===s?void 0:s.data)===e_||(n=t_(e.getDoc(),s_(!0).dom),s=n.firstChild,a.insertNode(n),i=1),e.formatter.apply(t,o,n),r.setCursorLocation(s,i)}},h_=(e,t,o,n)=>{const r=e.dom,s=e.selection;let a=!1;const i=e.formatter.get(t);if(!i)return;const l=s.getRng(),c=l.startContainer,d=l.startOffset;let m=c;as(c)&&(d!==c.data.length&&(a=!0),m=m.parentNode);const u=[];let g;while(m){if(Gk(e,m,t,o,n)){g=m;break}m.nextSibling&&(a=!0),u.push(m),m=m.parentNode}if(g)if(a){const a=s.getBookmark();l.collapse(!0);let c=Of(r,l,i,!0);c=pv(c),e.formatter.remove(t,o,c,n),s.moveToBookmark(a)}else{const a=Hh(e.getBody(),g),i=s_(!1).dom;c_(e,i,null!==a&&void 0!==a?a:g);const l=u_(e,i,g,t,o,n),c=m_(u.concat(l.toArray()),i);a&&i_(e,a,!1),s.setCursorLocation(c,1),r.isEmpty(g)&&r.remove(g)}},p_=(e,t)=>{const o=e.selection,n=e.getBody();l_(e,null,!1),8!==t&&46!==t||!o.isCollapsed()||o.getStart().innerHTML!==e_||l_(e,Hh(n,o.getStart())),37!==t&&39!==t||l_(e,Hh(n,o.getStart()))},f_=e=>{e.on("mouseup keydown",(t=>{p_(e,t.keyCode)}))},b_=(e,t)=>{const o=s_(!1),n=m_(t,o.dom);return tr(ln.fromDom(e),o),cr(ln.fromDom(e)),bd(n,0)},v_=(e,t)=>{const o=e.schema.getTextInlineElements();return Re(o,ko(t))&&!Lh(t.dom)&&!ts(t.dom)},y_=e=>Lh(e.dom)&&n_(e.dom),w_={},x_=Xr(["pre"]),C_=(e,t)=>{const o=w_[e];o||(w_[e]=[]),w_[e].push(t)},S_=(e,t)=>{Re(w_,e)&&Q(w_[e],(e=>{e(t)}))};C_("pre",(e=>{const t=e.selection.getRng(),o=e=>t=>{const o=t.previousSibling;return x_(o)&&Y(e,o)},n=(e,t)=>{const o=ln.fromDom(t),n=bn(o).dom;cr(o),ir(ln.fromDom(e),[ln.fromTag("br",n),ln.fromTag("br",n),...En(o)])};if(!t.collapsed){const t=e.selection.getSelectedBlocks(),r=oe(oe(t,x_),o(t));Q(r,(e=>{n(e.previousSibling,e)}))}}));const k_=["fontWeight","fontStyle","color","fontSize","fontFamily"],__=e=>w(e.styles)&&X(xe(e.styles),(e=>Y(k_,e))),O_=e=>ae(e,(e=>lf(e)&&"span"===e.inline&&__(e))),T_=(e,t)=>{const o=e.get(t);return C(o)?O_(o):j.none()},E_=(e,t)=>Mh(t,bd.fromRangeStart(e)).isNone(),D_=(e,t)=>!1===Ah(t,bd.fromRangeEnd(e)).exists((e=>!us(e.getNode())||Ah(t,e).isSome())),A_=e=>t=>ys(t)&&"false"!==e.getContentEditableParent(t),M_=e=>{const t=e.getSelectedBlocks(),o=e.getRng();if(e.isCollapsed())return[];if(1===t.length)return E_(o,t[0])&&D_(o,t[0])?t:[];{const e=fe(t).filter((e=>E_(o,e))).toArray(),n=be(t).filter((e=>D_(o,e))).toArray(),r=t.slice(1,-1);return e.concat(r).concat(n)}},N_=e=>oe(M_(e),A_(e.dom)),R_=e=>oe(e.getSelectedBlocks(),A_(e.dom)),B_=go.each,L_=e=>Kr(e)&&!rp(e)&&!Lh(e)&&!ts(e),H_=(e,t)=>{for(let o=e;o;o=o[t]){if(as(o)&&pt(o.data))return e;if(Kr(o)&&!rp(o))return o}return e},I_=(e,t,o)=>{const n=RS(e),r=Kr(t)&&Pp(t),s=Kr(o)&&Pp(o);if(r&&s){const r=H_(t,"previousSibling"),s=H_(o,"nextSibling");if(n.compare(r,s)){for(let e=r.nextSibling;e&&e!==s;){const t=e;e=e.nextSibling,r.appendChild(t)}return e.dom.remove(s),go.each(go.grep(s.childNodes),(e=>{r.appendChild(e)})),r}}return o},P_=(e,t,o,n)=>{var r;if(n&&!1!==t.merge_siblings){const t=null!==(r=I_(e,Vp(n),n))&&void 0!==r?r:n;I_(e,t,Vp(t,!0))}},z_=(e,t,o)=>{if(t.clear_child_styles){const n=t.links?"*:not(a)":"*";B_(e.select(n,o),(o=>{L_(o)&&Pp(o)&&B_(t.styles,((t,n)=>{e.setStyle(o,n,"")}))}))}},F_=(e,t,o)=>{B_(e.childNodes,(e=>{L_(e)&&(t(e)&&o(e),e.hasChildNodes()&&F_(e,t,o))}))},V_=(e,t)=>{"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0)},Z_=(e,t)=>o=>!(!o||!Xp(e,o,t)),U_=(e,t,o)=>n=>{e.setStyle(n,t,o),""===n.getAttribute("style")&&n.removeAttribute("style"),V_(e,n)},j_=nm.generate([{keep:[]},{rename:["name"]},{removed:[]}]),$_=/^(src|href|style)$/,W_=go.each,q_=Kp,G_=e=>/^(TR|TH|TD)$/.test(e.nodeName),K_=(e,t,o)=>e.isChildOf(t,o)&&t!==o&&!e.isBlock(o),Y_=(e,t,o)=>{let n=t[o?"startContainer":"endContainer"],r=t[o?"startOffset":"endOffset"];if(Kr(n)){const e=n.childNodes.length-1;!o&&r&&r--,n=n.childNodes[r>e?e:r]}return as(n)&&o&&r>=n.data.length&&(n=new Wr(n,e.getBody()).next()||n),as(n)&&!o&&0===r&&(n=new Wr(n,e.getBody()).prev()||n),n},X_=(e,t)=>{const o=t?"firstChild":"lastChild",n=e[o];return G_(e)&&n?"TR"===e.nodeName&&n[o]||n:e},J_=(e,t,o,n)=>{var r;const s=e.create(o,n);return null===(r=t.parentNode)||void 0===r||r.insertBefore(s,t),s.appendChild(t),s},Q_=(e,t,o,n,r)=>{const s=ln.fromDom(t),a=ln.fromDom(e.create(n,r)),i=o?Tn(s):On(s);return ir(a,i),o?(tr(s,a),nr(a,s)):(or(s,a),rr(a,s)),a.dom},eO=(e,t)=>t.links&&"A"===e.nodeName,tO=(e,t,o)=>{const n=t.parentNode;let r;const s=e.dom,a=Dm(e);nf(o)&&n===s.getRoot()&&(o.list_block&&q_(t,o.list_block)||Q(ve(t.childNodes),(t=>{Up(e,a,t.nodeName.toLowerCase())?r?r.appendChild(t):(r=J_(s,t,a),s.setAttribs(r,Am(e))):r=null}))),cf(o)&&!q_(o.inline,t)||s.remove(t,!0)},oO=(e,t,o)=>D(e)?{name:t,value:null}:{name:e,value:Gp(t,o)},nO=(e,t)=>{""===e.getAttrib(t,"style")&&(t.removeAttribute("style"),t.removeAttribute("data-mce-style"))},rO=(e,t,o,n,r)=>{let s=!1;W_(o.styles,((a,i)=>{const{name:l,value:c}=oO(i,a,n),d=Yp(c,l);(o.remove_similar||S(c)||!Kr(r)||q_(Xp(e,r,l),d))&&e.setStyle(t,l,""),s=!0})),s&&nO(e,t)},sO=(e,t,o)=>{"removeformat"===t?Q(R_(e.selection),(t=>{Q(k_,(o=>e.dom.setStyle(t,o,""))),nO(e.dom,t)})):T_(e.formatter,t).each((t=>{Q(R_(e.selection),(n=>rO(e.dom,n,t,o,null)))}))},aO=(e,t,o,n,r)=>{const s=e.dom,a=RS(e),i=e.schema;if(lf(t)&&li(i,t.inline)&&di(i,n)&&n.parentElement===e.getBody())return tO(e,n,t),j_.removed();if(!t.ceFalseOverride&&n&&"false"===s.getContentEditableParent(n))return j_.keep();if(n&&!Wk(s,n,t)&&!eO(n,t))return j_.keep();const l=n,c=t.preserve_attributes;if(lf(t)&&"all"===t.remove&&C(c)){const e=oe(s.getAttribs(l),(e=>Y(c,e.name.toLowerCase())));if(s.removeAllAttribs(l),Q(e,(e=>s.setAttrib(l,e.name,e.value))),e.length>0)return j_.rename("span")}if("all"!==t.remove){rO(s,l,t,o,r),W_(t.attributes,((e,n)=>{const{name:a,value:i}=oO(n,e,o);if(t.remove_similar||S(i)||!Kr(r)||q_(s.getAttrib(r,a),i)){if("class"===a){const e=s.getAttrib(l,a);if(e){let t="";if(Q(e.split(/\s+/),(e=>{/mce\-\w+/.test(e)&&(t+=(t?" ":"")+e)})),t)return void s.setAttrib(l,a,t)}}if($_.test(a)&&l.removeAttribute("data-mce-"+a),"style"===a&&Xr(["li"])(l)&&"none"===s.getStyle(l,"list-style-type"))return l.removeAttribute(a),void s.setStyle(l,"list-style-type","none");"class"===a&&l.removeAttribute("className"),l.removeAttribute(a)}})),W_(t.classes,(e=>{e=Gp(e,o),Kr(r)&&!s.hasClass(r,e)||s.removeClass(l,e)}));const e=s.getAttribs(l);for(let t=0;t<e.length;t++){const o=e[t].nodeName;if(!a.isAttributeInternal(o))return j_.keep()}}return"none"!==t.remove?(tO(e,l,t),j_.removed()):j_.keep()},iO=(e,t,o,n,r)=>aO(e,t,o,n,r).fold(Z,(t=>(e.dom.rename(n,t),!0)),U),lO=(e,t,o,n,r)=>{let s;return t.parentNode&&Q(Qp(e.dom,t.parentNode).reverse(),(t=>{if(!s&&Kr(t)&&"_start"!==t.id&&"_end"!==t.id){const a=Gk(e,t,o,n,r);a&&!1!==a.split&&(s=t)}})),s},cO=(e,t,o,n)=>aO(e,t,o,n,n).fold(B(n),(t=>{const o=e.dom.createFragment();return o.appendChild(n),e.dom.rename(n,t)}),B(null)),dO=(e,t,o,n,r,s,a,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;o++)if(n=cO(e,t[o],i,n),null===n)break;n&&(d&&n.appendChild(d),m||(m=n),d=n)}!s||a.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),lf(a)&&P_(e,a,i,d))}return n},mO=(e,t,o,n,r)=>{const s=e.formatter.get(t),a=s[0],i=e.dom,l=e.selection,c=n=>{const i=lO(e,n,t,o,r);return dO(e,s,i,n,n,!0,a,o)},d=e=>rp(e)&&Kr(e)&&("_start"===e.id||"_end"===e.id),m=t=>X(s,(n=>iO(e,n,o,t,t))),u=t=>{const o=ve(t.childNodes),n=m(t),r=n||X(s,(e=>Wk(i,t,e))),l=t.parentNode;if(!r&&T(l)&&df(a)&&m(l),a.deep&&o.length)for(let e=0;e<o.length;e++)u(o[e]);const c=["underline","line-through","overline"];Q(c,(o=>{Kr(t)&&e.dom.getStyle(t,"text-decoration")===o&&t.parentNode&&Jp(i,t.parentNode)===o&&iO(e,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:o}},void 0,t)}))},g=e=>{const t=i.get(e?"_start":"_end");if(t){let o=t[e?"firstChild":"lastChild"];return d(o)&&(o=o[e?"firstChild":"lastChild"]),as(o)&&0===o.data.length&&(o=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),i.remove(t,!0),o}return null},h=t=>{let o,n,r=Of(i,t,s,t.collapsed);if(a.split){if(r=pv(r),o=Y_(e,r,!0),n=Y_(e,r),o!==n){if(o=X_(o,!0),n=X_(n,!1),K_(i,o,n)){const e=j.from(o.firstChild).getOr(o);return c(Q_(i,e,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void g(!0)}if(K_(i,n,o)){const e=j.from(n.lastChild).getOr(n);return c(Q_(i,e,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void g(!1)}o=J_(i,o,"span",{id:"_start","data-mce-type":"bookmark"}),n=J_(i,n,"span",{id:"_end","data-mce-type":"bookmark"});const e=i.createRng();e.setStartAfter(o),e.setEndBefore(n),Tf(i,e,(e=>{Q(e,(e=>{rp(e)||rp(e.parentNode)||c(e)}))})),c(o),c(n),o=g(!0),n=g()}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}Tf(i,r,(e=>{Q(e,u)}))};if(n){if(Lp(n)){const e=i.createRng();e.setStartBefore(n),e.setEndAfter(n),h(e)}else h(n);Qf(e,t,n,o)}else l.isCollapsed()&&lf(a)&&!kp(e).length?h_(e,t,o,r):(zp(e,(()=>Rp(e,h)),(n=>lf(a)&&Kk(e,t,o,n))),e.nodeChanged()),sO(e,t,o),Qf(e,t,n,o)},uO=go.each,gO=(e,t,o,n)=>{const r=t=>{if(Kr(t)&&Kr(t.parentNode)&&Pp(t)){const o=Jp(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)&&(go.walk(n,r,"childNodes"),r(n))},hO=(e,t,o,n)=>{if(t.styles&&t.styles.backgroundColor){const r=Z_(e,"fontSize");F_(n,(e=>r(e)&&Pp(e)),U_(e,"backgroundColor",Gp(t.styles.backgroundColor,o)))}},pO=(e,t,o,n)=>{if(lf(t)&&("sub"===t.inline||"sup"===t.inline)){const o=Z_(e,"fontSize");F_(n,(e=>o(e)&&Pp(e)),U_(e,"fontSize",""));const r=oe(e.select("sup"===t.inline?"sub":"sup",n),Pp);e.remove(r,!0)}},fO=(e,t,o,n)=>{uO(t,(t=>{lf(t)&&uO(e.dom.select(t.inline,n),(n=>{L_(n)&&iO(e,t,o,n,t.exact?n:null)})),z_(e.dom,t,n)}))},bO=(e,t,o,n,r)=>{const s=r.parentNode;Gk(e,s,o,n)&&iO(e,t,n,r)||t.merge_with_parents&&s&&e.dom.getParent(s,(s=>!!Gk(e,s,o,n)&&(iO(e,t,n,r),!0)))},vO=go.each,yO=(e,t,o,n)=>{if(hu(e)&&lf(t)&&o.parentNode){const t=nl(e.schema),r=zk(ln.fromDom(o),(e=>Lh(e.dom)));return Be(t,n)&&Ka(ln.fromDom(o.parentNode),!1)&&!r}return!1},wO=(e,t,o,n)=>{if(vO(o.styles,((o,r)=>{e.setStyle(t,r,Gp(o,n))})),o.styles){const o=e.getAttrib(t,"style");o&&e.setAttrib(t,"data-mce-style",o)}},xO=(e,t,o,n)=>{const r=e.formatter.get(t),s=r[0],a=!n&&e.selection.isCollapsed(),i=e.dom,l=e.selection,c=(e,t=s)=>{E(t.onformat)&&t.onformat(e,t,o,n),wO(i,e,t,o),vO(t.attributes,((t,n)=>{i.setAttrib(e,n,Gp(t,o))})),vO(t.classes,(t=>{const n=Gp(t,o);i.hasClass(e,n)||i.addClass(e,n)}))},d=(e,t)=>{let o=!1;return vO(e,(e=>!!af(e)&&("false"===i.getContentEditable(t)&&!e.ceFalseOverride||(!(!T(e.collapsed)||e.collapsed===a)||(!(i.is(t,e.selector)&&!Lh(t))||(c(t,e),o=!0,!1)))))),o},m=e=>{if(y(e)){const t=i.create(e);return c(t),t}return null},u=(n,a,i)=>{const l=[];let u=!0;const g=s.inline||s.block,h=m(g),p=n=>rf(s)&&Gk(e,n,t,o),f=(t,o,n)=>{const r=sf(s)&&Zp(e.schema,t)&&Up(e,o,g);return n&&r},b=(t,o,r,a)=>{const l=t.nodeName.toLowerCase(),c=Up(e,g,l)&&Up(e,o,g),d=!i&&as(t)&&na(t.data),m=Lh(t),u=!lf(s)||!n.isBlock(t);return(r||a)&&c&&!d&&!m&&u};Tf(n,a,(t=>{let o;const a=t=>{let i=!1,m=u,v=!1;const y=t.parentNode,w=y.nodeName.toLowerCase(),x=n.getContentEditable(t);T(x)&&(m=u,u="true"===x,i=!0,v=qp(e,t));const C=u&&!i;if(us(t)&&!yO(e,s,t,w))return o=null,void(nf(s)&&n.remove(t));if(p(t))o=null;else{if(f(t,w,C)){const e=n.rename(t,g);return c(e),l.push(e),void(o=null)}if(af(s)){let e=d(r,t);if(!e&&T(y)&&df(s)&&(e=d(r,y)),!lf(s)||e)return void(o=null)}T(h)&&b(t,w,C,v)?(o||(o=n.clone(h,!1),y.insertBefore(o,t),l.push(o)),v&&i&&(u=m),o.appendChild(t)):(o=null,Q(ve(t.childNodes),a),i&&(u=m),o=null)}};Q(t,a)})),!0===s.links&&Q(l,(e=>{const t=e=>{"A"===e.nodeName&&c(e,s),Q(ve(e.childNodes),t)};t(e)})),Q(l,(a=>{const i=e=>{let t=0;return Q(e.childNodes,(e=>{$p(e)||rp(e)||t++})),t},d=e=>{const t=ae(e.childNodes,Hp).filter((e=>"false"!==n.getContentEditable(e)&&Wk(n,e,s)));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)},m=i(a);!(l.length>1)&&n.isBlock(a)||0!==m?(lf(s)||nf(s)&&s.wrapper)&&(s.exact||1!==m||(a=d(a)),fO(e,r,o,a),bO(e,s,t,o,a),hO(n,s,o,a),gO(n,s,o,a),pO(n,s,o,a),P_(e,s,o,a)):n.remove(a,!0)}))},g=Lp(n)?n:l.getNode();if("false"===i.getContentEditable(g)&&!qp(e,g))return n=g,d(r,n),void Jf(e,t,n,o);if(s){if(n)if(Lp(n)){if(!d(r,n)){const e=i.createRng();e.setStartBefore(n),e.setEndAfter(n),u(i,Of(i,e,r),!0)}}else u(i,n,!0);else a&&lf(s)&&!kp(e).length?g_(e,t,o):(l.setRng(XS(l.getRng())),zp(e,(()=>{Rp(e,((e,t)=>{const o=t?e:Of(i,e,r);u(i,o,!1)}))}),U),e.nodeChanged()),T_(e.formatter,t).each((t=>{Q(N_(e.selection),(e=>wO(i,e,t,o)))}));S_(t,e)}Jf(e,t,n,o)},CO=e=>Re(e,"vars"),SO=(e,t)=>{e.set({}),t.on("NodeChange",(o=>{TO(t,o.element,e.get())})),t.on("FormatApply FormatRemove",(o=>{const n=j.from(o.node).map((e=>Lp(e)?e:e.startContainer)).bind((e=>Kr(e)?j.some(e):j.from(e.parentElement))).getOrThunk((()=>kO(t)));TO(t,n,e.get())}))},kO=e=>e.selection.getStart(),_O=(e,t,o,n,r)=>{const s=t=>{const s=e.formatter.matchNode(t,o,null!==r&&void 0!==r?r:{},n);return!_(s)},a=t=>!!jk(e,t,o)||!n&&T(e.formatter.matchNode(t,o,r,!0));return se(t,s,a)},OO=(e,t)=>{const o=null!==t&&void 0!==t?t:kO(e);return oe(Qp(e.dom,o),(e=>Kr(e)&&!ts(e)))},TO=(e,t,o)=>{const n=OO(e,t);Se(o,((o,r)=>{const s=o=>{const s=_O(e,n,r,o.similar,CO(o)?o.vars:void 0),a=s.isSome();if(o.state.get()!==a){o.state.set(a);const e=s.getOr(t);CO(o)?o.callback(a,{node:e,format:r,parents:n}):Q(o.callbacks,(t=>t(a,{node:e,format:r,parents:n})))}};Q([o.withSimilar,o.withoutSimilar],s),Q(o.withVars,s)}))},EO=(e,t,o,n,r,s)=>{const a=t.get();Q(o.split(","),(t=>{const o=Ne(a,t).getOrThunk((()=>{const e={withSimilar:{state:Fl(!1),similar:!0,callbacks:[]},withoutSimilar:{state:Fl(!1),similar:!1,callbacks:[]},withVars:[]};return a[t]=e,e})),i=()=>{const o=OO(e);return _O(e,o,t,r,s).isSome()};if(_(s)){const e=r?o.withSimilar:o.withoutSimilar;e.callbacks.push(n),1===e.callbacks.length&&e.state.set(i())}else o.withVars.push({state:Fl(i()),similar:r,vars:s,callback:n})})),t.set(a)},DO=(e,t,o)=>{const n=e.get();Q(t.split(","),(e=>Ne(n,e).each((t=>{n[e]={withSimilar:{...t.withSimilar,callbacks:oe(t.withSimilar.callbacks,(e=>e!==o))},withoutSimilar:{...t.withoutSimilar,callbacks:oe(t.withoutSimilar.callbacks,(e=>e!==o))},withVars:oe(t.withVars,(e=>e.callback!==o))}})))),e.set(n)},AO=(e,t,o,n,r,s)=>(EO(e,t,o,n,r,s),{unbind:()=>DO(t,o,n)}),MO=(e,t,o,n)=>{const r=e.formatter.get(t);r&&(!Kk(e,t,o,n)||"toggle"in r[0]&&!r[0].toggle?xO(e,t,o,n):mO(e,t,o,n))};function NO(e){return NO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},NO(e)}function RO(e,t){return RO=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},RO(e,t)}function BO(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function LO(e,t,o){return LO=BO()?Reflect.construct:function(e,t,o){var n=[null];n.push.apply(n,t);var r=Function.bind.apply(e,n),s=new r;return o&&RO(s,o.prototype),s},LO.apply(null,arguments)}function HO(e){return IO(e)||PO(e)||zO(e)||VO()}function IO(e){if(Array.isArray(e))return FO(e)}function PO(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function zO(e,t){if(e){if("string"===typeof e)return FO(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?FO(e,t):void 0}}function FO(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}function VO(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var ZO=Object.hasOwnProperty,UO=Object.setPrototypeOf,jO=Object.isFrozen,$O=Object.getPrototypeOf,WO=Object.getOwnPropertyDescriptor,qO=Object.freeze,GO=Object.seal,KO=Object.create,YO="undefined"!==typeof Reflect&&Reflect,XO=YO.apply,JO=YO.construct;XO||(XO=function(e,t,o){return e.apply(t,o)}),qO||(qO=function(e){return e}),GO||(GO=function(e){return e}),JO||(JO=function(e,t){return LO(e,HO(t))});var QO=cT(Array.prototype.forEach),eT=cT(Array.prototype.pop),tT=cT(Array.prototype.push),oT=cT(String.prototype.toLowerCase),nT=cT(String.prototype.match),rT=cT(String.prototype.replace),sT=cT(String.prototype.indexOf),aT=cT(String.prototype.trim),iT=cT(RegExp.prototype.test),lT=dT(TypeError);function cT(e){return function(t){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return XO(e,t,n)}}function dT(e){return function(){for(var t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];return JO(e,o)}}function mT(e,t){UO&&UO(e,null);var o=t.length;while(o--){var n=t[o];if("string"===typeof n){var r=oT(n);r!==n&&(jO(t)||(t[o]=r),n=r)}e[n]=!0}return e}function uT(e){var t,o=KO(null);for(t in e)XO(ZO,e,[t])&&(o[t]=e[t]);return o}function gT(e,t){while(null!==e){var o=WO(e,t);if(o){if(o.get)return cT(o.get);if("function"===typeof o.value)return cT(o.value)}e=$O(e)}function n(e){return console.warn("fallback value for",e),null}return n}var hT=qO(["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"]),pT=qO(["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"]),fT=qO(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),bT=qO(["animate","color-profile","cursor","discard","fedropshadow","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"]),vT=qO(["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"]),yT=qO(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),wT=qO(["#text"]),xT=qO(["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","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","xmlns","slot"]),CT=qO(["accent-height","accumulate","additive","alignment-baseline","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","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","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","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","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"]),ST=qO(["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"]),kT=qO(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),_T=GO(/\{\{[\w\W]*|[\w\W]*\}\}/gm),OT=GO(/<%[\w\W]*|[\w\W]*%>/gm),TT=GO(/^data-[\-\w.\u00B7-\uFFFF]/),ET=GO(/^aria-[\-\w]+$/),DT=GO(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),AT=GO(/^(?:\w+script|data):/i),MT=GO(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),NT=GO(/^html$/i),RT=function(){return"undefined"===typeof window?null:window},BT=function(e,t){if("object"!==NO(e)||"function"!==typeof e.createPolicy)return null;var o=null,n="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(n)&&(o=t.currentScript.getAttribute(n));var r="dompurify"+(o?"#"+o:"");try{return e.createPolicy(r,{createHTML:function(e){return e}})}catch(s){return console.warn("TrustedTypes policy "+r+" could not be created."),null}};function LT(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:RT(),t=function(e){return LT(e)};if(t.version="2.3.8",t.removed=[],!e||!e.document||9!==e.document.nodeType)return t.isSupported=!1,t;var o=e.document,n=e.document,r=e.DocumentFragment,s=e.HTMLTemplateElement,a=e.Node,i=e.Element,l=e.NodeFilter,c=e.NamedNodeMap,d=void 0===c?e.NamedNodeMap||e.MozNamedAttrMap:c,m=e.HTMLFormElement,u=e.DOMParser,g=e.trustedTypes,h=i.prototype,p=gT(h,"cloneNode"),f=gT(h,"nextSibling"),b=gT(h,"childNodes"),v=gT(h,"parentNode");if("function"===typeof s){var y=n.createElement("template");y.content&&y.content.ownerDocument&&(n=y.content.ownerDocument)}var w=BT(g,o),x=w?w.createHTML(""):"",C=n,S=C.implementation,k=C.createNodeIterator,_=C.createDocumentFragment,O=C.getElementsByTagName,T=o.importNode,E={};try{E=uT(n).documentMode?n.documentMode:{}}catch(Ve){}var D={};t.isSupported="function"===typeof v&&S&&"undefined"!==typeof S.createHTMLDocument&&9!==E;var A,M,N=_T,R=OT,B=TT,L=ET,H=AT,I=MT,P=DT,z=null,F=mT({},[].concat(HO(hT),HO(pT),HO(fT),HO(vT),HO(wT))),V=null,Z=mT({},[].concat(HO(xT),HO(CT),HO(ST),HO(kT))),U=Object.seal(Object.create(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}})),j=null,$=null,W=!0,q=!0,G=!1,K=!1,Y=!1,X=!1,J=!1,Q=!1,ee=!1,te=!1,oe=!0,ne=!0,re=!1,se={},ae=null,ie=mT({},["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"]),le=null,ce=mT({},["audio","video","img","source","image","track"]),de=null,me=mT({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ue="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",he="http://www.w3.org/1999/xhtml",pe=he,fe=!1,be=["application/xhtml+xml","text/html"],ve="text/html",ye=null,we=n.createElement("form"),xe=function(e){return e instanceof RegExp||e instanceof Function},Ce=function(e){ye&&ye===e||(e&&"object"===NO(e)||(e={}),e=uT(e),z="ALLOWED_TAGS"in e?mT({},e.ALLOWED_TAGS):F,V="ALLOWED_ATTR"in e?mT({},e.ALLOWED_ATTR):Z,de="ADD_URI_SAFE_ATTR"in e?mT(uT(me),e.ADD_URI_SAFE_ATTR):me,le="ADD_DATA_URI_TAGS"in e?mT(uT(ce),e.ADD_DATA_URI_TAGS):ce,ae="FORBID_CONTENTS"in e?mT({},e.FORBID_CONTENTS):ie,j="FORBID_TAGS"in e?mT({},e.FORBID_TAGS):{},$="FORBID_ATTR"in e?mT({},e.FORBID_ATTR):{},se="USE_PROFILES"in e&&e.USE_PROFILES,W=!1!==e.ALLOW_ARIA_ATTR,q=!1!==e.ALLOW_DATA_ATTR,G=e.ALLOW_UNKNOWN_PROTOCOLS||!1,K=e.SAFE_FOR_TEMPLATES||!1,Y=e.WHOLE_DOCUMENT||!1,Q=e.RETURN_DOM||!1,ee=e.RETURN_DOM_FRAGMENT||!1,te=e.RETURN_TRUSTED_TYPE||!1,J=e.FORCE_BODY||!1,oe=!1!==e.SANITIZE_DOM,ne=!1!==e.KEEP_CONTENT,re=e.IN_PLACE||!1,P=e.ALLOWED_URI_REGEXP||P,pe=e.NAMESPACE||he,e.CUSTOM_ELEMENT_HANDLING&&xe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(U.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&xe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(U.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"===typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(U.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),A=A=-1===be.indexOf(e.PARSER_MEDIA_TYPE)?ve:e.PARSER_MEDIA_TYPE,M="application/xhtml+xml"===A?function(e){return e}:oT,K&&(q=!1),ee&&(Q=!0),se&&(z=mT({},HO(wT)),V=[],!0===se.html&&(mT(z,hT),mT(V,xT)),!0===se.svg&&(mT(z,pT),mT(V,CT),mT(V,kT)),!0===se.svgFilters&&(mT(z,fT),mT(V,CT),mT(V,kT)),!0===se.mathMl&&(mT(z,vT),mT(V,ST),mT(V,kT))),e.ADD_TAGS&&(z===F&&(z=uT(z)),mT(z,e.ADD_TAGS)),e.ADD_ATTR&&(V===Z&&(V=uT(V)),mT(V,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&mT(de,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(ae===ie&&(ae=uT(ae)),mT(ae,e.FORBID_CONTENTS)),ne&&(z["#text"]=!0),Y&&mT(z,["html","head","body"]),z.table&&(mT(z,["tbody"]),delete j.tbody),qO&&qO(e),ye=e)},Se=mT({},["mi","mo","mn","ms","mtext"]),ke=mT({},["foreignobject","desc","title","annotation-xml"]),_e=mT({},["title","style","font","a","script"]),Oe=mT({},pT);mT(Oe,fT),mT(Oe,bT);var Te=mT({},vT);mT(Te,yT);var Ee=function(e){var t=v(e);t&&t.tagName||(t={namespaceURI:he,tagName:"template"});var o=oT(e.tagName),n=oT(t.tagName);return e.namespaceURI===ge?t.namespaceURI===he?"svg"===o:t.namespaceURI===ue?"svg"===o&&("annotation-xml"===n||Se[n]):Boolean(Oe[o]):e.namespaceURI===ue?t.namespaceURI===he?"math"===o:t.namespaceURI===ge?"math"===o&&ke[n]:Boolean(Te[o]):e.namespaceURI===he&&(!(t.namespaceURI===ge&&!ke[n])&&(!(t.namespaceURI===ue&&!Se[n])&&(!Te[o]&&(_e[o]||!Oe[o]))))},De=function(e){tT(t.removed,{element:e});try{e.parentNode.removeChild(e)}catch(Ve){try{e.outerHTML=x}catch(Ve){e.remove()}}},Ae=function(e,o){try{tT(t.removed,{attribute:o.getAttributeNode(e),from:o})}catch(Ve){tT(t.removed,{attribute:null,from:o})}if(o.removeAttribute(e),"is"===e&&!V[e])if(Q||ee)try{De(o)}catch(Ve){}else try{o.setAttribute(e,"")}catch(Ve){}},Me=function(e){var t,o;if(J)e="<remove></remove>"+e;else{var r=nT(e,/^[\r\n\t ]+/);o=r&&r[0]}"application/xhtml+xml"===A&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var s=w?w.createHTML(e):e;if(pe===he)try{t=(new u).parseFromString(s,A)}catch(Ve){}if(!t||!t.documentElement){t=S.createDocument(pe,"template",null);try{t.documentElement.innerHTML=fe?"":s}catch(Ve){}}var a=t.body||t.documentElement;return e&&o&&a.insertBefore(n.createTextNode(o),a.childNodes[0]||null),pe===he?O.call(t,Y?"html":"body")[0]:Y?t.documentElement:a},Ne=function(e){return k.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,null,!1)},Re=function(e){return e instanceof m&&("string"!==typeof e.nodeName||"string"!==typeof e.textContent||"function"!==typeof e.removeChild||!(e.attributes instanceof d)||"function"!==typeof e.removeAttribute||"function"!==typeof e.setAttribute||"string"!==typeof e.namespaceURI||"function"!==typeof e.insertBefore)},Be=function(e){return"object"===NO(a)?e instanceof a:e&&"object"===NO(e)&&"number"===typeof e.nodeType&&"string"===typeof e.nodeName},Le=function(e,o,n){D[e]&&QO(D[e],(function(e){e.call(t,o,n,ye)}))},He=function(e){var o;if(Le("beforeSanitizeElements",e,null),Re(e))return De(e),!0;if(iT(/[\u0080-\uFFFF]/,e.nodeName))return De(e),!0;var n=M(e.nodeName);if(Le("uponSanitizeElement",e,{tagName:n,allowedTags:z}),e.hasChildNodes()&&!Be(e.firstElementChild)&&(!Be(e.content)||!Be(e.content.firstElementChild))&&iT(/<[/\w]/g,e.innerHTML)&&iT(/<[/\w]/g,e.textContent))return De(e),!0;if("select"===n&&iT(/<template/i,e.innerHTML))return De(e),!0;if(!z[n]||j[n]){if(!j[n]&&Pe(n)){if(U.tagNameCheck instanceof RegExp&&iT(U.tagNameCheck,n))return!1;if(U.tagNameCheck instanceof Function&&U.tagNameCheck(n))return!1}if(ne&&!ae[n]){var r=v(e)||e.parentNode,s=b(e)||e.childNodes;if(s&&r)for(var a=s.length,l=a-1;l>=0;--l)r.insertBefore(p(s[l],!0),f(e))}return De(e),!0}return e instanceof i&&!Ee(e)?(De(e),!0):"noscript"!==n&&"noembed"!==n||!iT(/<\/no(script|embed)/i,e.innerHTML)?(K&&3===e.nodeType&&(o=e.textContent,o=rT(o,N," "),o=rT(o,R," "),e.textContent!==o&&(tT(t.removed,{element:e.cloneNode()}),e.textContent=o)),Le("afterSanitizeElements",e,null),!1):(De(e),!0)},Ie=function(e,t,o){if(oe&&("id"===t||"name"===t)&&(o in n||o in we))return!1;if(q&&!$[t]&&iT(B,t));else if(W&&iT(L,t));else if(!V[t]||$[t]){if(!(Pe(e)&&(U.tagNameCheck instanceof RegExp&&iT(U.tagNameCheck,e)||U.tagNameCheck instanceof Function&&U.tagNameCheck(e))&&(U.attributeNameCheck instanceof RegExp&&iT(U.attributeNameCheck,t)||U.attributeNameCheck instanceof Function&&U.attributeNameCheck(t))||"is"===t&&U.allowCustomizedBuiltInElements&&(U.tagNameCheck instanceof RegExp&&iT(U.tagNameCheck,o)||U.tagNameCheck instanceof Function&&U.tagNameCheck(o))))return!1}else if(de[t]);else if(iT(P,rT(o,I,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==sT(o,"data:")||!le[e]){if(G&&!iT(H,rT(o,I,"")));else if(o)return!1}else;return!0},Pe=function(e){return e.indexOf("-")>0},ze=function(e){var t,o,n,r;Le("beforeSanitizeAttributes",e,null);var s=e.attributes;if(s){var a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:V};r=s.length;while(r--){t=s[r];var i=t,l=i.name,c=i.namespaceURI;o="value"===l?t.value:aT(t.value),n=M(l);var d=o;if(a.attrName=n,a.attrValue=o,a.keepAttr=!0,a.forceKeepAttr=void 0,Le("uponSanitizeAttribute",e,a),o=a.attrValue,!a.forceKeepAttr)if(a.keepAttr)if(iT(/\/>/i,o))Ae(l,e);else{K&&(o=rT(o,N," "),o=rT(o,R," "));var m=M(e.nodeName);if(Ie(m,n,o)){if(o!==d)try{c?e.setAttributeNS(c,l,o):e.setAttribute(l,o)}catch(Ve){Ae(l,e)}}else Ae(l,e)}else Ae(l,e)}Le("afterSanitizeAttributes",e,null)}},Fe=function e(t){var o,n=Ne(t);Le("beforeSanitizeShadowDOM",t,null);while(o=n.nextNode())Le("uponSanitizeShadowNode",o,null),He(o)||(o.content instanceof r&&e(o.content),ze(o));Le("afterSanitizeShadowDOM",t,null)};return t.sanitize=function(n,s){var i,l,c,d,m;if(fe=!n,fe&&(n="\x3c!--\x3e"),"string"!==typeof n&&!Be(n)){if("function"!==typeof n.toString)throw lT("toString is not a function");if(n=n.toString(),"string"!==typeof n)throw lT("dirty is not a string, aborting")}if(!t.isSupported){if("object"===NO(e.toStaticHTML)||"function"===typeof e.toStaticHTML){if("string"===typeof n)return e.toStaticHTML(n);if(Be(n))return e.toStaticHTML(n.outerHTML)}return n}if(X||Ce(s),t.removed=[],"string"===typeof n&&(re=!1),re){if(n.nodeName){var u=M(n.nodeName);if(!z[u]||j[u])throw lT("root node is forbidden and cannot be sanitized in-place")}}else if(n instanceof a)i=Me("\x3c!----\x3e"),l=i.ownerDocument.importNode(n,!0),1===l.nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?i=l:i.appendChild(l);else{if(!Q&&!K&&!Y&&-1===n.indexOf("<"))return w&&te?w.createHTML(n):n;if(i=Me(n),!i)return Q?null:te?x:""}i&&J&&De(i.firstChild);var g=Ne(re?n:i);while(c=g.nextNode())3===c.nodeType&&c===d||He(c)||(c.content instanceof r&&Fe(c.content),ze(c),d=c);if(d=null,re)return n;if(Q){if(ee){m=_.call(i.ownerDocument);while(i.firstChild)m.appendChild(i.firstChild)}else m=i;return V.shadowroot&&(m=T.call(o,m,!0)),m}var h=Y?i.outerHTML:i.innerHTML;return Y&&z["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&iT(NT,i.ownerDocument.doctype.name)&&(h="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+h),K&&(h=rT(h,N," "),h=rT(h,R," ")),w&&te?w.createHTML(h):h},t.setConfig=function(e){Ce(e),X=!0},t.clearConfig=function(){ye=null,X=!1},t.isValidAttribute=function(e,t,o){ye||Ce({});var n=M(e),r=M(t);return Ie(n,r,o)},t.addHook=function(e,t){"function"===typeof t&&(D[e]=D[e]||[],tT(D[e],t))},t.removeHook=function(e){if(D[e])return eT(D[e])},t.removeHooks=function(e){D[e]&&(D[e]=[])},t.removeAllHooks=function(){D={}},t}var HT=LT();const IT=go.explode,PT=()=>{const e={},t=(t,o)=>{Q(IT(t),(t=>{Re(e,t)||(e[t]={name:t,callbacks:[]}),e[t].callbacks.push(o)}))},o=()=>Me(e),n=(t,o)=>{Q(IT(t),(t=>{if(Re(e,t))if(T(o)){const n=e[t],r=oe(n.callbacks,(e=>e!==o));r.length>0?n.callbacks=r:delete e[t]}else delete e[t]}))};return{addFilter:t,getFilters:o,removeFilter:n}},zT=(e,t)=>{Q(t,(t=>{e.attr(t,null)}))},FT=(e,t,o)=>{e.addNodeFilter("font",(e=>{Q(e,(e=>{const n=t.parse(e.attr("style")),r=e.attr("color"),s=e.attr("face"),a=e.attr("size");r&&(n.color=r),s&&(n["font-family"]=s),a&&vt(a).each((e=>{n["font-size"]=o[e-1]})),e.name="span",e.attr("style",t.serialize(n)),zT(e,["color","face","size"])}))}))},VT=(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))}}))}))},ZT=(e,t,o)=>{var n;const r=il();t.convert_fonts_to_spans&&FT(e,r,go.explode(null!==(n=t.font_size_legacy_values)&&void 0!==n?n:"")),VT(e,o,r)},UT=(e,t,o)=>{t.inline_styles&&ZT(e,t,o)},jT=e=>fetch(e).then((e=>e.ok?e.blob():Promise.reject())).catch((()=>Promise.reject(`Cannot convert ${e} to Blob. Resource might not exist or is inaccessible.`))),$T=e=>{const t=/([a-z0-9+\/=\s]+)/i.exec(e);return t?t[1]:""},WT=e=>{const[t,...o]=e.split(","),n=o.join(","),r=/data:([^/]+\/[^;]+)(;.+)?/.exec(t);if(r){const e=";base64"===r[2],t=e?$T(n):decodeURIComponent(n);return j.some({type:r[1],data:t,base64Encoded:e})}return j.none()},qT=(e,t,o=!0)=>{let n=t;if(o)try{n=atob(t)}catch(s){return j.none()}const r=new Uint8Array(n.length);for(let a=0;a<r.length;a++)r[a]=n.charCodeAt(a);return j.some(new Blob([r],{type:e}))},GT=e=>new Promise(((t,o)=>{WT(e).bind((({type:e,data:t,base64Encoded:o})=>qT(e,t,o))).fold((()=>o("Invalid data URI")),t)})),KT=e=>ct(e,"blob:")?jT(e):ct(e,"data:")?GT(e):Promise.reject("Unknown URI format"),YT=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 XT=0;const JT=e=>(e||"blobid")+XT++,QT=(e,t,o)=>WT(e).bind((({data:e,type:n,base64Encoded:r})=>{if(t&&!r)return j.none();{const t=r?e:btoa(e);return o(t,n)}})),eE=(e,t,o)=>{const n=e.create(JT(),t,o);return e.add(n),n},tE=(e,t,o=!1)=>QT(t,o,((t,o)=>j.from(e.getByData(t,o)).orThunk((()=>qT(o,t).map((o=>eE(e,o,t))))))),oE=(e,t)=>{const o=()=>Promise.reject("Invalid data URI");if(ct(t,"blob:")){const n=e.getByUri(t);return T(n)?Promise.resolve(n):KT(t).then((t=>YT(t).then((n=>QT(n,!1,(o=>j.some(eE(e,t,o)))).getOrThunk(o)))))}return ct(t,"data:")?tE(e,t).fold(o,(e=>Promise.resolve(e))):Promise.reject("Unknown image data format")},nE=e=>T(e.attr("data-mce-bogus")),rE=e=>e.attr("src")===to.transparentSrc||T(e.attr("data-mce-placeholder")),sE=(e,t)=>{const{blob_cache:o}=t;if(o){const t=e=>{const t=e.attr("src");rE(e)||nE(e)||O(t)||tE(o,t,!0).each((t=>{e.attr("src",t.blobUri())}))};e.addAttributeFilter("src",(e=>Q(e,t)))}},aE=(e,t)=>{const o=e.schema;t.remove_trailing_brs&&e.addNodeFilter("br",((e,t,n)=>{const r=go.extend({},o.getBlockElements()),s=o.getNonEmptyElements(),a=o.getWhitespaceElements();r.body=1;const i=e=>e.name in r&&ui(o,e);for(let l=0,c=e.length;l<c;l++){let t=e[l],c=t.parent;if(c&&r[c.name]&&t===c.lastChild){let e=t.prev;while(e){const o=e.name;if("span"!==o||"bookmark"!==e.attr("data-mce-type")){"br"===o&&(t=null);break}e=e.prev}if(t&&(t.remove(),US(o,s,a,c))){const e=o.getElementRule(c.name);e&&(e.removeEmpty?c.remove():e.paddEmpty&&zS(n,i,c))}}else{let e=t;while(c&&c.firstChild===e&&c.lastChild===e){if(e=c,r[c.name])break;c=c.parent}if(e===c){const e=new pw("#text",3);e.value=xs,t.replace(e)}}}})),e.addAttributeFilter("href",(e=>{let o=e.length;const n=e=>{const t=e.split(" ").filter((e=>e.length>0));return t.concat(["noopener"]).sort().join(" ")},r=e=>{const t=e?go.trim(e):"";return/\b(noopener)\b/g.test(t)?t:n(t)};if(!t.allow_unsafe_link_target)while(o--){const t=e[o];"a"===t.name&&"_blank"===t.attr("target")&&t.attr("rel",r(t.attr("rel")))}})),t.allow_html_in_named_anchor||e.addAttributeFilter("id,name",(e=>{let t,o,n,r,s=e.length;while(s--)if(r=e[s],"a"===r.name&&r.firstChild&&!r.attr("href")){n=r.parent,t=r.lastChild;while(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;while(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 pw("li",1);e.attr("style","list-style-type: none"),t.wrap(e)}}));const n=o.getValidClasses();t.validate&&n&&e.addAttributeFilter("class",(e=>{var t;let o=e.length;while(o--){const r=e[o],s=null!==(t=r.attr("class"))&&void 0!==t?t:"",a=go.explode(s," ");let i="";for(let e=0;e<a.length;e++){const t=a[e];let o=!1,s=n["*"];s&&s[t]&&(o=!0),s=n[r.name],!o&&s&&s[t]&&(o=!0),o&&(i&&(i+=" "),i+=t)}i.length||(i=null),r.attr("class",i)}})),sE(e,t)},iE=go.each,lE=go.trim,cE=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],dE={ftp:21,http:80,https:443,mailto:25},mE=["img","video"],uE=(e,t)=>T(e)?!e:!T(t)||!Y(mE,t),gE=e=>{try{return decodeURIComponent(e)}catch(t){return unescape(e)}},hE=(e,t,o)=>{const n=gE(t);return!e.allow_script_urls&&(!!/((java|vb)script|mhtml):/i.test(n)||!e.allow_html_data_urls&&(/^data:image\//i.test(n)?uE(e.allow_svg_data_urls,o)&&/^data:image\/svg\+xml/i.test(n):/^data:/i.test(n)))};class pE{constructor(e,t={}){this.path="",this.directory="",e=lE(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 pE(document.location.href).directory;if(""===(null===o||void 0===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 s=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);s&&iE(cE,((e,t)=>{let o=s[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="")}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=Wi.decode(e).replace(/[\s\u0000-\u001F]+/g,"");return!hE(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}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 pE(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 pE(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?dE[this.protocol]:null;if(t&&(this.port||t)==(e.port||t))return!0}return!1}toRelPath(e,t){let o,n,r=0,s="";const a=e.substring(0,e.lastIndexOf("/")).split("/"),i=t.split("/");if(a.length>=i.length)for(o=0,n=a.length;o<n;o++)if(o>=i.length||a[o]!==i[o]){r=o+1;break}if(a.length<i.length)for(o=0,n=i.length;o<n;o++)if(o>=a.length||a[o]!==i[o]){r=o+1;break}if(1===r)return t;for(o=0,n=a.length-(r-1);o<n;o++)s+="../";for(o=r-1,n=i.length;o<n;o++)s+=o!==r-1?"/"+i[o]:i[o];return s}toAbsPath(e,t){let o=0;const n=/\/$/.test(t)?"/":"",r=e.split("/"),s=t.split("/"),a=[];iE(r,(e=>{e&&a.push(e)}));const i=[];for(let d=s.length-1;d>=0;d--)0!==s[d].length&&"."!==s[d]&&(".."!==s[d]?o>0?o--:i.push(s[d]):o++);const l=a.length-o;let c;return c=l<=0?me(i).join("/"):a.slice(0,l).join("/")+"/"+me(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 fE=go.makeMap,bE=go.extend,vE={IN_PLACE:!0,ALLOW_UNKNOWN_PROTOCOLS:!0,ALLOWED_TAGS:["#comment","#cdata-section","body"],ALLOWED_ATTR:[]},yE=go.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),wE="data-mce-type",xE=(e,t)=>{const o={...vE};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},CE=(e,t)=>{const o=HT(),n=t.getSpecialElements(),r=e.validate;let s=0;return o.addHook("uponSanitizeElement",((o,a)=>{var i,l,c;o.nodeType===yo&&!e.allow_conditional_comments&&/^\[if/i.test(null!==(i=o.nodeValue)&&void 0!==i?i:"")&&(o.nodeValue=" "+o.nodeValue);const d=a.tagName;if(o.nodeType!==Co||"body"===d)return;const m=ln.fromDom(o),u=d.toLowerCase(),g=Po(m,wE),h=Ho(m,"data-mce-bogus");if(!g&&y(h))return void("all"===h?cr(m):dr(m));const p=t.getElementRule(u);if(!r||p){if(a.allowedTags[d]=!0,r&&p&&!g){if(Q(null!==(l=p.attributesForced)&&void 0!==l?l:[],(e=>{Bo(m,e.name,"{$uid}"===e.value?"mce_"+s++:e.value)})),Q(null!==(c=p.attributesDefault)&&void 0!==c?c:[],(e=>{Po(m,e.name)||Bo(m,e.name,"{$uid}"===e.value?"mce_"+s++:e.value)})),p.attributesRequired&&!X(p.attributesRequired,(e=>Po(m,e))))return void dr(m);if(p.removeEmptyAttrs&&Fo(m))return void dr(m);p.outputName&&p.outputName!==u&&Dc(m,p.outputName)}}else Re(n,u)?cr(m):dr(m)})),o.addHook("uponSanitizeAttribute",((o,n)=>{const s=o.tagName.toLowerCase(),{attrName:a,attrValue:i}=n;n.keepAttr=!r||t.isValid(s,a)||ct(a,"data-")||ct(a,"aria-"),a in yE&&hE(e,i,s)&&(n.keepAttr=!1),n.keepAttr?(n.allowedAttributes[a]=!0,a in t.getBoolAttrs()&&(n.attrValue=a),e.allow_svg_data_urls&&ct(i,"data:image/svg+xml")&&(n.forceKeepAttr=!0)):!o.hasAttribute(wE)||"id"!==a&&"class"!==a&&"style"!==a||(n.forceKeepAttr=!0)})),o},SE=(e,t,o)=>{const n=e.name,r=n in o&&"title"!==n&&"textarea"!==n,s=t.childNodes;for(let a=0,i=s.length;a<i;a++){const t=s[a],n=new pw(t.nodeName.toLowerCase(),t.nodeType);if(Kr(t)){const e=t.attributes;for(let t=0,o=e.length;t<o;t++){const o=e[t];n.attr(o.name,o.value)}}else as(t)?(n.value=t.data,r&&(n.raw=!0)):(cs(t)||is(t)||ls(t))&&(n.value=t.data);SE(n,t,o),e.append(n)}},kE=(e,t,o)=>{const n=[];for(let r=e,s=r;r;s=r,r=r.walk()){const o=r;Q(t,(e=>e(o))),O(o.parent)&&o!==e?r=s:n.push(o)}for(let r=n.length-1;r>=0;r--){const e=n[r];Q(o,(t=>t(e)))}},_E=(e,t,o,n)=>{const r=o.validate,s=t.getNonEmptyElements(),a=t.getWhitespaceElements(),i=bE(fE("script,style,head,html,body,title,meta,param"),t.getBlockElements()),l=nl(t),c=/[ \t\r\n]+/g,d=/^[ \t\r\n]+/,m=/[ \t\r\n]+$/,u=e=>{let t=e.parent;while(T(t)){if(t.name in a)return!0;t=t.parent}return!1},g=e=>{let o=e;while(T(o)){if(o.name in l)return US(t,s,a,o);o=o.parent}return!1},h=e=>e.name in i&&!ui(t,e),p=(t,o)=>{const r=o?t.prev:t.next;return!T(r)&&!O(t.parent)&&(h(t.parent)&&(t.parent!==e||!0===n.isRootContent))},f=e=>{var t;if(3===e.type&&!u(e)){let o=null!==(t=e.value)&&void 0!==t?t:"";o=o.replace(c," "),(jS(e.prev,h)||p(e,!0))&&(o=o.replace(d,"")),0===o.length?e.remove():e.value=o}},b=e=>{var o;if(1===e.type){const o=t.getElementRule(e.name);if(r&&o){const r=US(t,s,a,e);o.paddInEmptyBlock&&r&&g(e)?zS(n,h,e):o.removeEmpty&&r?h(e)?e.remove():e.unwrap():o.paddEmpty&&(r||FS(e))&&zS(n,h,e)}}else if(3===e.type&&!u(e)){let t=null!==(o=e.value)&&void 0!==o?o:"";(e.next&&h(e.next)||p(e,!1))&&(t=t.replace(m,"")),0===t.length?e.remove():e.value=t}};return[f,b]},OE=(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},TE=(e={},t=al())=>{const o=PT(),n=PT(),r={validate:!0,root_name:"body",...e},s=new DOMParser,a=CE(r,t),i=(e,o,n="html")=>{const i="xhtml"===n?"application/xhtml+xml":"text/html",l=Re(t.getSpecialElements(),o.toLowerCase()),c=l?`<${o}>${e}</${o}>`:e,d="xhtml"===n?`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>${c}</body></html>`:`<body>${c}</body>`,m=s.parseFromString(d,i).body;return a.sanitize(m,xE(r,i)),a.removed=[],l?m.firstChild:m},l=o.addFilter,c=o.getFilters,d=o.removeFilter,m=n.addFilter,u=n.getFilters,g=n.removeFilter,h=(e,o)=>{GS(t,e)&&o.push(e)},p=(e,o)=>{const n=y(o.attr(wE)),r=1===o.type&&!Re(e,o.name)&&!mi(t,o);return 3===o.type||r&&!n},f=(e,o)=>{const n=bE(fE("script,style,head,html,body,title,meta,param"),t.getBlockElements()),s=/^[ \t\r\n]+/,a=/[ \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(s,"")),i=e.lastChild,i&&3===i.type&&(i.value=null===(o=i.value)||void 0===o?void 0:o.replace(a,"")))};if(t.isValidChild(e.name,o.toLowerCase())){while(i){const t=i.next;p(n,i)?(l||(l=new pw(o,1),l.attr(r.forced_root_block_attrs),e.insert(l,i)),l.append(i)):(c(l),l=null),i=t}c(l)}},b=(e,o={})=>{var n;const s=r.validate,a=null!==(n=o.context)&&void 0!==n?n:r.root_name,l=i(e,a,o.format);ri(t,l);const d=new pw(a,11);SE(d,l,t.getSpecialElements()),l.innerHTML="";const[m,g]=_E(d,t,r,o),p=[],b=s?e=>h(e,p):M,v={nodes:{},attributes:{}},y=e=>LS(c(),u(),e,v);if(kE(d,[m,y],[g,b]),p.reverse(),s&&p.length>0)if(o.context){const{pass:e,fail:n}=te(p,(e=>e.parent===d));WS(n,t,y),o.invalid=e.length>0}else WS(p,t,y);const w=OE(r,o);return w&&("body"===d.name||o.isRootContent)&&f(d,w),o.invalid||IS(v,o),d},v={schema:t,addAttributeFilter:m,getAttributeFilters:u,removeAttributeFilter:g,addNodeFilter:l,getNodeFilters:c,removeNodeFilter:d,parse:b};return aE(v,r),UT(v,r,t),v},EE=e=>Rk(e)?Aw({validate:!1}).serialize(e):e,DE=(e,t)=>{const o=EE(e),n=t(o);if(n.isDefaultPrevented())return n;if(Rk(e)){if(n.content!==o){const t=TE({validate:!1,forced_root_block:!1}).parse(n.content,{context:e.name});return{...n,content:t}}return{...n,content:e}}return n},AE=(e,t)=>{if(t.no_events)return tm.value(t);{const o=ob(e,t);return o.isDefaultPrevented()?tm.error(nb(e,{content:"",...o}).content):tm.value(o)}},ME=(e,t,o)=>{if(o.no_events)return t;{const n=DE(t,(t=>nb(e,{...o,content:t})));return n.content}},NE=(e,t)=>{if(t.no_events)return tm.value(t);{const o=DE(t.content,(o=>eb(e,{...t,content:o})));return o.isDefaultPrevented()?(tb(e,o),tm.error(void 0)):tm.value(o)}},RE=(e,t,o)=>{o.no_events||tb(e,{...o,content:t})},BE=(e,t,o)=>({element:e,width:t,rows:o}),LE=(e,t)=>({element:e,cells:t}),HE=(e,t)=>({x:e,y:t}),IE=(e,t)=>Io(e,t).bind(vt).getOr(1),PE=(e,t,o,n,r)=>{const s=IE(r,"rowspan"),a=IE(r,"colspan"),i=e.rows;for(let l=o;l<o+s;l++){i[l]||(i[l]=LE(Tc(n),[]));for(let e=t;e<t+a;e++){const n=i[l].cells;n[e]=l===o&&e===t?r:Oc(r)}}},zE=(e,t,o)=>{const n=e.rows,r=n[o]?n[o].cells:[];return!!r[t]},FE=(e,t,o)=>{while(zE(e,t,o))t++;return t},VE=e=>re(e,((e,t)=>t.cells.length>e?t.cells.length:e),0),ZE=(e,t)=>{const o=e.rows;for(let n=0;n<o.length;n++){const e=o[n].cells;for(let o=0;o<e.length;o++)if(hn(e[o],t))return j.some(HE(o,n))}return j.none()},UE=(e,t,o,n,r)=>{const s=[],a=e.rows;for(let i=o;i<=r;i++){const e=a[i].cells,o=t<n?e.slice(t,n+1):e.slice(n,t+1);s.push(LE(a[i].element,o))}return s},jE=(e,t,o)=>{const n=t.x,r=t.y,s=o.x,a=o.y,i=r<a?UE(e,n,r,s,a):UE(e,n,a,s,r);return BE(e.element,VE(i),i)},$E=(e,t)=>{const o=Oc(e.element),n=ln.fromTag("tbody");return ir(n,t),rr(o,n),o},WE=e=>J(e.rows,(e=>{const t=J(e.cells,(e=>{const t=Tc(e);return zo(t,"colspan"),zo(t,"rowspan"),t})),o=Oc(e.element);return ir(o,t),o})),qE=e=>{const t=BE(Oc(e),0,[]);return Q(ks(e,"tr"),((e,o)=>{Q(ks(e,"td,th"),((n,r)=>{PE(t,FE(t,r,o),o,e,n)}))})),BE(t.element,VE(t.rows),t.rows)},GE=e=>$E(e,WE(e)),KE=(e,t,o)=>ZE(e,t).bind((t=>ZE(e,o).map((o=>jE(e,t,o))))),YE=e=>ae(e,(e=>"ul"===ko(e)||"ol"===ko(e))),XE=(e,t)=>ae(e,(e=>"li"===ko(e)&&Ap(e,t))).fold(B([]),(t=>YE(e).map((e=>{const t=ln.fromTag(ko(e)),o=De(Jn(e),((e,t)=>ct(t,"list-style")));return Gn(t,o),[ln.fromTag("li"),t]})).getOr([]))),JE=(e,t)=>{const o=re(t,((e,t)=>(rr(t,e),t)),e);return t.length>0?Qb([o]):o},QE=e=>$s(e)?wn(e).filter(js).fold(B([]),(t=>[e,t])):js(e)?[e]:[],eD=(e,t)=>{const o=ln.fromDom(t.commonAncestorContainer),n=ox(o,e),r=oe(n,Ys),s=XE(n,t),a=r.concat(s.length?s:QE(o));return J(a,Oc)},tD=()=>Qb([]),oD=(e,t)=>JE(ln.fromDom(t.cloneContents()),eD(e,t)),nD=(e,t)=>Zr(t,"table",I(hn,e)),rD=(e,t)=>nD(e,t[0]).bind((e=>{const o=t[0],n=t[t.length-1],r=qE(e);return KE(r,o,n).map((e=>Qb([GE(e)])))})).getOrThunk(tD),sD=(e,t)=>t.length>0&&t[0].collapsed?tD():oD(e,t[0]),aD=(e,t)=>{const o=Sp(t,e);return o.length>0?rD(e,o):sD(e,t)},iD=(e,t)=>t>=0&&t<e.length&&ip(e.charAt(t)),lD=e=>ra(e.innerText),cD=e=>e.map((e=>e.nodeName)).getOr("div").toLowerCase(),dD=e=>j.from(e.selection.getRng()).map((t=>{var o;const n=j.from(e.dom.getParent(t.commonAncestorContainer,e.dom.isBlock)),r=e.getBody(),s=cD(n),a=ln.fromDom(t.cloneContents());Cw(a),Sw(a);const i=e.dom.add(r,s,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},a.dom),l=lD(i),c=ra(null!==(o=i.textContent)&&void 0!==o?o:"");if(e.dom.remove(i),iD(c,0)||iD(c,c.length-1)){const e=n.getOr(r),t=lD(e),o=t.indexOf(l);if(-1===o)return l;{const e=iD(t,o-1),n=iD(t,o+l.length);return(e?" ":"")+l+(n?" ":"")}}return l})).getOr(""),mD=(e,t)=>{const o=e.selection.getRng(),n=e.dom.create("body"),r=e.selection.getSel(),s=Jy(e,vp(r)),a=t.contextual?aD(ln.fromDom(e.getBody()),s).dom:o.cloneContents();return a&&n.appendChild(a),e.selection.serializer.serialize(n,t)},uD=(e,t)=>{if("text"===t.format)return dD(e);{const o=mD(e,t);return"tree"===t.format?o:e.selection.isCollapsed()?"":o}},gD=(e,t)=>({...e,format:t,get:!0,selection:!0,getInner:!0}),hD=(e,t,o={})=>{const n=gD(o,t);return AE(e,n).fold(L,(t=>{const o=uD(e,t);return ME(e,o,t)}))},pD=0,fD=1,bD=2,vD=(e,t)=>{const o=e.length+t.length+2,n=new Array(o),r=new Array(o),s=(e,t,o)=>({start:e,end:t,diag:o}),a=(o,n,r,s,i)=>{const c=l(o,n,r,s);if(null===c||c.start===n&&c.diag===n-s||c.end===o&&c.diag===o-r){let a=o,l=r;while(a<n||l<s)a<n&&l<s&&e[a]===t[l]?(i.push([pD,e[a]]),++a,++l):n-o>s-r?(i.push([bD,e[a]]),++a):(i.push([fD,t[l]]),++l)}else{a(o,c.start,r,c.start-c.diag,i);for(let t=c.start;t<c.end;++t)i.push([pD,e[t]]);a(c.end,n,c.end-c.diag,s,i)}},i=(o,n,r,a)=>{let i=o;while(i-n<a&&i<r&&e[i]===t[i-n])++i;return s(o,i,n)},l=(o,s,a,l)=>{const c=s-o,d=l-a;if(0===c||0===d)return null;const m=c-d,u=d+c,g=(u%2===0?u:u+1)/2;let h,p,f,b,v;for(n[1+g]=o,r[1+g]=s+1,h=0;h<=g;++h){for(p=-h;p<=h;p+=2){f=p+g,p===-h||p!==h&&n[f-1]<n[f+1]?n[f]=n[f+1]:n[f]=n[f-1]+1,b=n[f],v=b-o+a-p;while(b<s&&v<l&&e[b]===t[v])n[f]=++b,++v;if(m%2!==0&&m-h<=p&&p<=m+h&&r[f-m]<=n[f])return i(r[f-m],p+o-a,s,l)}for(p=m-h;p<=m+h;p+=2){f=p+g-m,p===m-h||p!==m+h&&r[f+1]<=r[f-1]?r[f]=r[f+1]-1:r[f]=r[f-1],b=r[f]-1,v=b-o+a-p;while(b>=o&&v>=a&&e[b]===t[v])r[f]=b--,v--;if(m%2===0&&-h<=p&&p<=h&&r[f]<=n[f+m])return i(r[f],p+o-a,s,l)}}return null},c=[];return a(0,e.length,0,t.length,c),c},yD=e=>Kr(e)?e.outerHTML:as(e)?Wi.encodeRaw(e.data,!1):cs(e)?"\x3c!--"+e.data+"--\x3e":"",wD=e=>{let t;const o=document.createElement("div"),n=document.createDocumentFragment();e&&(o.innerHTML=e);while(t=o.firstChild)n.appendChild(t);return n},xD=(e,t,o)=>{const n=wD(t);if(e.hasChildNodes()&&o<e.childNodes.length){const t=e.childNodes[o];e.insertBefore(n,t)}else e.appendChild(n)},CD=(e,t)=>{if(e.hasChildNodes()&&t<e.childNodes.length){const o=e.childNodes[t];e.removeChild(o)}},SD=(e,t)=>{let o=0;Q(e,(e=>{e[0]===pD?o++:e[0]===fD?(xD(t,e[1],o),o++):e[0]===bD&&CD(t,o)}))},kD=e=>oe(J(ve(e.childNodes),yD),(e=>e.length>0)),_D=(e,t)=>{const o=J(ve(t.childNodes),yD);return SD(vD(o,e),t),t},OD=qe((()=>document.implementation.createHTMLDocument("undo"))),TD=e=>-1!==e.indexOf("</iframe>"),ED=e=>({type:"fragmented",fragments:e,content:"",bookmark:null,beforeBookmark:null}),DD=e=>({type:"complete",fragments:null,content:e,bookmark:null,beforeBookmark:null}),AD=e=>{const t=kD(e.getBody()),o=ce(t,(t=>{const o=ww(e.serializer,t);return o.length>0?[o]:[]})),n=o.join("");return TD(n)?ED(o):DD(n)},MD=(e,t,o)=>{const n=o?t.beforeBookmark:t.bookmark;"fragmented"===t.type?_D(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw",no_selection:!T(n)||!Vh(n)||!n.isFakeCaret}),n&&(e.selection.moveToBookmark(n),e.selection.scrollIntoView())},ND=e=>"fragmented"===e.type?e.fragments.join(""):e.content,RD=e=>{const t=ln.fromTag("body",OD());return hr(t,ND(e)),Q(ks(t,"*[data-mce-bogus]"),dr),gr(t)},BD=(e,t)=>ND(e)===ND(t),LD=(e,t)=>RD(e)===RD(t),HD=(e,t)=>!(!e||!t)&&(!!BD(e,t)||LD(e,t)),ID=e=>0===e.get(),PD=(e,t,o)=>{ID(o)&&(e.typing=t)},zD=(e,t)=>{e.typing&&(PD(e,!1,t),e.add())},FD=e=>{e.typing&&(e.typing=!1,e.add())},VD=(e,t,o)=>{ID(t)&&o.set(Xd(e.selection))},ZD=(e,t,o,n,r,s,a)=>{const i=AD(e),l=go.extend(s||{},i);if(!ID(n)||e.removed)return null;const c=t.data[o.get()];if(e.dispatch("BeforeAddUndo",{level:l,lastLevel:c,originalEvent:a}).isDefaultPrevented())return null;if(c&&HD(c,l))return null;t.data[o.get()]&&r.get().each((e=>{t.data[o.get()].beforeBookmark=e}));const d=Cu(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=Xd(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:a};return o.get()>0?(e.setDirty(!0),e.dispatch("AddUndo",m),e.dispatch("change",m)):e.dispatch("AddUndo",m),l},UD=(e,t,o)=>{t.data=[],o.set(0),t.typing=!1,e.dispatch("ClearUndos")},jD=(e,t,o,n,r)=>{if(t.transact(n)){const n=t.data[o.get()].bookmark,s=t.data[o.get()-1];MD(e,s,!0),t.transact(r)&&(t.data[o.get()-1].beforeBookmark=n)}},$D=(e,t,o)=>{let n;return t.get()<o.length-1&&(t.set(t.get()+1),n=o[t.get()],MD(e,n,!1),e.setDirty(!0),e.dispatch("Redo",{level:n})),n},WD=(e,t,o,n)=>{let r;return t.typing&&(t.add(),t.typing=!1,PD(t,!1,o)),n.get()>0&&(n.set(n.get()-1),r=t.data[n.get()],MD(e,r,!0),e.setDirty(!0),e.dispatch("Undo",{level:r})),r},qD=e=>{e.clear(),e.add()},GD=(e,t,o)=>o.get()>0||t.typing&&t.data[0]&&!HD(AD(e),t.data[0]),KD=(e,t)=>t.get()<e.data.length-1&&!e.typing,YD=(e,t,o)=>(zD(e,t),e.beforeChange(),e.ignore(o),e.add()),XD=(e,t)=>{try{e.set(e.get()+1),t()}finally{e.set(e.get()-1)}},JD=(e,t)=>{const o=e.dom,n=T(t)?t:e.getBody();Q(o.select("table,a",n),(t=>{switch(t.nodeName){case"TABLE":const n=Au(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=Mu(e);n&&e.hasVisual?o.addClass(t,r):o.removeClass(t,r)}break}})),e.dispatch("VisualAid",{element:t,hasVisual:e.hasVisual})},QD=e=>({init:{bindEvents:M},undoManager:{beforeChange:(t,o)=>VD(e,t,o),add:(t,o,n,r,s,a)=>ZD(e,t,o,n,r,s,a),undo:(t,o,n)=>WD(e,t,o,n),redo:(t,o)=>$D(e,t,o),clear:(t,o)=>UD(e,t,o),reset:e=>qD(e),hasUndo:(t,o)=>GD(e,t,o),hasRedo:(e,t)=>KD(e,t),transact:(e,t,o)=>YD(e,t,o),ignore:(e,t)=>XD(e,t),extra:(t,o,n,r)=>jD(e,t,o,n,r)},formatter:{match:(t,o,n,r)=>Kk(e,t,o,n,r),matchAll:(t,o)=>Yk(e,t,o),matchNode:(t,o,n,r)=>Gk(e,t,o,n,r),canApply:t=>Jk(e,t),closest:t=>Xk(e,t),apply:(t,o,n)=>xO(e,t,o,n),remove:(t,o,n,r)=>mO(e,t,o,n,r),toggle:(t,o,n)=>MO(e,t,o,n),formatChanged:(t,o,n,r,s)=>AO(e,t,o,n,r,s)},editor:{getContent:t=>Tw(e,t),setContent:(t,o)=>Pk(e,t,o),insertContent:(t,o)=>Nk(e,t,o),addVisual:t=>JD(e,t)},selection:{getContent:(t,o)=>hD(e,t,o)},autocompleter:{addDecoration:t=>iw(e,t),removeDecoration:()=>dw(e,ln.fromDom(e.getBody()))},raw:{getModel:()=>j.none()}}),eA=e=>{const t=e=>w(e)?e:{},{init:o,undoManager:n,formatter:r,editor:s,selection:a,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,s)=>r.match(e,t(o),s),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,s)=>r.remove(e,t(o)),toggle:(e,o,n)=>r.toggle(e,t(o)),formatChanged:(e,t,o,n,s)=>r.formatChanged(t,o,n,s)},editor:{getContent:e=>s.getContent(e),setContent:(e,t)=>({content:s.setContent(e,t),html:""}),insertContent:(e,t)=>(s.insertContent(e),""),addVisual:s.addVisual},selection:{getContent:(e,t)=>a.getContent(t)},autocompleter:{addDecoration:i.addDecoration,removeDecoration:i.removeDecoration},raw:{getModel:()=>j.some(l.getRawModel())}}},tA=()=>{const e=B(null),t=B("");return{init:{bindEvents:M},undoManager:{beforeChange:M,add:e,undo:e,redo:e,clear:M,reset:M,hasUndo:Z,hasRedo:Z,transact:e,ignore:M,extra:M},formatter:{match:Z,matchAll:B([]),matchNode:B(void 0),canApply:Z,closest:t,apply:M,remove:M,toggle:M,formatChanged:B({unbind:M})},editor:{getContent:t,setContent:B({content:"",html:""}),insertContent:B(""),addVisual:M},selection:{getContent:t},autocompleter:{addDecoration:M,removeDecoration:M},raw:{getModel:B(j.none())}}},oA=e=>Re(e.plugins,"rtc"),nA=e=>Ne(e.plugins,"rtc").bind((e=>j.from(e.setup))),rA=e=>{const t=e;return nA(e).fold((()=>(t.rtcInstance=QD(e),j.none())),(e=>(t.rtcInstance=tA(),j.some((()=>e().then((e=>(t.rtcInstance=eA(e),e.rtc.isRemote))))))))},sA=e=>e.rtcInstance?e.rtcInstance:QD(e),aA=e=>{const t=e.rtcInstance;if(t)return t;throw new Error("Failed to get RTC instance not yet initialized.")},iA=(e,t,o)=>{aA(e).undoManager.beforeChange(t,o)},lA=(e,t,o,n,r,s,a)=>aA(e).undoManager.add(t,o,n,r,s,a),cA=(e,t,o,n)=>aA(e).undoManager.undo(t,o,n),dA=(e,t,o)=>aA(e).undoManager.redo(t,o),mA=(e,t,o)=>{aA(e).undoManager.clear(t,o)},uA=(e,t)=>{aA(e).undoManager.reset(t)},gA=(e,t,o)=>aA(e).undoManager.hasUndo(t,o),hA=(e,t,o)=>aA(e).undoManager.hasRedo(t,o),pA=(e,t,o,n)=>aA(e).undoManager.transact(t,o,n),fA=(e,t,o)=>{aA(e).undoManager.ignore(t,o)},bA=(e,t,o,n,r)=>{aA(e).undoManager.extra(t,o,n,r)},vA=(e,t,o,n,r)=>aA(e).formatter.match(t,o,n,r),yA=(e,t,o)=>aA(e).formatter.matchAll(t,o),wA=(e,t,o,n,r)=>aA(e).formatter.matchNode(t,o,n,r),xA=(e,t)=>aA(e).formatter.canApply(t),CA=(e,t)=>aA(e).formatter.closest(t),SA=(e,t,o,n)=>{aA(e).formatter.apply(t,o,n)},kA=(e,t,o,n,r)=>{aA(e).formatter.remove(t,o,n,r)},_A=(e,t,o,n)=>{aA(e).formatter.toggle(t,o,n)},OA=(e,t,o,n,r,s)=>aA(e).formatter.formatChanged(t,o,n,r,s),TA=(e,t)=>sA(e).editor.getContent(t),EA=(e,t,o)=>sA(e).editor.setContent(t,o),DA=(e,t,o)=>sA(e).editor.insertContent(t,o),AA=(e,t,o)=>aA(e).selection.getContent(t,o),MA=(e,t)=>aA(e).editor.addVisual(t),NA=e=>aA(e).init.bindEvents(),RA=(e,t)=>aA(e).autocompleter.addDecoration(t),BA=e=>aA(e).autocompleter.removeDecoration(),LA=(e,t={})=>{const o=t.format?t.format:"html";return AA(e,o,t)},HA=e=>0===e.dom.length?(cr(e),j.none()):j.some(e),IA=(e,t)=>e.filter((e=>Pf.isBookmarkNode(e.dom))).bind(t?_n:kn),PA=(e,t,o,n)=>{const r=e.dom,s=t.dom,a=n?r.length:s.length;n?(qx(r,s,!1,!n),o.setStart(s,a)):(qx(s,r,!1,!n),o.setEnd(s,a))},zA=(e,t)=>{wn(e).each((o=>{const n=e.dom;t&&Mx(o,bd(n,0))?$x(n,0):!t&&Rx(o,bd(n,n.length))&&Wx(n,n.length)}))},FA=(e,t,o,n)=>{e.bind((e=>{const r=n?Wx:$x;return r(e.dom,n?e.dom.length:0),t.filter(Do).map((t=>PA(e,t,o,n)))})).orThunk((()=>{const e=IA(t,n).or(t).filter(Do);return e.map((e=>zA(e,n)))}))},VA=(e,t)=>{const o=j.from(t.firstChild).map(ln.fromDom),n=j.from(t.lastChild).map(ln.fromDom);e.deleteContents(),e.insertNode(t);const r=o.bind(kn).filter(Do).bind(HA),s=n.bind(_n).filter(Do).bind(HA);FA(r,o,e,!0),FA(s,n,e,!1),e.collapse(!1)},ZA=(e,t)=>({format:"html",...e,set:!0,selection:!0,content:t}),UA=(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()}:{},s=e.parser.parse(t.content,{forced_root_block:!1,...r,...t});return Aw({validate:!1},e.schema).serialize(s)}return t.content},jA=(e,t,o={})=>{const n=ZA(o,t);NE(e,n).each((t=>{const o=UA(e,t),n=e.selection.getRng();VA(n,n.createContextualFragment(o)),e.selection.setRng(n),Gv(e,n),RE(e,o,t)}))},$A=(e,t,o)=>{if(Re(e,t)){const n=oe(e[t],(e=>e!==o));0===n.length?delete e[t]:e[t]=n}};var WA=(e,t)=>{let o,n;const r=(t,o)=>ae(o,(o=>e.is(o,t))),s=t=>e.getParents(t,void 0,e.getRoot()),a=()=>{o={},n={},t.on("NodeChange",(e=>{const t=e.element,a=s(t),i={};Se(o,((e,t)=>{r(t,a).each((o=>{n[t]||(Q(e,(e=>{e(!0,{node:o,selector:t,parents:a})})),n[t]=e),i[t]=e}))})),Se(n,((e,o)=>{i[o]||(delete n[o],Q(e,(e=>{e(!1,{node:t,selector:o,parents:a})})))}))}))};return{selectorChangedWithUnbind:(e,i)=>(o||a(),o[e]||(o[e]=[]),o[e].push(i),r(e,s(t.selection.getStart())).each((()=>{n[e]=o[e]})),{unbind:()=>{$A(o,e,i),$A(n,e,i)}})}};const qA=e=>!(!e||!e.ownerDocument)&&pn(ln.fromDom(e.ownerDocument),ln.fromDom(e)),GA=e=>!!e&&(qA(e.startContainer)&&qA(e.endContainer)),KA=(e,t,o,n)=>{let r,s;const{selectorChangedWithUnbind:a}=WA(e,n),i=(t,o)=>{const r=e.createRng();T(t)&&T(o)?(r.setStart(t,o),r.setEnd(t,o),y(r),f(!1)):(Mp(e,r,n.getBody(),!0),y(r))},l=e=>LA(n,e),c=(e,t)=>jA(n,e,t),d=e=>Wy(n.getBody(),v(),e),m=e=>qy(n.getBody(),v(),e),u=(e,t)=>B.getBookmark(e,t),g=e=>B.moveToBookmark(e),h=(t,o)=>(Xy(e,t,o).each(y),t),p=()=>{const e=v(),t=b();return!(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},f=e=>{const t=v();t.collapse(!!e),y(t)},b=()=>t.getSelection?t.getSelection():t.document.selection,v=()=>{let o;const a=(e,t,o)=>{try{return t.compareBoundaryPoints(e,o)}catch(n){return-1}},i=t.document;if(T(n.bookmark)&&!Fy(n)){const e=dy(n);if(e.isSome())return e.map((e=>Jy(n,[e])[0])).getOr(i.createRange())}try{const e=b();e&&!Gr(e.anchorNode)&&(o=e.rangeCount>0?e.getRangeAt(0):i.createRange(),o=Jy(n,[o])[0])}catch(l){}if(o||(o=i.createRange()),ds(o.startContainer)&&o.collapsed){const t=e.getRoot();o.setStart(t,0),o.setEnd(t,0)}return r&&s&&(0===a(o.START_TO_START,o,r)&&0===a(o.END_TO_END,o,r)?o=s:(r=null,s=null)),o},y=(e,t)=>{if(!GA(e))return;const o=b(),a=n.dispatch("SetSelectionRange",{range:e,forward:t});if(e=a.range,o){s=e;try{o.removeAllRanges(),o.addRange(e)}catch(i){}!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?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})},w=t=>(c(e.getOuterHTML(t)),t),x=()=>Ky(n.getBody(),v()),C=(t,o)=>Yy(e,v(),t,o),S=()=>{const t=b(),o=null===t||void 0===t?void 0:t.anchorNode,n=null===t||void 0===t?void 0:t.focusNode;if(!t||!o||!n||Gr(o)||Gr(n))return!0;const r=e.createRng(),s=e.createRng();try{r.setStart(o,t.anchorOffset),r.collapse(!0),s.setStart(n,t.focusOffset),s.collapse(!0)}catch(a){return!0}return r.compareBoundaryPoints(r.START_TO_START,s)<=0},k=()=>{const t=v(),o=b();if(!wp(o)&&Np(n)){const o=gv(e,t);return o.each((e=>{y(e,S())})),o.getOr(t)}return t},_=(e,t)=>(a(e,t),R),O=()=>{let t,o=e.getRoot();while(o&&"BODY"!==o.nodeName){if(o.scrollHeight>o.clientHeight){t=o;break}o=o.parentNode}return t},E=(e,t)=>{T(e)?qv(n,e,t):Gv(n,v(),t)},D=(e,t)=>y(ov(e,t,n.getDoc())),A=()=>{const e=v();return e.collapsed?bd.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},M=()=>{t=r=s=null,L.destroy()},N=(t={type:"word"})=>y(fv(e).expand(v(),t)),R={dom:e,win:t,serializer:o,editor:n,expand:N,collapse:f,setCursorLocation:i,getContent:l,setContent:c,getBookmark:u,moveToBookmark:g,select:h,isCollapsed:p,isForward:S,setNode:w,getNode:x,getSel:b,setRng:y,getRng:v,getStart:d,getEnd:m,getSelectedBlocks:C,normalize:k,selectorChanged:_,selectorChangedWithUnbind:a,getScrollContainer:O,scrollIntoView:E,placeCaretAt:D,getBoundingClientRect:A,destroy:M},B=Pf(R),L=bb(R,n);return R.bookmarkManager=B,R.controlSelection=L,R},YA=(e,t,o)=>{e.addAttributeFilter("data-mce-tabindex",((e,t)=>{let o=e.length;while(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,s=t.url_converter,a=t.url_converter_scope;let i=e.length;while(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):s&&(l=s.call(a,l,n,t.name)),t.attr(n,l.length>0?l:null))}})),e.addAttributeFilter("class",(e=>{let t=e.length;while(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;while(n--){const t=e[n];if("bookmark"===t.attr("data-mce-type")&&!o.cleanup){const e=j.from(t.firstChild).exists((e=>{var t;return!na(null!==(t=e.value)&&void 0!==t?t:"")}));e?t.unwrap():t.remove()}}})),e.addNodeFilter("noscript",(e=>{var t;let o=e.length;while(o--){const n=e[o].firstChild;n&&(n.value=Wi.decode(null!==(t=n.value)&&void 0!==t?t:""))}})),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 s=e.length;while(s--){const a=e[s],i=a.firstChild,l=null!==(n=null===i||void 0===i?void 0:i.value)&&void 0!==n?n:"";if("script"===o){const e=a.attr("type");e&&a.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;while(n--){const r=e[n],s=r.value;t.preserve_cdata&&0===(null===s||void 0===s?void 0:s.indexOf("[CDATA["))?(r.name="#cdata",r.type=4,r.value=o.decode(s.replace(/^\[CDATA\[|\]\]$/g,""))):0===(null===s||void 0===s?void 0:s.indexOf("mce:protected "))&&(r.name="#text",r.type=3,r.raw=!0,r.value=unescape(s).substr(14))}})),e.addNodeFilter("xml:namespace,input",((e,t)=>{let o=e.length;while(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;while(o--)e[o].attr(t,null)}))},XA=e=>{const t=e=>"br"===(null===e||void 0===e?void 0:e.name),o=e.lastChild;if(t(o)){const e=o.prev;t(e)&&(o.remove(),e.remove())}},JA=(e,t,o)=>{let n;const r=e.dom;let s=t.cloneNode(!0);const a=document.implementation;if(a.createHTMLDocument){const e=a.createHTMLDocument("");go.each("BODY"===s.nodeName?s.childNodes:[s],(t=>{e.body.appendChild(e.importNode(t,!0))})),s="BODY"!==s.nodeName?e.body.firstChild:e.body,n=r.doc,r.doc=e}return Ff(e,{...o,node:s}),n&&(r.doc=n),s},QA=(e,t)=>T(e)&&e.hasEventListeners("PreProcess")&&!t.no_events,eM=(e,t,o)=>QA(e,o)?JA(e,t,o):t,tM=(e,t,o)=>{-1===go.inArray(t,o)&&(e.addAttributeFilter(o,((e,t)=>{let o=e.length;while(o--)e[o].attr(t,null)})),t.push(o))},oM=(e,t,o)=>{if(!t.no_events&&e){const n=Vf(e,{...t,content:o});return n.content}return o},nM=(e,t,o)=>{const n=ra(o.getInner?t.innerHTML:e.getOuterHTML(t));return o.selection||Gs(ln.fromDom(t))?n:go.trim(n)},rM=(e,t,o)=>{const n=o.selection?{forced_root_block:!1,...o}:o,r=e.parse(t,n);return XA(r),r},sM=(e,t,o)=>{const n=Aw(e,t);return n.serialize(o)},aM=(e,t,o,n,r)=>{const s=sM(t,o,n);return oM(e,r,s)},iM=(e,t)=>{const o=["data-mce-selected"],n=t&&t.dom?t.dom:Rl.DOM,r=t&&t.schema?t.schema:al(e);e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs=!("remove_trailing_brs"in e)||e.remove_trailing_brs;const s=TE(e,r);YA(s,e,n);const a=(o,a={})=>{const i={format:"html",...a},l=eM(t,o,i),c=nM(n,l,i),d=rM(s,c,i);return"tree"===i.format?d:aM(t,e,r,d,i)};return{schema:r,addNodeFilter:s.addNodeFilter,addAttributeFilter:s.addAttributeFilter,serialize:a,addRules:r.addValidElements,setRules:r.setValidElements,addTempAttr:I(tM,s,o),getTempAttrs:B(o),getNodeFilters:s.getNodeFilters,getAttributeFilters:s.getAttributeFilters,removeNodeFilter:s.removeNodeFilter,removeAttributeFilter:s.removeAttributeFilter}},lM=(e,t)=>{const o=iM(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}},cM="html",dM=(e,t)=>({...e,format:t,get:!0,getInner:!0}),mM=(e,t={})=>{const o=t.format?t.format:cM,n=dM(t,o);return AE(e,n).fold(L,(t=>{const o=TA(e,t);return ME(e,o,t)}))},uM="html",gM=(e,t)=>({format:uM,...e,set:!0,content:t}),hM=(e,t,o={})=>{const n=gM(o,t);return NE(e,n).map((t=>{const o=EA(e,t.content,t);return RE(e,o.html,t),o.content})).getOr(t)},pM="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".split(","),fM="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor".split(","),bM=e=>{const t=oe(pM,(t=>Re(e,t))),o=e.forced_root_block;return!1!==o&&""!==o||t.push("forced_root_block (false only)"),he(t)},vM=e=>{const t=go.makeMap(e.plugins," "),o=e=>Re(t,e),n=oe(fM,o);return he(n)},yM=(e,t)=>{const o=bM(e),n=vM(t),r=n.length>0,s=o.length>0,a="mobile"===t.theme;if(r||s||a){const e="\n- ",t=a?`\n\nThemes:${e}mobile`:"",i=r?`\n\nPlugins:${e}${n.join(e)}`:"",l=s?`\n\nOptions:${e}${o.join(e)}`:"";console.warn("The following deprecated features are currently enabled and have been removed in TinyMCE 6.0. These features will no longer work and should be removed from the TinyMCE configuration. See https://www.tiny.cloud/docs/tinymce/6/migration-from-5x/ for more information."+t+i+l)}},wM=(e,t)=>{yM(e,t)},xM=Rl.DOM,CM=e=>{xM.setStyle(e.id,"display",e.orgDisplay)},SM=e=>j.from(e).each((e=>e.destroy())),kM=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}},_M=e=>{const t=e.formElement;t&&(t._mceOldSubmit&&(t.submit=t._mceOldSubmit,delete t._mceOldSubmit),xM.unbind(t,"submit reset",e.formEventDelegate))},OM=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&&T(null===r||void 0===r?void 0:r.nextSibling)&&xM.remove(r.nextSibling),Zf(e),e.editorManager.remove(e),!e.inline&&n&&CM(e),Uf(e),xM.remove(e.getContainer()),SM(t),SM(o),e.destroy()}},TM=(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(),SM(o),SM(n)),_M(e),kM(e),e.destroyed=!0):e.remove())},EM=()=>{const e={},t=(t,o)=>{e[t]=o},o=t=>e[t]?e[t]:{icons:{}},n=t=>Re(e,t);return{add:t,get:o,has:n}},DM=EM(),AM=ec.ModelManager,MM=(e,t)=>{const o=t.dom;return o[e]},NM=(e,t)=>parseInt(Kn(t,e),10),RM=I(MM,"clientWidth"),BM=I(MM,"clientHeight"),LM=I(NM,"margin-top"),HM=I(NM,"margin-left"),IM=e=>e.dom.getBoundingClientRect(),PM=(e,t,o)=>{const n=RM(e),r=BM(e);return t>=0&&o>=0&&t<=n&&o<=r},zM=(e,t,o,n)=>{const r=IM(t),s=e?r.left+t.dom.clientLeft+HM(t):0,a=e?r.top+t.dom.clientTop+LM(t):0,i=o-s,l=n-a;return{x:i,y:l}},FM=(e,t,o)=>{const n=ln.fromDom(e.getBody()),r=e.inline?n:vn(n),s=zM(e.inline,r,t,o);return PM(r,s.x,s.y)},VM=e=>j.from(e).map(ln.fromDom),ZM=e=>{const t=e.inline?e.getBody():e.getContentAreaContainer();return VM(t).map(jn).getOr(!1)};var UM=()=>{const e=()=>{throw new Error("Theme did not provide a NotificationManager implementation.")};return{open:e,close:e,getArgs:e}};const jM=e=>{const t=[],o=()=>{const t=e.theme;return t&&t.getNotificationManagerImpl?t.getNotificationManagerImpl():UM()},n=()=>j.from(t[0]),r=(e,t)=>e.type===t.type&&e.text===t.text&&!e.progressBar&&!e.timeout&&!t.progressBar&&!t.timeout,s=()=>{Q(t,(e=>{e.reposition()}))},a=e=>{t.push(e)},i=e=>{ie(t,(t=>t===e)).each((e=>{t.splice(e,1)}))},l=(l,c=!0)=>e.removed||!ZM(e)?{}:(c&&e.dispatch("BeforeOpenNotification",{notification:l}),ae(t,(e=>r(o().getArgs(e),l))).getOrThunk((()=>{e.editorManager.setActive(e);const t=o().open(l,(()=>{i(t),s(),n().fold((()=>e.focus()),(e=>Kv(ln.fromDom(e.getEl()))))}));return a(t),s(),e.dispatch("OpenNotification",{notification:{...t}}),t}))),c=()=>{n().each((e=>{o().close(e),i(e),s()}))},d=B(t),m=e=>{e.on("SkinLoaded",(()=>{const t=au(e);t&&l({text:t,type:"warning",timeout:0},!1),s()})),e.on("show ResizeEditor ResizeWindow NodeChange",(()=>{requestAnimationFrame(s)})),e.on("remove",(()=>{Q(t.slice(),(e=>{o().close(e)}))}))};return m(e),{open:l,close:c,getNotifications:d}},$M=ec.PluginManager,WM=ec.ThemeManager;var qM=()=>{const e=()=>{throw new Error("Theme did not provide a WindowManager implementation.")};return{open:e,openUrl:e,alert:e,confirm:e,close:e}};const GM=e=>{let t=[];const o=()=>{const t=e.theme;return t&&t.getWindowManagerImpl?t.getWindowManagerImpl():qM()},n=(e,t)=>(...o)=>t?t.apply(e,o):void 0,r=t=>{e.dispatch("OpenWindow",{dialog:t})},s=t=>{e.dispatch("CloseWindow",{dialog:t})},a=e=>{t.push(e),r(e)},i=o=>{s(o),t=oe(t,(e=>e!==o)),0===t.length&&e.focus()},l=()=>j.from(t[t.length-1]),c=t=>{e.editorManager.setActive(e),cy(e),e.ui.show();const o=t();return a(o),o},d=(e,t)=>c((()=>o().open(e,t,i))),m=e=>c((()=>o().openUrl(e,i))),u=(e,t,r)=>{const s=o();s.alert(e,n(r||s,t))},g=(e,t,r)=>{const s=o();s.confirm(e,n(r||s,t))},h=()=>{l().each((e=>{o().close(e),i(e)}))};return e.on("remove",(()=>{Q(t,(e=>{o().close(e)}))})),{open:d,openUrl:m,alert:u,confirm:g,close:h}},KM=(e,t)=>{e.notificationManager.open({type:"error",text:t})},YM=(e,t)=>{e._skinLoaded?KM(e,t):e.on("SkinLoaded",(()=>{KM(e,t)}))},XM=(e,t)=>{YM(e,Ql.translate(["Failed to upload image: {0}",t]))},JM=(e,t,o)=>{Xf(e,t,{message:o}),console.error(o)},QM=(e,t,o)=>o?`Failed to load ${e}: ${o} from url ${t}`:`Failed to load ${e} url: ${t}`,eN=(e,t,o)=>{JM(e,"PluginLoadError",QM("plugin",t,o))},tN=(e,t,o)=>{JM(e,"IconsLoadError",QM("icons",t,o))},oN=(e,t,o)=>{JM(e,"LanguageLoadError",QM("language",t,o))},nN=(e,t,o)=>{JM(e,"ThemeLoadError",QM("theme",t,o))},rN=(e,t,o)=>{JM(e,"ModelLoadError",QM("model",t,o))},sN=(e,t,o)=>{const n=Ql.translate(["Failed to initialize plugin: {0}",t]);Xf(e,"PluginLoadError",{message:n}),aN(n,o),YM(e,n)},aN=(e,...t)=>{const o=window.console;o&&(o.error?o.error(e,...t):o.log(e,...t))},iN=e=>/^[a-z0-9\-]+$/i.test(e),lN=e=>dN(e,Xm(e)),cN=e=>dN(e,Qm(e)),dN=(e,t)=>{const o=e.editorManager.baseURL+"/skins/content",n=e.editorManager.suffix,r=`content${n}.css`;return J(t,(t=>iN(t)&&!e.inline?`${o}/${t}/${r}`:e.documentBaseURI.toAbsolute(t)))},mN=e=>{e.contentCSS=e.contentCSS.concat(lN(e),cN(e))},uN=U,gN=(e,t,o)=>wr(e,t,uN,o),hN=e=>e?ve(e.getElementsByTagName("img")):[],pN=(e,t)=>{const o={},n=(n,r=U)=>{const s=oe(hN(n),(t=>{const o=t.src;return!t.hasAttribute("data-mce-bogus")&&(!t.hasAttribute("data-mce-placeholder")&&(!(!o||o===to.transparentSrc)&&(ct(o,"blob:")?!e.isUploaded(o)&&r(t):!!ct(o,"data:")&&r(t))))})),a=J(s,(e=>{const n=e.src;if(Re(o,n))return o[n].then((t=>y(t)?t:{image:e,blobInfo:t.blobInfo}));{const r=oE(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(a)};return{findAll:n}},fN=()=>{const e=1,t=2;let o={};const n=(e,t)=>({status:e,resultUri:t}),r=e=>e in o,s=e=>{const t=o[e];return t?t.resultUri:null},a=t=>!!r(t)&&o[t].status===e,i=e=>!!r(e)&&o[e].status===t,l=t=>{o[t]=n(e,null)},c=(e,r)=>{o[e]=n(t,r)},d=e=>{delete o[e]},m=()=>{o={}};return{hasBlobUri:r,getResultUri:s,isPending:a,isUploaded:i,markPending:l,markUploaded:c,removeFailed:d,destroy:m}};let bN=0;const vN=()=>{const e=()=>Math.round(4294967295*Math.random()).toString(36),t=(new Date).getTime();return"s"+t.toString(36)+e()+e()+e()},yN=e=>e+bN+++vN(),wN=()=>{let e=[];const t=e=>{const t={"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"};return t[e.toLowerCase()]||"dat"},o=(e,t,o,r,s)=>{if(y(e)){const a=e;return n({id:a,name:r,filename:s,blob:t,base64:o})}if(w(e))return n(e);throw new Error("Unknown input type")},n=e=>{if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");const o=e.id||yN("blobid"),n=e.name||o,r=e.blob;return{id:B(o),name:B(n),filename:B(e.filename||n+"."+t(r.type)),blob:B(r),base64:B(e.base64),blobUri:B(e.blobUri||URL.createObjectURL(r)),uri:B(e.uri)}},r=t=>{a(t.id())||e.push(t)},s=t=>ae(e,t).getOrUndefined(),a=e=>s((t=>t.id()===e)),i=e=>s((t=>t.blobUri()===e)),l=(e,t)=>s((o=>o.base64()===e&&o.blob().type===t)),c=t=>{e=oe(e,(e=>e.blobUri()!==t||(URL.revokeObjectURL(e.blobUri()),!1)))},d=()=>{Q(e,(e=>{URL.revokeObjectURL(e.blobUri())})),e=[]};return{create:o,add:r,get:a,getByUri:i,getByData:l,findFirst:s,removeByUri:c,destroy:d}},xN=(e,t)=>{const o={},n=(e,t)=>e?e.replace(/\/$/,"")+"/"+t.replace(/^\//,""):t,r=(e,o)=>new Promise(((r,s)=>{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=()=>{s("Image upload failed due to a XHR Transport error. Code: "+a.status)},a.onload=()=>{if(a.status<200||a.status>=300)return void s("HTTP Error: "+a.status);const e=JSON.parse(a.responseText);e&&y(e.location)?r(n(t.basePath,e.location)):s("Invalid JSON: "+a.responseText)};const i=new FormData;i.append("file",e.blob(),e.filename()),a.send(i)})),s=E(t.handler)?t.handler:r,a=()=>new Promise((e=>{e([])})),i=(e,t)=>({url:t,blobInfo:e,status:!0}),l=(e,t)=>({url:"",blobInfo:e,status:!1,error:t}),c=(e,t)=>{go.each(o[e],(e=>{e(t)})),delete o[e]},d=(t,o,n)=>(e.markPending(t.blobUri()),new Promise((r=>{let s,a;try{const d=()=>{s&&(s.close(),a=M)},m=o=>{d(),e.markUploaded(t.blobUri(),o),c(t.blobUri(),i(t,o)),r(i(t,o))},u=o=>{d(),e.removeFailed(t.blobUri()),c(t.blobUri(),l(t,o)),r(l(t,o))};a=e=>{e<0||e>100||j.from(s).orThunk((()=>j.from(n).map(F))).each((t=>{s=t,t.progressBar.value(e)}))},o(t,a).then(m,(e=>{u(y(e)?{message:e}:e)}))}catch(d){r(l(t,d))}}))),m=e=>e===r,u=e=>{const t=e.blobUri();return new Promise((e=>{o[t]=o[t]||[],o[t].push(e)}))},g=(t,o)=>(t=go.grep(t,(t=>!e.isUploaded(t.blobUri()))),Promise.all(go.map(t,(t=>e.isPending(t.blobUri())?u(t):d(t,s,o))))),h=(e,o)=>!t.url&&m(s)?a():g(e,o);return{upload:h}},CN=e=>()=>e.notificationManager.open({text:e.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0}),SN=(e,t)=>xN(t,{url:Vm(e),basePath:Zm(e),credentials:Um(e),handler:jm(e)}),kN=e=>{const t=fN(),o=SN(e,t);return{upload:(t,n=!0)=>o.upload(t,n?CN(e):void 0)}},_N=e=>{const t=wN();let o,n;const r=fN(),s=[],a=t=>o=>e.selection?t(o):[],i=e=>e+(-1===e.indexOf("?")?"?":"&")+(new Date).getTime(),l=(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},c=(e,t,o)=>{const n=`src="${o}"${o===to.transparentSrc?' data-mce-placeholder="1"':""}`;return e=l(e,`src="${t}"`,n),e=l(e,'data-mce-src="'+t+'"','data-mce-src="'+o+'"'),e},d=(t,o)=>{Q(e.undoManager.data,(e=>{"fragmented"===e.type?e.fragments=J(e.fragments,(e=>c(e,t,o))):e.content=c(e.content,t,o)}))},m=(t,o)=>{const n=e.convertURL(o,"src");d(t.src,o),Lo(ln.fromDom(t),{src:Im(e)?i(o):o,"data-mce-src":n})},u=()=>(o||(o=SN(e,r)),f().then(a((n=>{const r=J(n,(e=>e.blobInfo));return o.upload(r,CN(e)).then(a((o=>{const r=[];let s=!1;const a=J(o,((o,a)=>{const{blobInfo:i,image:l}=n[a];let c=!1;return o.status&&Pm(e)?(o.url&&!lt(l.src,o.url)&&(s=!0),t.removeByUri(l.src),oA(e)||m(l,o.url)):o.error&&(o.error.remove&&(d(l.src,to.transparentSrc),r.push(l),c=!0),XM(e,o.error.message)),{element:l,status:o.status,uploadUri:o.url,blobInfo:i,removed:c}}));return r.length>0&&!oA(e)?e.undoManager.transact((()=>{Q(r,(o=>{e.dom.remove(o),t.removeByUri(o.src)}))})):s&&e.undoManager.dispatchChange(),a})))})))),g=()=>Hm(e)?u():Promise.resolve([]),h=e=>de(s,(t=>t(e))),p=e=>{s.push(e)},f=()=>(n||(n=pN(r,t)),n.findAll(e.getBody(),h).then(a((t=>{const o=oe(t,(t=>!y(t)||(YM(e,t),!1)));return oA(e)||Q(o,(e=>{d(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")})),o})))),b=()=>{t.destroy(),r.destroy(),n=o=null},v=o=>o.replace(/src="(blob:[^"]+)"/g,((o,n)=>{const s=r.getResultUri(n);if(s)return'src="'+s+'"';let a=t.getByUri(n);if(a||(a=re(e.editorManager.get(),((e,t)=>e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)),void 0)),a){const e=a.blob();return'src="data:'+e.type+";base64,"+a.base64()+'"'}return o}));return e.on("SetContent",(()=>{Hm(e)?g():f()})),e.on("RawSaveContent",(e=>{e.content=v(e.content)})),e.on("GetContent",(e=>{e.source_view||"raw"===e.format||"tree"===e.format||(e.content=v(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:p,uploadImages:u,uploadImagesAuto:g,scanForImages:f,destroy:b}},ON=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:"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:"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:"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"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:(e,t,o)=>Kr(e)&&e.hasAttribute("href"),onformat:(e,o,n)=>{go.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?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 go.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),(e=>{n[e]={block:e,remove:"all"}})),n},TN={remove_similar:!0,inherit:!1},EN={selector:"td,th",...TN},DN={tablecellbackgroundcolor:{styles:{backgroundColor:"%value"},...EN},tablecellverticalalign:{styles:{"vertical-align":"%value"},...EN},tablecellbordercolor:{styles:{borderColor:"%value"},...EN},tablecellclass:{classes:["%value"],...EN},tableclass:{selector:"table",classes:["%value"],...TN},tablecellborderstyle:{styles:{borderStyle:"%value"},...EN},tablecellborderwidth:{styles:{borderWidth:"%value"},...EN}},AN=B(DN),MN=e=>{const t={},o=e=>T(e)?t[e]:t,n=e=>Re(t,e),r=(e,o)=>{e&&(y(e)?(C(o)||(o=[o]),Q(o,(e=>{_(e.deep)&&(e.deep=!af(e)),_(e.split)&&(e.split=!af(e)||lf(e)),_(e.remove)&&af(e)&&!lf(e)&&(e.remove="none"),af(e)&&lf(e)&&(e.mixed=!0,e.block_expand=!0),y(e.classes)&&(e.classes=e.classes.split(/\s+/))})),t[e]=o):Se(e,((e,t)=>{r(t,e)})))},s=e=>(e&&t[e]&&delete t[e],t);return r(ON(e)),r(AN()),r(uu(e)),{get:o,has:n,register:r,unregister:s}},NN=go.each,RN=Rl.DOM,BN=e=>T(e)&&w(e),LN=(e,t)=>{const o=t&&t.schema||al({}),n=(e,t)=>{t.classes.length>0&&RN.addClass(e,t.classes.join(" ")),RN.setAttribs(e,t.attrs)},r=e=>{const t=y(e)?{name:e,classes:[],attrs:{}}:e,o=RN.create(t.name);return n(o,t),o},s=(e,t)=>{const n=o.getElementRule(e.nodeName.toLowerCase()),r=null===n||void 0===n?void 0:n.parentsRequired;return!(!r||!r.length)&&(t&&Y(r,t)?t:r[0])},a=(e,t,o)=>{let n;const i=t[0],l=BN(i)?i.name:void 0,c=s(e,l);if(c)l===c?(n=i,t=t.slice(1)):n=c;else if(i)n=i,t=t.slice(1);else if(!o)return e;const d=n?r(n):RN.create("div");d.appendChild(e),o&&go.each(o,(t=>{const o=r(t);d.insertBefore(o,e)}));const m=BN(n)?n.siblings:void 0;return a(d,t,m)},i=RN.create("div");if(e.length>0){const t=e[0],o=r(t),n=BN(t)?t.siblings:void 0;i.appendChild(a(o,e.slice(1),n))}return i},HN=e=>{e=go.trim(e);let t="div";const o={name:t,classes:[],attrs:{},selector:e};return"*"!==e&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,((e,t,n,r,s)=>{switch(t){case"#":o.attrs.id=n;break;case".":o.classes.push(n);break;case":":-1!==go.inArray("checked disabled enabled read-only required".split(" "),n)&&(o.attrs[n]=n);break}if("["===r){const e=s.match(/([\w\-]+)(?:\=\"([^\"]+))?/);e&&(o.attrs[e[1]]=e[2])}return""}))),o.name=t||"div",o},IN=e=>y(e)?(e=e.split(/\s*,\s*/)[0],e=e.replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),go.map(e.split(/(?:>|\s+(?![^\[\]]+\]))/),(e=>{const t=go.map(e.split(/(?:~\+|~|\+)/),HN),o=t.pop();return t.length&&(o.siblings=t),o})).reverse()):[],PN=(e,t)=>{let o="",n=gu(e);if(""===n)return"";const r=e=>y(e)?e.replace(/%(\w+)/g,""):"",s=(t,o)=>RN.getStyle(null!==o&&void 0!==o?o:e.getBody(),t,!0);if(y(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 a,i=t.block||t.inline||"span";const l=IN(t.selector);l.length>0?(l[0].name||(l[0].name=i),i=t.selector,a=LN(l,e)):a=LN([i],e);const c=RN.select(i,a)[0]||a.firstChild;NN(t.styles,((e,t)=>{const o=r(e);o&&RN.setStyle(c,t,o)})),NN(t.attributes,((e,t)=>{const o=r(e);o&&RN.setAttrib(c,t,o)})),NN(t.classes,(e=>{const t=r(e);RN.hasClass(c,t)||RN.addClass(c,t)})),e.dispatch("PreviewFormats"),RN.setStyles(a,{position:"absolute",left:-65535}),e.getBody().appendChild(a);const d=s("fontSize"),m=/px$/.test(d)?parseInt(d,10):0;return NN(n.split(" "),(e=>{let t=s(e,c);if(("background-color"!==e||!/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)||(t=s(e),"#ffffff"!==bp(t).toLowerCase()))&&("color"!==e||"#000000"!==bp(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===m)return;const e=parseFloat(t)/(/%$/.test(t)?100:1);t=e*m+"px"}"border"===e&&t&&(o+="padding:0 2px;"),o+=e+":"+t+";"}})),e.dispatch("AfterPreviewFormats"),RN.remove(a),o},zN=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"])},FN=e=>{const t=MN(e),o=Fl({});return zN(e),f_(e),oA(e)||SO(o,e),{get:t.get,has:t.has,register:t.register,unregister:t.unregister,apply:(t,o,n)=>{SA(e,t,o,n)},remove:(t,o,n,r)=>{kA(e,t,o,n,r)},toggle:(t,o,n)=>{_A(e,t,o,n)},match:(t,o,n,r)=>vA(e,t,o,n,r),closest:t=>CA(e,t),matchAll:(t,o)=>yA(e,t,o),matchNode:(t,o,n,r)=>wA(e,t,o,n,r),canApply:t=>xA(e,t),formatChanged:(t,n,r,s)=>OA(e,o,t,n,r,s),getCssText:I(PN,e)}},VN=e=>{switch(e.toLowerCase()){case"undo":case"redo":case"mcefocus":return!0;default:return!1}},ZN=(e,t,o)=>{const n=Fl(!1),r=e=>{PD(t,!1,o),t.add({},e)};e.on("init",(()=>{t.add()})),e.on("BeforeExecCommand",(e=>{const n=e.command;VN(n)||(zD(t,o),t.beforeChange())})),e.on("ExecCommand",(e=>{const t=e.command;VN(t)||r(e)})),e.on("ObjectResizeStart cut",(()=>{t.beforeChange()})),e.on("SaveContent ObjectResized blur",r),e.on("dragend",r),e.on("keyup",(o=>{const s=o.keyCode;o.isDefaultPrevented()||((s>=33&&s<=36||s>=37&&s<=40||45===s||o.ctrlKey)&&(r(),e.nodeChanged()),46!==s&&8!==s||e.nodeChanged(),n.get()&&t.typing&&!HD(AD(e),t.data[0])&&(e.isDirty()||e.setDirty(!0),e.dispatch("TypingUndo"),n.set(!1),e.nodeChanged()))})),e.on("keydown",(e=>{const s=e.keyCode;if(e.isDefaultPrevented())return;if(s>=33&&s<=36||s>=37&&s<=40||45===s)return void(t.typing&&r(e));const a=e.ctrlKey&&!e.altKey||e.metaKey;!(s<16||s>20)||224===s||91===s||t.typing||a||(t.beforeChange(),PD(t,!0,o),t.add({},e),n.set(!0))})),e.on("mousedown",(e=>{t.typing&&r(e)}));const s=e=>"insertReplacementText"===e.inputType,a=e=>"insertText"===e.inputType&&null===e.data,i=e=>"insertFromPaste"===e.inputType||"insertFromDrop"===e.inputType;e.on("input",(e=>{e.inputType&&(s(e)||a(e)||i(e))&&r(e)})),e.on("AddUndo Undo Redo ClearUndos",(t=>{t.isDefaultPrevented()||e.nodeChanged()}))},UN=e=>{e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo")},jN=e=>{const t=nc(),o=Fl(0),n=Fl(0),r={data:[],typing:!1,beforeChange:()=>{iA(e,o,t)},add:(s,a)=>lA(e,r,n,o,t,s,a),dispatchChange:()=>{e.setDirty(!0);const t=AD(e);t.bookmark=Xd(e.selection),e.dispatch("change",{level:t,lastLevel:pe(r.data,n.get()).getOrUndefined()})},undo:()=>cA(e,r,o,n),redo:()=>dA(e,n,r.data),clear:()=>{mA(e,r,n)},reset:()=>{uA(e,r)},hasUndo:()=>gA(e,r,n),hasRedo:()=>hA(e,r,n),transact:t=>pA(e,r,o,t),ignore:t=>{fA(e,o,t)},extra:(t,o)=>{bA(e,r,n,t,o)}};return oA(e)||ZN(e,r,o),UN(e),r},$N=[9,27,db.HOME,db.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,db.DOWN,db.UP,db.LEFT,db.RIGHT].concat(to.browser.isFirefox()?[224]:[]),WN="data-mce-placeholder",qN=e=>"keydown"===e.type||"keyup"===e.type,GN=e=>{const t=e.keyCode;return t===db.BACKSPACE||t===db.DELETE},KN=e=>{if(qN(e)){const t=e.keyCode;return!GN(e)&&(db.metaKeyPressed(e)||e.altKey||t>=112&&t<=123||Y($N,t))}return!1},YN=e=>qN(e)&&!(GN(e)||"keyup"===e.type&&229===e.keyCode),XN=(e,t,o)=>{if(Ka(ln.fromDom(t),!1)){const n=t.firstElementChild;return!n||!e.getStyle(t.firstElementChild,"padding-left")&&!e.getStyle(t.firstElementChild,"padding-right")&&o===n.nodeName.toLowerCase()}return!1},JN=e=>{var t;const o=e.dom,n=Dm(e),r=null!==(t=ru(e))&&void 0!==t?t:"",s=(t,a)=>{if(KN(t))return;const i=e.getBody(),l=!YN(t)&&XN(o,i,n),c=""!==o.getAttrib(i,WN);(c!==l||a)&&(o.setAttrib(i,WN,l?r:null),o.setAttrib(i,"aria-placeholder",l?r:null),Yf(e,l),e.on(l?"keydown":"keyup",s),e.off(l?"keyup":"keydown",s))};pt(r)&&e.on("init",(t=>{s(t,!0),e.on("change SetContent ExecCommand",s),e.on("paste",(t=>fy.setEditorTimeout(e,(()=>s(t)))))}))},QN=(e,t)=>({block:e,position:t}),eR=(e,t)=>({from:e,to:t}),tR=(e,t)=>{const o=ln.fromDom(e),n=ln.fromDom(t.container());return AC(o,n).map((e=>QN(e,t)))},oR=e=>!hn(e.from.block,e.to.block),nR=(e,t)=>{const o=t=>hn(t,e),n=e=>qs(e)||hs(e.dom);return Pr(t,n,o).filter(Eo).getOr(e)},rR=(e,t)=>{const o=ln.fromDom(e);return hn(nR(o,t.from.block),nR(o,t.to.block))},sR=e=>!1===ps(e.from.block.dom)&&!1===ps(e.to.block.dom),aR=e=>{const t=e=>Us(e)||ii(e.dom);return t(e.from.block)&&t(e.to.block)},iR=(e,t,o)=>us(o.position.getNode())&&!Ka(o.block)?Dh(!1,o.block.dom).bind((n=>n.isEqual(o.position)?Oh(t,e,n).bind((t=>tR(e,t))):j.some(o))).getOr(o):o,lR=(e,t,o)=>{const n=tR(e,bd.fromRangeStart(o)),r=n.bind((o=>Oh(t,e,o.position).bind((o=>tR(e,o).map((o=>iR(e,t,o)))))));return fo(n,r,eR).filter((t=>oR(t)&&rR(e,t)&&sR(t)&&aR(t)))},cR=(e,t,o)=>o.collapsed?lR(e,t,o):j.none(),dR=e=>{const t=En(e);return ie(t,zs).fold(B(t),(e=>t.slice(0,e)))},mR=e=>{const t=dR(e);return Q(t,cr),t},uR=(e,t)=>{const o=ox(t,e);return ae(o.reverse(),(e=>Ka(e))).each(cr)},gR=e=>0===oe(On(e),(e=>!Ka(e))).length,hR=(e,t,o,n)=>{if(Ka(o))return ea(o),Nh(o.dom);gR(n)&&Ka(t)&&tr(n,ln.fromTag("br"));const r=Mh(o.dom,bd.before(n.dom));return Q(mR(t),(e=>{tr(n,e)})),uR(e,t),r},pR=(e,t,o)=>{if(Ka(o))return cr(o),Ka(t)&&ea(t),Nh(t.dom);const n=Rh(o.dom);return Q(mR(t),(e=>{rr(o,e)})),uR(e,t),n},fR=(e,t)=>{const o=ox(t,e);return j.from(o[o.length-1])},bR=(e,t)=>pn(t,e)?fR(t,e):j.none(),vR=(e,t)=>{Dh(e,t.dom).bind((e=>j.from(e.getNode()))).map(ln.fromDom).filter(Zs).each(cr)},yR=(e,t,o)=>(vR(!0,t),vR(!1,o),bR(t,o).fold(I(pR,e,t,o),I(hR,e,t,o))),wR=(e,t,o,n)=>t?yR(e,n,o):yR(e,o,n),xR=(e,t)=>{const o=ln.fromDom(e.getBody()),n=cR(o.dom,t,e.selection.getRng()).map((n=>()=>{wR(o,t,n.from.block,n.to.block).each((t=>{e.selection.setRng(t.toRange())}))}));return n},CR=(e,t)=>{const o=t.getRng();return fo(AC(e,ln.fromDom(o.startContainer)),AC(e,ln.fromDom(o.endContainer)),((n,r)=>hn(n,r)?j.none():j.some((()=>{o.deleteContents(),wR(e,!0,n,r).each((e=>{t.setRng(e.toRange())}))})))).getOr(j.none())},SR=(e,t)=>{const o=ln.fromDom(t),n=I(hn,e);return Ir(o,qs,n).isSome()},kR=(e,t)=>SR(e,t.startContainer)||SR(e,t.endContainer),_R=(e,t)=>{const o=Mh(e.dom,bd.fromRangeStart(t)).isNone(),n=Ah(e.dom,bd.fromRangeEnd(t)).isNone();return!kR(e,t)&&o&&n},OR=e=>j.some((()=>{e.setContent(""),e.selection.setCursorLocation()})),TR=e=>{const t=ln.fromDom(e.getBody()),o=e.selection.getRng();return _R(t,o)?OR(e):CR(t,e.selection)},ER=(e,t)=>e.selection.isCollapsed()?j.none():TR(e),DR=(e,t,o,n,r)=>j.from(t._selectionOverrides.showCaret(e,o,n,r)),AR=e=>{const t=e.ownerDocument.createRange();return t.selectNode(e),t},MR=(e,t)=>{const o=e.dispatch("BeforeObjectSelected",{target:t});return o.isDefaultPrevented()?j.none():j.some(AR(t))},NR=(e,t,o)=>{const n=Jg(1,e.getBody(),t),r=bd.fromRangeStart(n),s=r.getNode();if(Eg(s))return DR(1,e,s,!r.isAtEnd(),!1);const a=r.getNode(!0);if(Eg(a))return DR(1,e,a,!1,!1);const i=AS(e.dom.getRoot(),r.getNode());return Eg(i)?DR(1,e,i,!1,o):j.none()},RR=(e,t,o)=>t.collapsed?NR(e,t,o).getOr(t):t,BR=e=>Xw(e)||qw(e),LR=e=>Jw(e)||Gw(e),HR=(e,t)=>{as(t)&&0===t.data.length&&e.remove(t)},IR=(e,t,o,n,r,s)=>{DR(n,e,s.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)})),HR(e.dom,o)},PR=(e,t)=>{const o=e.selection.getRng();if(!as(o.commonAncestorContainer))return j.none();const n=t?sh.Forwards:sh.Backwards,r=vh(e.getBody()),s=I(nh,t?r.next:r.prev),a=t?BR:LR,i=eh(n,e.getBody(),o),l=s(i),c=l?xC(t,l):l;if(!c||!rh(i,c))return j.none();if(a(c))return j.some((()=>IR(e,o,i.getNode(),n,t,c)));const d=s(c);return d&&a(d)&&rh(c,d)?j.some((()=>IR(e,o,i.getNode(),n,t,d))):j.none()},zR=(e,t)=>PR(e,t),FR=(e,t)=>{const o=e.getBody();return t?Nh(o).filter(Xw):Rh(o).filter(Jw)},VR=e=>{const t=e.selection.getRng();return!t.collapsed&&(FR(e,!0).exists((e=>e.isEqual(bd.fromRangeStart(t))))||FR(e,!1).exists((e=>e.isEqual(bd.fromRangeEnd(t)))))},ZR=e=>T(e)&&(qs(ln.fromDom(e))||$s(ln.fromDom(e))),UR=nm.generate([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),jR=(e,t)=>{const o=t.getNode(!e),n=e?"after":"before";return Kr(o)&&o.getAttribute("data-mce-caret")===n},$R=(e,t,o,n)=>{const r=t=>Vs(ln.fromDom(t))&&!$g(o,n,e);return Qg(!t,o).fold((()=>Qg(t,n).fold(Z,r)),r)},WR=(e,t,o,n)=>{const r=n.getNode(!t);return AC(ln.fromDom(e),ln.fromDom(o.getNode())).map((e=>Ka(e)?UR.remove(e.dom):UR.moveToElement(r))).orThunk((()=>j.some(UR.moveToElement(r))))},qR=(e,t,o)=>Oh(t,e,o).bind((n=>ZR(n.getNode())||$R(e,t,o,n)?j.none():t&&ps(n.getNode())||!t&&ps(n.getNode(!0))?WR(e,t,o,n):t&&Jw(o)||!t&&Xw(o)?j.some(UR.moveToPosition(n)):j.none())),GR=(e,t)=>O(t)?j.none():e&&ps(t.nextSibling)?j.some(UR.moveToElement(t.nextSibling)):!e&&ps(t.previousSibling)?j.some(UR.moveToElement(t.previousSibling)):j.none(),KR=(e,t,o)=>o.fold((e=>j.some(UR.remove(e))),(e=>j.some(UR.moveToElement(e))),(o=>$g(t,o,e)?j.none():j.some(UR.moveToPosition(o)))),YR=(e,t,o)=>jR(t,o)?GR(t,o.getNode(!t)).orThunk((()=>qR(e,t,o))):qR(e,t,o).bind((t=>KR(e,o,t))),XR=(e,t,o)=>{const n=Jg(t?1:-1,e,o),r=bd.fromRangeStart(n),s=ln.fromDom(e);return!t&&Jw(r)?j.some(UR.remove(r.getNode(!0))):t&&Xw(r)?j.some(UR.remove(r.getNode())):!t&&Xw(r)&&hx(s,r)?px(s,r).map((e=>UR.remove(e.getNode()))):t&&Jw(r)&&gx(s,r)?fx(s,r).map((e=>UR.remove(e.getNode()))):YR(e,t,r)},JR=(e,t)=>o=>(e._selectionOverrides.hideFakeCaret(),uC(e,t,ln.fromDom(o)),!0),QR=(e,t)=>o=>{const n=t?bd.before(o):bd.after(o);return e.selection.setRng(n.toRange()),!0},eB=e=>t=>(e.selection.setRng(t.toRange()),!0),tB=(e,t)=>j.from(AS(e.getBody(),t)),oB=(e,t)=>{const o=e.selection.getNode();return tB(e,o).filter(ps).fold((()=>XR(e.getBody(),t,e.selection.getRng()).map((o=>()=>o.fold(JR(e,t),QR(e,t),eB(e))))),(()=>j.some(M)))},nB=e=>{Q(ks(e,".mce-offscreen-selection"),cr)},rB=(e,t)=>{const o=e.selection.getNode();if(ps(o)&&!fs(o)){const n=tB(e,o.parentNode).filter(ps);return n.fold((()=>j.some((()=>{nB(ln.fromDom(e.getBody())),uC(e,t,ln.fromDom(e.selection.getNode())),MC(e)}))),(()=>j.some(M)))}return VR(e)?j.some((()=>{BC(e,e.selection.getRng(),ln.fromDom(e.getBody()))})):j.none()},sB=e=>{const t=e.dom,o=e.selection,n=AS(e.getBody(),o.getNode());if(hs(n)&&t.isBlock(n)&&t.isEmpty(n)){const e=t.create("br",{"data-mce-bogus":"1"});t.setHTML(n,""),n.appendChild(e),o.setRng(bd.before(e).toRange())}return!0},aB=(e,t)=>e.selection.isCollapsed()?oB(e,t):rB(e,t),iB=(e,t)=>{const o=bd.fromRangeStart(e.selection.getRng());return Oh(t,e.getBody(),o).filter((e=>t?$w(e):Ww(e))).bind((e=>Wg(t?0:-1,e))).map((t=>()=>e.selection.select(t)))},lB=(e,t)=>e.selection.isCollapsed()?iB(e,t):j.none(),cB=as,dB=e=>cB(e)&&e.data[0]===oa,mB=e=>cB(e)&&e.data[e.data.length-1]===oa,uB=e=>{var t;const o=null!==(t=e.ownerDocument)&&void 0!==t?t:document;return o.createTextNode(oa)},gB=e=>{var t;if(cB(e.previousSibling))return mB(e.previousSibling)||e.previousSibling.appendData(oa),e.previousSibling;if(cB(e))return dB(e)||e.insertData(0,oa),e;{const o=uB(e);return null===(t=e.parentNode)||void 0===t||t.insertBefore(o,e),o}},hB=e=>{var t,o;if(cB(e.nextSibling))return dB(e.nextSibling)||e.nextSibling.insertData(0,oa),e.nextSibling;if(cB(e))return mB(e)||e.appendData(oa),e;{const n=uB(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}},pB=(e,t)=>e?gB(t):hB(t),fB=I(pB,!0),bB=I(pB,!1),vB=(e,t)=>as(e.container())?pB(t,e.container()):pB(t,e.getNode()),yB=(e,t)=>{const o=t.get();return o&&e.container()===o&&la(o)},wB=(e,t)=>t.fold((t=>{yg(e.get());const o=fB(t);return e.set(o),j.some(bd(o,o.length-1))}),(t=>Nh(t).map((t=>{if(yB(t,e)){const t=e.get();return bd(t,1)}{yg(e.get());const o=vB(t,!0);return e.set(o),bd(o,1)}}))),(t=>Rh(t).map((t=>{if(yB(t,e)){const t=e.get();return bd(t,t.length-1)}{yg(e.get());const o=vB(t,!1);return e.set(o),bd(o,o.length-1)}}))),(t=>{yg(e.get());const o=bB(t);return e.set(o),j.some(bd(o,1))})),xB=(e,t)=>{for(let o=0;o<e.length;o++){const n=e[o].apply(null,t);if(n.isSome())return n}return j.none()},CB=nm.generate([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),SB=(e,t)=>{const o=jg(t,e);return o||e},kB=(e,t,o)=>{const n=CC(o),r=SB(t,n.container());return vC(e,r,n).fold((()=>Ah(r,n).bind(I(vC,e,r)).map((e=>CB.before(e)))),j.none)},_B=(e,t)=>null===Hh(e,t),OB=(e,t,o)=>vC(e,t,o).filter(I(_B,t)),TB=(e,t,o)=>{const n=SC(o);return OB(e,t,n).bind((e=>{const t=Mh(e,n);return t.isNone()?j.some(CB.start(e)):j.none()}))},EB=(e,t,o)=>{const n=CC(o);return OB(e,t,n).bind((e=>{const t=Ah(e,n);return t.isNone()?j.some(CB.end(e)):j.none()}))},DB=(e,t,o)=>{const n=SC(o),r=SB(t,n.container());return vC(e,r,n).fold((()=>Mh(r,n).bind(I(vC,e,r)).map((e=>CB.after(e)))),j.none)},AB=e=>!fC(NB(e)),MB=(e,t,o)=>{const n=xB([kB,TB,EB,DB],[e,t,o]);return n.filter(AB)},NB=e=>e.fold(L,L,L,L),RB=e=>e.fold(B("before"),B("start"),B("end"),B("after")),BB=e=>e.fold(CB.before,CB.before,CB.after,CB.after),LB=e=>e.fold(CB.start,CB.start,CB.end,CB.end),HB=(e,t)=>RB(e)===RB(t)&&NB(e)===NB(t),IB=(e,t,o,n,r,s)=>fo(vC(t,o,n),vC(t,o,r),((t,n)=>t!==n&&yC(o,t,n)?CB.after(e?t:n):s)).getOr(s),PB=(e,t)=>e.fold(U,(e=>!HB(e,t))),zB=(e,t,o,n,r)=>{const s=xC(e,r),a=Oh(e,o,s).map(I(xC,e)),i=a.fold((()=>n.map(BB)),(r=>MB(t,o,r).map(I(IB,e,t,o,s,r)).filter(I(PB,n))));return i.filter(AB)},FB=(e,t)=>e?t.fold(N(j.some,CB.start),j.none,N(j.some,CB.after),j.none):t.fold(j.none,N(j.some,CB.before),j.none,N(j.some,CB.end)),VB=(e,t,o,n)=>{const r=xC(e,n),s=MB(t,o,r);return MB(t,o,r).bind(I(FB,e)).orThunk((()=>zB(e,t,o,s,n)))},ZB=e=>E(e.selection.getSel().modify),UB=(e,t,o)=>{const n=e?1:-1;return t.setRng(bd(o.container(),o.offset()+n).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0},jB=(e,t)=>{const o=t.selection.getRng(),n=e?bd.fromRangeEnd(o):bd.fromRangeStart(o);return!!ZB(t)&&(e&&ua(n)?UB(!0,t.selection,n):!(e||!ga(n))&&UB(!1,t.selection,n))};var $B;(function(e){e[e["Br"]=0]="Br",e[e["Block"]=1]="Block",e[e["Wrap"]=2]="Wrap",e[e["Eol"]=3]="Eol"})($B||($B={}));const WB=(e,t)=>e===sh.Backwards?me(t):t,qB=(e,t,o)=>e===sh.Forwards?t.next(o):t.prev(o),GB=(e,t,o,n)=>us(n.getNode(t===sh.Forwards))?$B.Br:!1===$g(o,n)?$B.Block:$B.Wrap,KB=(e,t,o,n)=>{const r=vh(o);let s=n;const a=[];while(s){const n=qB(t,r,s);if(!n)break;if(us(n.getNode(!1)))return t===sh.Forwards?{positions:WB(t,a).concat([n]),breakType:$B.Br,breakAt:j.some(n)}:{positions:WB(t,a),breakType:$B.Br,breakAt:j.some(n)};if(n.isVisible()){if(e(s,n)){const e=GB(o,t,s,n);return{positions:WB(t,a),breakType:e,breakAt:j.some(n)}}a.push(n),s=n}else s=n}return{positions:WB(t,a),breakType:$B.Eol,breakAt:j.none()}},YB=(e,t,o,n)=>t(o,n).breakAt.map((n=>{const r=t(o,n).positions;return e===sh.Backwards?r.concat(n):[n].concat(r)})).getOr([]),XB=(e,t)=>re(e,((e,o)=>e.fold((()=>j.some(o)),(n=>fo(fe(n.getClientRects()),fe(o.getClientRects()),((e,r)=>{const s=Math.abs(t-e.left),a=Math.abs(t-r.left);return a<=s?o:n})).or(e)))),j.none()),JB=(e,t)=>fe(t.getClientRects()).bind((t=>XB(e,t.left))),QB=I(KB,bd.isAbove,-1),eL=I(KB,bd.isBelow,1),tL=I(YB,-1,QB),oL=I(YB,1,eL),nL=(e,t)=>QB(e,t).breakAt.isNone(),rL=(e,t)=>eL(e,t).breakAt.isNone(),sL=e=>Nh(e).map((t=>[t].concat(eL(e,t).positions))).getOr([]),aL=e=>Rh(e).map((t=>QB(e,t).positions.concat(t))).getOr([]),iL=(e,t)=>JB(tL(e,t),t),lL=(e,t)=>JB(oL(e,t),t),cL=ps,dL=(e,t)=>Math.abs(e.left-t),mL=(e,t)=>Math.abs(e.right-t),uL=e=>Be(e,"node"),gL=(e,t)=>je(e,((e,o)=>{const n=Math.min(dL(e,t),mL(e,t)),r=Math.min(dL(o,t),mL(o,t));return r===n&&uL(o)&&cL(o.node)||r<n?o:e})),hL=e=>{const t=t=>J(t,(t=>{const o=Rc(t);return o.node=e,o}));if(Kr(e))return t(e.getClientRects());if(as(e)){const o=e.ownerDocument.createRange();return o.setStart(e,0),o.setEnd(e,e.data.length),t(o.getClientRects())}return[]},pL=e=>ce(e,hL);var fL;(function(e){e[e["Up"]=-1]="Up",e[e["Down"]=1]="Down"})(fL||(fL={}));const bL=(e,t,o,n)=>{let r=n;while(r=Zg(r,e,Ba,t))if(o(r))return},vL=(e,t,o,n,r,s)=>{let a=0;const i=[],l=n=>{let s=pL([n]);-1===e&&(s=s.reverse());for(let e=0;e<s.length;e++){const n=s[e];if(!o(n,c)){if(i.length>0&&t(n,We(i))&&a++,n.line=a,r(n))return!0;i.push(n)}}return!1},c=We(s.getClientRects());if(!c)return i;const d=s.getNode();return d&&(l(d),bL(e,n,l,d)),i},yL=(e,t)=>t.line>e,wL=(e,t)=>t.line===e,xL=I(vL,fL.Up,Ic,Pc),CL=I(vL,fL.Down,Pc,Ic),SL=e=>We(e.getClientRects()),kL=(e,t,o,n)=>{const r=vh(t);let s,a,i,l;const c=[];let d=0;1===e?(s=r.next,a=Pc,i=Ic,l=bd.after(n)):(s=r.prev,a=Ic,i=Pc,l=bd.before(n));const m=SL(l);do{if(!l.isVisible())continue;const e=SL(l);if(i(e,m))continue;c.length>0&&a(e,We(c))&&d++;const t=Rc(e);if(t.position=l,t.line=d,o(t))return c;c.push(t)}while(l=s(l));return c},_L=e=>t=>yL(e,t),OL=e=>t=>wL(e,t),TL=(e,t)=>{e.selection.setRng(t),Gv(e,e.selection.getRng())},EL=(e,t,o)=>j.some(RR(e,t,o)),DL=(e,t,o,n,r,s)=>{const a=t===sh.Forwards,i=vh(e.getBody()),l=I(nh,a?i.next:i.prev),c=a?n:r;if(!o.collapsed){const n=jc(o);if(s(n))return DR(t,e,n,t===sh.Backwards,!1);if(VR(e)){const e=o.cloneRange();return e.collapse(t===sh.Backwards),j.from(e)}}const d=eh(t,e.getBody(),o);if(c(d))return MR(e,d.getNode(!a));let m=l(d);const u=ya(o);if(!m)return u?j.some(o):j.none();if(m=xC(a,m),c(m))return DR(t,e,m.getNode(!a),a,!1);const g=l(m);return g&&c(g)&&rh(m,g)?DR(t,e,g.getNode(!a),a,!1):u?EL(e,m.toRange(),!1):j.none()},AL=(e,t,o,n,r,s)=>{const a=eh(t,e.getBody(),o),i=We(a.getClientRects()),l=t===fL.Down,c=e.getBody();if(!i)return j.none();if(VR(e)){const e=l?bd.fromRangeEnd(o):bd.fromRangeStart(o),t=l?lL:iL;return t(c,e).orThunk((()=>j.from(e))).map((e=>e.toRange()))}const d=l?CL:xL,m=d(c,_L(1),a),u=oe(m,OL(1)),g=i.left,h=gL(u,g);if(h&&s(h.node)){const o=Math.abs(g-h.left),n=Math.abs(g-h.right);return DR(t,e,h.node,o<n,!1)}let p;if(p=n(a)?a.getNode():r(a)?a.getNode(!0):jc(o),p){const o=kL(t,c,_L(1),p);let n=gL(oe(o,OL(1)),g);if(n)return EL(e,n.position.toRange(),!1);if(n=We(oe(o,OL(0))),n)return EL(e,n.position.toRange(),!1)}return 0===u.length?ML(e,l).filter(l?r:n).map((t=>RR(e,t.toRange(),!1))):j.none()},ML=(e,t)=>{const o=e.selection.getRng(),n=t?bd.fromRangeEnd(o):bd.fromRangeStart(o),r=Ug(n.container(),e.getBody());if(t){const e=eL(r,n);return be(e.positions)}{const e=QB(r,n);return fe(e.positions)}},NL=(e,t,o)=>ML(e,t).filter(o).exists((t=>(e.selection.setRng(t.toRange()),!0))),RL=(e,t)=>{const o=e.dom.createRng();o.setStart(t.container(),t.offset()),o.setEnd(t.container(),t.offset()),e.selection.setRng(o)},BL=(e,t)=>{e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected")},LL=(e,t,o)=>wB(t,o).map((t=>(RL(e,t),o))),HL=(e,t,o)=>{const n=bd.fromRangeStart(e);if(e.collapsed)return n;{const r=bd.fromRangeEnd(e);return o?Mh(t,r).getOr(r):Ah(t,n).getOr(n)}},IL=(e,t,o)=>{const n=e.getBody(),r=HL(e.selection.getRng(),n,o),s=I(pC,e),a=VB(o,s,n,r);return a.bind((o=>LL(e,t,o)))},PL=(e,t,o)=>{const n=J(ks(ln.fromDom(t.getRoot()),'*[data-mce-selected="inline-boundary"]'),(e=>e.dom)),r=oe(n,e),s=oe(o,e);Q(ue(r,s),I(BL,!1)),Q(ue(s,r),I(BL,!0))},zL=(e,t)=>{const o=t.get();if(e.selection.isCollapsed()&&!e.composing&&o){const n=bd.fromRangeStart(e.selection.getRng());bd.isTextPosition(n)&&!wC(n)&&(RL(e,vg(o,n)),t.set(null))}},FL=(e,t,o,n)=>{if(t.selection.isCollapsed()){const r=oe(n,e);Q(r,(n=>{const r=bd.fromRangeStart(t.selection.getRng());MB(e,t.getBody(),r).bind((e=>LL(t,o,e)))}))}},VL=(e,t,o)=>!!mu(e)&&IL(e,t,o).isSome(),ZL=(e,t,o)=>!!mu(t)&&jB(e,t),UL=e=>{const t=Fl(null),o=I(pC,e);return e.on("NodeChange",(n=>{mu(e)&&(PL(o,e.dom,n.parents),zL(e,t),FL(o,e,t,n.parents))})),t},jL=I(ZL,!0),$L=I(ZL,!1),WL=(e,t,o)=>{if(mu(e)){const n=ML(e,t).getOrThunk((()=>{const o=e.selection.getRng();return t?bd.fromRangeEnd(o):bd.fromRangeStart(o)}));return MB(I(pC,e),e.getBody(),n).exists((t=>{const n=BB(t);return wB(o,n).exists((t=>(RL(e,t),!0)))}))}return!1},qL=(e,t)=>{const o=document.createRange();return o.setStart(e.container(),e.offset()),o.setEnd(t.container(),t.offset()),o},GL=e=>fo(Nh(e),Rh(e),((t,o)=>{const n=xC(!0,t),r=xC(!1,o);return Ah(e,n).forall((e=>e.isEqual(r)))})).getOr(!0),KL=(e,t)=>o=>wB(t,o).map((t=>()=>RL(e,t))),YL=(e,t,o,n)=>{const r=e.getBody(),s=I(pC,e);e.undoManager.ignore((()=>{e.selection.setRng(qL(o,n)),OC(e),MB(s,r,bd.fromRangeStart(e.selection.getRng())).map(LB).bind(KL(e,t)).each(V)})),e.nodeChanged()},XL=(e,t)=>{const o=jg(t,e);return o||e},JL=(e,t,o,n)=>{const r=XL(e.getBody(),n.container()),s=I(pC,e),a=MB(s,r,n),i=a.bind((e=>o?e.fold(B(j.some(LB(e))),j.none,B(j.some(BB(e))),j.none):e.fold(j.none,B(j.some(BB(e))),j.none,B(j.some(LB(e))))));return i.map(KL(e,t)).getOrThunk((()=>{const i=Th(o,r,n),l=i.bind((e=>MB(s,r,e)));return fo(a,l,(()=>vC(s,r,n).bind((t=>GL(t)?j.some((()=>{uC(e,o,ln.fromDom(t))})):j.none())))).getOrThunk((()=>l.bind((()=>i.map((r=>()=>{o?YL(e,t,n,r):YL(e,t,r,n)}))))))}))},QL=(e,t,o)=>{if(e.selection.isCollapsed()&&mu(e)){const n=bd.fromRangeStart(e.selection.getRng());return JL(e,t,o,n)}return j.none()},eH=(e,t)=>{const o=ox(t,e);return ie(o,zs).fold(B(o),(e=>o.slice(0,e)))},tH=e=>1===Nn(e),oH=(e,t,o,n)=>{const r=I(v_,t),s=J(oe(n,r),(e=>e.dom));if(0===s.length)uC(t,e,o);else{const e=b_(o.dom,s);t.selection.setRng(e.toRange())}},nH=(e,t)=>{const o=ln.fromDom(e.getBody()),n=ln.fromDom(e.selection.getStart()),r=oe(eH(o,n),tH);return be(r).bind((o=>{const n=bd.fromRangeStart(e.selection.getRng());return NC(t,n,o.dom)&&!y_(o)?j.some((()=>oH(t,e,o,r))):j.none()}))},rH=(e,t)=>e.selection.isCollapsed()?nH(e,t):j.none(),sH=(e,t,o)=>T(o)?j.some((()=>{e._selectionOverrides.hideFakeCaret(),uC(e,t,ln.fromDom(o))})):j.none(),aH=(e,t)=>{const o=t?qw:Gw,n=t?sh.Forwards:sh.Backwards,r=eh(n,e.getBody(),e.selection.getRng());return o(r)?sH(e,t,r.getNode(!t)):j.from(xC(t,r)).filter((e=>o(e)&&rh(r,e))).bind((o=>sH(e,t,o.getNode(!t))))},iH=(e,t)=>{const o=e.selection.getNode();return vs(o)?sH(e,t,o):j.none()},lH=(e,t)=>e.selection.isCollapsed()?aH(e,t):iH(e,t),cH=e=>Pr(e,(e=>hs(e.dom)||ps(e.dom))).exists((e=>hs(e.dom))),dH=e=>vt(null!==e&&void 0!==e?e:"").getOr(0),mH=(e,t)=>{const o=e||Fs(t)?"margin":"padding",n="rtl"===Kn(t,"direction")?"-right":"-left";return o+n},uH=(e,t,o,n,r,s)=>{const a=mH(o,ln.fromDom(s)),i=dH(e.getStyle(s,a));if("outdent"===t){const t=Math.max(0,i-n);e.setStyle(s,a,t?t+r:"")}else{const t=i+n+r;e.setStyle(s,a,t)}},gH=(e,t)=>de(t,(t=>{const o=mH(Km(e),t),n=Xn(t,o).map(dH).getOr(0),r=e.dom.getContentEditable(t.dom);return"false"!==r&&n>0})),hH=e=>{const t=bH(e);return!e.mode.isReadOnly()&&(t.length>1||gH(e,t))},pH=e=>js(e)||$s(e),fH=e=>wn(e).exists(pH),bH=e=>oe(ur(e.selection.getSelectedBlocks()),(e=>!pH(e)&&!fH(e)&&cH(e))),vH=(e,t)=>{var o,n;const{dom:r}=e,s=Ym(e),a=null!==(n=null===(o=/[a-z%]+$/i.exec(s))||void 0===o?void 0:o[0])&&void 0!==n?n:"px",i=dH(s),l=Km(e);Q(bH(e),(e=>{uH(r,t,l,i,a,e.dom)}))},yH=e=>vH(e,"indent"),wH=e=>vH(e,"outdent"),xH=e=>{if(e.selection.isCollapsed()&&hH(e)){const t=e.dom,o=e.selection.getRng(),n=bd.fromRangeStart(o),r=t.getParent(o.startContainer,t.isBlock);if(null!==r&&ix(ln.fromDom(r),n))return j.some((()=>wH(e)))}return j.none()},CH=(e,t,o)=>ye([xH,aB,zR,(e,o)=>QL(e,t,o),xR,DS,lB,lH,ER,rH],(t=>t(e,o))),SH=(e,t)=>{const o=CH(e,t,!1);o.fold((()=>{OC(e),MC(e)}),V)},kH=(e,t)=>{const o=CH(e,t,!0);o.fold((()=>TC(e)),V)},_H=(e,t)=>{e.addCommand("delete",(()=>{SH(e,t)})),e.addCommand("forwardDelete",(()=>{kH(e,t)}))},OH=5,TH=400,EH=e=>void 0===e.touches||1!==e.touches.length?j.none():j.some(e.touches[0]),DH=(e,t)=>{const o=Math.abs(e.clientX-t.x),n=Math.abs(e.clientY-t.y);return o>OH||n>OH},AH=e=>{const t=nc(),o=Fl(!1),n=sc((t=>{e.dispatch("longpress",{...t,type:"longpress"}),o.set(!0)}),TH);e.on("touchstart",(e=>{EH(e).each((r=>{n.cancel();const s={x:r.clientX,y:r.clientY,target:e.target};n.throttle(e),o.set(!1),t.set(s)}))}),!0),e.on("touchmove",(r=>{n.cancel(),EH(r).each((n=>{t.on((r=>{DH(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)},MH=(e,t)=>Re(e,t.nodeName),NH=(e,t)=>!!as(t)||!!Kr(t)&&(!MH(e.getBlockElements(),t)&&!rp(t)&&!di(e,t)),RH=(e,t,o)=>X(tx(ln.fromDom(o),ln.fromDom(t)),(t=>MH(e,t.dom))),BH=(e,t)=>{if(as(t)){if(0===t.data.length)return!0;if(/^\s+$/.test(t.data)&&(!t.nextSibling||MH(e,t.nextSibling)))return!0}return!1},LH=e=>e.dom.create(Dm(e),Am(e)),HH=e=>{const t=e.dom,o=e.selection,n=e.schema,r=n.getBlockElements(),s=o.getStart(),a=e.getBody();let i,l,c=!1;const d=Dm(e);if(!s||!Kr(s))return;const m=a.nodeName.toLowerCase();if(!n.isValidChild(m,d.toLowerCase())||RH(r,a,s))return;const u=o.getRng(),{startContainer:g,startOffset:h,endContainer:p,endOffset:f}=u,b=Fy(e);let v=a.firstChild;while(v)if(Kr(v)&&si(n,v),NH(n,v)){if(BH(r,v)){l=v,v=v.nextSibling,t.remove(l);continue}i||(i=LH(e),a.insertBefore(i,v),c=!0),l=v,v=v.nextSibling,i.appendChild(l)}else i=null,v=v.nextSibling;c&&b&&(u.setStart(g,h),u.setEnd(p,f),o.setRng(u),e.nodeChanged())},IH=(e,t,o)=>{const n=ln.fromDom(LH(e)),r=Qs();rr(n,r),o(t,n);const s=document.createRange();return s.setStartBefore(r.dom),s.setEndBefore(r.dom),s},PH=e=>{e.on("NodeChange",I(HH,e))},zH=e=>t=>-1!==(" "+t.attr("class")+" ").indexOf(e),FH=(e,t,o)=>function(n){const r=arguments,s=r[r.length-2],a=s>0?t.charAt(s-1):"";if('"'===a)return n;if(">"===a){const e=t.lastIndexOf("<",s);if(-1!==e){const o=t.substring(e,s);if(-1!==o.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>"},VH=(e,t,o)=>{let n=t.length,r=o.content;if("raw"!==o.format){while(n--)r=r.replace(t[n],FH(e,r,Ju(e)));o.content=r}},ZH=e=>{const t="contenteditable",o=" "+go.trim(Qu(e))+" ",n=" "+go.trim(Ju(e))+" ",r=zH(o),s=zH(n),a=eg(e);a.length>0&&e.on("BeforeSetContent",(t=>{VH(e,a,t)})),e.parser.addAttributeFilter("class",(e=>{let o=e.length;while(o--){const n=e[o];r(n)?n.attr(t,"true"):s(n)&&n.attr(t,"false")}})),e.serializer.addAttributeFilter(t,(e=>{let o=e.length;while(o--){const n=e[o];(r(n)||s(n))&&(a.length>0&&n.attr("data-mce-content")?(n.name="#text",n.type=3,n.raw=!0,n.value=n.attr("data-mce-content")):n.attr(t,null))}}))},UH=e=>Ur(ln.fromDom(e.getBody()),"*[data-mce-caret]").map((e=>e.dom)).getOrNull(),jH=(e,t)=>{t.hasAttribute("data-mce-caret")&&(va(t),e.selection.setRng(e.selection.getRng()),e.selection.scrollIntoView(t))},$H=(e,t)=>{const o=UH(e);if(o)return"compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void jH(e,o)):void(da(o)&&(jH(e,o),e.undoManager.add()))},WH=e=>{e.on("keyup compositionstart",I($H,e))},qH=ps,GH=(e,t,o)=>DL(t,e,o,Xw,Jw,qH),KH=(e,t,o)=>{const n=e=>Xw(e)||Kw(e),r=e=>Jw(e)||Yw(e);return AL(t,e,o,n,r,qH)},YH=e=>{const t=e.dom.create(Dm(e));return t.innerHTML='<br data-mce-bogus="1">',t},XH=(e,t,o)=>{const n=vh(e.getBody()),r=I(nh,1===t?n.next:n.prev);if(o.collapsed){const n=e.dom.getParent(o.startContainer,"PRE");if(!n)return;const s=r(bd.fromRangeStart(o));if(!s){const o=ln.fromDom(YH(e));1===t?or(ln.fromDom(n),o):tr(ln.fromDom(n),o),e.selection.select(o.dom,!0),e.selection.collapse()}}},JH=(e,t)=>{const o=t?sh.Forwards:sh.Backwards,n=e.selection.getRng();return GH(o,e,n).orThunk((()=>(XH(e,o,n),j.none())))},QH=(e,t)=>{const o=t?1:-1,n=e.selection.getRng();return KH(o,e,n).orThunk((()=>(XH(e,o,n),j.none())))},eI=(e,t)=>JH(e,t).exists((t=>(TL(e,t),!0))),tI=(e,t)=>QH(e,t).exists((t=>(TL(e,t),!0))),oI=(e,t)=>{const o=t?Jw:Xw;return NL(e,t,o)},nI=(e,t)=>FR(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=>(TL(e,t),!0))),rI=e=>Y(["figcaption"],ko(e)),sI=(e,t)=>{const o=I(hn,t);return Pr(ln.fromDom(e.container()),zs,o).filter(rI)},aI=(e,t,o)=>t?rL(e.dom,o):nL(e.dom,o),iI=(e,t)=>{const o=ln.fromDom(e.getBody()),n=bd.fromRangeStart(e.selection.getRng());return sI(n,o).exists((()=>{if(aI(o,t,n)){const n=t?rr:nr,r=IH(e,o,n);return e.selection.setRng(r),!0}return!1}))},lI=(e,t)=>!!e.selection.isCollapsed()&&iI(e,t),cI={shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0},dI=e=>J(e,(e=>({...cI,...e}))),mI=e=>J(e,(e=>({...cI,...e}))),uI=(e,t)=>t.keyCode===e.keyCode&&t.shiftKey===e.shiftKey&&t.altKey===e.altKey&&t.ctrlKey===e.ctrlKey&&t.metaKey===e.metaKey,gI=(e,t)=>ce(dI(e),(e=>uI(e,t)?[e]:[])),hI=(e,t)=>ce(mI(e),(e=>uI(e,t)?[e]:[])),pI=(e,...t)=>()=>e.apply(null,t),fI=(e,t)=>ae(gI(e,t),(e=>e.action())),bI=(e,t)=>ye(hI(e,t),(e=>e.action())),vI=(e,t)=>{const o=t?sh.Forwards:sh.Backwards,n=e.selection.getRng();return DL(e,o,n,qw,Gw,vs).exists((t=>(TL(e,t),!0)))},yI=(e,t)=>{const o=t?1:-1,n=e.selection.getRng();return AL(e,o,n,qw,Gw,vs).exists((t=>(TL(e,t),!0)))},wI=(e,t)=>{const o=t?Gw:qw;return NL(e,t,o)},xI=nm.generate([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),CI=e=>xI.none(e),SI={...xI,none:CI},kI=(e,t)=>_I(e,t,U),_I=(e,t,o)=>ce(En(e),(e=>dn(e,t)?o(e)?[e]:[]:_I(e,t,o))),OI=(e,t,o=Z)=>{if(o(t))return j.none();if(Y(e,ko(t)))return j.some(t);const n=e=>dn(e,"table")||o(e);return Zr(t,e.join(","),n)},TI=(e,t)=>OI(["td","th"],e,t),EI=e=>kI(e,"th,td"),DI=(e,t)=>jr(e,"table",t),AI=(e,t,o,n,r=U)=>{const s=1===n;if(!s&&o<=0)return SI.first(e[0]);if(s&&o>=e.length-1)return SI.last(e[e.length-1]);{const s=o+n,a=e[s];return r(a)?SI.middle(t,a):AI(e,t,s,n,r)}},MI=(e,t)=>DI(e,t).bind((t=>{const o=EI(t),n=ie(o,(t=>hn(e,t)));return n.map((e=>({index:e,all:o})))})),NI=(e,t,o)=>{const n=MI(e,o);return n.fold((()=>SI.none(e)),(o=>AI(o.all,e,o.index,1,t)))},RI=(e,t,o)=>{const n=MI(e,o);return n.fold((()=>SI.none()),(o=>AI(o.all,e,o.index,-1,t)))},BI=e=>jr(e,"[contenteditable]"),LI=(e,t=!1)=>jn(e)?e.dom.isContentEditable:BI(e).fold(B(t),(e=>"true"===HI(e))),HI=e=>e.dom.contentEditable,II=(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}),PI=(e,t)=>ce(t,(t=>{const o=II(Rc(t.getBoundingClientRect()),-1);return[{x:o.left,y:e(o),cell:t},{x:o.right,y:e(o),cell:t}]})),zI=(e,t,o)=>re(e,((e,n)=>e.fold((()=>j.some(n)),(e=>{const r=Math.sqrt(Math.abs(e.x-t)+Math.abs(e.y-o)),s=Math.sqrt(Math.abs(n.x-t)+Math.abs(n.y-o));return j.some(s<r?n:e)}))),j.none()),FI=(e,t,o,n,r)=>{const s=ks(ln.fromDom(o),"td,th,caption").map((e=>e.dom)),a=oe(PI(e,s),(e=>t(e,r)));return zI(a,n,r).map((e=>e.cell))},VI=e=>e.bottom,ZI=e=>e.top,UI=(e,t)=>e.y<t,jI=(e,t)=>e.y>t,$I=I(FI,VI,UI),WI=I(FI,ZI,jI),qI=(e,t)=>fe(t.getClientRects()).bind((t=>$I(e,t.left,t.top))).bind((e=>JB(aL(e),t))),GI=(e,t)=>be(t.getClientRects()).bind((t=>WI(e,t.left,t.top))).bind((e=>JB(sL(e),t))),KI=(e,t,o)=>o.breakAt.exists((o=>e(t,o).breakAt.isSome())),YI=e=>e.breakType===$B.Wrap&&0===e.positions.length,XI=e=>e.breakType===$B.Br&&1===e.positions.length,JI=(e,t,o)=>{const n=e(t,o);return YI(n)||!us(o.getNode())&&XI(n)?!KI(e,t,n):n.breakAt.isNone()},QI=I(JI,QB),eP=I(JI,eL),tP=(e,t,o)=>{const n=bd.fromRangeStart(t);return Dh(!e,o).exists((e=>e.isEqual(n)))},oP=(e,t,o,n)=>{const r=e.selection.getRng(),s=t?1:-1;return!(!Tg()||!tP(t,r,o))&&(DR(s,e,o,!t,!1).each((t=>{TL(e,t)})),!0)},nP=(e,t,o)=>qI(t,o).orThunk((()=>fe(o.getClientRects()).bind((o=>XB(tL(e,bd.before(t)),o.left))))).getOr(bd.before(t)),rP=(e,t,o)=>GI(t,o).orThunk((()=>fe(o.getClientRects()).bind((o=>XB(oL(e,bd.after(t)),o.left))))).getOr(bd.after(t)),sP=(e,t)=>{const o=t.getNode(e);return ns(o)?j.some(o):j.none()},aP=(e,t,o)=>{t.undoManager.transact((()=>{const n=e?or:tr,r=IH(t,ln.fromDom(o),n);TL(t,r)}))},iP=(e,t,o)=>{const n=sP(!!t,o),r=!1===t;n.fold((()=>TL(e,o.toRange())),(n=>Dh(r,e.getBody()).filter((e=>e.isEqual(o))).fold((()=>TL(e,o.toRange())),(o=>aP(t,e,n)))))},lP=(e,t,o,n)=>{const r=e.selection.getRng(),s=bd.fromRangeStart(r),a=e.getBody();if(!t&&QI(n,s)){const n=nP(a,o,s);return iP(e,t,n),!0}if(t&&eP(n,s)){const n=rP(a,o,s);return iP(e,t,n),!0}return!1},cP=(e,t,o)=>j.from(e.dom.getParent(e.selection.getNode(),"td,th")).bind((n=>j.from(e.dom.getParent(n,"table")).map((r=>o(e,t,r,n))))).getOr(!1),dP=(e,t)=>cP(e,t,oP),mP=(e,t)=>cP(e,t,lP),uP=e=>{const t=Gb.exact(e,0,e,0);return ev(t)},gP=(e,t,o)=>o.fold(j.none,j.none,((e,t)=>nw(t).map((e=>uP(e)))),(o=>(e.execCommand("mceTableInsertRowAfter"),hP(e,t,o)))),hP=(e,t,o)=>gP(e,t,NI(o,LI)),pP=(e,t,o)=>gP(e,t,RI(o,LI)),fP=(e,t)=>{const o=["table","li","dl"],n=ln.fromDom(e.getBody()),r=e=>{const t=ko(e);return hn(e,n)||Y(o,t)},s=e.selection.getRng(),a=ln.fromDom(t?s.endContainer:s.startContainer);return TI(a,r).map((o=>{DI(o,r).each((t=>{e.model.table.clearSelectedCells(t.dom)})),e.selection.collapse(!t);const n=t?hP:pP,s=n(e,r,o);return s.each((t=>{e.selection.setRng(t)})),!0})).getOr(!1)},bP=(e,t,o)=>{const n=to.os.isMacOS()||to.os.isiOS();fI([{keyCode:db.RIGHT,action:pI(eI,e,!0)},{keyCode:db.LEFT,action:pI(eI,e,!1)},{keyCode:db.UP,action:pI(tI,e,!1)},{keyCode:db.DOWN,action:pI(tI,e,!0)},...n?[{keyCode:db.UP,action:pI(nI,e,!1),metaKey:!0,shiftKey:!0},{keyCode:db.DOWN,action:pI(nI,e,!0),metaKey:!0,shiftKey:!0}]:[],{keyCode:db.RIGHT,action:pI(dP,e,!0)},{keyCode:db.LEFT,action:pI(dP,e,!1)},{keyCode:db.UP,action:pI(mP,e,!1)},{keyCode:db.DOWN,action:pI(mP,e,!0)},{keyCode:db.RIGHT,action:pI(vI,e,!0)},{keyCode:db.LEFT,action:pI(vI,e,!1)},{keyCode:db.UP,action:pI(yI,e,!1)},{keyCode:db.DOWN,action:pI(yI,e,!0)},{keyCode:db.RIGHT,action:pI(VL,e,t,!0)},{keyCode:db.LEFT,action:pI(VL,e,t,!1)},{keyCode:db.RIGHT,ctrlKey:!n,altKey:n,action:pI(jL,e,t)},{keyCode:db.LEFT,ctrlKey:!n,altKey:n,action:pI($L,e,t)},{keyCode:db.UP,action:pI(lI,e,!1)},{keyCode:db.DOWN,action:pI(lI,e,!0)}],o).each((e=>{o.preventDefault()}))},vP=(e,t)=>{e.on("keydown",(o=>{o.isDefaultPrevented()||bP(e,t,o)}))},yP=(e,t)=>({container:e,offset:t}),wP=Rl.DOM,xP=e=>t=>e===t?-1:0,CP=e=>t=>e.isBlock(t)||Y(["BR","IMG","HR","INPUT"],t.nodeName)||"false"===e.getContentEditable(t),SP=(e,t,o)=>{if(as(e)&&t>=0)return j.some(yP(e,t));{const n=Mc(wP);return j.from(n.backwards(e,t,xP(e),o)).map((e=>yP(e.container,e.container.data.length)))}},kP=(e,t,o)=>{if(as(e)&&t>=e.length)return j.some(yP(e,t));{const n=Mc(wP);return j.from(n.forwards(e,t,xP(e),o)).map((e=>yP(e.container,0)))}},_P=(e,t,o)=>{if(!as(e))return j.none();const n=e.data;if(t>=0&&t<=n.length)return j.some(yP(e,t));{const n=Mc(wP);return j.from(n.backwards(e,t,xP(e),o)).bind((e=>{const n=e.container.data;return _P(e.container,t+n.length,o)}))}},OP=(e,t,o)=>{if(!as(e))return j.none();const n=e.data;if(t<=n.length)return j.some(yP(e,t));{const r=Mc(wP);return j.from(r.forwards(e,t,xP(e),o)).bind((e=>OP(e.container,t-n.length,o)))}},TP=(e,t,o,n,r)=>{const s=Mc(e,CP(e));return j.from(s.backwards(t,o,n,r))},EP=e=>e.collapsed&&as(e.startContainer),DP=e=>ra(e.toString().replace(/\u00A0/g," ")),AP=e=>""!==e&&-1!=="  \f\n\r\t\v".indexOf(e),MP=(e,t)=>e.substring(t.length),NP=(e,t,o)=>{let n;const r=o.charAt(0);for(n=t-1;n>=0;n--){const s=e.charAt(n);if(AP(s))return j.none();if(r===s&&lt(e,o,n,t))break}return j.some(n)},RP=(e,t,o,n=0)=>{if(!EP(t))return j.none();const r={text:"",offset:0},s=(e,t,n)=>(r.text=n+r.text,r.offset+=t,NP(r.text,r.offset,o).getOr(t)),a=e.getParent(t.startContainer,e.isBlock)||e.getRoot();return TP(e,t.startContainer,t.startOffset,s,a).bind((e=>{const r=t.cloneRange();if(r.setStart(e.container,e.offset),r.setEnd(t.endContainer,t.endOffset),r.collapsed)return j.none();const s=DP(r),a=s.lastIndexOf(o);return 0!==a||MP(s,o).length<n?j.none():j.some({text:MP(s,o),range:r,trigger:o})}))},BP=(e,t,o,n=0)=>lw(ln.fromDom(t.startContainer)).fold((()=>RP(e,t,o,n)),(t=>{const n=e.createRng();n.selectNode(t.dom);const r=DP(n);return j.some({range:n,text:MP(r,o),trigger:o})})),LP=e=>e.nodeType===So,HP=e=>e.nodeType===Co,IP=e=>{if(LP(e))return yP(e,e.data.length);{const t=e.childNodes;return t.length>0?IP(t[t.length-1]):yP(e,t.length)}},PP=(e,t)=>{const o=e.childNodes;return o.length>0&&t<o.length?PP(o[t],0):o.length>0&&HP(e)&&o.length===t?IP(o[o.length-1]):yP(e,t)},zP=(e,t)=>{var o;const n=null!==(o=e.getParent(t.container,e.isBlock))&&void 0!==o?o:e.getRoot();return TP(e,t.container,t.offset,((e,t)=>0===t?-1:t),n).filter((e=>{const t=e.container.data.charAt(e.offset-1);return!AP(t)})).isSome()},FP=e=>t=>{const o=PP(t.startContainer,t.startOffset);return!zP(e,o)},VP=(e,t,o)=>ye(o.triggers,(o=>BP(e,t,o))),ZP=(e,t)=>{const o=t(),n=e.selection.getRng();return VP(e.dom,n,o).bind((o=>UP(e,t,o)))},UP=(e,t,o,n={})=>{var r;const s=t(),a=e.selection.getRng(),i=null!==(r=a.startContainer.nodeValue)&&void 0!==r?r:"",l=oe(s.lookupByTrigger(o.trigger),(t=>o.text.length>=t.minChars&&t.matches.getOrThunk((()=>FP(e.dom)))(o.range,i,o.text)));if(0===l.length)return j.none();const c=Promise.all(J(l,(e=>{const t=e.fetch(o.text,e.maxResults,n);return t.then((t=>({matchText:o.text,items:t,columns:e.columns,onAction:e.onAction,highlightOn:e.highlightOn})))})));return j.some({lookupData:c,context:o})};var jP;(function(e){e[e["Error"]=0]="Error",e[e["Value"]=1]="Value"})(jP||(jP={}));const $P=(e,t,o)=>e.stype===jP.Error?t(e.serror):o(e.svalue),WP=e=>{const t=[],o=[];return Q(e,(e=>{$P(e,(e=>o.push(e)),(e=>t.push(e)))})),{values:t,errors:o}},qP=(e,t)=>e.stype===jP.Error?{stype:jP.Error,serror:t(e.serror)}:e,GP=(e,t)=>e.stype===jP.Value?{stype:jP.Value,svalue:t(e.svalue)}:e,KP=(e,t)=>e.stype===jP.Value?t(e.svalue):e,YP=(e,t)=>e.stype===jP.Error?t(e.serror):e,XP=e=>({stype:jP.Value,svalue:e}),JP=e=>({stype:jP.Error,serror:e}),QP=e=>$P(e,tm.error,tm.value),ez=e=>e.fold(JP,XP),tz={fromResult:ez,toResult:QP,svalue:XP,partition:WP,serror:JP,bind:KP,bindError:YP,map:GP,mapError:qP,fold:$P},oz=e=>w(e)&&xe(e).length>100?" removed due to size":JSON.stringify(e,null,2),nz=e=>{const t=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:B("... (only showing first ten failures)")}]):e;return J(t,(e=>"Failed path: ("+e.path.join(" > ")+")\n"+e.getErrorInfo()))},rz=(e,t)=>tz.serror([{path:e,getErrorInfo:t}]),sz=(e,t,o)=>rz(e,(()=>'Could not find valid *required* value for "'+t+'" in '+oz(o))),az=(e,t)=>rz(e,(()=>'Choice schema did not contain choice key: "'+t+'"')),iz=(e,t,o)=>rz(e,(()=>'The chosen schema: "'+o+'" did not exist in branches: '+oz(t))),lz=(e,t)=>rz(e,B(t)),cz=(e,t,o,n)=>{const r=Ne(o,n);return r.fold((()=>iz(e,o,n)),(o=>o.extract(e.concat(["branch: "+n]),t)))},dz=(e,t)=>{const o=(o,n)=>{const r=Ne(n,e);return r.fold((()=>az(o,e)),(e=>cz(o,n,t,e)))},n=()=>"chooseOn("+e+"). Possible values: "+xe(t);return{extract:o,toString:n}},mz=(e,t)=>t,uz=(e,t)=>{const o=x(e)&&x(t);return o?hz(e,t):t},gz=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)Re(r,t)&&(o[t]=e(o[t],r[t]))}return o},hz=gz(uz),pz=gz(mz),fz=()=>({tag:"required",process:{}}),bz=e=>({tag:"defaultedThunk",process:e}),vz=e=>bz(B(e)),yz=()=>({tag:"option",process:{}}),wz=(e,t)=>e.length>0?tz.svalue(hz(t,pz.apply(void 0,e))):tz.svalue(t),xz=e=>N(tz.serror,le)(e),Cz=(e,t)=>{const o=tz.partition(e);return o.errors.length>0?xz(o.errors):wz(o.values,t)},Sz=e=>{const t=tz.partition(e);return t.errors.length>0?xz(t.errors):tz.svalue(t.values)},kz={consolidateObj:Cz,consolidateArr:Sz},_z=(e,t,o,n)=>({tag:"field",key:e,newKey:t,presence:o,prop:n}),Oz=(e,t)=>({tag:"custom",newKey:e,instantiator:t}),Tz=(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)}},Ez=e=>{const t=(t,o)=>tz.bindError(e(o),(e=>lz(t,e))),o=B("val");return{extract:t,toString:o}},Dz=Ez(tz.svalue),Az=(e,t,o,n)=>Ne(t,o).fold((()=>sz(e,o,t)),n),Mz=(e,t,o,n)=>{const r=Ne(e,t).getOrThunk((()=>o(e)));return n(r)},Nz=(e,t,o)=>o(Ne(e,t)),Rz=(e,t,o,n)=>{const r=Ne(e,t).map((t=>!0===t?o(e):t));return n(r)},Bz=(e,t,o,n,r)=>{const s=e=>r.extract(t.concat([n]),e),a=e=>e.fold((()=>tz.svalue(j.none())),(e=>{const o=r.extract(t.concat([n]),e);return tz.map(o,j.some)}));switch(e.tag){case"required":return Az(t,o,n,s);case"defaultedThunk":return Mz(o,n,e.process,s);case"option":return Nz(o,n,a);case"defaultedOptionThunk":return Rz(o,n,e.process,a);case"mergeWithThunk":return Mz(o,n,B({}),(t=>{const n=hz(e.process(o),t);return s(n)}))}},Lz=(e,t,o)=>{const n={},r=[];for(const s of o)Tz(s,((o,s,a,i)=>{const l=Bz(a,e,t,o,i);tz.fold(l,(e=>{r.push(...e)}),(e=>{n[s]=e}))}),((e,o)=>{n[e]=o(t)}));return r.length>0?tz.serror(r):tz.svalue(n)},Hz=e=>{const t=(t,o)=>Lz(t,o,e),o=()=>{const t=J(e,(e=>Tz(e,((e,t,o,n)=>e+" -> "+n.toString()),((e,t)=>"state("+e+")"))));return"obj{\n"+t.join("\n")+"}"};return{extract:t,toString:o}},Iz=e=>{const t=(t,o)=>{const n=J(o,((o,n)=>e.extract(t.concat(["["+n+"]"]),o)));return kz.consolidateArr(n)},o=()=>"array("+e.toString()+")";return{extract:t,toString:o}},Pz=e=>Ez((t=>e(t).fold(tz.serror,tz.svalue))),zz=(e,t,o)=>{const n=t.extract([e],o);return tz.mapError(n,(e=>({input:o,errors:e})))},Fz=(e,t,o)=>tz.toResult(zz(e,t,o)),Vz=e=>"Errors: \n"+nz(e.errors).join("\n")+"\n\nInput object: "+oz(e.input),Zz=(e,t)=>dz(e,ke(t,Hz)),Uz=B(Dz),jz=(e,t)=>Ez((o=>{const n=typeof o;return e(o)?tz.svalue(o):tz.serror(`Expected type: ${t} but got: ${n}`)})),$z=jz(D,"number"),Wz=jz(y,"string"),qz=jz(k,"boolean"),Gz=jz(E,"function"),Kz=_z,Yz=Oz,Xz=e=>Pz((t=>Y(e,t)?tm.value(t):tm.error(`Unsupported value: "${t}", choose one of "${e.join(", ")}".`))),Jz=(e,t)=>Kz(e,e,fz(),t),Qz=e=>Jz(e,Wz),eF=e=>Jz(e,Gz),tF=(e,t)=>Kz(e,e,fz(),Iz(t)),oF=(e,t)=>Kz(e,e,yz(),t),nF=e=>oF(e,Wz),rF=e=>oF(e,Gz),sF=(e,t)=>Kz(e,e,vz(t),Uz()),aF=(e,t,o)=>Kz(e,e,vz(t),o),iF=(e,t)=>aF(e,t,$z),lF=(e,t)=>aF(e,t,Wz),cF=(e,t,o)=>aF(e,t,Xz(o)),dF=(e,t)=>aF(e,t,qz),mF=(e,t)=>aF(e,t,Gz),uF=(e,t,o)=>aF(e,t,Iz(o)),gF=Qz("type"),hF=eF("fetch"),pF=eF("onAction"),fF=mF("onSetup",(()=>M)),bF=nF("text"),vF=nF("icon"),yF=nF("tooltip"),wF=nF("label"),xF=dF("active",!1),CF=dF("enabled",!0),SF=dF("primary",!1),kF=e=>sF("columns",e),_F=e=>lF("type",e),OF=Hz([gF,Qz("trigger"),iF("minChars",1),kF(1),iF("maxResults",10),rF("matches"),hF,pF,uF("highlightOn",[],Wz)]),TF=e=>Fz("Autocompleter",OF,{trigger:e.ch,...e}),EF=[CF,yF,vF,bF,fF],DF=[xF].concat(EF),AF=[mF("predicate",Z),cF("scope","node",["node","editor"]),cF("position","selection",["node","selection","line"])],MF=EF.concat([_F("contextformbutton"),SF,pF,Yz("original",L)]),NF=DF.concat([_F("contextformbutton"),SF,pF,Yz("original",L)]),RF=EF.concat([_F("contextformbutton")]),BF=DF.concat([_F("contextformtogglebutton")]),LF=Zz("type",{contextformbutton:MF,contextformtogglebutton:NF});Hz([_F("contextform"),mF("initValue",B("")),wF,tF("commands",LF),oF("launch",Zz("type",{contextformbutton:RF,contextformtogglebutton:BF}))].concat(AF));const HF=e=>{const t=e.ui.registry.getAll().popups,o=ke(t,(e=>TF(e).fold((e=>{throw new Error(Vz(e))}),L))),n=He(Ae(o,(e=>e.trigger))),r=Me(o),s=e=>oe(r,(t=>t.trigger===e));return{dataset:o,triggers:n,lookupByTrigger:s}},IF=(e,t)=>{const o=sc(t.load,50);e.on("keypress compositionend",(e=>{27!==e.which&&o.throttle()})),e.on("keydown",(e=>{const n=e.which;8===n?o.throttle():27===n&&t.cancelIfNecessary()})),e.on("remove",o.cancel)},PF=e=>{const t=nc(),o=Fl(!1),n=t.isSet,r=()=>{n()&&(BA(e),ab(e),o.set(!1),t.clear())},s=o=>{n()||(RA(e,o.range),t.set({trigger:o.trigger,matchLength:o.text.length}))},a=qe((()=>HF(e))),i=o=>t.get().map((t=>BP(e.dom,e.selection.getRng(),t.trigger).bind((t=>UP(e,a,t,o))))).getOrThunk((()=>ZP(e,a))),l=n=>{i(n).fold(r,(n=>{s(n.context),n.lookupData.then((s=>{t.get().map((a=>{const i=n.context;a.trigger===i.trigger&&(i.text.length-a.matchLength>=10?r():(t.set({...a,matchLength:i.text.length}),o.get()?sb(e,{lookupData:s}):(o.set(!0),rb(e,{lookupData:s}))))}))}))}))};e.addCommand("mceAutocompleterReload",((e,t)=>{const o=w(t)?t.fetchOptions:{};l(o)})),e.addCommand("mceAutocompleterClose",r),IF(e,{cancelIfNecessary:r,load:l})},zF=e=>(t,o,n={})=>{const r=t.getBody(),s={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:M,inputType:o},a=ul(new InputEvent(e));return t.dispatch(e,{...a,...s,...n})},FF=zF("input"),VF=zF("beforeinput"),ZF=(e,t,o)=>{const n=o.keyCode===db.BACKSPACE?"deleteContentBackward":"deleteContentForward";bI([{keyCode:db.BACKSPACE,action:pI(xH,e)},{keyCode:db.BACKSPACE,action:pI(aB,e,!1)},{keyCode:db.DELETE,action:pI(aB,e,!0)},{keyCode:db.BACKSPACE,action:pI(zR,e,!1)},{keyCode:db.DELETE,action:pI(zR,e,!0)},{keyCode:db.BACKSPACE,action:pI(QL,e,t,!1)},{keyCode:db.DELETE,action:pI(QL,e,t,!0)},{keyCode:db.BACKSPACE,action:pI(DS,e,!1)},{keyCode:db.DELETE,action:pI(DS,e,!0)},{keyCode:db.BACKSPACE,action:pI(lB,e,!1)},{keyCode:db.DELETE,action:pI(lB,e,!0)},{keyCode:db.BACKSPACE,action:pI(lH,e,!1)},{keyCode:db.DELETE,action:pI(lH,e,!0)},{keyCode:db.BACKSPACE,action:pI(ER,e,!1)},{keyCode:db.DELETE,action:pI(ER,e,!0)},{keyCode:db.BACKSPACE,action:pI(xR,e,!1)},{keyCode:db.DELETE,action:pI(xR,e,!0)},{keyCode:db.BACKSPACE,action:pI(rH,e,!1)},{keyCode:db.DELETE,action:pI(rH,e,!0)}],o).each((t=>{o.preventDefault();const r=VF(e,n);r.isDefaultPrevented()||(t(),FF(e,n))}))},UF=(e,t)=>{fI([{keyCode:db.BACKSPACE,action:pI(sB,e)},{keyCode:db.DELETE,action:pI(sB,e)}],t)},jF=(e,t)=>{e.on("keydown",(o=>{o.isDefaultPrevented()||ZF(e,t,o)})),e.on("keyup",(t=>{t.isDefaultPrevented()||UF(e,t)}))},$F=e=>{while(e){if(Kr(e)||as(e)&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}return null},WF=(e,t)=>{const o=e.dom,n=e.schema.getMoveCaretBeforeOnEnterElements();if(!t)return;if(/^(LI|DT|DD)$/.test(t.nodeName)){const e=$F(t.firstChild);e&&/^(UL|OL|DL)$/.test(e.nodeName)&&t.insertBefore(o.doc.createTextNode(xs),t.firstChild)}const r=o.createRng();if(t.normalize(),t.hasChildNodes()){const e=new Wr(t,t);let o,s=t;while(o=e.current()){if(as(o)){r.setStart(o,0),r.setEnd(o,0);break}if(n[o.nodeName.toLowerCase()]){r.setStartBefore(o),r.setEndBefore(o);break}s=o,o=e.next()}o||(r.setStart(s,0),r.setEnd(s,0))}else us(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),Gv(e,r)},qF=(e,t)=>{const o=e.getRoot();let n,r=t;while(r!==o&&r&&"false"!==e.getContentEditable(r))"true"===e.getContentEditable(r)&&(n=r),r=r.parentNode;return r!==o?n:o},GF=e=>j.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock)),KF=e=>GF(e).fold(B(""),(e=>e.nodeName.toUpperCase())),YF=e=>GF(e).filter((e=>$s(ln.fromDom(e)))).isSome(),XF=(e,t)=>e.firstChild&&e.firstChild.nodeName===t,JF=e=>{var t;return(null===(t=e.parentNode)||void 0===t?void 0:t.firstChild)===e},QF=(e,t)=>{const o=null===e||void 0===e?void 0:e.parentNode;return T(o)&&o.nodeName===t},eV=e=>T(e)&&/^(OL|UL|LI)$/.test(e.nodeName),tV=e=>T(e)&&/^(LI|DT|DD)$/.test(e.nodeName),oV=e=>eV(e)&&eV(e.parentNode),nV=e=>{const t=e.parentNode;return tV(t)?t:e},rV=(e,t,o)=>{let n=e[o?"firstChild":"lastChild"];while(n){if(Kr(n))break;n=n[o?"nextSibling":"previousSibling"]}return n===t},sV=(e,t,o,n,r)=>{const s=e.dom,a=e.selection.getRng(),i=o.parentNode;if(o===e.getBody()||!i)return;oV(o)&&(r="LI");let l=t(r);if(rV(o,n,!0)&&rV(o,n,!1))if(QF(o,"LI")){const e=nV(o);s.insertAfter(l,e),JF(o)?s.remove(e):s.remove(o)}else s.replace(l,o);else if(rV(o,n,!0))QF(o,"LI")?(s.insertAfter(l,nV(o)),l.appendChild(s.doc.createTextNode(" ")),l.appendChild(o)):i.insertBefore(l,o),s.remove(n);else if(rV(o,n,!1))s.insertAfter(l,nV(o)),s.remove(n);else{o=nV(o);const e=a.cloneRange();e.setStartAfter(n),e.setEndAfter(o);const t=e.extractContents();"LI"===r&&XF(t,"LI")?(l=t.firstChild,s.insertAfter(t,o)):(s.insertAfter(t,o),s.insertAfter(l,o)),s.remove(n)}WF(e,l)},aV=e=>{Q(Lr(ln.fromDom(e),Do),(e=>{const t=e.dom;t.nodeValue=ra(t.data)}))},iV=(e,t)=>{const o=e.dom.getParent(t,"ol,ul,dl");return null!==o&&"false"===e.dom.getContentEditableParent(o)},lV=(e,t)=>t&&"A"===t.nodeName&&e.isEmpty(t),cV=e=>{e.innerHTML='<br data-mce-bogus="1">'},dV=(e,t)=>e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t,mV=(e,t)=>T(t)&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t),uV=(e,t,o)=>{var n;const r=[];if(!o)return;let s=o;while(s=s.firstChild){if(e.isBlock(s))return;Kr(s)&&!t[s.nodeName.toLowerCase()]&&r.push(s)}let a=r.length;while(a--)s=r[a],(!s.hasChildNodes()||s.firstChild===s.lastChild&&""===(null===(n=s.firstChild)||void 0===n?void 0:n.nodeValue)||lV(e,s))&&e.remove(s)},gV=(e,t,o)=>as(t)?e?1===o&&t.data.charAt(o-1)===oa?0:o:o===t.data.length-1&&t.data.charAt(o)===oa?t.data.length:o:o,hV=e=>{const t=e.cloneRange();return t.setStart(e.startContainer,gV(!0,e.startContainer,e.startOffset)),t.setEnd(e.endContainer,gV(!1,e.endContainer,e.endOffset)),t},pV=e=>{let t=e;do{as(t)&&(t.data=t.data.replace(/^[\r\n]+/,"")),t=t.firstChild}while(t)},fV=(e,t,o)=>{const n=e.dom;j.from(o.style).map(n.parseStyle).each((e=>{const o=Jn(ln.fromDom(t)),r={...o,...e};n.setStyles(t,r)}));const r=j.from(o.class).map((e=>e.split(/\s+/))),s=j.from(t.className).map((e=>oe(e.split(/\s+/),(e=>""!==e))));fo(r,s,((e,o)=>{const r=oe(o,(t=>!Y(e,t))),s=[...e,...r];n.setAttrib(t,"class",s.join(" "))}));const a=["style","class"],i=De(o,((e,t)=>!Y(a,t)));n.setAttribs(t,i)},bV=(e,t)=>{const o=Dm(e);if(o.toLowerCase()===t.tagName.toLowerCase()){const o=Am(e);fV(e,t,o)}},vV=(e,t,o,n,r)=>{var s;const a=e.dom,i=null!==(s=qF(a,n))&&void 0!==s?s:a.getRoot();let l=a.getParent(n,a.isBlock);if(!l||!mV(a,l)){let s;if(l=l||i,s=l===e.getBody()||bs(l)?l.nodeName.toLowerCase():l.parentNode?l.parentNode.nodeName.toLowerCase():"",!l.hasChildNodes()){const n=a.create(t);return bV(e,n),l.appendChild(n),o.setStart(n,0),o.setEnd(n,0),n}let c,d=n;while(d&&d.parentNode!==l)d=d.parentNode;while(d&&!a.isBlock(d))c=d,d=d.previousSibling;if(c&&e.schema.isValidChild(s,t.toLowerCase())){const s=c.parentNode,i=a.create(t);bV(e,i),s.insertBefore(i,c),d=c;while(d&&!a.isBlock(d)){const e=d.nextSibling;i.appendChild(d),d=e}o.setStart(n,r),o.setEnd(n,r)}}return n},yV=(e,t)=>{t.normalize();const o=t.lastChild;(!o||Kr(o)&&/^(left|right)$/gi.test(e.getStyle(o,"float",!0)))&&e.add(t,"br")},wV=(e,t)=>{const o=Lm(e);return!O(t)&&(y(o)?Y(go.explode(o),t.nodeName.toLowerCase()):o)},xV=(e,t)=>{let o,n,r,s,a=!1;const i=e.dom,l=e.schema,c=l.getNonEmptyElements(),d=e.selection.getRng(),m=Dm(e),u=t=>{let n=o;const s=l.getTextInlineElements();let a;a=t||"TABLE"===r||"HR"===r?i.create(t||m):v.cloneNode(!1);let c=a;if(!1===Bm(e))i.setAttrib(a,"style",null),i.setAttrib(a,"class",null);else do{if(s[n.nodeName]){if(Lh(n)||rp(n))continue;const e=n.cloneNode(!1);i.setAttrib(e,"id",""),a.hasChildNodes()?(e.appendChild(a.firstChild),a.appendChild(e)):(c=e,a.appendChild(e))}}while((n=n.parentNode)&&n!==b);return bV(e,a),cV(c),a},g=e=>{const t=gV(e,o,n);if(as(o)&&(e?t>0:t<o.data.length))return!1;if(o.parentNode===v&&a&&!e)return!0;if(e&&Kr(o)&&o===v.firstChild)return!0;if(dV(o,"TABLE")||dV(o,"HR"))return a&&!e||!a&&e;const r=new Wr(o,v);let s;as(o)&&(e&&0===t?r.prev():e||t!==o.data.length||r.next());while(s=r.current()){if(Kr(s)){if(!s.getAttribute("data-mce-bogus")){const e=s.nodeName.toLowerCase();if(c[e]&&"br"!==e)return!1}}else if(as(s)&&!Ha(s.data))return!1;e?r.prev():r.next()}return!0},h=()=>{let t;return t=/^(H[1-6]|PRE|FIGURE)$/.test(r)&&"HGROUP"!==y?u(m):u(),wV(e,s)&&mV(i,s)&&i.isEmpty(v)?t=i.split(s,v):i.insertAfter(t,v),WF(e,t),t};gv(i,d).each((e=>{d.setStart(e.startContainer,e.startOffset),d.setEnd(e.endContainer,e.endOffset)})),o=d.startContainer,n=d.startOffset;const p=!(!t||!t.shiftKey),f=!(!t||!t.ctrlKey);Kr(o)&&o.hasChildNodes()&&(a=n>o.childNodes.length-1,o=o.childNodes[Math.min(n,o.childNodes.length-1)]||o,n=a&&as(o)?o.data.length:0);const b=qF(i,o);if(!b||iV(e,o))return;p||(o=vV(e,m,d,o,n));let v=i.getParent(o,i.isBlock)||i.getRoot();s=T(null===v||void 0===v?void 0:v.parentNode)?i.getParent(v.parentNode,i.isBlock):null,r=v?v.nodeName.toUpperCase():"";const y=s?s.nodeName.toUpperCase():"";if("LI"===y&&!f){const e=s;v=e,s=e.parentNode,r=y}if(/^(LI|DT|DD)$/.test(r)&&Kr(s)&&i.isEmpty(v))return void sV(e,u,s,v,m);if(v===e.getBody())return;const w=v.parentNode;let x;if(ia(v))x=va(v),i.isEmpty(v)&&cV(v),bV(e,x),WF(e,x);else if(g(!1))x=h();else if(g(!0)&&w)x=w.insertBefore(u(),v),WF(e,dV(v,"HR")?x:v);else{const t=hV(d).cloneRange();t.setEndAfter(v);const o=t.extractContents();aV(o),pV(o),x=o.firstChild,i.insertAfter(o,v),uV(i,c,x),yV(i,v),i.isEmpty(v)&&cV(v),x.normalize(),i.isEmpty(x)?(i.remove(x),h()):(bV(e,x),WF(e,x))}i.setAttrib(x,"id",""),e.dispatch("NewBlock",{newBlock:x})},CV="insertParagraph",SV={insert:xV,fakeEventName:CV},kV=(e,t,o)=>{const n=new Wr(t,o);let r;const s=e.getNonEmptyElements();while(r=n.next())if(s[r.nodeName.toLowerCase()]||as(r)&&r.length>0)return!0;return!1},_V=(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),Gv(e,n)},OV=(e,t)=>{const o=e.selection,n=e.dom,r=o.getRng();let s,a=!1;gv(n,r).each((e=>{r.setStart(e.startContainer,e.startOffset),r.setEnd(e.endContainer,e.endOffset)}));let i=r.startOffset,l=r.startContainer;if(Kr(l)&&l.hasChildNodes()){const e=i>l.childNodes.length-1;l=l.childNodes[Math.min(i,l.childNodes.length-1)]||l,i=e&&as(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),as(l)&&i>=l.data.length&&(kV(e.schema,l,c||n.getRoot())||(s=n.create("br"),r.insertNode(s),r.setStartAfter(s),r.setEndAfter(s),a=!0)),s=n.create("br"),xd(n,r,s),_V(e,s,a),e.undoManager.add()},TV=(e,t)=>{const o=ln.fromTag("br");tr(ln.fromDom(t),o),e.undoManager.add()},EV=(e,t)=>{AV(e.getBody(),t)||or(ln.fromDom(t),ln.fromTag("br"));const o=ln.fromTag("br");or(ln.fromDom(t),o),_V(e,o.dom,!1),e.undoManager.add()},DV=e=>us(e.getNode()),AV=(e,t)=>!!DV(bd.after(t))||Ah(e,bd.after(t)).map((e=>us(e.getNode()))).getOr(!1),MV=e=>e&&"A"===e.nodeName&&"href"in e,NV=e=>e.fold(Z,MV,MV,Z),RV=e=>{const t=I(pC,e),o=bd.fromRangeStart(e.selection.getRng());return MB(t,e.getBody(),o).filter(NV)},BV=(e,t)=>{t.fold(M,I(TV,e),I(EV,e),M)},LV=(e,t)=>{const o=RV(e);o.isSome()?o.each(I(BV,e)):OV(e,t)},HV="insertLineBreak",IV={insert:LV,fakeEventName:HV},PV=(e,t)=>GF(e).filter((e=>t.length>0&&dn(ln.fromDom(e),t))).isSome(),zV=e=>PV(e,Nm(e)),FV=e=>PV(e,Rm(e)),VV=nm.generate([{br:[]},{block:[]},{none:[]}]),ZV=(e,t)=>FV(e),UV=e=>(t,o)=>YF(t)===e,jV=(e,t)=>(o,n)=>{const r=KF(o)===e.toUpperCase();return r===t},$V=e=>{const t=qF(e.dom,e.selection.getStart());return O(t)},WV=e=>jV("pre",e),qV=()=>jV("summary",!0),GV=e=>(t,o)=>Em(t)===e,KV=(e,t)=>zV(e),YV=(e,t)=>t,XV=e=>{const t=Dm(e),o=qF(e.dom,e.selection.getStart());return T(o)&&e.schema.isValidChild(o.nodeName,t)},JV=(e,t)=>(o,n)=>{const r=re(e,((e,t)=>e&&t(o,n)),!0);return r?j.some(t):j.none()},QV=(e,t)=>xB([JV([ZV],VV.none()),JV([WV(!0),$V],VV.none()),JV([qV()],VV.br()),JV([WV(!0),GV(!1),YV],VV.br()),JV([WV(!0),GV(!1)],VV.block()),JV([WV(!0),GV(!0),YV],VV.block()),JV([WV(!0),GV(!0)],VV.br()),JV([UV(!0),YV],VV.br()),JV([UV(!0)],VV.block()),JV([KV],VV.br()),JV([YV],VV.br()),JV([XV],VV.block())],[e,!(!t||!t.shiftKey)]).getOr(VV.none()),eZ=(e,t,o)=>{if(t.selection.isCollapsed()||_C(t),T(o)){const o=VF(t,e.fakeEventName);if(o.isDefaultPrevented())return}e.insert(t,o),T(o)&&FF(t,e.fakeEventName)},tZ=(e,t)=>{const o=()=>eZ(IV,e,t),n=()=>eZ(SV,e,t),r=QV(e,t);switch(Mm(e)){case"linebreak":r.fold(o,o,M);break;case"block":r.fold(n,n,M);break;case"invert":r.fold(n,o,M);break;default:r.fold(o,n,M);break}},oZ=(e,t)=>{t.isDefaultPrevented()||(t.preventDefault(),FD(e.undoManager),e.undoManager.transact((()=>{tZ(e,t)})))},nZ=e=>{e.on("keydown",(t=>{t.keyCode===db.ENTER&&oZ(e,t)}))},rZ=(e,t,o)=>{const n=to.os.isMacOS()||to.os.isiOS();fI([{keyCode:db.END,action:pI(oI,e,!0)},{keyCode:db.HOME,action:pI(oI,e,!1)},...n?[]:[{keyCode:db.HOME,action:pI(nI,e,!1),ctrlKey:!0,shiftKey:!0},{keyCode:db.END,action:pI(nI,e,!0),ctrlKey:!0,shiftKey:!0}],{keyCode:db.END,action:pI(wI,e,!0)},{keyCode:db.HOME,action:pI(wI,e,!1)},{keyCode:db.END,action:pI(WL,e,!0,t)},{keyCode:db.HOME,action:pI(WL,e,!1,t)}],o).each((e=>{o.preventDefault()}))},sZ=(e,t)=>{e.on("keydown",(o=>{o.isDefaultPrevented()||rZ(e,t,o)}))},aZ=e=>{e.on("input",(t=>{t.isComposing||Ux(e)}))},iZ=Gt(),lZ=(e,t,o)=>{fI([{keyCode:db.PAGE_UP,action:pI(WL,e,!1,t)},{keyCode:db.PAGE_DOWN,action:pI(WL,e,!0,t)}],o)},cZ=e=>e.stopImmediatePropagation(),dZ=e=>e.keyCode===db.PAGE_UP||e.keyCode===db.PAGE_DOWN,mZ=(e,t,o)=>{o&&!e.get()?t.on("NodeChange",cZ,!0):!o&&e.get()&&t.off("NodeChange",cZ),e.set(o)},uZ=(e,t)=>{if(iZ.os.isMacOS())return;const o=Fl(!1);e.on("keydown",(t=>{dZ(t)&&mZ(o,e,!0)})),e.on("keyup",(n=>{n.isDefaultPrevented()||lZ(e,t,n),dZ(n)&&o.get()&&(mZ(o,e,!1),e.nodeChanged())}))},gZ=(e,t)=>{const o=t.container(),n=t.offset();return as(o)?(o.insertData(n,e),j.some(bd(o,n+e.length))):th(t).map((o=>{const n=ln.fromText(e);return t.isAtEnd()?or(o,n):tr(o,n),bd(n.dom,e.length)}))},hZ=I(gZ,xs),pZ=I(gZ," "),fZ=e=>t=>t.fold((t=>Mh(e.dom,bd.before(t))),(e=>Nh(e)),(e=>Rh(e)),(t=>Ah(e.dom,bd.after(t)))),bZ=(e,t)=>o=>Ax(e,o)?hZ(t):pZ(t),vZ=e=>t=>(e.selection.setRng(t.toRange()),e.nodeChanged(),!0),yZ=e=>{const t=bd.fromRangeStart(e.selection.getRng()),o=ln.fromDom(e.getBody());if(e.selection.isCollapsed()){const n=I(pC,e),r=bd.fromRangeStart(e.selection.getRng());return MB(n,e.getBody(),r).bind(fZ(o)).map((n=>()=>bZ(o,t)(n).each(vZ(e))))}return j.none()},wZ=(e,t)=>{bI([{keyCode:db.SPACEBAR,action:pI(yZ,e)}],t).each((o=>{t.preventDefault();const n=VF(e,"insertText",{data:" "});n.isDefaultPrevented()||(o(),FF(e,"insertText",{data:" "}))}))},xZ=e=>{e.on("keydown",(t=>{t.isDefaultPrevented()||wZ(e,t)}))},CZ=e=>ig(e)?[{keyCode:db.TAB,action:pI(fP,e,!0)},{keyCode:db.TAB,shiftKey:!0,action:pI(fP,e,!1)}]:[],SZ=(e,t)=>{fI([...CZ(e)],t).each((e=>{t.preventDefault()}))},kZ=e=>{e.on("keydown",(t=>{t.isDefaultPrevented()||SZ(e,t)}))},_Z=e=>{if(e.addShortcut("Meta+P","","mcePrint"),PF(e),oA(e))return Fl(null);{const t=UL(e);return WH(e),vP(e,t),jF(e,t),nZ(e),xZ(e),aZ(e),kZ(e),sZ(e,t),uZ(e,t),t}};class OZ{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&&nv(r,t)||e.dispatch("SelectionChange"),t=r})),e.on("contextmenu",(()=>{e.dispatch("SelectionChange")})),e.on("SelectionChange",(()=>{const t=e.selection.getStart(!0);t&&Np(e)&&!o.isSameElementPath(t)&&e.dom.isChildOf(t,e.getBody())&&e.nodeChanged({selectionChange:!0})})),e.on("mouseup",(t=>{!t.isDefaultPrevented()&&Np(e)&&("IMG"===e.selection.getNode().nodeName?fy.setEditorTimeout(e,(()=>{e.nodeChanged()})):e.nodeChanged())}))}nodeChanged(e={}){const t=this.editor.selection;let o;if(this.editor.initialized&&t&&!Su(this.editor)&&!this.editor.mode.isReadOnly()){const n=this.editor.getBody();o=t.getStart(!0)||n,o.ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(o,n)||(o=n);const r=[];this.editor.dom.getParent(o,(e=>e===n||(r.push(e),!1))),this.editor.dispatch("NodeChange",{...e,element:o,parents:r})}}isSameElementPath(e){let t;const o=this.editor,n=me(o.dom.getParents(e,U,o.getBody()));if(n.length===this.lastPath.length){for(t=n.length;t>=0;t--)if(n[t]!==this.lastPath[t])break;if(-1===t)return this.lastPath=n,!0}return this.lastPath=n,!1}}const TZ="x-tinymce/html",EZ=B(TZ),DZ="\x3c!-- "+TZ+" --\x3e",AZ=e=>DZ+e,MZ=e=>e.replace(DZ,""),NZ=e=>-1!==e.indexOf(DZ),RZ=e=>!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(e),BZ=(e,t)=>{let o="<"+e;const n=Ae(t,((e,t)=>t+'="'+Wi.encodeAllRaw(e)+'"'));return n.length&&(o+=" "+n.join(" ")),o+">"},LZ=(e,t,o)=>{const n=e.split(/\n\n/),r=BZ(t,o),s="</"+t+">",a=J(n,(e=>e.split(/\n/).join("<br />"))),i=e=>r+e+s;return 1===a.length?a[0]:J(a,i).join("")},HZ="%MCEPASTEBIN%",IZ=(e,t)=>{const{dom:o,selection:n}=e,r=e.getBody();t.set(n.getRng());const s=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"},HZ);to.browser.isFirefox()&&o.setStyle(s,"left","rtl"===o.getStyle(r,"direction",!0)?65535:-65535),o.bind(s,"beforedeactivate focusin focusout",(e=>{e.stopPropagation()})),s.focus(),n.select(s,!0)},PZ=(e,t)=>{const o=e.dom;if(zZ(e)){let n;const r=t.get();while(n=zZ(e))o.remove(n),o.unbind(n);r&&e.selection.setRng(r)}t.set(null)},zZ=e=>e.dom.get("mcepastebin"),FZ=e=>T(e)&&"mcepastebin"===e.id,VZ=e=>{const t=e.dom,o=(e,o)=>{e.appendChild(o),t.remove(o,!0)},[n,...r]=oe(e.getBody().childNodes,FZ);Q(r,(e=>{o(n,e)}));const s=t.select("div[id=mcepastebin]",n);for(let a=s.length-1;a>=0;a--){const e=t.create("div");n.insertBefore(e,s[a]),o(e,s[a])}return n?n.innerHTML:""},ZZ=e=>e===HZ,UZ=e=>{const t=Fl(null);return{create:()=>IZ(e,t),remove:()=>PZ(e,t),getEl:()=>zZ(e),getHtml:()=>VZ(e),getLastRng:t.get}},jZ=(e,t)=>(go.each(t,(t=>{e=v(t,RegExp)?e.replace(t,""):e.replace(t[0],t[1])})),e),$Z=e=>{const t=al(),o=TE({},t);let n="";const r=t.getVoidElements(),s=go.makeMap("script noscript style textarea video audio iframe object"," "),a=t.getBlockElements(),i=e=>{const o=e.name,l=e;if("br"!==o){if("wbr"!==o)if(r[o]&&(n+=" "),s[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)}a[o]&&l.next&&(n+="\n","p"===o&&(n+="\n"))}}else n+="\n"};return e=jZ(e,[/<!\[[^\]]+\]>/g]),i(o.parse(e)),n},WZ=e=>{const t=(e,t,o)=>t||o?xs:" ";return e=jZ(e,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,t],/<br class="Apple-interchange-newline">/g,/<br>$/i]),e},qZ=e=>{let t=0;return()=>e+t++},GZ=e=>{const t=e.toLowerCase(),o={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"};return go.hasOwn(o,t)?"image/"+o[t]:"image/"+t},KZ=(e,t)=>{const o=TE({},e.schema);o.addNodeFilter("meta",(e=>{go.each(e,(e=>{e.remove()}))}));const n=o.parse(t,{forced_root_block:!1,isRootContent:!0});return Aw({validate:!0},e.schema).serialize(n)},YZ=(e,t)=>({content:e,cancelled:t}),XZ=(e,t,o)=>{const n=e.dom.create("div",{style:"display:none"},t),r=lb(e,n,o);return YZ(r.node.innerHTML,r.isDefaultPrevented())},JZ=(e,t,o)=>{const n=ib(e,t,o),r=KZ(e,n.content);return e.hasEventListeners("PastePostProcess")&&!n.isDefaultPrevented()?XZ(e,r,o):YZ(r,n.isDefaultPrevented())},QZ=(e,t,o)=>JZ(e,t,o),eU=(e,t)=>(e.insertContent(t,{merge:$u(e),paste:!0}),!0),tU=e=>/^https?:\/\/[\w\-\/+=.,!;:&%@^~(){}?#]+$/i.test(e),oU=(e,t)=>tU(t)&&X(ag(e),(e=>dt(t.toLowerCase(),`.${e.toLowerCase()}`))),nU=(e,t,o)=>(e.undoManager.extra((()=>{o(e,t)}),(()=>{e.insertContent('<img src="'+t+'">')})),!0),rU=(e,t,o)=>(e.undoManager.extra((()=>{o(e,t)}),(()=>{e.execCommand("mceInsertLink",!1,t)})),!0),sU=(e,t,o)=>!(e.selection.isCollapsed()||!tU(t))&&rU(e,t,o),aU=(e,t,o)=>!!oU(e,t)&&nU(e,t,o),iU=(e,t)=>{go.each([sU,aU,eU],(o=>!o(e,t,eU)))},lU=(e,t,o)=>{o||!Wu(e)?eU(e,t):iU(e,t)},cU=qZ("mceclip"),dU=(e,t,o,n)=>{const r=QZ(e,t,o);r.cancelled||lU(e,r.content,n)},mU=(e,t,o)=>{const n=o||NZ(t);dU(e,MZ(t),n,!1)},uU=(e,t)=>{const o=e.dom.encode(t).replace(/\r\n/g,"\n"),n=Fa(o,Gu(e)),r=LZ(n,Dm(e),Am(e));dU(e,r,!1,!0)},gU=e=>{const t={};if(e&&e.types)for(let n=0;n<e.types.length;n++){const r=e.types[n];try{t[r]=e.getData(r)}catch(o){t[r]=""}}return t},hU=(e,t)=>t in e&&e[t].length>0,pU=e=>hU(e,"text/html")||hU(e,"text/plain"),fU=(e,t)=>{const o=t.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i);return T(o)?e.dom.encode(o[1]):void 0},bU=(e,t,o,n)=>{const r=cU(),s=Im(e)&&T(o.name),a=s?fU(e,o.name):r,i=s?o.name:void 0,l=t.create(r,o,n,a,i);return t.add(l),l},vU=(e,t)=>{WT(t.uri).each((({data:o,type:n,base64Encoded:r})=>{const s=r?o:btoa(o),a=t.file,i=e.editorUpload.blobCache,l=i.getByData(s,n),c=null!==l&&void 0!==l?l:bU(e,i,a,s);mU(e,`<img src="${c.blobUri()}">`,!1)}))},yU=e=>"paste"===e.type,wU=e=>Promise.all(J(e,(e=>YT(e).then((t=>({file:e,uri:t})))))),xU=e=>{const t=ag(e);return e=>ct(e.type,"image/")&&X(t,(t=>GZ(t)===e.type))},CU=(e,t)=>{const o=t.items?ce(ve(t.items),(e=>"file"===e.kind?[e.getAsFile()]:[])):[],n=t.files?ve(t.files):[];return oe(o.length>0?o:n,xU(e))},SU=(e,t,o)=>{const n=yU(t)?t.clipboardData:t.dataTransfer;if(Fu(e)&&n){const r=CU(e,n);if(r.length>0)return t.preventDefault(),wU(r).then((t=>{o&&e.selection.setRng(o),Q(t,(t=>{vU(e,t)}))})),!0}return!1},kU=e=>{var t,o;return to.os.isAndroid()&&0===(null===(o=null===(t=e.clipboardData)||void 0===t?void 0:t.items)||void 0===o?void 0:o.length)},_U=e=>db.metaKeyPressed(e)&&86===e.keyCode||e.shiftKey&&45===e.keyCode,OU=(e,t,o,n)=>{let r=WZ(o);const s=hU(t,EZ())||NZ(o),a=!s&&RZ(r),i=tU(r);(ZZ(r)||!r.length||a&&!i)&&(n=!0),(n||i)&&(r=hU(t,"text/plain")&&a?t["text/plain"]:$Z(r)),ZZ(r)||(n?uU(e,r):mU(e,r,s))},TU=(e,t,o)=>{let n;const r=()=>t.getLastRng()||e.selection.getRng();e.on("keydown",(e=>{_U(e)&&!e.isDefaultPrevented()&&(n=e.shiftKey&&86===e.keyCode)})),e.on("paste",(s=>{if(s.isDefaultPrevented()||kU(s))return;const a="text"===o.get()||n;n=!1;const i=gU(s.clipboardData);!pU(i)&&SU(e,s,r())||(hU(i,"text/html")?(s.preventDefault(),OU(e,i,i["text/html"],a)):(t.create(),fy.setEditorTimeout(e,(()=>{const o=t.getHtml();t.remove(),OU(e,i,o,a)}),0)))}))},EU=e=>{const t=e=>ct(e,"webkit-fake-url"),o=e=>ct(e,"data:"),n=e=>{var t;return!0===(null===(t=e.data)||void 0===t?void 0:t.paste)};e.parser.addNodeFilter("img",((r,s,a)=>{if(!Fu(e)&&n(a))for(const n of r){const r=n.attr("src");y(r)&&!n.attr("data-mce-object")&&r!==to.transparentSrc&&(t(r)||!Ku(e)&&o(r))&&n.remove()}}))},DU=(e,t,o)=>{TU(e,t,o),EU(e)},AU=(e,t)=>{"text"===t.get()?(t.set("html"),cb(e,!1)):(t.set("text"),cb(e,!0)),e.focus()},MU=(e,t)=>{e.addCommand("mceTogglePlainTextPaste",(()=>{AU(e,t)})),e.addCommand("mceInsertClipboardContent",((t,o)=>{o.html&&mU(e,o.html,o.internal),o.text&&uU(e,o.text)}))},NU=(e,t,o)=>{if(!e)return!1;try{return e.clearData(),e.setData("text/html",t),e.setData("text/plain",o),e.setData(EZ(),t),!0}catch(n){return!1}},RU=(e,t,o,n)=>{NU(e.clipboardData,t.html,t.text)?(e.preventDefault(),n()):o(t.html,n)},BU=e=>(t,o)=>{const{dom:n,selection:r}=e,s=n.create("div",{contenteditable:"false","data-mce-bogus":"all"}),a=n.create("div",{contenteditable:"true"},t);n.setStyles(s,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),s.appendChild(a),n.add(e.getBody(),s);const i=r.getRng();a.focus();const l=n.createRng();l.selectNodeContents(a),r.setRng(l),fy.setEditorTimeout(e,(()=>{r.setRng(i),n.remove(s),o()}),0)},LU=e=>({html:AZ(e.selection.getContent({contextual:!0})),text:e.selection.getContent({format:"text"})}),HU=e=>!!e.dom.getParent(e.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",e.getBody()),IU=e=>!e.selection.isCollapsed()||HU(e),PU=e=>t=>{!t.isDefaultPrevented()&&IU(e)&&RU(t,LU(e),BU(e),(()=>{if(to.browser.isChromium()||to.browser.isFirefox()){const t=e.selection.getRng();fy.setEditorTimeout(e,(()=>{e.selection.setRng(t),e.execCommand("Delete")}),0)}else e.execCommand("Delete")}))},zU=e=>t=>{!t.isDefaultPrevented()&&IU(e)&&RU(t,LU(e),BU(e),M)},FU=e=>{e.on("cut",PU(e)),e.on("copy",zU(e))},VU=(e,t)=>{var o,n;return fv.getCaretRangeFromPoint(null!==(o=t.clientX)&&void 0!==o?o:0,null!==(n=t.clientY)&&void 0!==n?n:0,e.getDoc())},ZU=e=>{const t=e["text/plain"];return!!t&&0===t.indexOf("file://")},UU=(e,t)=>{e.focus(),t&&e.selection.setRng(t)},jU=e=>X(e.files,(e=>/^image\//.test(e.type))),$U=(e,t)=>{zu(e)&&e.on("dragend dragover draggesture dragdrop drop drag",(e=>{e.preventDefault(),e.stopPropagation()})),Fu(e)||e.on("drop",(e=>{const t=e.dataTransfer;t&&jU(t)&&e.preventDefault()})),e.on("drop",(o=>{if(o.isDefaultPrevented()||t.get())return;const n=VU(e,o);if(O(n))return;const r=gU(o.dataTransfer),s=hU(r,EZ());if((!pU(r)||ZU(r))&&SU(e,o,n))return;const a=r[EZ()],i=a||r["text/html"]||r["text/plain"];i&&(o.preventDefault(),fy.setEditorTimeout(e,(()=>{e.undoManager.transact((()=>{a&&e.execCommand("Delete"),UU(e,n);const t=WZ(i);r["text/html"]?mU(e,t,s):uU(e,t)}))})))})),e.on("dragstart",(e=>{t.set(!0)})),e.on("dragover dragend",(o=>{Fu(e)&&!t.get()&&(o.preventDefault(),UU(e,VU(e,o))),"dragend"===o.type&&t.set(!1)}))},WU=e=>{const t=t=>o=>{t(e,o)},o=Vu(e);E(o)&&e.on("PastePreProcess",t(o));const n=Zu(e);E(n)&&e.on("PastePostProcess",t(n))},qU=(e,t)=>{e.on("PastePreProcess",(o=>{o.content=t(e,o.content,o.internal)}))},GU=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,KU=e=>go.trim(e).replace(GU,bp).toLowerCase(),YU=(e,t,o)=>{const n=Uu(e);if(o||"all"===n||!ju(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,s,a)=>{const i=o.parseStyle(o.decode(s)),l={};for(let d=0;d<r.length;d++){const e=i[r[d]];let t=e,s=o.getStyle(n,r[d],!0);/color/.test(r[d])&&(t=KU(t),s=KU(s)),s!==t&&(l[r[d]]=e)}const c=o.serializeStyle(l,"span");return c?t+' style="'+c+'"'+a:t+a}))}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},XU=e=>{(to.browser.isChromium()||to.browser.isSafari())&&qU(e,YU)},JU=e=>{const t=Fl(!1),o=Fl(qu(e)?"text":"html"),n=UZ(e);XU(e),MU(e,o),WU(e),e.on("PreInit",(()=>{FU(e),$U(e,t),DU(e,n,o)}))},QU=e=>{e.on("click",(t=>{e.dom.getParent(t.target,"details")&&t.preventDefault()}))},ej=e=>{e.parser.addNodeFilter("details",(e=>{Q(e,(e=>{e.attr("data-mce-open",e.attr("open")),e.attr("open","open")}))})),e.serializer.addNodeFilter("details",(e=>{Q(e,(e=>{const t=e.attr("data-mce-open");e.attr("open",y(t)?t:null),e.attr("data-mce-open",null)}))}))},tj=e=>{QU(e),ej(e)},oj=us,nj=as,rj=e=>ps(e.dom),sj=e=>hs(e.dom),aj=e=>t=>hn(ln.fromDom(e),t),ij=(e,t)=>Pr(ln.fromDom(e),(e=>sj(e)||zs(e)),aj(t)).getOr(ln.fromDom(t)).dom,lj=(e,t)=>Pr(ln.fromDom(e),rj,aj(t)),cj=(e,t,o)=>{const n=new Wr(e,t),r=o?n.next.bind(n):n.prev.bind(n);let s=e;for(let a=o?e:r();a&&!oj(a);a=r())Ea(a)&&(s=a);return s},dj=(e,t)=>{const o=bd.fromRangeStart(e),n=o.getNode(),r=ij(n,t),s=cj(n,r,!1),a=cj(n,r,!0),i=document.createRange();return lj(s,r).fold((()=>{nj(s)?i.setStart(s,0):i.setStartBefore(s)}),(e=>i.setStartBefore(e.dom))),lj(a,r).fold((()=>{nj(a)?i.setEnd(a,a.data.length):i.setEndAfter(a)}),(e=>i.setEndAfter(e.dom))),i},mj=e=>{const t=dj(e.selection.getRng(),e.getBody());e.selection.setRng(XS(t))},uj=e=>{e.on("mousedown",(t=>{t.detail>=3&&(t.preventDefault(),mj(e))}))};var gj;(function(e){e["Before"]="before",e["After"]="after"})(gj||(gj={}));const hj=(e,t)=>Math.abs(e.left-t),pj=(e,t)=>Math.abs(e.right-t),fj=(e,t)=>e>=t.top&&e<=t.bottom,bj=(e,t)=>e.top<t.bottom&&e.bottom>t.top,vj=(e,t)=>{const o=Zc(e,t)/Math.min(e.height,t.height);return bj(e,t)&&o>.5},yj=(e,t)=>{const o=oe(e,(e=>fj(t,e)));return Fc(o).fold((()=>[[],e]),(t=>{const{pass:o,fail:n}=te(e,(e=>vj(e,t)));return[o,n]}))},wj=(e,t)=>({node:e.node,position:hj(e,t)<pj(e,t)?gj.Before:gj.After}),xj=(e,t,o)=>t>e.left&&t<e.right?0:Math.min(Math.abs(e.left-t),Math.abs(e.right-t)),Cj=(e,t,o)=>{const n=e=>Ea(e.node)?j.some(e):Kr(e.node)?Cj(ve(e.node.childNodes),t,o):j.none(),r=(e,r)=>{if(e.length>=2){const s=n(e[0]).getOr(e[0]),a=n(e[1]).getOr(e[1]),i=Math.abs(r(s,t,o)-r(a,t,o));if(i<2){if(as(s.node))return j.some(s);if(as(a.node))return j.some(a)}}return j.none()},s=(e,s)=>{const a=he(e,((e,n)=>s(e,t,o)-s(n,t,o)));return r(a,s).orThunk((()=>ye(a,n)))},[a,i]=yj(pL(e),o),{pass:l,fail:c}=te(i,(e=>e.top<o));return s(a,xj).orThunk((()=>s(c,Vc))).orThunk((()=>s(l,Vc)))},Sj=(e,t,o,n)=>{const r=(t,s)=>{const a=e=>Kr(e)&&e.classList.contains("mce-drag-container"),i=oe(t.dom.childNodes,P(a));return s.fold((()=>Cj(i,o,n)),(e=>{const t=oe(i,(t=>t!==e.dom));return Cj(t,o,n)})).orThunk((()=>{const o=hn(t,e)?j.none():xn(t);return o.bind((e=>r(e,j.some(t))))}))};return r(t,j.none())},kj=(e,t,o)=>{const n=ln.fromDom(e),r=bn(n),s=ln.fromPoint(r,t,o).filter((e=>pn(n,e))),a=s.getOr(n);return Sj(n,a,t,o)},_j=(e,t,o)=>kj(e,t,o).filter((e=>Dg(e.node))).map((e=>wj(e,t))),Oj=e=>{var t,o;const n=e.getBoundingClientRect(),r=e.ownerDocument,s=r.documentElement,a=r.defaultView;return{top:n.top+(null!==(t=null===a||void 0===a?void 0:a.scrollY)&&void 0!==t?t:0)-s.clientTop,left:n.left+(null!==(o=null===a||void 0===a?void 0:a.scrollX)&&void 0!==o?o:0)-s.clientLeft}},Tj=e=>e.inline?Oj(e.getBody()):{left:0,top:0},Ej=e=>{const t=e.getBody();return e.inline?{left:t.scrollLeft,top:t.scrollTop}:{left:0,top:0}},Dj=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},Aj=(e,t)=>{if(t.target.ownerDocument!==e.getDoc()){const o=Oj(e.getContentAreaContainer()),n=Dj(e);return{left:t.pageX-o.left+n.left,top:t.pageY-o.top+n.top}}return{left:t.pageX,top:t.pageY}},Mj=(e,t,o)=>({pageX:o.left-e.left+t.left,pageY:o.top-e.top+t.top}),Nj=(e,t)=>Mj(Tj(e),Ej(e),Aj(e,t)),Rj=32,Bj=100,Lj=8,Hj=16,Ij=ps,Pj=Kc(Ij,hs),zj=(e,t)=>Ij(t)&&t!==e,Fj=(e,t,o)=>!O(t)&&(t!==o&&!e.dom.isChildOf(t,o)&&!Ij(t)),Vj=e=>{const t=e.cloneNode(!0);return t.removeAttribute("data-mce-selected"),t},Zj=(e,t,o,n)=>{const r=e.dom,s=t.cloneNode(!0);r.setStyles(s,{width:o,height:n}),r.setAttrib(s,"data-mce-selected",null);const a=r.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return r.setStyles(a,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:o,height:n}),r.setStyles(s,{margin:0,boxSizing:"border-box"}),a.appendChild(s),a},Uj=(e,t)=>{e.parentNode!==t&&t.appendChild(e)},jj=(e,t)=>o=>()=>{const n="left"===e?o.scrollX:o.scrollY;o.scroll({[e]:n+t,behavior:"smooth"})},$j=jj("left",-Rj),Wj=jj("left",Rj),qj=jj("top",-Rj),Gj=jj("top",Rj),Kj=(e,t,o,n,r,s,a,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>s&&(g=t.pageY+n-s),e.style.width=o-u+"px",e.style.height=n-g+"px";const h=l.clientHeight,p=l.clientWidth,f=a+l.getBoundingClientRect().top,b=i+l.getBoundingClientRect().left;d.on((e=>{e.intervalId.clear(),e.dragging&&m&&(a+Lj>=h?e.intervalId.set(Gj(c)):a-Lj<=0?e.intervalId.set(qj(c)):i+Lj>=p?e.intervalId.set(Wj(c)):i-Lj<=0?e.intervalId.set($j(c)):f+Hj>=window.innerHeight?e.intervalId.set(Gj(window)):f-Hj<=0?e.intervalId.set(qj(window)):b+Hj>=window.innerWidth?e.intervalId.set(Wj(window)):b-Hj<=0&&e.intervalId.set($j(window)))}))},Yj=e=>{e&&e.parentNode&&e.parentNode.removeChild(e)},Xj=e=>0===e.button,Jj=(e,t)=>({pageX:t.pageX-e.relX,pageY:t.pageY+5}),Qj=(e,t)=>o=>{if(Xj(o)){const n=ae(t.dom.getParents(o.target),Pj).getOr(null);if(T(n)&&zj(t.getBody(),n)){const r=t.dom.getPos(n),s=t.getBody(),a=t.getDoc().documentElement;e.set({element:n,dragging:!1,screenX:o.screenX,screenY:o.screenY,maxX:(t.inline?s.scrollWidth:a.offsetWidth)-2,maxY:(t.inline?s.scrollHeight:a.offsetHeight)-2,relX:o.pageX-r.x,relY:o.pageY-r.y,width:n.offsetWidth,height:n.offsetHeight,ghost:Zj(t,n,n.offsetWidth,n.offsetHeight),intervalId:oc(Bj)})}}},e$=(e,t)=>{const o=rc(((e,o)=>{t._selectionOverrides.hideFakeCaret(),_j(t.getBody(),e,o).fold((()=>t.selection.placeCaretAt(e,o)),(n=>{const r=t._selectionOverrides.showCaret(1,n.node,n.position===gj.Before,!1);r?t.selection.setRng(r):t.selection.placeCaretAt(e,o)}))}),0);t.on("remove",o.cancel);const n=e;return r=>e.on((e=>{const s=Math.max(Math.abs(r.screenX-e.screenX),Math.abs(r.screenY-e.screenY));if(!e.dragging&&s>10){const o=t.dispatch("dragstart",{target:e.element});if(o.isDefaultPrevented())return;e.dragging=!0,t.focus()}if(e.dragging){const s=r.currentTarget===t.getDoc().documentElement,a=Jj(e,Nj(t,r));Uj(e.ghost,t.getBody()),Kj(e.ghost,a,e.width,e.height,e.maxX,e.maxY,r.clientY,r.clientX,t.getContentAreaContainer(),t.getWin(),n,s),o.throttle(r.clientX,r.clientY)}}))},t$=e=>{const t=e.getSel();if(T(t)){const e=t.getRangeAt(0),o=e.startContainer;return as(o)?o.parentNode:o}return null},o$=(e,t)=>o=>{e.on((e=>{if(e.intervalId.clear(),e.dragging){if(Fj(t,t$(t.selection),e.element)){const n=Vj(e.element),r=t.dispatch("drop",{clientX:o.clientX,clientY:o.clientY});r.isDefaultPrevented()||t.undoManager.transact((()=>{Yj(e.element),t.insertContent(t.dom.getOuterHTML(n)),t._selectionOverrides.hideFakeCaret()}))}t.dispatch("dragend")}})),r$(e)},n$=(e,t)=>()=>{e.on((e=>{e.intervalId.clear(),e.dragging&&t.dispatch("dragend")})),r$(e)},r$=e=>{e.on((e=>{e.intervalId.clear(),Yj(e.ghost)})),e.clear()},s$=e=>{const t=nc(),o=Rl.DOM,n=document,r=Qj(t,e),s=e$(t,e),a=o$(t,e),i=n$(t,e);e.on("mousedown",r),e.on("mousemove",s),e.on("mouseup",a),o.bind(n,"mousemove",s),o.bind(n,"mouseup",i),e.on("remove",(()=>{o.unbind(n,"mousemove",s),o.unbind(n,"mouseup",i)})),e.on("keydown",(e=>{e.keyCode===db.ESC&&i()}))},a$=e=>{const t=t=>{if(!t.isDefaultPrevented()){const o=t.dataTransfer;o&&(Y(o.types,"Files")||o.files.length>0)&&(t.preventDefault(),"drop"===t.type&&YM(e,"Dropped file type is not supported"))}},o=o=>{Oy(e,o.target)&&t(o)},n=()=>{const n=Rl.DOM,r=e.dom,s=document,a=e.inline?e.getBody():e.getDoc(),i=["drop","dragover"];Q(i,(e=>{n.bind(s,e,o),r.bind(a,e,t)})),e.on("remove",(()=>{Q(i,(e=>{n.unbind(s,e,o),r.unbind(a,e,t)}))}))};e.on("init",(()=>{fy.setEditorTimeout(e,n,0)}))},i$=e=>{s$(e),Eu(e)&&a$(e)},l$=e=>{const t=rc((()=>{if(!e.removed&&e.getBody().contains(document.activeElement)){const t=e.selection.getRng();if(t.collapsed){const o=RR(e,t,!1);e.selection.setRng(o)}}}),0);e.on("focus",(()=>{t.throttle()})),e.on("blur",(()=>{t.cancel()}))},c$=e=>{e.on("init",(()=>{e.on("focusin",(t=>{const o=t.target;if(vs(o)){const t=AS(e.getBody(),o),n=ps(t)?t:o;e.selection.getNode()!==n&&MR(e,n).each((t=>e.selection.setRng(t)))}}))}))},d$=ps,m$=(e,t)=>AS(e.getBody(),t),u$=e=>{const t=e.selection,o=e.dom,n=e.getBody(),r=Og(e,n,o.isBlock,(()=>Fy(e))),s="sel-"+o.uniqueId(),a="data-mce-selected";let i;const l=e=>T(e)&&o.hasClass(e,"mce-offscreen-selection"),c=e=>e!==n&&(d$(e)||vs(e))&&o.isChildOf(e,n),d=e=>{e&&t.setRng(e)},m=(o,n,s,a=!0)=>{const i=e.dispatch("ShowCaret",{target:n,direction:o,before:s});return i.isDefaultPrevented()?null:(a&&t.scrollIntoView(n,-1===o),r.show(s,n))},u=e=>{e.hasAttribute("data-mce-caret")&&(va(e),t.scrollIntoView(e))},g=()=>{e.on("click",(t=>{const o=m$(e,t.target);o&&d$(o)&&(t.preventDefault(),e.focus())})),e.on("blur NewBlock",w),e.on("ResizeWindow FullscreenStateChanged",r.reposition),e.on("tap",(t=>{const o=t.target,n=m$(e,o);d$(n)?(t.preventDefault(),MR(e,n).each(y)):c(o)&&MR(e,o).each(y)}),!0),e.on("mousedown",(t=>{const r=t.target;if(r!==n&&"HTML"!==r.nodeName&&!o.isChildOf(r,n))return;if(!FM(e,t.clientX,t.clientY))return;w(),C();const s=m$(e,r);d$(s)?(t.preventDefault(),MR(e,s).each(y)):_j(n,t.clientX,t.clientY).each((o=>{t.preventDefault();const n=m(1,o.node,o.position===gj.Before,!1);d(n),Kr(s)?s.focus():e.getBody().focus()}))})),e.on("keypress",(e=>{db.modifierPressed(e)||d$(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("SetSelectionRange",(e=>{e.range=f(e.range);const t=y(e.range,e.forward);t&&(e.range=t)}));const s=e=>Kr(e)&&"mcepastebin"===e.id;e.on("AfterSetSelectionRange",(e=>{const t=e.range,o=t.startContainer.parentElement;p(t)||s(o)||C(),l(o)||w()})),i$(e),l$(e),c$(e)},h=e=>ca(e)||pa(e)||fa(e),p=e=>h(e.startContainer)||h(e.endContainer),f=t=>{const n=e.schema.getVoidElements(),r=o.createRng(),s=t.startContainer,a=t.startOffset,i=t.endContainer,l=t.endOffset;return Re(n,s.nodeName.toLowerCase())?0===a?r.setStartBefore(s):r.setStartAfter(s):r.setStart(s,a),Re(n,i.nodeName.toLowerCase())?0===l?r.setEndBefore(i):r.setEndAfter(i):r.setEnd(i,l),r},b=(n,r)=>{const a=ln.fromDom(e.getBody()),i=e.getDoc(),l=Ur(a,"#"+s).getOrThunk((()=>{const e=ln.fromHtml('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>',i);return Bo(e,"id",s),rr(a,e),e})),c=o.createRng();lr(l),ir(l,[ln.fromText(xs,i),ln.fromDom(r),ln.fromText(xs,i)]),c.setStart(l.dom.firstChild,1),c.setEnd(l.dom.lastChild,0),Gn(l,{top:o.getPos(n,e.getBody()).y+"px"}),Kv(l);const d=t.getSel();return d&&(d.removeAllRanges(),d.addRange(c)),c},v=t=>{const n=t.cloneNode(!0),r=e.dispatch("ObjectSelected",{target:t,targetClone:n});if(r.isDefaultPrevented())return null;const s=b(t,r.targetClone),l=ln.fromDom(t);return Q(ks(ln.fromDom(e.getBody()),`*[${a}]`),(e=>{hn(l,e)||zo(e,a)})),o.getAttrib(t,a)||t.setAttribute(a,"1"),i=t,C(),s},y=(e,t)=>{if(!e)return null;if(e.collapsed){if(!p(e)){const r=t?1:-1,s=eh(r,n,e),a=s.getNode(!t);if(T(a)){if(Dg(a))return m(r,a,!!t&&!s.isAtEnd(),!1);if(la(a)&&ps(a.nextSibling)){const e=o.createRng();return e.setStart(a,0),e.setEnd(a,0),e}}const i=s.getNode(t);if(T(i)){if(Dg(i))return m(r,i,!t&&!s.isAtEnd(),!1);if(la(i)&&ps(i.previousSibling)){const e=o.createRng();return e.setStart(i,1),e.setEnd(i,1),e}}}return null}let r=e.startContainer,s=e.startOffset;const a=e.endOffset;if(as(r)&&0===s&&d$(r.parentNode)&&(r=r.parentNode,s=o.nodeIndex(r),r=r.parentNode),!Kr(r))return null;if(a===s+1&&r===e.endContainer){const e=r.childNodes[s];if(c(e))return v(e)}return null},w=()=>{i&&i.removeAttribute(a),Ur(ln.fromDom(e.getBody()),"#"+s).each(cr),i=null},x=()=>{r.destroy(),i=null},C=()=>{r.hide()};return oA(e)||g(),{showCaret:m,showBlockCaretContainer:u,hideFakeCaret:C,destroy:x}},g$=(e,t)=>{let o=t;for(let n=e.previousSibling;as(n);n=n.previousSibling)o+=n.data.length;return o},h$=(e,t,o,n,r)=>{if(as(o)&&(n<0||n>o.data.length))return[];const s=r&&as(o)?[g$(o,n)]:[n];let a=o;while(a!==t&&a.parentNode)s.push(e.nodeIndex(a,r)),a=a.parentNode;return a===t?s.reverse():[]},p$=(e,t,o,n,r,s,a=!1)=>{const i=h$(e,t,o,n,a),l=h$(e,t,r,s,a);return{start:i,end:l}},f$=(e,t)=>{const o=t.slice(),n=o.pop();if(D(n)){const t=re(o,((e,t)=>e.bind((e=>j.from(e.childNodes[t])))),j.some(e));return t.bind((e=>as(e)&&(n<0||n>e.data.length)?j.none():j.some({node:e,offset:n})))}return j.none()},b$=(e,t)=>f$(e,t.start).bind((({node:o,offset:n})=>f$(e,t.end).map((({node:e,offset:t})=>{const r=document.createRange();return r.setStart(o,n),r.setEnd(e,t),r})))),v$=(e,t,o,n=!1)=>p$(e,t,o.startContainer,o.startOffset,o.endContainer,o.endOffset,n),y$=(e,t,o)=>{if(t&&e.isEmpty(t)&&!o(t)){const n=t.parentNode;e.remove(t),y$(e,n,o)}},w$=(e,t,o,n=!0)=>{const r=t.startContainer.parentNode,s=t.endContainer.parentNode;t.deleteContents(),n&&!o(t.startContainer)&&(as(t.startContainer)&&0===t.startContainer.data.length&&e.remove(t.startContainer),as(t.endContainer)&&0===t.endContainer.data.length&&e.remove(t.endContainer),y$(e,r,o),r!==s&&y$(e,s,o))},x$=(e,t)=>j.from(e.dom.getParent(t.startContainer,e.dom.isBlock)),C$=(e,t,o)=>{const n=e.dynamicPatternsLookup({text:o,block:t});return{...e,blockPatterns:lm(n).concat(e.blockPatterns),inlinePatterns:cm(n).concat(e.inlinePatterns)}},S$=(e,t,o,n)=>{const r=e.createRng();return r.setStart(t,0),r.setEnd(o,n),r.toString()},k$=(e,t,o)=>{const n=kP(t,0,t);n.each((n=>{const r=n.container;OP(r,o.start.length,t).each((o=>{const n=e.createRng();n.setStart(r,0),n.setEnd(o.container,o.offset),w$(e,n,(e=>e===t))}))}))},_$=(e,t)=>{const o=e.dom,n=t.pattern,r=b$(o.getRoot(),t.range).getOrDie("Unable to resolve path range"),s=(e,t)=>{const o=t.get(e);return C(o)&&fe(o).exists((e=>Re(e,"block")))};return x$(e,r).each((t=>{"block-format"===n.type?s(n.format,e.formatter)&&e.undoManager.transact((()=>{k$(e.dom,t,n),e.formatter.apply(n.format)})):"block-command"===n.type&&e.undoManager.transact((()=>{k$(e.dom,t,n),e.execCommand(n.cmd,!1,n.value)}))})),!0},O$=e=>he(e,((e,t)=>t.start.length-e.start.length)),T$=(e,t)=>{const o=O$(e),n=t.replace(xs," ");return ae(o,(e=>0===t.indexOf(e.start)||0===n.indexOf(e.start)))},E$=(e,t,o,n)=>{var r;const s=e.dom,a=Dm(e);if(!s.is(t,a))return[];const i=null!==(r=t.textContent)&&void 0!==r?r:"";return T$(o.blockPatterns,i).map((e=>go.trim(i).length===e.start.length?[]:[{pattern:e,range:p$(s,s.getRoot(),t,0,t,0,n)}])).getOr([])},D$=(e,t)=>{if(0===t.length)return;const o=e.selection.getBookmark();Q(t,(t=>_$(e,t))),e.selection.moveToBookmark(o)},A$=(e,t)=>e.create("span",{"data-mce-type":"bookmark",id:t}),M$=(e,t)=>{const o=e.createRng();return o.setStartAfter(t.start),o.setEndBefore(t.end),o},N$=(e,t,o)=>{const n=b$(e.getRoot(),o).getOrDie("Unable to resolve path range"),r=n.startContainer,s=n.endContainer,a=0===n.endOffset?s:s.splitText(n.endOffset),i=0===n.startOffset?r:r.splitText(n.startOffset),l=i.parentNode,c=a.parentNode;return{prefix:t,end:c.insertBefore(A$(e,t+"-end"),a),start:l.insertBefore(A$(e,t+"-start"),i)}},R$=(e,t,o)=>{y$(e,e.get(t.prefix+"-end"),o),y$(e,e.get(t.prefix+"-start"),o)},B$=e=>0===e.start.length,L$=e=>(t,o)=>{const n=t.data,r=n.substring(0,o),s=r.lastIndexOf(e.charAt(e.length-1)),a=r.lastIndexOf(e);return-1!==a?a+e.length:-1!==s?s+1:-1},H$=(e,t,o,n)=>{const r=t.start,s=TP(e,n.container,n.offset,L$(r),o);return s.bind((n=>{var s,a;const i=null!==(a=null===(s=o.textContent)||void 0===s?void 0:s.indexOf(r))&&void 0!==a?a:-1,l=-1!==i&&n.offset>=i+r.length;if(l){const t=e.createRng();return t.setStart(n.container,n.offset-r.length),t.setEnd(n.container,n.offset),j.some(t)}{const s=n.offset-r.length;return _P(n.container,s,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((()=>H$(e,t,o,yP(n.container,0))))}}))},I$=(e,t,o,n,r,s=!1)=>{if(0===t.start.length&&!s){const t=e.createRng();return t.setStart(o,n),t.setEnd(o,n),j.some(t)}return SP(o,n,r).bind((o=>{const n=H$(e,t,r,o);return n.bind((e=>{var t;if(s){if(e.endContainer===o.container&&e.endOffset===o.offset)return j.none();if(0===o.offset&&(null===(t=e.endContainer.textContent)||void 0===t?void 0:t.length)===e.endOffset)return j.none()}return j.some(e)}))}))},P$=(e,t,o,n)=>{const r=e.dom,s=r.getRoot(),a=o.pattern,i=o.position.container,l=o.position.offset;return _P(i,l-o.pattern.end.length,t).bind((c=>{const d=p$(r,s,c.container,c.offset,i,l,n);if(B$(a))return j.some({matches:[{pattern:a,startRng:d,endRng:d}],position:c});{const i=z$(e,o.remainingPatterns,c.container,c.offset,t,n),l=i.getOr({matches:[],position:c}),m=l.position,u=I$(r,a,m.container,m.offset,t,i.isNone());return u.map((e=>{const t=v$(r,s,e,n);return{matches:l.matches.concat([{pattern:a,startRng:t,endRng:d}]),position:yP(e.startContainer,e.startOffset)}}))}}))},z$=(e,t,o,n,r,s)=>{const a=e.dom;return SP(o,n,a.getRoot()).bind((i=>{const l=S$(a,r,o,n);for(let a=0;a<t.length;a++){const c=t[a];if(!dt(l,c.end))continue;const d=t.slice();d.splice(a,1);const m=P$(e,r,{pattern:c,remainingPatterns:d,position:i},s);if(m.isNone()&&n>0)return z$(e,t,o,n-1,r,s);if(m.isSome())return m}return j.none()}))},F$=(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)},V$=(e,t,o,n)=>{const r=M$(e.dom,o);w$(e.dom,r,n),F$(e,t,r)},Z$=(e,t,o,n,r)=>{const s=e.dom,a=M$(s,n),i=M$(s,o);w$(s,i,r),w$(s,a,r);const l={prefix:o.prefix,start:o.end,end:n.start},c=M$(s,l);F$(e,t,c)},U$=(e,t)=>{const o=Cc("mce_textpattern"),n=ne(t,((t,n)=>{const r=N$(e,o+`_end${t.length}`,n.endRng);return t.concat([{...n,endMarker:r}])}),[]);return ne(n,((t,r)=>{const s=n.length-t.length-1,a=B$(r.pattern)?r.endMarker:N$(e,o+`_start${s}`,r.startRng);return t.concat([{...r,startMarker:a}])}),[])},j$=e=>he(e,((e,t)=>t.end.length-e.end.length)),$$=(e,t)=>{const o=de(e,(e=>X(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},W$=(e,t,o,n,r,s)=>{const a=z$(e,r.inlinePatterns,o,n,t,s).fold((()=>[]),(e=>e.matches)),i=z$(e,j$(r.inlinePatterns),o,n,t,s).fold((()=>[]),(e=>e.matches));return $$(a,i)},q$=(e,t)=>{if(0===t.length)return;const o=e.dom,n=e.selection.getBookmark(),r=U$(o,t);Q(r,(t=>{const n=o.getParent(t.startMarker.start,o.isBlock),r=e=>e===n;B$(t.pattern)?V$(e,t.pattern,t.endMarker,r):Z$(e,t.pattern,t.startMarker,t.endMarker,r),R$(o,t.endMarker,r),R$(o,t.startMarker,r)})),e.selection.moveToBookmark(n)},G$=(e,t)=>{const o=e.selection.getRng();return x$(e,o).map((n=>{var r;const s=Math.max(0,o.startOffset),a=C$(t,n,null!==(r=n.textContent)&&void 0!==r?r:""),i=W$(e,n,o.startContainer,s,a,!0),l=E$(e,n,a,!0);return(l.length>0||i.length>0)&&(e.undoManager.add(),e.undoManager.extra((()=>{e.execCommand("mceInsertNewLine")}),(()=>{e.insertContent(ws),q$(e,i),D$(e,l);const t=e.selection.getRng(),o=SP(t.startContainer,t.startOffset,e.dom.getRoot());e.execCommand("mceInsertNewLine"),o.each((t=>{const o=t.container;o.data.charAt(t.offset-1)===ws&&(o.deleteData(t.offset-1,1),y$(e.dom,o.parentNode,(t=>t===e.dom.getRoot())))}))})),!0)})).getOr(!1)},K$=(e,t)=>{const o=e.selection.getRng();x$(e,o).map((n=>{const r=Math.max(0,o.startOffset-1),s=S$(e.dom,n,o.startContainer,r),a=C$(t,n,s),i=W$(e,n,o.startContainer,r,a,!1);i.length>0&&e.undoManager.transact((()=>{q$(e,i)}))}))},Y$=(e,t,o)=>{for(let n=0;n<e.length;n++)if(o(e[n],t))return!0;return!1},X$=(e,t)=>Y$(e,t,((e,t)=>e===t.keyCode&&!db.modifierPressed(t))),J$=(e,t)=>Y$(e,t,((e,t)=>e.charCodeAt(0)===t.charCode)),Q$=e=>{const t=[",",".",";",":","!","?"],o=[32],n=()=>dm(Yu(e),Xu(e)),r=()=>og(e);e.on("keydown",(t=>{if(13===t.keyCode&&!db.modifierPressed(t)&&e.selection.isCollapsed()){const o=n(),s=o.inlinePatterns.length>0||o.blockPatterns.length>0||r();s&&G$(e,o)&&t.preventDefault()}}),!0);const s=()=>{if(e.selection.isCollapsed()){const t=n(),o=t.inlinePatterns.length>0||r();o&&K$(e,t)}};e.on("keyup",(e=>{X$(o,e)&&s()})),e.on("keypress",(o=>{J$(t,o)&&fy.setEditorTimeout(e,s)}))},eW=e=>{Q$(e)},tW=e=>{const t=go.each,o=db.BACKSPACE,n=db.DELETE,r=e.dom,s=e.selection,a=e.parser,i=to.browser,l=i.isFirefox(),c=i.isChromium()||i.isSafari(),d=to.deviceType.isiPhone()||to.deviceType.isiPad(),m=to.os.isMacOS()||to.os.isiOS(),u=(t,o)=>{try{e.getDoc().execCommand(t,!1,String(o))}catch(n){}},g=e=>e.isDefaultPrevented(),h=()=>{const t=e=>{const t=r.create("body"),o=e.cloneContents();return t.appendChild(o),s.serializer.serialize(t,{format:"html"})},a=o=>{const n=t(o),s=r.createRng();s.selectNode(e.getBody());const a=t(s);return n===a};e.on("keydown",(t=>{const s=t.keyCode;if(!g(t)&&(s===n||s===o)){const o=e.selection.isCollapsed(),n=e.getBody();if(o&&!r.isEmpty(n))return;if(!o&&!a(e.selection.getRng()))return;t.preventDefault(),e.setContent(""),n.firstChild&&r.isBlock(n.firstChild)?e.selection.setCursorLocation(n.firstChild,0):e.selection.setCursorLocation(n,0),e.nodeChanged()}}))},p=()=>{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=s.getRng(),e.getBody().focus(),"mousedown"===t.type){if(ca(o.startContainer))return;s.placeCaretAt(t.clientX,t.clientY)}else s.setRng(o)}))},b=()=>{e.on("keydown",(t=>{if(!g(t)&&t.keyCode===o){if(!e.getBody().getElementsByTagName("hr").length)return;if(s.isCollapsed()&&0===s.getRng().startOffset){const e=s.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())}}}))},v=()=>{Range.prototype.getClientRects||e.on("mousedown",(t=>{if(!g(t)&&"HTML"===t.target.nodeName){const t=e.getBody();t.blur(),fy.setEditorTimeout(e,(()=>{t.focus()}))}}))},y=()=>{const t=Mu(e);e.on("click",(o=>{const n=o.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==r.getContentEditableParent(n)&&(o.preventDefault(),e.selection.select(n),e.nodeChanged()),"A"===n.nodeName&&r.hasClass(n,t)&&0===n.childNodes.length&&(o.preventDefault(),s.select(n))}))},w=()=>{const o=()=>{const o=r.getAttribs(s.getStart().cloneNode(!1));return()=>{const n=s.getStart();n!==e.getBody()&&(r.setAttrib(n,"style",null),t(o,(e=>{n.setAttributeNode(e.cloneNode(!0))})))}},n=()=>!s.isCollapsed()&&r.getParent(s.getStart(),r.isBlock)!==r.getParent(s.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();fy.setEditorTimeout(e,(()=>{t()}))}}))},x=()=>{e.on("keydown",(e=>{if(!g(e)&&e.keyCode===o&&s.isCollapsed()&&0===s.getRng().startOffset){const t=s.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}return!0}))},C=()=>{e.on("keydown",(t=>{if(g(t)||t.keyCode!==db.BACKSPACE)return;let o=s.getRng();const n=o.startContainer,a=o.startOffset,i=r.getRoot();let l=n;if(o.collapsed&&0===a){while(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),s.setRng(o))}}))},S=()=>{const t=()=>{u("StyleWithCSS",!1),u("enableInlineTableEditing",!1),ou(e)||u("enableObjectResizing",!1)};ku(e)||e.on("BeforeExecCommand mousedown",t)},k=()=>{const o=()=>{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?void 0:o.lastChild)===e){while(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})}}))};e.on("SetContent ExecCommand",(e=>{"setcontent"!==e.type&&"mceInsertLink"!==e.command||o()}))},_=()=>{e.on("init",(()=>{u("DefaultParagraphSeparator",Dm(e))}))},O=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},T=()=>{e.on("keyup focusin mouseup",(t=>{db.modifierPressed(t)||O(e)||s.normalize()}),!0)},E=()=>{e.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},D=()=>{e.inline||e.on("keydown",(()=>{document.activeElement===document.body&&e.getWin().focus()}))},A=()=>{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())})))},N=()=>{m&&e.on("keydown",(t=>{if(db.metaKeyPressed(t)&&!t.shiftKey&&(37===t.keyCode||39===t.keyCode)){t.preventDefault();const o=e.selection.getSel();o.modify("move",37===t.keyCode?"backward":"forward","lineboundary")}}))},R=()=>{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}")},B=()=>{e.on("init",(()=>{e.dom.bind(e.getBody(),"submit",(e=>{e.preventDefault()}))}))},L=()=>{a.addNodeFilter("br",(e=>{let t=e.length;while(t--)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()}))},H=M,I=()=>{if(!l||e.removed)return!1;const t=e.selection.getSel();return!t||!t.rangeCount||0===t.rangeCount},P=()=>{c&&(f(),y(),B(),p(),d&&(D(),A(),R())),l&&(v(),S(),E(),N())},z=()=>{C(),h(),to.windowsPhone||T(),c&&(f(),y(),_(),B(),x(),L(),d?(D(),A(),R()):p()),l&&(b(),v(),w(),S(),k(),E(),N(),x())};return oA(e)?P():z(),{refreshContentEditable:H,isHidden:I}},oW=Rl.DOM,nW=(e,t)=>{const o=ln.fromDom(e.getBody()),n=Pn(In(o)),r=ln.fromTag("style");Bo(r,"type","text/css"),rr(r,ln.fromText(t)),rr(n,r),e.on("remove",(()=>{cr(r)}))},rW=e=>e.inline?e.getElement().nodeName.toLowerCase():void 0,sW=e=>De(e,(e=>!1===_(e))),aW=e=>{const t=e.options.get,o=e.editorUpload.blobCache;return sW({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_unsafe_link_target:t("allow_unsafe_link_target"),convert_fonts_to_spans:t("convert_fonts_to_spans"),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"),remove_trailing_brs:t("remove_trailing_brs"),inline_styles:t("inline_styles"),root_name:rW(e),validate:!0,blob_cache:o,document:e.getDoc()})},iW=e=>{const t=e.options.get;return sW({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")})},lW=e=>{const t=e.options.get;return{...aW(e),...iW(e),...sW({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")})}},cW=e=>{const t=TE(aW(e),e.schema);return t.addAttributeFilter("src,href,style,tabindex",((t,o)=>{const n=e.dom,r="data-mce-"+o;let s=t.length;while(s--){const a=t[s];let i=a.attr(o);if(i&&!a.attr(r)){if(0===i.indexOf("data:")||0===i.indexOf("blob:"))continue;"style"===o?(i=n.serializeStyle(n.parseStyle(i),a.name),i.length||(i=null),a.attr(r,i),a.attr(o,i)):"tabindex"===o?(a.attr(r,i),a.attr(o,null)):a.attr(r,e.convertURL(i,o,a.name))}}})),t.addNodeFilter("script",(e=>{let t=e.length;while(t--){const o=e[t],n=o.attr("type")||"no/type";0!==n.indexOf("mce-")&&o.attr("type","mce-"+n)}})),tg(e)&&t.addNodeFilter("#cdata",(t=>{var o;let n=t.length;while(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();while(o--){const e=t[o];e.isEmpty(n)&&0===e.getAll("br").length&&e.append(new pw("br",1))}})),t},dW=e=>{const t=Hu(e);t&&fy.setEditorTimeout(e,(()=>{let o;o=!0===t?e:e.editorManager.get(t),o&&!o.destroyed&&(o.focus(),o.selection.scrollIntoView())}),100)},mW=e=>{const t=e.dom.getRoot();e.inline||Np(e)&&e.selection.getStart(!0)!==t||Nh(t).each((t=>{const o=t.getNode(),n=ns(o)?Nh(o).getOr(t):t;e.selection.setRng(n.toRange())}))},uW=e=>{e.bindPendingEventDelegates(),e.initialized=!0,Kf(e),e.focus(!0),mW(e),e.nodeChanged({initial:!0});const t=Bu(e);E(t)&&t.call(e,e),dW(e)},gW=e=>e.inline?e.ui.styleSheetLoader:e.dom.styleSheetLoader,hW=(e,t,o)=>{const n=[gW(e).loadAll(t)];return e.inline?n:n.concat([e.ui.styleSheetLoader.loadAll(o)])},pW=e=>{const t=gW(e),o=Qm(e),n=e.contentCSS,r=()=>{t.unloadAll(n),e.inline||e.ui.styleSheetLoader.unloadAll(o)},s=()=>{e.removed?r():e.on("remove",r)};if(e.contentStyles.length>0){let t="";go.each(e.contentStyles,(e=>{t+=e+"\r\n"})),e.dom.addStyle(t)}const a=Promise.all(hW(e,n,o)).then(s).catch(s),i=Jm(e);return i&&nW(e,i),a},fW=e=>{const t=e.getDoc(),o=e.getBody();qf(e),Iu(e)||(t.body.spellcheck=!1,oW.setAttrib(o,"spellcheck","false")),e.quirks=tW(e),Gf(e);const n=eu(e);void 0!==n&&(o.dir=n);const r=Pu(e);r&&e.on("BeforeSetContent",(e=>{go.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}))},bW=e=>{oA(e)||e.load({initial:!0,format:"html"}),e.startContent=e.getContent({format:"raw"})},vW=e=>{!0!==e.removed&&(bW(e),uW(e))},yW=e=>{const t=e.getElement();let o=e.getDoc();e.inline&&(oW.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=ku(e),e.readonly||(e.inline&&"static"===oW.getStyle(n,"position",!0)&&(n.style.position="relative"),n.contentEditable="true"),n.disabled=!1,e.editorUpload=_N(e),e.schema=al(iW(e)),e.dom=Rl(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:$m(e),referrerPolicy:Wm(e),onSetAttrib:t=>{e.dispatch("SetAttrib",t)}}),e.parser=cW(e),e.serializer=lM(lW(e),e),e.selection=KA(e.dom,e.getWin(),e.serializer,e),e.annotator=If(e),e.formatter=FN(e),e.undoManager=jN(e),e._nodeChangeDispatcher=new OZ(e),e._selectionOverrides=u$(e),AH(e),tj(e),ZH(e),oA(e)||(uj(e),eW(e));const r=_Z(e);_H(e,r),PH(e),JN(e),JU(e);const s=rA(e);fW(e),s.fold((()=>{pW(e).then((()=>vW(e)))}),(t=>{e.setProgressState(!0),pW(e).then((()=>{t().then((t=>{e.setProgressState(!1),vW(e),NA(e)}),(t=>{e.notificationManager.open({type:"error",text:String(t)}),vW(e),NA(e)}))}))}))},wW=(e,t)=>{if(e.inline||(e.getElement().style.visibility=e.orgVisibility),t||e.inline)yW(e);else{const t=e.iframeElement,o=gN(ln.fromDom(t),"load",(()=>{o.unbind(),e.contentDocument=t.contentDocument,yW(e)}));if(to.browser.isFirefox()){const t=e.getDoc();t.open(),t.write(e.iframeHTML),t.close()}else t.srcdoc=e.iframeHTML}},xW=Rl.DOM,CW=(e,t,o,n)=>{const r=ln.fromTag("iframe");return n.each((e=>Bo(r,"tabindex",e))),Lo(r,o),Lo(r,{id:e+"_ifr",frameBorder:"0",allowTransparency:"true",title:t}),Yo(r,"tox-edit-area__iframe"),r},SW=e=>{let t=Sm(e)+"<html><head>";km(e)!==e.documentBaseUrl&&(t+='<base href="'+e.documentBaseURI.getURI()+'" />'),t+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';const o=_m(e),n=Om(e),r=e.translate(Nu(e));return Tm(e)&&(t+='<meta http-equiv="Content-Security-Policy" content="'+Tm(e)+'" />'),t+=`</head><body id="${o}" class="mce-content-body ${n}" data-id="${e.id}" aria-label="${r}"><br></body></html>`,t},kW=(e,t)=>{const o=e.translate("Rich Text Area"),n=Io(ln.fromDom(e.getElement()),"tabindex").bind(vt),r=CW(e.id,o,Cm(e),n).dom;r.onload=()=>{r.onload=null,e.dispatch("load")},e.contentAreaContainer=t.iframeContainer,e.iframeElement=r,e.iframeHTML=SW(e),xW.add(t.iframeContainer,r)},_W=(e,t)=>{kW(e,t),t.editorContainer&&(t.editorContainer.style.display=e.orgDisplay,e.hidden=xW.isHidden(t.editorContainer)),e.getElement().style.display="none",xW.setAttrib(e.id,"aria-hidden","true"),wW(e)},OW=Rl.DOM,TW=(e,t,o)=>{const n=$M.get(o),r=$M.urls[o]||e.documentBaseUrl.replace(/\/$/,"");if(o=go.trim(o),n&&-1===go.inArray(t,o)){if(e.plugins[o])return;try{const s=n(e,r)||{};e.plugins[o]=s,E(s.init)&&(s.init(e,r),t.push(o))}catch(s){sN(e,o,s)}}},EW=e=>e.replace(/^\-/,""),DW=e=>{const t=[];Q(Ou(e),(o=>{TW(e,t,EW(o))}))},AW=e=>{const t=go.trim(zm(e)),o=e.ui.registry.getAll().icons,n={...DM.get("default").icons,...DM.get(t).icons};Se(n,((t,n)=>{Re(o,n)||e.ui.registry.addIcon(n,t)}))},MW=e=>{const t=iu(e);if(y(t)){const o=WM.get(t);e.theme=o(e,WM.urls[t])||{},E(e.theme.init)&&e.theme.init(e,WM.urls[t]||e.documentBaseUrl.replace(/\/$/,""))}else e.theme={}},NW=e=>{const t=cu(e),o=AM.get(t);e.model=o(e,AM.urls[t])},RW=e=>{const t=e.theme.renderUI;return t?t():IW(e)},BW=e=>{const t=e.getElement(),o=iu(e),n=o(e,t);return n.editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||e.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||e.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:t.offsetHeight,n},LW=(e,t)=>({editorContainer:e,iframeContainer:t,api:{}}),HW=e=>{const t=OW.create("div");return OW.insertAfter(t,e),LW(t,t)},IW=e=>{const t=e.getElement();return e.inline?LW(null):HW(t)},PW=e=>{const t=e.getElement();return e.orgDisplay=t.style.display,y(iu(e))?RW(e):E(iu(e))?BW(e):IW(e)},zW=(e,t)=>{const o={show:j.from(t.show).getOr(M),hide:j.from(t.hide).getOr(M),isEnabled:j.from(t.isEnabled).getOr(U),setEnabled:o=>{e.mode.isReadOnly()||j.from(t.setEnabled).each((e=>e(o)))}};e.ui={...e.ui,...o}},FW=e=>{e.dispatch("ScriptsLoaded"),AW(e),MW(e),NW(e),DW(e);const t=PW(e);zW(e,j.from(t.api).getOr({})),e.editorContainer=t.editorContainer,mN(e),e.inline?wW(e):_W(e,{editorContainer:t.editorContainer,iframeContainer:t.iframeContainer})},VW=Rl.DOM,ZW=e=>"-"===e.charAt(0),UW=(e,t)=>{const o=qm(t),n=Gm(t);if(!Ql.hasCode(o)&&"en"!==o){const r=pt(n)?n:`${t.editorManager.baseURL}/langs/${o}.js`;e.add(r).catch((()=>{oN(t,r,o)}))}},jW=(e,t)=>{const o=iu(e);if(y(o)&&!ZW(o)&&!Re(WM.urls,o)){const n=lu(e),r=n?e.documentBaseURI.toAbsolute(n):`themes/${o}/theme${t}.js`;WM.load(o,r).catch((()=>{nN(e,r,o)}))}},$W=(e,t)=>{const o=cu(e);if("plugin"!==o&&!Re(AM.urls,o)){const n=du(e),r=y(n)?e.documentBaseURI.toAbsolute(n):`models/${o}/model${t}.js`;AM.load(o,r).catch((()=>{rN(e,r,o)}))}},WW=e=>j.from(Fm(e)).filter(pt).map((e=>({url:e,name:j.none()}))),qW=(e,t,o)=>j.from(t).filter((e=>pt(e)&&!DM.has(e))).map((t=>({url:`${e.editorManager.baseURL}/icons/${t}/icons${o}.js`,name:j.some(t)}))),GW=(e,t,o)=>{const n=qW(t,"default",o),r=WW(t).orThunk((()=>qW(t,zm(t),"")));Q(po([n,r]),(o=>{e.add(o.url).catch((()=>{tN(t,o.url,o.name.getOrUndefined())}))}))},KW=(e,t)=>{const o=(t,o)=>{$M.load(t,o).catch((()=>{eN(e,o,t)}))};Se(Tu(e),((t,n)=>{o(n,t),e.options.set("plugins",Ou(e).concat(n))})),Q(Ou(e),(e=>{e=go.trim(e),!e||$M.urls[e]||ZW(e)||o(e,`plugins/${e}/plugin${t}.js`)}))},YW=e=>{const t=iu(e);return!y(t)||T(WM.get(t))},XW=e=>{const t=cu(e);return T(AM.get(t))},JW=(e,t)=>{const o=zl.ScriptLoader,n=()=>{!e.removed&&YW(e)&&XW(e)&&FW(e)};jW(e,t),$W(e,t),UW(o,e),GW(o,e,t),KW(e,t),o.loadQueue().then(n,n)},QW=(e,t)=>wi.forElement(e,{contentCssCors:_u(t),referrerPolicy:Wm(t)}),eq=e=>{const t=e.id;Ql.setCode(qm(e));const o=()=>{VW.unbind(window,"ready",o),e.render()};if(!xl.Event.domLoaded)return void VW.bind(window,"ready",o);if(!e.getElement())return;const n=ln.fromDom(e.getElement()),r=Vo(n);e.on("remove",(()=>{ee(n.dom.attributes,(e=>zo(n,e.name))),Lo(n,r)})),e.ui.styleSheetLoader=QW(n,e),bu(e)?e.inline=!0:(e.orgVisibility=e.getElement().style.visibility,e.getElement().style.visibility="hidden");const s=e.getElement().form||VW.getParent(t,"form");s&&(e.formElement=s,vu(e)&&!ss(e.getElement())&&(VW.insertAfter(VW.create("input",{type:"hidden",name:t}),t),e.hasHiddenInput=!0),e.formEventDelegate=t=>{e.dispatch(t.type,t)},VW.bind(s,"submit reset",e.formEventDelegate),e.on("reset",(()=>{e.resetContent()})),!yu(e)||s.submit.nodeType||s.submit.length||s._mceOldSubmit||(s._mceOldSubmit=s.submit,s.submit=()=>(e.editorManager.triggerSave(),e.setDirty(!1),s._mceOldSubmit(s)))),e.windowManager=GM(e),e.notificationManager=jM(e),sg(e)&&e.on("GetContent",(e=>{e.save&&(e.content=VW.encode(e.content))})),wu(e)&&e.on("submit",(()=>{e.initialized&&e.save()})),xu(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),JW(e,e.suffix)},tq=(e,t)=>({sections:B(e),options:B(t)}),oq=Gt().deviceType,nq=oq.isPhone(),rq=oq.isTablet(),sq=e=>{if(O(e))return[];{const t=C(e)?e:e.split(/[ ,]/),o=J(t,ut);return oe(o,pt)}},aq=(e,t)=>{const o=Ee(t,((t,o)=>Y(e,o)));return tq(o.t,o.f)},iq=(e,t,o={})=>{const n=e.sections(),r=Ne(n,t).getOr({});return go.extend({},o,r)},lq=(e,t)=>Re(e.sections(),t),cq=(e,t)=>lq(e,t)?e.sections()[t]:{},dq=(e,t)=>{const o={table_grid:!1,object_resizing:!1,resize:!1,toolbar_mode:Ne(e,"toolbar_mode").getOr("scrolling"),toolbar_sticky:!1},n={menubar:!1};return{...o,...t?n:{}}},mq=(e,t)=>{var o;const n=null!==(o=t.external_plugins)&&void 0!==o?o:{};return e&&e.external_plugins?go.extend({},e.external_plugins,n):n},uq=(e,t)=>[...sq(e),...sq(t)],gq=(e,t,o,n)=>e&&lq(t,"mobile")?n:o,hq=(e,t,o,n)=>{const r=sq(o.forced_plugins),s=sq(n.plugins),a=cq(t,"mobile"),i=a.plugins?sq(a.plugins):s,l=gq(e,t,s,i),c=uq(r,l);return go.extend(n,{forced_plugins:r,plugins:c})},pq=(e,t)=>e&&lq(t,"mobile"),fq=(e,t,o,n,r)=>{var s;const a=e?{mobile:dq(null!==(s=r.mobile)&&void 0!==s?s:{},t)}:{},i=aq(["mobile"],hz(a,r)),l=go.extend(o,n,i.options(),pq(e,i)?iq(i,"mobile"):{},{external_plugins:mq(n,i.options())});return hq(e,i,n,l)},bq=(e,t)=>fq(nq||rq,nq,t,e,t),vq=(e,t)=>MA(e,t),yq=e=>{const t=(t,o)=>{e.formatter.toggle(t,o),e.nodeChanged()},o=o=>()=>{Q("left,center,right,justify".split(","),(t=>{o!==t&&e.formatter.remove("align"+t)})),"none"!==o&&t("align"+o)};e.editorCommands.addCommands({JustifyLeft:o("left"),JustifyCenter:o("center"),JustifyRight:o("right"),JustifyFull:o("justify"),JustifyNone:o("none")})},wq=e=>{const t=t=>()=>{const o=e.selection,n=o.isCollapsed()?[e.dom.getParent(o.getNode(),e.dom.isBlock)]:o.getSelectedBlocks();return X(n,(o=>T(e.formatter.matchNode(o,t))))};e.editorCommands.addCommands({JustifyLeft:t("alignleft"),JustifyCenter:t("aligncenter"),JustifyRight:t("alignright"),JustifyFull:t("alignjustify")},"state")},xq=e=>{yq(e),wq(e)},Cq=e=>{e.editorCommands.addCommands({"Cut,Copy,Paste":t=>{const o=e.getDoc();let n;try{o.execCommand(t)}catch(r){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.");(to.os.isMacOS()||to.os.isiOS())&&(t=t.replace(/Ctrl\+/g,"⌘+")),e.notificationManager.open({text:t,type:"error"})}}})},Sq=(e,t,o)=>{const n=ln.fromDom(e.getRoot());return o=Mx(n,bd.fromRangeStart(t))?o.replace(/^ /,"&nbsp;"):o.replace(/^&nbsp;/," "),o=Rx(n,bd.fromRangeEnd(t))?o.replace(/(&nbsp;| )(<br( \/)>)?$/,"&nbsp;"):o.replace(/&nbsp;(<br( \/)?>)?$/," "),o},kq=e=>{if("string"!==typeof e){const t=go.extend({paste:e.paste,data:{paste:e.paste}},e);return{content:e.content,details:t}}return{content:e,details:{}}},_q=(e,t)=>{const o=e.selection,n=e.dom;return/^ | $/.test(t)?Sq(n,o.getRng(),t):t},Oq=(e,t)=>{const{content:o,details:n}=kq(t);NE(e,{...n,content:_q(e,o),format:"html",set:!1,selection:!0}).each((t=>{const o=DA(e,t.content,n);RE(e,o,t),e.addVisual()}))},Tq=e=>{e.editorCommands.addCommands({mceCleanup:()=>{const t=e.selection.getBookmark();e.setContent(e.getContent()),e.selection.moveToBookmark(t)},insertImage:(t,o,n)=>{Oq(e,e.dom.createHTML("img",{src:n}))},insertHorizontalRule:()=>{e.execCommand("mceInsertContent",!1,"<hr>")},insertText:(t,o,n)=>{Oq(e,e.dom.encode(n))},insertHTML:(t,o,n)=>{Oq(e,n)},mceInsertContent:(t,o,n)=>{Oq(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("")}})},Eq={"font-size":"size","font-family":"face"},Dq=No("font"),Aq=(e,t,o)=>{const n=t=>Xn(t,e).orThunk((()=>Dq(t)?Ne(Eq,e).bind((e=>Io(t,e))):j.none())),r=e=>hn(ln.fromDom(t),e);return Zk(ln.fromDom(o),(e=>n(e)),r)},Mq=e=>e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,","),Nq=(e,t)=>j.from(Rl.DOM.getStyle(t,e,!0)),Rq=e=>(t,o)=>j.from(o).map(ln.fromDom).filter(Eo).bind((o=>Aq(e,t,o.dom).or(Nq(e,o.dom)))).getOr(""),Bq=Rq("font-size"),Lq=N(Mq,Rq("font-family")),Hq=e=>Nh(e.getBody()).bind((e=>{const t=e.container();return j.from(as(t)?t.parentNode:t)})),Iq=e=>j.from(e.selection.getRng()).bind((t=>{const o=e.getBody(),n=t.startContainer===o&&0===t.startOffset;return n?j.none():j.from(e.selection.getStart(!0))})),Pq=(e,t)=>Iq(e).orThunk(I(Hq,e)).map(ln.fromDom).filter(Eo).bind(t),zq=(e,t)=>Pq(e,R(j.some,t)),Fq=(e,t)=>{if(/^[0-9.]+$/.test(t)){const o=parseInt(t,10);if(o>=1&&o<=7){const n=ng(e),r=rg(e);return r.length>0?r[o-1]||t:n[o-1]||t}return t}return t},Vq=e=>{const t=e.split(/\s*,\s*/);return J(t,(e=>-1===e.indexOf(" ")||ct(e,'"')||ct(e,"'")?e:`'${e}'`)).join(",")},Zq=(e,t)=>{const o=Fq(e,t);e.formatter.toggle("fontname",{value:Vq(o)}),e.nodeChanged()},Uq=e=>zq(e,(t=>Lq(e.getBody(),t.dom))).getOr(""),jq=(e,t)=>{e.formatter.toggle("fontsize",{value:Fq(e,t)}),e.nodeChanged()},$q=e=>zq(e,(t=>Bq(e.getBody(),t.dom))).getOr(""),Wq=e=>zq(e,(t=>{const o=ln.fromDom(e.getBody()),n=Zk(t,(e=>Xn(e,"line-height")),I(hn,o)),r=()=>{const e=parseFloat(Kn(t,"line-height")),o=parseFloat(Kn(t,"font-size"));return String(e/o)};return n.getOrThunk(r)})).getOr(""),qq=(e,t)=>{e.formatter.toggle("lineheight",{value:String(t)}),e.nodeChanged()},Gq=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)=>{Zq(e,n)},FontSize:(t,o,n)=>{jq(e,n)},LineHeight:(t,o,n)=>{qq(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(y(n)?n:"p")},mceToggleFormat:(e,o,n)=>{t(n)}})},Kq=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",(()=>Uq(e))),e.editorCommands.addQueryValueHandler("FontSize",(()=>$q(e))),e.editorCommands.addQueryValueHandler("LineHeight",(()=>Wq(e)))},Yq=e=>{Gq(e),Kq(e)},Xq=e=>{e.editorCommands.addCommands({mceAddUndoLevel:()=>{e.undoManager.add()},mceEndUndoLevel:()=>{e.undoManager.add()},Undo:()=>{e.undoManager.undo()},Redo:()=>{e.undoManager.redo()}})},Jq=e=>{e.editorCommands.addCommands({Indent:()=>{yH(e)},Outdent:()=>{wH(e)}}),e.editorCommands.addCommands({Outdent:()=>hH(e)},"state")},Qq=e=>{const t=(t,o,n)=>{const r=y(n)?{href:n}:n,s=e.dom.getParent(e.selection.getNode(),"a");w(r)&&y(r.href)&&(r.href=r.href.replace(/ /g,"%20"),s&&r.href||e.formatter.remove("link"),r.href&&e.formatter.apply("link",r,s))};e.editorCommands.addCommands({unlink:()=>{if(e.selection.isCollapsed()){const t=e.dom.getParent(e.selection.getStart(),"a");t&&e.dom.remove(t,!0)}else e.formatter.remove("link")},mceInsertLink:t,createLink:t})},eG=e=>{e.editorCommands.addCommands({"InsertUnorderedList,InsertOrderedList":t=>{e.getDoc().execCommand(t);const o=e.dom.getParent(e.selection.getNode(),"ol,ul");if(o){const t=o.parentNode;if(t&&/^(H[1-6]|P|ADDRESS|PRE)$/.test(t.nodeName)){const n=e.selection.getBookmark();e.dom.split(t,o),e.selection.moveToBookmark(n)}}}})},tG=e=>{e.editorCommands.addCommands({"InsertUnorderedList,InsertOrderedList":t=>{const o=e.dom.getParent(e.selection.getNode(),"ul,ol");return o&&("insertunorderedlist"===t&&"UL"===o.tagName||"insertorderedlist"===t&&"OL"===o.tagName)}},"state")},oG=e=>{eG(e),tG(e)},nG=e=>{e.editorCommands.addCommands({insertParagraph:()=>{eZ(SV,e)},mceInsertNewLine:(t,o,n)=>{tZ(e,n)},InsertLineBreak:(t,o,n)=>{eZ(IV,e)}})},rG=e=>{e.editorCommands.addCommands({mceSelectNodeDepth:(t,o,n)=>{let r=0;e.dom.getParent(e.selection.getNode(),(t=>!Kr(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(),hs);if(t){const o=e.dom.createRng();o.selectNodeContents(t),e.selection.setRng(o)}}})},sG=e=>{e.editorCommands.addCommands({mceRemoveNode:(t,o,n)=>{const r=null!==n&&void 0!==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)=>{jy(e,!0===n)},mceToggleVisualAid:()=>{e.hasVisual=!e.hasVisual,e.addVisual()}})},aG=e=>{xq(e),Cq(e),Xq(e),rG(e),Tq(e),Qq(e),Jq(e),nG(e),oG(e),Yq(e),sG(e)},iG=["toggleview"],lG=e=>Y(iG,e.toLowerCase());class cG{constructor(e){this.commands={state:{},exec:{},value:{}},this.editor=e}execCommand(e,t=!1,o,n){const r=this.editor,s=e.toLowerCase(),a=null===n||void 0===n?void 0:n.skip_focus;if(r.removed)return!1;"mcefocus"!==s&&(/^(mceAddUndoLevel|mceEndUndoLevel)$/i.test(s)||a?my(r):r.focus());const i=r.dispatch("BeforeExecCommand",{command:e,ui:t,value:o});if(i.isDefaultPrevented())return!1;const l=this.commands.exec[s];return!!E(l)&&(l(s,t,o),r.dispatch("ExecCommand",{command:e,ui:t,value:o}),!0)}queryCommandState(e){if(!lG(e)&&this.editor.quirks.isHidden()||this.editor.removed)return!1;const t=e.toLowerCase(),o=this.commands.state[t];return!!E(o)&&o(t)}queryCommandValue(e){if(!lG(e)&&this.editor.quirks.isHidden()||this.editor.removed)return"";const t=e.toLowerCase(),o=this.commands.value[t];return E(o)?o(t):""}addCommands(e,t="exec"){const o=this.commands;Se(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&&void 0!==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&&void 0!==o?o:this.editor)}addQueryValueHandler(e,t,o){this.commands.value[e.toLowerCase()]=()=>t.call(null!==o&&void 0!==o?o:this.editor)}}const dG="data-mce-contenteditable",mG=(e,t,o)=>{en(e,t)&&!o?Jo(e,t):o&&Yo(e,t)},uG=(e,t,o)=>{try{e.getDoc().execCommand(t,!1,String(o))}catch(n){}},gG=(e,t)=>{e.dom.contentEditable=t?"true":"false"},hG=e=>{Q(ks(e,'*[contenteditable="true"]'),(e=>{Bo(e,dG,"true"),gG(e,!1)}))},pG=e=>{Q(ks(e,`*[${dG}="true"]`),(e=>{zo(e,dG),gG(e,!0)}))},fG=e=>{j.from(e.selection.getNode()).each((e=>{e.removeAttribute("data-mce-selected")}))},bG=e=>{e.selection.setRng(e.selection.getRng())},vG=(e,t)=>{const o=ln.fromDom(e.getBody());mG(o,"mce-content-readonly",t),t?(e.selection.controlSelection.hideResizeRect(),e._selectionOverrides.hideFakeCaret(),fG(e),e.readonly=!0,gG(o,!1),hG(o)):(e.readonly=!1,gG(o,!0),pG(o),uG(e,"StyleWithCSS",!1),uG(e,"enableInlineTableEditing",!1),uG(e,"enableObjectResizing",!1),Vy(e)&&e.focus(),bG(e),e.nodeChanged())},yG=e=>e.readonly,wG=e=>{e.parser.addAttributeFilter("contenteditable",(t=>{yG(e)&&Q(t,(e=>{e.attr(dG,e.attr("contenteditable")),e.attr("contenteditable","false")}))})),e.serializer.addAttributeFilter(dG,(t=>{yG(e)&&Q(t,(e=>{e.attr("contenteditable",e.attr(dG))}))})),e.serializer.addTempAttr(dG)},xG=e=>{e.serializer?wG(e):e.on("PreInit",(()=>{wG(e)}))},CG=e=>"click"===e.type,SG=["copy"],kG=e=>Y(SG,e.type),_G=(e,t)=>{const o=t=>hn(t,ln.fromDom(e.getBody()));return jr(t,"a",o).bind((e=>Io(e,"href")))},OG=(e,t)=>{if(CG(t)&&!db.metaKeyPressed(t)){const o=ln.fromDom(t.target);_G(e,o).each((o=>{if(t.preventDefault(),/^#/.test(o)){const t=e.dom.select(`${o},[name="${it(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 kG(t)&&e.dispatch(t.type,t)},TG=e=>{e.on("ShowCaret",(t=>{yG(e)&&t.preventDefault()})),e.on("ObjectSelected",(t=>{yG(e)&&t.preventDefault()}))},EG=go.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 DG{constructor(e){this.bindings={},this.settings=e||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||Z}static isNative(e){return!!EG[e.toLowerCase()]}fire(e,t){return this.dispatch(e,t)}dispatch(e,t){const o=e.toLowerCase(),n=gl(o,null!==t&&void 0!==t?t:{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(n);const r=this.bindings[o];if(r)for(let s=0,a=r.length;s<a;s++){const e=r[s];if(!e.removed){if(e.once&&this.off(o,e.func),n.isImmediatePropagationStopped())return n;if(!1===e.func.call(this.scope,n))return n.preventDefault(),n}}return n}on(e,t,o,n){if(!1===t&&(t=Z),t){const r={func:t,removed:!1};n&&go.extend(r,n);const s=e.toLowerCase().split(" ");let a=s.length;while(a--){const e=s[a];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;while(n--){const r=o[n];let s=this.bindings[r];if(!r)return Se(this.bindings,((e,t)=>{this.toggleEvent(t,!1),delete this.bindings[t]})),this;if(s){if(t){const e=te(s,(e=>e.func===t));s=e.fail,this.bindings[r]=s,Q(e.pass,(e=>{e.removed=!0}))}else s.length=0;s.length||(this.toggleEvent(e,!1),delete this.bindings[r])}}}else Se(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 AG=e=>(e._eventDispatcher||(e._eventDispatcher=new DG({scope:e,toggleEvent:(t,o)=>{DG.isNative(t)&&e.toggleNativeEvent&&e.toggleNativeEvent(t,o)}})),e._eventDispatcher),MG={fire(e,t,o){return this.dispatch(e,t,o)},dispatch(e,t,o){const n=this;if(n.removed&&"remove"!==e&&"detach"!==e)return gl(e.toLowerCase(),null!==t&&void 0!==t?t:{},n);const r=AG(n).dispatch(e,t);if(!1!==o&&n.parent){let t=n.parent();while(t&&!r.isPropagationStopped())t.dispatch(e,r,!1),t=t.parent?t.parent():void 0}return r},on(e,t,o){return AG(this).on(e,t,o)},off(e,t){return AG(this).off(e,t)},once(e,t){return AG(this).once(e,t)},hasEventListeners(e){return AG(this).has(e)}},NG=Rl.DOM;let RG;const BG=(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=su(e);return o?(e.eventRoot||(e.eventRoot=NG.select(o)[0]),e.eventRoot):e.getBody()},LG=e=>!e.hidden&&!yG(e),HG=(e,t,o)=>{LG(e)?e.dispatch(t,o):yG(e)&&OG(e,o)},IG=(e,t)=>{if(e.delegates||(e.delegates={}),e.delegates[t]||e.removed)return;const o=BG(e,t);if(su(e)){if(RG||(RG={},e.editorManager.on("removeEditor",(()=>{e.editorManager.activeEditor||RG&&(Se(RG,((t,o)=>{e.dom.unbind(BG(e,o))})),RG=null)}))),RG[t])return;const n=o=>{const n=o.target,r=e.editorManager.get();let s=r.length;while(s--){const e=r[s].getBody();(e===n||NG.isChildOf(n,e))&&HG(r[s],t,o)}};RG[t]=n,NG.bind(o,t,n)}else{const n=o=>{HG(e,t,o)};NG.bind(o,t,n),e.delegates[t]=n}},PG={...MG,bindPendingEventDelegates(){const e=this;go.each(e._pendingNativeEvents,(t=>{IG(e,t)}))},toggleNativeEvent(e,t){const o=this;"focus"!==e&&"blur"!==e&&(o.removed||(t?o.initialized?IG(o,e):o._pendingNativeEvents?o._pendingNativeEvents.push(e):o._pendingNativeEvents=[e]:o.initialized&&o.delegates&&(o.dom.unbind(BG(o,e),e,o.delegates[e]),delete o.delegates[e])))},unbindAllNativeEvents(){const e=this,t=e.getBody(),o=e.dom;e.delegates&&(Se(e.delegates,((t,o)=>{e.dom.unbind(BG(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()))}},zG=e=>y(e)?{value:e.split(/[ ,]/),valid:!0}:A(e,y)?{value:e,valid:!0}:{valid:!1,message:"The value must be a string[] or a comma/space separated string."},FG=e=>{const t=(()=>{switch(e){case"array":return C;case"boolean":return k;case"function":return E;case"number":return D;case"object":return w;case"string":return y;case"string[]":return zG;case"object[]":return e=>A(e,w);case"regexp":return e=>v(e,RegExp);default:return U}})();return o=>jG(o,t,`The value must be a ${e}.`)},VG=e=>y(e.processor),ZG=(e,t)=>{const o=ft(t.message)?"":`. ${t.message}`;return e+o},UG=e=>e.valid,jG=(e,t,o="")=>{const n=t(e);return k(n)?n?{value:e,valid:!0}:{valid:!1,message:o}:n},$G=(e,t,o)=>{if(!_(t)){const n=jG(t,o);if(UG(n))return n.value;console.error(ZG(`Invalid default value passed for the "${e}" option`,n))}},WG=(e,t)=>{const o={},n={},r=(e,t,o)=>{const r=jG(t,o);return UG(r)?(n[e]=r.value,!0):(console.warn(ZG(`Invalid value passed for the ${e} option`,r)),!1)},s=(e,s)=>{const a=VG(s)?FG(s.processor):s.processor,i=$G(e,s.default,a);o[e]={...s,default:i,processor:a};const l=Ne(n,e).orThunk((()=>Ne(t,e)));l.each((t=>r(e,t,a)))},a=e=>Re(o,e),i=e=>Ne(n,e).orThunk((()=>Ne(o,e).map((e=>e.default)))).getOrUndefined(),l=(e,t)=>{if(a(e)){const n=o[e];return n.immutable?(console.error(`"${e}" is an immutable option and cannot be updated`),!1):r(e,t,n.processor)}return console.warn(`"${e}" is not a registered option. Ensure the option has been registered before setting a value.`),!1},c=e=>{const t=a(e);return t&&delete n[e],t},d=e=>Re(n,e);return{register:s,isRegistered:a,get:i,set:l,unset:c,isSet:d}},qG=["design","readonly"],GG=(e,t,o,n)=>{const r=o[t.get()],s=o[n];try{s.activate()}catch(a){return void console.error(`problem while activating editor mode ${n}:`,a)}r.deactivate(),r.editorReadOnly!==s.editorReadOnly&&vG(e,s.editorReadOnly),t.set(n),jf(e,n)},KG=(e,t,o,n)=>{if(n!==o.get()){if(!Re(t,n))throw new Error(`Editor mode '${n}' is invalid`);e.initialized?GG(e,o,t,n):e.on("init",(()=>GG(e,o,t,n)))}},YG=(e,t,o)=>{if(Y(qG,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)}}}}},XG=e=>{const t=Fl("design"),o=Fl({design:{activate:M,deactivate:M,editorReadOnly:!1},readonly:{activate:M,deactivate:M,editorReadOnly:!0}});return xG(e),TG(e),{isReadOnly:()=>yG(e),set:n=>KG(e,o.get(),t,n),get:()=>t.get(),register:(e,t)=>{o.set(YG(o.get(),e,t))}}},JG=go.each,QG=go.explode,eK={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},tK=go.makeMap("alt,ctrl,shift,meta,access"),oK=e=>e in tK,nK=e=>{const t={},o=to.os.isMacOS()||to.os.isiOS();JG(QG(e.toLowerCase(),"+"),(e=>{oK(e)?t[e]=!0:/^[0-9]{2,}$/.test(e)?t.keyCode=parseInt(e,10):(t.charCode=e.charCodeAt(0),t.keyCode=eK[e]||e.toUpperCase().charCodeAt(0))}));const n=[t.keyCode];let r;for(r in tK)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 rK{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()||(JG(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,s=r.normalizeCommandFunc(o);return JG(QG(go.trim(e)),(e=>{const o=r.createShortcut(e,t,s,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)}:go.isArray(o)?()=>{t.editor.execCommand(o[0],o[1],o[2])}:o}createShortcut(e,t,o,n){const r=go.map(QG(e,">"),nK);return r[r.length-1]=go.extend(r[r.length-1],{func:o,scope:n||this.editor}),go.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 sK=()=>{const e={},t={},o={},n={},r={},s={},a={},i={},l=(e,t)=>(o,n)=>{e[o.toLowerCase()]={...n,type:t}},c=(e,t)=>n[e.toLowerCase()]=t;return{addButton:l(e,"button"),addGroupToolbarButton:l(e,"grouptoolbarbutton"),addToggleButton:l(e,"togglebutton"),addMenuButton:l(e,"menubutton"),addSplitButton:l(e,"splitbutton"),addMenuItem:l(t,"menuitem"),addNestedMenuItem:l(t,"nestedmenuitem"),addToggleMenuItem:l(t,"togglemenuitem"),addAutocompleter:l(o,"autocompleter"),addContextMenu:l(r,"contextmenu"),addContextToolbar:l(s,"contexttoolbar"),addContextForm:l(s,"contextform"),addSidebar:l(a,"sidebar"),addView:l(i,"views"),addIcon:c,getAll:()=>({buttons:e,menuItems:t,icons:n,popups:o,contextMenus:r,contextToolbars:s,sidebars:a,views:i})}},aK=()=>{const e=sK();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,getAll:e.getAll}},iK=Rl.DOM,lK=go.extend,cK=go.each;class dK{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.editorManager=o,this.documentBaseUrl=o.documentBaseURL,lK(this,PG);const n=this;this.id=e,this.hidden=!1;const r=bq(o.defaultOptions,t);this.options=WG(n,r),xm(n);const s=this.options.get;s("deprecation_warnings")&&wM(t,r);const a=s("suffix");a&&(o.suffix=a),this.suffix=o.suffix;const i=s("base_url");i&&o._setBaseUrl(i),this.baseUri=o.baseURI;const l=Wm(n);l&&(zl.ScriptLoader._setReferrerPolicy(l),Rl.DOM.styleSheetLoader._setReferrerPolicy(l));const c=_u(n);T(c)&&Rl.DOM.styleSheetLoader._setContentCssCors(c),ec.languageLoad=s("language_load"),ec.baseURL=o.baseURL,this.setDirty(!1),this.documentBaseURI=new pE(km(n),{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=bu(n),this.hasVisual=Du(n),this.shortcuts=new rK(this),this.editorCommands=new cG(this),aG(this);const d=s("cache_suffix");d&&(to.cacheSuffix=d.replace(/^[\?\&]+/,"")),this.ui={registry:aK(),styleSheetLoader:void 0,show:M,hide:M,setEnabled:M,isEnabled:U},this.mode=XG(n),o.dispatch("SetupEditor",{editor:this});const m=Ru(n);E(m)&&m.call(n,n)}render(){eq(this)}focus(e){this.execCommand("mceFocus",!1,e)}hasFocus(){return Fy(this)}translate(e){return Ql.translate(e)}getParam(e,t,o){const n=this.options;return n.isRegistered(e)||(T(o)?n.register(e,{processor:o,default:t}):n.register(e,{processor:U,default:t})),n.isSet(e)||_(t)?n.get(e):t}hasPlugin(e,t){const o=Y(Ou(this),e);return!!o&&(!t||void 0!==$M.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":(iK.show(e.getContainer()),iK.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)):(iK.hide(e.getContainer()),iK.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=ss(o)?o.value:o.innerHTML,s=t.setContent(r,n);return n.no_events||t.dispatch("LoadContent",{...n,element:o}),s}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 s={...n,content:r};if(s.no_events||t.dispatch("SaveContent",s),"raw"===s.format&&t.dispatch("RawSaveContent",s),r=s.content,ss(o))o.value=r;else{!e.is_removing&&t.inline||(o.innerHTML=r);const n=iK.getParent(t.id,"form");n&&cK(n.elements,(e=>e.name!==t.id||(e.value=r,!1)))}return s.element=n.element=o=null,!1!==s.set_dirty&&t.setDirty(!1),r}setContent(e,t){return hM(this,e,t)}getContent(e){return mM(this,e)}insertContent(e,t){t&&(e=lK({content:e},t)),this.execCommand("mceInsertContent",!1,e)}resetContent(e){void 0===e?hM(this,this.startContent,{format:"raw"}):hM(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||iK.get(e.id+"_parent")),e.container}getContentAreaContainer(){return this.contentAreaContainer}getElement(){return this.targetElm||(this.targetElm=iK.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?void 0:o.body)&&void 0!==t?t:null}convertURL(e,t,o){const n=this,r=n.options.get,s=Lu(n);return E(s)?s.call(n,e,o,!0,t):!r("convert_urls")||"link"===o||w(o)&&"LINK"===o.nodeName||0===e.indexOf("file:")||0===e.length?e:r("relative_urls")?n.documentBaseURI.toRelative(e):(e=n.documentBaseURI.toAbsolute(e,r("remove_script_host")),e)}addVisual(e){vq(this,e)}remove(){OM(this)}destroy(e){TM(this,e)}uploadImages(){return this.editorUpload.uploadImages()}_scanForImages(){return this.editorUpload.scanForImages()}}const mK=Rl.DOM,uK=go.each;let gK,hK=!1,pK=[];const fK=e=>{const t=e.type;uK(xK.get(),(o=>{switch(t){case"scroll":o.dispatch("ScrollWindow",e);break;case"resize":o.dispatch("ResizeWindow",e);break}}))},bK=e=>{if(e!==hK){const t=Rl.DOM;e?(t.bind(window,"resize",fK),t.bind(window,"scroll",fK)):(t.unbind(window,"resize",fK),t.unbind(window,"scroll",fK)),hK=e}},vK=e=>{const t=pK;return pK=oe(pK,(t=>e!==t)),xK.activeEditor===e&&(xK.activeEditor=pK.length>0?pK[0]:null),xK.focusedEditor===e&&(xK.focusedEditor=null),t.length!==pK.length},yK=e=>{e&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(vK(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0)},wK="CSS1Compat"!==document.compatMode,xK={...MG,baseURI:null,baseURL:null,defaultOptions:{},documentBaseURL:null,suffix:null,majorVersion:"6",minorVersion:"3.2",releaseDate:"2023-02-22",i18n:Ql,activeEditor:null,focusedEditor:null,setup(){const e=this;let t="",o="",n=pE.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 s=r.substring(r.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(r)){-1!==s.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("/"))}}e.baseURL=new pE(n).toAbsolute(t),e.documentBaseURL=n,e.baseURI=new pE(e.baseURL),e.suffix=o,Ay(e)},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&&Se(n,((e,t)=>{ec.PluginManager.urls[t]=e}))},init(e){const t=this;let o;const n=go.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"," "),r=(e,t)=>e.inline&&t.tagName.toLowerCase()in n,s=e=>{let t=e.id;return t||(t=Ne(e,"name").filter((e=>!mK.get(e))).getOrThunk(mK.uniqueId),e.setAttribute("id",t)),t},a=o=>{const n=e[o];if(n)return n.apply(t,[])},i=e=>to.browser.isIE()||to.browser.isEdge()?(aN("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tiny.cloud/docs/tinymce/6/support/#supportedwebbrowsers"),[]):wK?(aN("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[]):y(e.selector)?mK.select(e.selector):T(e.target)?[e.target]:[];let l=e=>{o=e};const c=()=>{let o=0;const n=[];let d;const m=(e,r,s)=>{const a=new dK(e,r,t);n.push(a),a.on("init",(()=>{++o===d.length&&l(n)})),a.targetElm=a.targetElm||s,a.render()};mK.unbind(window,"ready",c),a("onpageload"),d=we(i(e)),go.each(d,(e=>{yK(t.get(e.id))})),d=go.grep(d,(e=>!t.get(e.id))),0===d.length?l([]):uK(d,(t=>{r(e,t)?aN("Could not initialize inline editor on invalid inline target element",t):m(s(t),e,t)}))};return mK.bind(window,"ready",c),new Promise((e=>{o?e(o):l=t=>{e(t)}}))},get(e){return 0===arguments.length?pK.slice(0):y(e)?ae(pK,(t=>t.id===e)).getOr(null):D(e)&&pK[e]?pK[e]:null},add(e){const t=this,o=t.get(e.id);return o===e||(null===o&&pK.push(e),bK(!0),t.activeEditor=e,t.dispatch("AddEditor",{editor:e}),gK||(gK=e=>{const o=t.dispatch("BeforeUnload");if(o.returnValue)return e.preventDefault(),e.returnValue=o.returnValue,o.returnValue},window.addEventListener("beforeunload",gK))),e},createEditor(e,t){return this.add(new dK(e,t,this))},remove(e){const t=this;let o;if(e){if(!y(e))return o=e,S(t.get(o.id))?null:(vK(o)&&t.dispatch("RemoveEditor",{editor:o}),0===pK.length&&window.removeEventListener("beforeunload",gK),o.remove(),bK(pK.length>0),o);uK(mK.select(e),(e=>{o=t.get(e.id),o&&t.remove(o)}))}else for(let n=pK.length-1;n>=0;n--)t.remove(pK[n])},execCommand(e,t,o){var n;const r=this,s=w(o)?null!==(n=o.id)&&void 0!==n?n:o.index:o;switch(e){case"mceAddEditor":if(!r.get(s)){const e=o.options;new dK(s,e,r).render()}return!0;case"mceRemoveEditor":{const e=r.get(s);return e&&e.remove(),!0}case"mceToggleEditor":{const e=r.get(s);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:()=>{uK(pK,(e=>{e.save()}))},addI18n:(e,t)=>{Ql.add(e,t)},translate:e=>Ql.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 pE(this.documentBaseURL).toAbsolute(e.replace(/\/+$/,"")),this.baseURI=new pE(this.baseURL)}};xK.setup();const CK=()=>{const e=nc(),t=e=>({items:e,types:xe(e),getType:t=>Ne(e,t).getOrUndefined()}),o=t=>{e.set(t)},n=()=>e.get().getOrUndefined(),r=e.clear;return{FakeClipboardItem:t,write:o,read:n,clear:r}},SK=CK(),kK=Math.min,_K=Math.max,OK=Math.round,TK=(e,t,o)=>{let n=t.x,r=t.y;const s=e.w,a=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+=OK(l/2)),"c"===c[1]&&(n+=OK(i/2)),"b"===c[3]&&(r-=a),"r"===c[4]&&(n-=s),"c"===c[3]&&(r-=OK(a/2)),"c"===c[4]&&(n-=OK(s/2)),NK(n,r,s,a)},EK=(e,t,o,n)=>{for(let r=0;r<n.length;r++){const s=TK(e,t,n[r]);if(s.x>=o.x&&s.x+s.w<=o.w+o.x&&s.y>=o.y&&s.y+s.h<=o.h+o.y)return n[r]}return null},DK=(e,t,o)=>NK(e.x-t,e.y-o,e.w+2*t,e.h+2*o),AK=(e,t)=>{const o=_K(e.x,t.x),n=_K(e.y,t.y),r=kK(e.x+e.w,t.x+t.w),s=kK(e.y+e.h,t.y+t.h);return r-o<0||s-n<0?null:NK(o,n,r-o,s-n)},MK=(e,t,o)=>{let n=e.x,r=e.y,s=e.x+e.w,a=e.y+e.h;const i=t.x+t.w,l=t.y+t.h,c=_K(0,t.x-n),d=_K(0,t.y-r),m=_K(0,s-i),u=_K(0,a-l);return n+=c,r+=d,o&&(s+=c,a+=d,n-=m,r-=u),s-=m,a-=u,NK(n,r,s-n,a-r)},NK=(e,t,o,n)=>({x:e,y:t,w:o,h:n}),RK=e=>NK(e.left,e.top,e.width,e.height),BK={inflate:DK,relativePosition:TK,findBestRelativePosition:EK,intersect:AK,clamp:MK,create:NK,fromClientRect:RK},LK=(e,t,o=1e3)=>{let n=!1,r=null;const s=e=>(...t)=>{n||(n=!0,null!==r&&(clearTimeout(r),r=null),e.apply(null,t))},a=s(e),i=s(t),l=(...e)=>{n||null!==r||(r=setTimeout((()=>i.apply(null,e)),o))};return{start:l,resolve:a,reject:i}},HK=()=>{const e={},t={},o=(o,n)=>{const r=`Script at URL "${n}" failed to load`,s=`Script at URL "${n}" did not call \`tinymce.Resource.add('${o}', data)\` within 1 second`;if(void 0!==e[o])return e[o];{const a=new Promise(((e,a)=>{const i=LK(e,a);t[o]=i.resolve,zl.ScriptLoader.loadScript(n).then((()=>i.start(s)),(()=>i.reject(r)))}));return e[o]=a,a}},n=(o,n)=>{void 0!==t[o]&&(t[o](n),delete t[o]),e[o]=Promise.resolve(n)},r=t=>{delete e[t]};return{load:o,add:n,unload:r}},IK=HK(),PK=()=>(()=>{let e={},t=[];const o={getItem:t=>{const o=e[t];return o||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})();let zK;try{const e="__storage_test__";zK=window.localStorage,zK.setItem(e,e),zK.removeItem(e)}catch($K){zK=PK()}var FK=zK;const VK={geom:{Rect:BK},util:{Delay:fy,Tools:go,VK:db,URI:pE,EventDispatcher:DG,Observable:MG,I18n:Ql,LocalStorage:FK,ImageUploader:kN},dom:{EventUtils:xl,TreeWalker:Wr,TextSeeker:Mc,DOMUtils:Rl,ScriptLoader:zl,RangeUtils:fv,Serializer:lM,StyleSheetLoader:vi,ControlSelection:bb,BookmarkManager:Pf,Selection:KA,Event:xl.Event},html:{Styles:il,Entities:Wi,Node:pw,Schema:al,DomParser:TE,Writer:Dw,Serializer:Aw},Env:to,AddOnManager:ec,Annotator:If,Formatter:FN,UndoManager:jN,EditorCommands:cG,WindowManager:GM,NotificationManager:jM,EditorObservable:PG,Shortcuts:rK,Editor:dK,FocusManager:gy,EditorManager:xK,DOM:Rl.DOM,ScriptLoader:zl.ScriptLoader,PluginManager:$M,ThemeManager:WM,ModelManager:AM,IconManager:DM,Resource:IK,FakeClipboard:SK,trim:go.trim,isArray:go.isArray,is:go.is,toArray:go.toArray,makeMap:go.makeMap,each:go.each,map:go.map,grep:go.grep,inArray:go.inArray,extend:go.extend,walk:go.walk,resolve:go.resolve,explode:go.explode,_addCacheSuffix:go._addCacheSuffix},ZK=go.extend(xK,VK),UK=t=>{try{e.exports=t}catch(o){}},jK=e=>{window.tinymce=e,window.tinyMCE=e};jK(ZK),UK(ZK)})()}}]);